View previous topic :: View next topic |
Author |
Message |
newuser Beginner
Joined: 12 Jun 2003 Posts: 16 Topics: 8
|
Posted: Thu Jun 12, 2003 10:39 am Post subject: Extracting a subset of records from input file |
|
|
Hello,
I have an input file of the format:
Header1 record
Detail1 record - 1
Detail1 record - 2
Detail1 record - 3
Detail1 record - 4
Header2 record
Detail2 record - 1
Detail2 record - 2
Detail2 record - 3
Header1 record for another transaction
Detail1 record - 1
Detail1 record - 2
Header3 record
etc
Header1 record is identified by a value of HEADER1 at position 5.
Similarly HEADER2 at position 5 and so on. Pls note that the records are not in sorted order.
I need to create all Header1 records to one output file. There is no identifier for Detail records except that it just follows the Header record and ends when the next Header record is reached.
My file is FBM 214.
My output needs to look like for HEADER1 records in this example as:
Header1 record
Detail1 record - 1
Detail1 record - 2
Detail1 record - 3
Detail1 record - 4
Header1 record for another transaction
Detail1 record - 1
Detail1 record - 2
Can any utility do this? We have FileAid, Syncsort & SAS.
Regards!
paddy! |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Fri Jun 13, 2003 12:03 am Post subject: |
|
|
Paddy,
Do you only want the HEADER1 records and its corresponding Detail-1 records. Is there any SORT criteria for the DETAIL-1 records.
Cheers,
Coolman
________
Honda XR350
Last edited by coolman on Sat Feb 05, 2011 1:24 am; edited 1 time in total |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
LaluMon Beginner
Joined: 28 Dec 2002 Posts: 21 Topics: 7
|
Posted: Fri Jun 13, 2003 9:45 pm Post subject: |
|
|
I need Header1 and corresponding detail records also!
Well, if it means anything, maybe my problem is simplified by the fact that the input records will be in the sorted order. Always Header1 corresponding records will come first before the start of Header2's. My input file will now look like:
Header1 record
Detail1 record - 1
Detail1 record - 2
Detail1 record - 3
Detail1 record - 4
Header1 record for another transaction
Detail1 record - 1
Detail1 record - 2
Header2 record
Detail2 record - 1
Detail2 record - 2
Detail2 record - 3
Header3 record
etc
Regards
Paddy! |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Sat Jun 14, 2003 12:21 am Post subject: |
|
|
Hi Paddy,
You could probably write an ISPF Macro to do what you want. How to do it depends on whether this is a 1 shot deal, a testing utility, or a production job run on a regular sked.
BTW, why is the file FBM?
Jack |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
LaluMon Beginner
Joined: 28 Dec 2002 Posts: 21 Topics: 7
|
Posted: Sat Jun 14, 2003 10:29 am Post subject: |
|
|
It is for production and I resorted to simple COBOL. The file is a metacode print file, hence FBM!
Regards
paddy! |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|
|