How to drop cases that does not contain any of the given strings of characters delivered through a local macro?
data test;
input id $ b c $ d e $ f;
datalines;
AAA 50 11 1 222 22
BBB 35 12 2 250 25
CCC 75 13 3 990 99
;
run;
proc contents data=test out=vars(keep=name type) noprint; run;
%let rvar = "id", "b";
%let rvar1 = "c", "d", "e", "f";
data vars;
set vars;
if name NOT in (&rvar); *Of course this line will not work;
*if name in (&rvar1);
/*IT works if I set 'rvar' accordingly.
Though, this can be an option, thre are so many variables
to consider for my data set under this condition; */
run;
Exisiting data;
Desired data:
... View more