Here is Hash approach. You can do this using array too. It is easy to get CODE instead of code_new. If you insist on this name, it is still possible. data a;
input code;
datalines;
35
10
20
50
3540
;
run;
data b;
input code_s $20.;
datalines;
35,90
36,3540
72
10,1010
;
run;
data want;
if _n_ = 1 then do;
if 0 then set a;
declare hash h(dataset:'a');
h.definekey('code');
h.definedone();
end;
set b;
nw = countw(code_s, ',');
do i = 1 to nw;
code = input(scan(code_s, i, ','), 8.);
if h.find() = 0 then output;
end;
drop i nw;
run;
proc print data = want;
run;
... View more