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