SORT JCL to put SPACES end of record using INREC or OUTREC The following sort card will take data from 8th pos (3 bytes) and put at 1st pos (3bytes) and take data from 60th pos(8bytes) and put at 10th position. The data from pos 4th position to 9th position will have spaces (Hex value ’40’) and the data from 19th position to end of file will have low values (hex value ’00’)
SORT FIELDS=COPY,STOPAFT=100 INREC FIELDS=(1:8,3,10:60,8)
; ; ; ; The following image shows that there are spaces between the fields selected by INREC but has low values at the end of the record Hex view of the above file If you wish to have spaces at the end of each record instead of low values then use either of the sort cards
SORT FIELDS=COPY,STOPAFT=100 INREC FIELDS=(1:8,3,10:60,8,69X)
SORT FIELDS=COPY,STOPAFT=100 INREC FIELDS=(1:8,3,10:60,8,69C’ ‘)
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,STOPAFT=100 INREC FIELDS=(1:8,3,10:60,8,69X)