SORT JCL with STOPAFT and SKIPREC

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

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. ; ; ; ; //SORTIN   DD DISP=SHR,DSN=USERID.ABC.INPFILE, //SORTOUT  DD DSN=USERID.ABC.OUTFILE, //      SPACE=(TRK,(30,10),RLSE),                                 //      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)      SORT FIELDS=COPY,SKIPREC=x,STOPAFT=y