SORT – OUTPUT DATASET DCB (LRECL,RECFM,BLKSIZE)
SORT automatically sets the LRECL of your new output data set (HLQ1.HLQ2.SORTOUT) to the reformatted output record length, so LRECL=4 would be set in this case, as we have written only 4 bytes into output dataset. You do not need to specify the LRECL on your SORTOUT DD statement, because SORT will set it appropriately for you.
In general, it is best to let SORT set the RECFM, LRECL and BLKSIZE for your NEW SORTOUT data sets.
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=HLQ1.HLQ2.SORTIN,DISP=SHR
//SORTOUT DD DSN=HLQ1.HLQ2.SORTOUT,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,CATLG)
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1,4)
/*
Similarly in SORT (In fact in any other JCL), you can just copy the DCB parameters of input dataset by providing the DCB parameter for your output dataset as below.
DCB=(*.SORTIN)
Where SORTIN is the DD name of the input dataset from which you want to copy the DCB parameters.
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=HLQ1.HLQ2.SORTIN,DISP=SHR
//SORTOUT DD DSN=HLQ1.HLQ2.SORTOUT,UNIT=SYSDA,
// DCB=(*.SORTIN),SPACE=(CYL,(5,5)),DISP=(,CATLG)
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1,4)
/*
——————————————————————————————————–
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