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
comparing vsam files
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: comparing vsam files
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.i wrote the logic but getting soc7 when comparing vsam record with other format file.
-
- Posts: 2
- Joined: Wed Feb 22, 2017 10:27 pm
- Skillset: cobol, jcl, easytrieve, ca7
- Referer: web search
Re: comparing vsam files
Thanks for the reply. I found the reason soc7 and with my logic now iam able to get the desired output
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Joining 2 vb files into vsam files ended error
by newbiemainframe » Thu Nov 12, 2020 7:59 am » in JCL - 1
- 1734
-
by NicC
View the latest post
Thu Nov 12, 2020 7:15 pm
-
-
- 3
- 7862
-
by socker_dad
View the latest post
Thu Jan 28, 2021 4:13 am
-
- 2
- 1407
-
by Robert Sample
View the latest post
Fri Oct 22, 2021 9:41 pm
-
-
Can anyone tell me how to retrieve the vsam system timestamp
by jdechirico » Tue Jun 18, 2024 9:22 pm » in VSAM/SMS - 1
- 1536
-
by enrico-sorichetti
View the latest post
Tue Jun 18, 2024 10:06 pm
-
-
- 2
- 1425
-
by naga821
View the latest post
Fri Oct 28, 2022 7:31 pm