Hey i want to compare two files say A & B . If there was a match found between the files then i need to update the file B with the details of File A.
Input :
A - sequential file
111 AAAA Mumbai
222 BBBB Chennai
333 CCCC Delhi
B VSAM File
222 BBBB
444 DDDD
Output File
B VSAM File
222 BBBB Chennai
444 DDDD
Compare 2 Files
-
- Posts: 110
- Joined: Thu Dec 27, 2007 5:18 pm
- Skillset: Known little stuffs to answer a few queries!!
- Referer: Google
- Contact:
Re: Compare 2 Files
ESDS or KSDS??
If I were you I would go with a simple COBOL program.
Something like:
Refer manuals and try coding this logic. Post if you face problems.
Arun.
If I were you I would go with a simple COBOL program.
Something like:
Code: Select all
OPEN INPUT FILE1
I-O FILE2
PERFORM UNTIL EOF-FILE1
READ FILE1
AT END SET EOF-FILE1 TO TRUE
END-READ.
IF NOT EOF-FILE1
MOVE KEY-FILE1 TO KEY-FILE2
READ FILE2
NOT INVALID KEY
MOVE FIELD-TO-UPDATE TO FILE2-UPDATED
WRITE FILE2
END-READ
END-IF
END-PERFORM.
Refer manuals and try coding this logic. Post if you face problems.
Arun.
-
- Posts: 110
- Joined: Thu Dec 27, 2007 5:18 pm
- Skillset: Known little stuffs to answer a few queries!!
- Referer: Google
- Contact:
Re: Compare 2 Files
My logic will work only for KSDS. Use "ACCESS IS RANDOM" in FILE-CONTROL.
If your file is ESDS then we have to go for sequential search logic.
Arun.
If your file is ESDS then we have to go for sequential search logic.
Arun.
-
- 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
- 1760
-
by NicC
View the latest post
Thu Nov 12, 2020 7:15 pm
-
-
-
compare substring in the same record
by samb01 » Mon Jun 12, 2023 1:08 pm » in DFSORT/ICETOOL/ICEGENER - 10
- 2909
-
by sergeyken
View the latest post
Tue Jun 13, 2023 11:04 pm
-
-
- 3
- 1593
-
by sergeyken
View the latest post
Thu May 13, 2021 1:07 am
-
-
compare number lines of two dataset
by samb01 » Wed Nov 13, 2024 8:46 pm » in DFSORT/ICETOOL/ICEGENER - 6
- 2159
-
by sergeyken
View the latest post
Fri Nov 15, 2024 12:41 pm
-
-
- 8
- 6144
-
by kbabu
View the latest post
Mon Mar 15, 2021 8:25 am