Page 1 of 1

Compare data in two files using JCL

PostPosted: Mon Nov 21, 2016 8:13 pm
by mounika1041
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)

Re: Compare data in two files using JCL

PostPosted: Mon Nov 21, 2016 8:18 pm
by enrico-sorichetti
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

Re: Compare data in two files using JCL

PostPosted: Mon Nov 21, 2016 8:24 pm
by mounika1041
sorry, this is the first time i am posting.. so i didnot know where exactly to post.. i am using syncsort :D

Re: Compare data in two files using JCL

PostPosted: Mon Nov 21, 2016 9:19 pm
by enrico-sorichetti
so i didnot know where exactly to post..


it seems to me that the list of the forums section is clear enough :mrgreen: