I have two input files as mentioned below. On non matching condition the input file FLAG which is at position 10 has to be overwritten with 'J'.
FILE1:
1234 ABCD N 9999
FILE2:
2345 ABCD J 9999
2356 ABCD N 9999
2356 ABCD N 9999
I tried with below mentioned SORT card but its not giving the results as expected instead I am getting the below mentioned output.
SORT CARD:
JOINKEYS FILES=F1,FIELDS=(12,4,A,5,4,A,10,1,A)
JOINKEYS FILES=F2,FIELDS=(12,4,A,5,4,A,10,1,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,16)
SORT FIELDS=(1,4,CH,A,5,4,CH,A)
OUTREC IFTHEN=(WHEN=(10,1,CH,EQ,C'N'),OVERLAY=(10:C'J'))
JOINKEYS FILES=F2,FIELDS=(12,4,A,5,4,A,10,1,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,16)
SORT FIELDS=(1,4,CH,A,5,4,CH,A)
OUTREC IFTHEN=(WHEN=(10,1,CH,EQ,C'N'),OVERLAY=(10:C'J'))
Current output:
1234 ABCD N 9999
Expected output:
1234 ABCD J 9999
Could anyone help me out with this ?