Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

File matching based on a field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
bibek24

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Tue Aug 25, 2009 9:56 pm    Post subject: File matching based on a field
Reply with quote

I have two input file.Input-1 and Input-2
I need to match both the files based on a field say sec-no
Input-1 may have more that 1 records with the same sec-no whereas it is unique in input-2
If sec-no from the Input-1 matches with sec-no in the input-2, write to output with the information from input-1 and input-2
If not matches, record should be written but corresponding input-2 fields in the output should be spaces.

I copied the input-2 file into a VSAM KSDS, with dynamic access and Key as sec-no

I just need to know how the logic should be written for reading the VSAM file for each record of the input-1
I have a very little knowledge how a KSDS file is processed for a match against a sequential file
Could anyone please help me out?
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 25, 2009 10:04 pm    Post subject:
Reply with quote

Hello,

Instead of using a vsam file, suggest you download the sample 2-file match/merge code that is attached to a "Sticky" near the top of the cobol part of the forum.

It is a waste of resources to create/load/read a vsam file just to match the "keys".
Back to top
View user's profile Send private message
bibek24

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Tue Aug 25, 2009 10:33 pm    Post subject: Reply to: File matching based on a field
Reply with quote

Where is the attachment? I didn't get it.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 25, 2009 10:35 pm    Post subject:
Reply with quote

Sticky containing cobol match/merge logic
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us