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?