Posted: Wed Feb 11, 2009 3:37 am Post subject: Multiple headers in SORT
Hi Guys,
I am having 4 files as Input to SORT and all four of them contain a header and then detail records. it is possible that some times one of them may be empty. All the four files will have same headers.
I need to write to sortout to 2 different files based on some field criteria. But the problem I have is, I should have only one header in the output files.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Feb 11, 2009 9:14 am Post subject:
RAJATALL,
1. What is the LRECL/RECFM of the 4 files
2. How do you identify the header and the detail records?
3. What is the condition to split the input into 2 different files _________________ Kolusu
www.linkedin.com/in/kolusu
Posted: Wed Feb 11, 2009 10:27 am Post subject: Multiple headers in SORT
Hi Kolusu,
The files are FB files and having a LRECL of 100
Headers and Trailers are identified with '00' in the first 2 bytes
We check the 10th bye of the file and based on the values writing them to 2 different files.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Feb 11, 2009 11:09 am Post subject:
RAJATALL,
The following DFSORT JCL will give you the desired results. I assumed that you don't need the trailer.
we add a seqnum at the end of header and trailer record using an IFTHEN and we then using it on INCLUDE on OUTFIL to only pick the first header. The other OR condition is to split your file based on the value in pos 10.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum