Page 1 of 1

issues comparing two files and writing outputs

PostPosted: Sat Jun 13, 2009 1:03 am
by samara8609
I am attempting to compare 2 files, lets say file A and file B, on a key that is 7 bytes long and starts at position 1. Both files have already been sorted in the following format: (1,7,bi,a). The main problem is that file B has duplicate keys. I need to output all records from file b that have a matching key in file A to one file and all the records from file b that do not have a matching key in file A to another file. Both file a and file b are sequential files. Any help with this would be greatly appreciated

Re: issues comparing two files and writing outputs

PostPosted: Sat Jun 13, 2009 3:10 am
by dick scherrer
Hello,

What have you written so far?

Which version of Easytrieve is used on your system?

Suggest you refer to the information about "synchronized file processing" if you have the current release.

Re: issues comparing two files and writing outputs

PostPosted: Mon Jun 15, 2009 7:14 pm
by samara8609
i am currently using ca-easytrieve/Plus for os/390
I have only written the encironment and library sections, i have not done the activity section because i am not sure how to handle the duplicate files with the matches statement. I've done this program on COBOL, but have decided to try it on EZT as a learning experience.

Re: issues comparing two files and writing outputs

PostPosted: Wed Jun 17, 2009 5:21 am
by dick scherrer
Hello,

i am currently using ca-easytrieve/Plus for os/390
Somewhere (probably near the top of the Ezt output) will be a number (i.e. 6.3, 6.4, 11 etc).

Near the top of the COBOL part of the forum is a Sticky titled:
2-file match/merge sample code


This contains working logic for what you want to do. You should be able to re-code that sample in Ezt using 2 input file definitions. This approach would not use any built-in function to match.