SORT JCL to filter data using INREC or OUTREC
SORT JCL to filter data using INREC or OUTREC
INREC can be used to filter or reformat the input data so that the sorting is more efficient.
In the following sort card the inrec statement will take the data from 7th pos (3 bytes) and put at positions 1st(3bytes) in the
output file and take data from 56th position (4 bytes) and put at position 4th (4bytes). The soting will occur on the first 3 bytes
of the output record.
INREC FIELDS=(1:7,3,4:56,4)SORT FIELDS=(1,3,CH,A)
Example JCL is provided below.
; ; ; ;
//SETP001 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//REPORT1 DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=USERID.ABC.INPFILE,
//SORTOUT DD DSN=USERID.ABC.OUTFILE,
// DISP=(,CATLG),
// SPACE=(TRK,(30,10),RLSE),
// UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)
//SORTWK01 DD UNIT=DISK,SPACE=(CYL,(20,5),RLSE)
//SORTWK02 DD UNIT=DISK,SPACE=(CYL,(20,5),RLSE)
//SORTWK03 DD UNIT=DISK,SPACE=(CYL,(20,5),RLSE)
//SYSIN DD *
INREC FIELDS=(1:7,3,4:56,4)
SORT FIELDS=(1,3,CH,A)
/*
//*