Hello- i have a file which has a header and detail records , i want to split the file based on value and here below is the one i have coded
//SPLIT EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=PYU678S.ITR1.FUTR.RTLDTA.UNLOAD,DISP=SHR //OUT01 DD SYSOUT=* //OUT02 DD SYSOUT=* //OUT03 DD SYSOUT=* //OUT04 DD SYSOUT=* //OUT05 DD SYSOUT=* //SYSIN DD * SORT FIELDS=COPY OUTREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(40,5),PUSH=(651:ID=2)) OUTFIL FNAMES=OUT01,BUILD=(1,650),INCLUDE=(651,2,ZD,EQ,01) OUTFIL FNAMES=OUT02,BUILD=(1,650),INCLUDE=(651,2,ZD,EQ,02) OUTFIL FNAMES=OUT03,BUILD=(1,650),INCLUDE=(651,2,ZD,EQ,03) OUTFIL FNAMES=OUT04,BUILD=(1,650),INCLUDE=(651,2,ZD,EQ,04) OUTFIL FNAMES=OUT05,BUILD=(1,650),INCLUDE=(651,2,ZD,EQ,05) /* Here , i want to add the header in the OUT01-05 files . is there a way we can do in the same step. Sample input data as follows ******************************* Top of Data ******************************** RTPOSY_NBR } PRREM_DESC1 } PSORE_NBR } RETAIL_TYPE_DESC } RETAIL_AMT 500127657 }NECT CY ABACAXI }1141 }SBH - Base Especial 500792452 }NECT CY UVA 1L }1141 }SBH - Base Especial 500792451 }NECT CY MARACUJA 1L }1141 }SBH - Base Especial 500827656 }NECT CY MANGA }1151 }SBH - Base Especial 500840785 }NECT CY PESSEGO L 1L }1151 }SBH - Base Especial 500759650 }ALC GEL GB CLAS }1181 }SBH - Base Especial 500759651 }ALC GEL GB BLUE }1181 }SBH - Base Especial 500766705 }ALC GEL GB CLASSIC }1191 }SBH- Base Especial 500839893 }NECT CY LARANJ 1L }1191 }SHB - Base Especial Thanks Ron T ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN