MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Extracting a subset of records from input file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
newuser
Beginner


Joined: 12 Jun 2003
Posts: 16
Topics: 8

PostPosted: Thu Jun 12, 2003 10:39 am    Post subject: Extracting a subset of records from input file Reply with quote

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
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Fri Jun 13, 2003 12:03 am    Post subject: Reply with quote

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
View user's profile Send private message
LaluMon
Beginner


Joined: 28 Dec 2002
Posts: 21
Topics: 7

PostPosted: Fri Jun 13, 2003 9:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sat Jun 14, 2003 12:21 am    Post subject: Reply with quote

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
View user's profile Send private message
LaluMon
Beginner


Joined: 28 Dec 2002
Posts: 21
Topics: 7

PostPosted: Sat Jun 14, 2003 10:29 am    Post subject: Reply with quote

It is for production and I resorted to simple COBOL. The file is a metacode print file, hence FBM!

Regards
paddy!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group