Tags

, , , ,

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)

/*

 

You might also like to look at:

 

Important SQL CODES and ABEND CODES
SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
KNOW YOUR MAINFRAME
REXX – INITIAL SETUP
SAS – SAMPLE PROGRAM
SORT – CONVERT PD to ZD IN DISPLAYABLE FORMAT (ZDF)
SORT – Alphanumeric Tests for INCLUDE and OMIT
SORT – EQUALS Option
SORT – PARSE – REFORMAT VARIABLE FIELDS
SORT – FINDREP, IFTHEN and INREC
SORT – JUSTIFY, SQUEEZE and OVERLAY
SORT – LOOKUP AND CHANGE
SORT – CONVERT PD to ZD and BI to ZD
SORT – OUTREC – TRAN
SORT – OUTREC – INSERT ZEROES, BLANKS, STRINGS
SORT – OUTPUT DATASET DCB (LRECL,RECFM,BLKSIZE)
SORT – INCLUDE and OMIT
SORT – Process Order of CONTROL Statements
SORT – How to use VB dataset (VLSHRT)
SORT – EDIT MASK PATTERNS
SORT – EDIT NUMERIC FIELDS (I,T,S)
SORT – EDIT FIRST AND LAST RECORD
SORT – SYMBOLS
SORT – TO REPLACE A CHAR WITH ANOTHER CHAR – ALTSEQ
SORT – SET RETURN CODE ‘04’ IF OUTPUT FILE IS EMPTY
SORT – INREC, INCLUDE and OMIT
SORT – SKIPREC and STOPAFT
SORT – INREC
SORT – SUM FIELDS
SORT – REMOVE DUPLICATES AND WRITE THEM TO XSUM
DFSORT – Informational and Error Messages
SORT JOIN – UNPAIRED RECORDS INDICATOR
SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
SORT JOB – SIMPLE COPY
SORT TIPS
Advertisements