Page 1 of 1

CHANGE and NOMATCH not working, help!

PostPosted: Thu Sep 30, 2010 1:36 am
by adelewalsh
I have 2 files that I'm matching. If a match is found, I want to change a field on the first file.
I'm using the following code :
 JOIN UNPAIRED,F1                                       
 JOINKEYS FILE=F1,FIELDS=(1,4,A,16,4,A,55,5,A)           
 JOINKEYS FILE=F2,FIELDS=(1,4,A,16,4,A,10,5,A)           
                                                         
 REFORMAT FIELDS=(F1:1,59,F2:10,5),FILL=X'40'           
                                                         
 SORT FIELDS=COPY                                       
 SUM FIELDS=NONE                                         
 OUTFIL OUTREC=(1:1,9,                                   
                10:10,5,CHANGE=(5,C'ALPHA',55,5),       
                        NOMATCH=(10,5),                 
                15:15,45)                               

Where
F1 looks like
----+----1----+----2----+----3----+----4----+----5----+----         
5076  00;ALPHA;AGED;1;00;0900104;01;1;A; ;  ;   ;0011;00113 
5076  00;ALPHA;AGED;1;00;0900104;01;1;A; ;  ;   ;0012;01545 
5076  00;ALPHA;AGED;1;00;0900104;01;1;A; ;  ;   ;0013;00542 
5076  00;ALPHA;AGED;1;00;0900104;01;1;A; ;  ;   ;0014;00467 
5076  00;ALPHA;AGED;1;00;0900104;01;1;A; ;  ;   ;0015;00378 
5076  00;02032;AGED;3;00;0900104;01;1;A; ;  ;   ;0016;02032   

and
F2 like
5076  00;00113;AGED;1;00;1010827;01;2;C; ;  ; Í ;0013 


What I want returned from this sample would be just the matched record to have the word ALPHA changed to 00113:
5076  00;00113;AGED;1;00;0900104;01;1;A; ;  ;   ;0011;00113 
5076  00;ALPHA;AGED;1;00;0900104;01;1;A; ;  ;   ;0012;01545 
5076  00;ALPHA;AGED;1;00;0900104;01;1;A; ;  ;   ;0013;00542 
5076  00;ALPHA;AGED;1;00;0900104;01;1;A; ;  ;   ;0014;00467 
5076  00;ALPHA;AGED;1;00;0900104;01;1;A; ;  ;   ;0015;00378 
5076  00;02032;AGED;3;00;0900104;01;1;A; ;  ;   ;0016;02032 


But what I'm getting is all records changing the word ALPHA to what's in the last field, regardless of match or not...not sure what I have wrong on my card???
5076  00;00113;AGED;1;00;0900104;01;1;A; ;  ;   ;0011;00113 
5076  00;01545;AGED;1;00;0900104;01;1;A; ;  ;   ;0012;01545 
5076  00;00542;AGED;1;00;0900104;01;1;A; ;  ;   ;0013;00542 
5076  00;00467;AGED;1;00;0900104;01;1;A; ;  ;   ;0014;00467 
5076  00;00378;AGED;1;00;0900104;01;1;A; ;  ;   ;0015;00378 
5076  00;02032;AGED;3;00;0900104;01;1;A; ;  ;   ;0016;02032

Re: CHANGE and NOMATCH not working, help!

PostPosted: Thu Sep 30, 2010 2:31 am
by adelewalsh
Please ignore...I should have been using an IFTHEN with an overlay...thank you anyway to anyone that may have been looking at this for me.

Re: CHANGE and NOMATCH not working, help!

PostPosted: Thu Sep 30, 2010 3:01 am
by dick scherrer
Good to hear it is working - thank you for letting us know :)

d