I have two files. first file is of record length 582 and second file is of length 80.
i have few fields in first file and a field named key which is of 8 length.
in the second file i have only two fields that is new key and old key both are of 8 length.
now i have to compare this two files find if the old key is present in the first file if present then replace the old key with new key which is present in file 2. if there is no match then it should have the same old key and nothing should be changed
i worked with the below code
JOINKEYS FILES=F1,FIELDS=(17,8,A)
JOINKEYS FILES=F2,FIELDS=(10,8,A)
JOIN UNPAIRED,F1 ONLY
REFORMAT FIELDS=(F1:1,16,F2:1,8,F1:25,558)
OPTION COPY
but if they cant find old key in the file it is getting filled with blank, i want the old key as old key if there is no match.. can somebody please help? thanks in advance
file 1----------key starts at position 17 and of length 8
file 2 ---------1-8(new key) 9-16(old key)
Compare data in two files using JCL
-
- Posts: 3
- Joined: Mon Nov 21, 2016 8:05 pm
- Skillset: Mainframes beginner
- Referer: google first search
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Compare data in two files using JCL
vey few people will help if You post to the wrong section of the forums
tell us what sort product You will be using.
look at the messages
WER... ==> SYNCSORT
ICE... ==> IBM DFSORT
and the topic will be moved to the proper section
tell us what sort product You will be using.
look at the messages
WER... ==> SYNCSORT
ICE... ==> IBM DFSORT
and the topic will be moved to the proper section
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Posts: 3
- Joined: Mon Nov 21, 2016 8:05 pm
- Skillset: Mainframes beginner
- Referer: google first search
Re: Compare data in two files using JCL
sorry, this is the first time i am posting.. so i didnot know where exactly to post.. i am using syncsort 

-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Compare data in two files using JCL
so i didnot know where exactly to post..
it seems to me that the list of the forums section is clear enough

cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- 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
- 1752
-
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
- 2860
-
by sergeyken
View the latest post
Tue Jun 13, 2023 11:04 pm
-
-
- 3
- 1574
-
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
- 2112
-
by sergeyken
View the latest post
Fri Nov 15, 2024 12:41 pm
-
-
- 8
- 6127
-
by kbabu
View the latest post
Mon Mar 15, 2021 8:25 am