JCL- Sort ‘PD’ to ‘ZD’ with Length Calculation

Here is the PD sort card in JCL. If needed, you can elaborate on it. We need data in Zoned decimal. When the data is in the ZD, we can view it.

How to convert ‘PD’ to ‘ZD’

Here is a sort card to convert packed decimals to zoned decimals.

Example 1

Since packed decimal data you can’t read in the EDIT field, you can specify a format you want for display.

//sysin  DD  *
SORT FIELDS=COPY
INCLUDE COND=(1,5,PD,EDIT(TTTTTTT.TT))
/*
Advertisements

Example 2

//sysin  DD  *
SORT FIELDS=COPY
INCLUDE COND=(1,5,PD,TO=ZD,LENGTH=9)
/*

Here I used SORT FIELDS=COPY is equal to OPTION COPY. Calculation for length: PD= 5 bytes Length=((2 x PD) -1) = (2x 5) -1 = 9 bytes.

Related

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.

Comments are closed.