SORT JCL with STOPAFT and SKIPREC
If you wish to skip certain number of records and stop sorting after
certain number of records then you can use the following SORT parm
SORT FIELDS=COPY,SKIPREC=x,STOPAFT=y
Where
x is the number of records which are to be skipped while sorting
y is the number of records after which sorting is required to be stopped.
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 *
SORT FIELDS=COPY,SKIPREC=x,STOPAFT=y
/*
//*
Comments
Post new comment