comparing vsam files



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

comparing vsam files

Postby Nag849 » Wed Feb 22, 2017 10:31 pm

want to develop code to compare 2 files (file1 vsam, file2-ref FB)


input:
file1 - F1field1 F1filed2 F1field3 F1field4
aaa 10 x y
bbb 12 o n
file2 - F2field1 F2filed2 F2filed3 F2field4
aaa 10 x b
bbb 12 r n

output file
aaa 10 not matching field4 y
bbb 12 not matching filed3 r

file1 has 100 variables col1 to col
file2 has 10 variables.. lets say filed1 filed2 field3 field4.etc
i want to compare file1 first 2 fields with file2 first 2 fields if matches then compare each field of same record in file1 with reference of file2. i want to write un matched record on the output file. so here the comparision is 1 to many because 1st record in file should be compared with all records in file 2 as its my reference data. if first 2 fields matches but not maching other fields in the record, then i want to write unmatched filed only. not the entire record.

i wrote the logic but getting soc7 when comparing vsam record with other format file. any code for this will be appreciated.


if F1filed1 F1filed match with any records from file2 then compare filed3 and field4 from both files if not matching then write output file F1field1, F1filed2 unmatched filed3
Nag849
 
Posts: 2
Joined: Wed Feb 22, 2017 10:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: comparing vsam files

Postby Robert Sample » Thu Feb 23, 2017 5:34 am

i wrote the logic but getting soc7 when comparing vsam record with other format file.
The S0C7 abend occurs when -- AND ONLY WHEN -- you have defined a numeric (packed-decimal) variable that does not contain packed decimal data. Hence the S0C7 abend has absolutely nothing to do with your logic and EVERYTHING to do with your data definition. You may have the logic coded perfectly (and don't ask for logic help unless you first post what you have already), but the data definition could still cause S0C7 abends.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: comparing vsam files

Postby Nag849 » Thu Feb 23, 2017 6:41 am

Thanks for the reply. I found the reason soc7 and with my logic now iam able to get the desired output
Nag849
 
Posts: 2
Joined: Wed Feb 22, 2017 10:27 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post