Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
Hi,
Is it possible to compare two files.
My requirement is i had two files of same record length.
First i need to check whether the number of records in both the files is same or not.
If the record count is same then i should validate the key field in both the files that starts from 5 to 10 position.
Can i do this.
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
Quote:
i should validate the key field in both the files that starts from 5 to 10 position
Please provide the sample input/output and more explanation in how to validate the key fields in both the files.
Whether you need a line to line comparision with key fields or looking for match of key in file 1 in file2 of one of the records.
In output whether you want only matched key records or non-matched key records or both in separate files.
Whether your key fields contains the unique values or not.
Following is the code to check for count match or not.
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
Hi,
Here the explanation.
I had a input file of record length 80 with 1000 records. And the key field is from 5 to 10. After processing the job a output file will be generated which is of same record length and same key by updating one of the field. Here my input and output files will be using same copybook.
The main intention is i want to check whether the records provided in the input are there in the output or not. Thats why i am validating the record count and record key of my input and output file.
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
some more information is here.
both the files will be in sorted order only
i need line by line comparision with key fields
and i need output of matched and non-matched records seperate files
and the key fileds contain unique values
my input file:
amex100001bhaskar300.00..........( ).....
my output file:
amex100001bhaskar300.00..........(yes)....
initially the field with () will be blank in the input file. it will be updated with values in the output file.
So here i want to compare the key field that starts from 5 to 10
ie. 100001 and also number of records should be same
all the records that i passed as input should be present in the output.