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)Â