[code:o8ljcuhy]data test;
input x y z m;
cards;
1 . 2 .
2 3 4 5
;
run;
proc sql noprint; select name into :var separated by ' ' from dictionary.columns where libname='WORK' and memname='TEST' ;quit;
%macro mm;
data a; set test;
length m_var $ 10;
array aa(4) x y z m;
%do i=1 %to 4;
if missing(aa(&i.)) then m_var=catx(' ',m_var,"%scan(&var.,&i.)") ;
if missing(aa(&i.)) then aa(&i.)=0;
%end;
run;
%mend;
%mm[/code:o8ljcuhy]