SORT – CONVERT PD to ZD IN DISPLAYABLE FORMAT (ZDF)
In most of the scenarios, your input file has data either in Packed decimal (COMP-3) 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.
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.
But the above SORT card would have an Alphabet instead of number as the last byte in the new ZD value. Use the below SORT card with ZDF option, to have the new ZD value as all numeric.
OUTREC FIELDS=(1,4,PD,ZDF)
——————————————————————————————————–
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 |
Pingback: SORT – PARSE – READ EXCEL (CSV) FILE IN MAINFRAMES | F1 for Mainframe