I believe below sample covers what you're asking for. %let a1=1; %let a2=2; %let a3=3; %let a4=4; %let a5=5; %let a6=; %let a7=; %let a8=8; %let a9=; %let a10=; proc sql noprint; select value into :in_values separated by ',' from dictionary.macros where scope='GLOBAL' and prxmatch('/A\d+/oi',name)=1 and not missing(value) ; quit; data test; do i= 0 to 10; if i in (&in_values) then output; end; run;
... View more