Not going to do it for you, but to start:
data _null_;
set meta end=last;
if _n_=1 then call execute('data want;');
if vtype=1 then call execute(cat(' attrib ',strip(vname),';'));
else call execute('...');
if last then call execute(';run;');
run;
... View more