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 |
VSAM to PS Convertation : Below JCL Converts VSAM to PS FILE. Field-7 from 44 to 50 is PACKED Decimal. How should I use above to convert PD to ZD while copying data to PS file. Thanks in Advance.
//G62XXXXJ JOB ,,NOTIFY=&SYSUID,CLASS=D,MSGLEVEL=(1,1),MSGCLASS=X
//STEP1 EXEC PGM=IEFBR14
//STEP DD DSN=G62XXXX.TESTVSAM.TEMP.PS,DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(100,10),RLSE),
// DCB=(LRECL=1000,BLKSIZE=10000000,RECFM=FB)
//STEP DD DSN=G624513.TESTVSAM.MASK.TEMP.PS,DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(100,10),RLSE),
// DCB=(LRECL=1000,BLKSIZE=10000000,RECFM=FB),
// DSORG=PS
//SYSPRINT DD SYSOUT=*
//STEP2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
REPRO –
ODS(‘G62XXXX.TESTVSAM.TEMP.PS’) –
IDS(‘G62XXXX.TESTVSAM’)
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=G62XXXX.TESTVSAM,
// DISP=SHR
//SORTOUT DD DSN=G62XXXX.TESTVSAM.TEMP.PS,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(100,10),RLSE),
// DCB=(LRECL=1000,BLKSIZE=0,RECFM=FB)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,43,44,7,PD,TO=ZD,51,950)
/*
Pingback: SORT – PARSE – READ EXCEL (CSV) FILE IN MAINFRAMES | F1 for Mainframe