Extracting a subset of records from input file
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Utilities

#1: Extracting a subset of records from input file Author: newuser PostPosted: Thu Jun 12, 2003 10:39 am
    —
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!

#2:  Author: coolmanLocation: US PostPosted: Fri Jun 13, 2003 12:03 am
    —
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

#3:  Author: LaluMon PostPosted: Fri Jun 13, 2003 9:45 pm
    —
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!

#4:  Author: sladeLocation: Edison, NJ USA PostPosted: Sat Jun 14, 2003 12:21 am
    —
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

#5:  Author: LaluMon PostPosted: Sat Jun 14, 2003 10:29 am
    —
It is for production and I resorted to simple COBOL. The file is a metacode print file, hence FBM!

Regards
paddy!



MVSFORUMS.com -> Utilities


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group