IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File matching based on a field


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Tue Aug 25, 2009 10:04 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top