Why the RSUBMIT /ENDRSUBMIT?
Please provide the rules involved. Examples without the rules are often not sufficient to get a get a general solution.
Unless your code is really long, say more than a couple of hundred lines it is better to post the code into a code box so every one can see the code involved. Copy from the editor and paste into a box on the forum opened with either the </> or "running man" icon that appears above the main message box such as:
rsubmit;
data a;
input name $ age gender $;
cards;
sa 33 F
Sb 39 M
AY 11 M
SA 8 F
Ny Fair
;
run;
endrsubmit;
rsubmit;
data b(index=(name));
input name $ colr $ ;
cards;
sa brown
sa fair
Sb fair
AY fair
SA brown
Sy Fair
;
run;
endrsubmit;
rsubmit;
data c(index=(colr));
input colr $ skindis $ SD $;
cards;
Brown Medium MD
fair More MR
Black less LS
;
run;
endrsubmit;
rsubmit;
data cb;
set a;
set b (keep= name colr) key=name /unique;
if _error_ = 1 then do;
_error_ = 0;
end;
set c (keep= colr skindis) key=colr /unique;
if _error_ = 1 then do;
_error_ = 0;
end;
run;
endrsubmit;