Page 1 of 1

COBOL match and merge on VSAM

PostPosted: Sat May 08, 2010 5:28 am
by d_ash
Hello,
I have a requirement to use a VSAM input file (size 50) and Flat file (VB size300). i will have customer number, date and customer date of birth in the VSAM file and in the VB file I have customer number and date and some other details.
Here i have to match these 2 files for customer number and output file should contain the complete details of VB file size 300 plus the dob from VSAM file. Please let me know what logic should be used here.
Other thing is I will have 5 or 6 records in the VB file, but I need to match the customer number and merge the DOB only for the first record and all other records should be written in the Output as it is.
ex: first record should match customer number and write it with DOB, but the other records from 2 to 5 or may 7 should be written as it is.

Thanks in advance.
Das.

Re: COBOL match and merge on VSAM

PostPosted: Sat May 08, 2010 6:26 am
by Robert Sample
Depending upon the number of records in each file, either sort the sequential file and do a two-way match program, or read the sequential file and do a direct read of the VSAM file data. In any case, please remember this is a HELP forum, not a DO-YOUR-PROGRAMMING-FOR-YOU forum and we won't provide code -- just assistance and pointers if you have problems.

Re: COBOL match and merge on VSAM

PostPosted: Sat May 08, 2010 7:53 am
by dick scherrer
Hello and welcome to the forum,

Before writing any code, you need to determine how younwill implement the requirement.

Suggest you post how you intend to implement and people here can review your design and comment before you invest a lot of time in code that might not be used.

Once you have worked thru the design, we can also help if there are questions or problems developing the code.