SORT – CONVERT PD to ZD and BI to ZD
In most of the scenarios, your input file has data either in Packed decimal (COMP-3) format or Binary (COMP) format which is not in readable format. To change this to readable format, you need to convert these numbers into ZONED Decimal (ZD) format. This can be accomplished using SORT.
-
BI to ZD
Suppose your input file has first 4 bytes in Binary format and you want it in displayable format
OUTREC FIELDS=(1,4,BI,TO=ZD,LENGTH=6)
p,m,BI,TO=ZD converts the BI values to ZD values. By default, a 4-byte BI value produces a 10-byte ZD value, but LENGTH=6 override the default length to produce a 6-byte ZD value.
OUTREC FIELDS=(1,4,BI,TO=ZD)
This does not override the length of output ZD value produced.
-
PD to ZD
Suppose your input file has first 4 bytes in packed format and you want it in displayable format
OUTREC FIELDS=(1,4,PD,TO=ZD,LENGTH=6)
p,m,PD,TO=ZD converts the PD values to ZD values. By default, a 4-byte BI value produces a 7-byte ZD value, but LENGTH=6 override the default length to produce a 6-byte ZD value.
OUTREC FIELDS=(1,4,PD,TO=ZD)
This does not override the length of output ZD value produced.
——————————————————————————————————–
In United States, If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog
——————————————————————————————————–
You may also like to look at:
Working on Mainframes – Is Change to a different technology necessary |