Joined: 08 Jul 2010 Posts: 12 Location: United Kingdom
Hi,
I am new to this forum. I have a requirement where in I will have to split one file into five files with trailer in it. My input file will have 5 sets of Detail and trailer records and need to be split into 5 files with each set of detail and trailer in each file
INPUT:
D
D
D
D
T
D
D
T
D
T
D
T
D
D
T
OUTPUT Expected:
OUTPUT1:
D
D
D
D
T
OUTPUT2:
D
D
T
OUTPUT3:
D
T
OUTPUT4:
D
T
OUTPUT5:
D
D
T
This is really an urgent requirement. Any help on this would really be appreciated.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Mani,
You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Joined: 08 Jul 2010 Posts: 12 Location: United Kingdom
Thank you Frank! The above code is writing only the trailer record in the output file. I need the outfile with Detail as well as trailer record. Could you help?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Mani,
My job does what you asked for based on the input you showed and the expected output you showed. If you're not getting the details records, then your input is either different than what you said it was, or you changed my job in some way.
Your input example shows D records followed by a T record for each group where D and T are in position 1. Is that what it really looks like?
If not, show a better example.
You would have to show me YOUR actual job and JES messages for the run before I could try to figure out what you did wrong.
Quote:
This is really an urgent requirement.
And yet, you didn't bother to show any useful information when you said it didn't work for you.