Created on May 15, 2021, 5:34 a.m. - by Jack, Peter
I want to add header detail in the output file using SORT utility
You need to give us more information like lrecl, recfm of the input and output file.
Anyhow, what i can suggest you is, instead of creating new sort step to add header detail. you can modify the existing COBOL program to add header details on the output file.
Thanks Srinivasan. This file is not created by cobol program. we are receiving this file from the upstream distributed application via NDM transmission.
Jack, You can add a Header by using the HEADER1 command in the SORT utility
see this example code,
//STEP EXEC PGM=SORT
//SORTIN DD DSN=input file
//SORTOUT DD DSN=output file
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=SORTOUT,
HEADER1=(1:C'EEID',11:C'CUMBID',30:C'DEPID',132:X,/,132C'-'),
OUTREC=(1:1,10,
11:41,9,PD,EDIT=(TTTTTTTTTTTTTTTTTT),
30:50,10,132:X)
/*