> Here , i want to add the header in the OUT01-05 files . is there a
> way we can do in the same step.

Ron,

You used KEYBEGIN on 40,5 , the header record will have a Group number 1
and the detail records will have group number starting at 2.  So if your
input file always has a header then you need to use the group number 1 to
include the header.  You also need to remove the temporary group id number
that you created. You need to use BUILD for that.

//SYSIN    DD *
  OPTION COPY
  OUTREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(40,5),PUSH=(651:ID=2))
  OUTFIL FNAMES=OUT01,BUILD=(01,650),INCLUDE=(651,2,SS,EQ,C'01,02')
  OUTFIL FNAMES=OUT02,BUILD=(01,650),INCLUDE=(651,2,SS,EQ,C'01,03')
  OUTFIL FNAMES=OUT03,BUILD=(01,650),INCLUDE=(651,2,SS,EQ,C'01,04')
  OUTFIL FNAMES=OUT04,BUILD=(01,650),INCLUDE=(651,2,SS,EQ,C'01,05')
  OUTFIL FNAMES=OUT05,BUILD=(01,650),INCLUDE=(651,2,SS,EQ,C'01,06')
/*

>> for instance if the header record is the only with double-blank at 651:


Massimo,

That will NOT work. Keybegin will look wherever there is a change in the
key at position 40 for 5 bytes.  So the first key change is on the Header
record itself.


Thanks,
Kolusu
DFSORT Development
IBM Corporation

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to