data have;
input a b c d;
cards;
1 2 3 4
. 5 . .
2 . 6 .
;
proc sql noprint;
select count(*) into:nvar_num
from dictionary.columns where libname='WORK' and memname='HAVE';
data want(drop=i);
set have;
array num _numeric_;
array num_(&nvar_num) _temporary_;
do i=1 to &nvar_num;
retain num_;
if not missing(num(i))then num_(i)=num(i);
num(i)=num_(i);
end;
run;