Joined: 02 May 2006 Posts: 7 Location: Charlotte, NC, US
Hi,
I have a file having records distinguished by Record ID,
Record Id 010 - Header
020 - Sub Header
030/040/050/06 - Detail Record
My file has all the Detail records at top followed by the Subheader & Header can i have it so that the Header comes First followed by sub Header and all the corresoponding Detial records.
Is there any way i can do this using SORT.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Your example doesn't make sense unless there's a missing 010 record after the first 020 record. I'm going to assume that's the case. If not, then you need to explain why the 010 record from the second input group appears in the first output group instead of in the second output group.
Here's a DFSORT job that will do what I think you asked for. I added the missing 010 record. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Joined: 02 May 2006 Posts: 7 Location: Charlotte, NC, US
Hi Frank,
Actually Header can have multiple subheaders so it is not necessary that a 020 record should be followed by a 010 record.
However i got the Logic and i think i can work with it.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
Actually Header can have multiple subheaders so it is not necessary that a 020 record should be followed by a 010 record.
Ok, but that doesn't explain why you show the 010 record from the second input group appearing in the first output group instead of in the second output group.
Quote:
However i got the Logic and i think i can work with it.