I am giving here a simple sort card. This if need you can elaborate it. In many occasions, we need data in Zoned decimal. If we convert data into ZD, then, we can see the data in the file.
How to Convert ‘pd’ to ‘zd’ (Packed Decimal to Zoned Decimal)
//sysin DD * SORT FIELDS=COPY INCLUDE COND=(1,5,PD,EDIT(TTTTTTT.TT)) /*
//sysin DD * SORT FIELDS=COPY INCLUDE COND=(1,5,PD,TO=ZD,LENGTH=9) /*
So the EDIT will give the way, how to display it of packed decimal. I am just giving: SORT FIELDS=COPY is equal to OPTION COPY. Calculation for length: PD= 5 bytes Length=((2 x PD) -1) = (2x 5) -1 = 9 bytes.