Hello there,
I have to compare two files; if there is a match then an asterisk needs to added to the record of the second file. However, the first file is a fixparm wherein it contains different type of record to be compared with the second file.
1st file (40 lrecl):The first field is 8 length and second filed start at 14 position.
PARDA001 aaaaaaaaaaaaaaaaaaaaaaa
PBCCA002 aaaaaaaaaaaaaaaaaaaaaaa
PLUAK005 aaaaaaaaaaaaaaaaaaaaaaa
2nd file is a fixparm
PAR
PLUAK
The output should contain all the records from the 1st file but for the matched records an asterisk(*) needs to be added after first 8 length. The second field should start from 14th position
The output should appear something like below:
PARDA001* aaaaaaaaaaaaaaaaaaaaaaa
PBCCA002 aaaaaaaaaaaaaaaaaaaaaaa
PLUAK005* aaaaaaaaaaaaaaaaaaaaaaa
I am just learning joins now and already using simple joins in my jcls.
I tried to do this like below (considering the fixparms are hard coded like PARDA001*):
JOINKEYS FILE=F1,FIELDS=(1,8,A)
JOINKEYS FILE=F2,FIELDS=(1,8,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F2:1,9,F1:10,40)
OPTION COPY
but this takes me into complex as I need to use all wild characters after PAR and also the it doesn't give complete record of the unmatched file.
Could you please help?
Thanks & Regards,
Kitz