SORT JCL to append data in a record using INREC or OUTREC There may be instances when you wish to append some data at the end or between a record. The following SORT parm will come handy in such situations The following sort card will add char ‘LITERAL’ in the output file at 5th position.
INREC FIELDS=(1:7,3,4:56,4,5:C’LITERAL’)
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) Â Â Â INREC FIELDS=(1:7,3,4:56,4,5:C’LITERAL’)
I guess instead of 5 it should be 8, Is this right?