*** If you know the name of the 30th and 60th variable, then:;
data b;
set a;
keep var30name -- var60name;
run;
*** If not, then ;
proc sql noprint;
select name into : namelst separated by " "
from dictionary.columns
where libname="lib-name" and memname="A" and 30
*** If you know the name of the 30th and 60th variable, then:;
data b;
set a;
keep var30name -- var60name;
run;
*** If not, then ;
proc sql noprint;
select name into : namelst separated by " "
from dictionary.columns
where libname="lib-name" and memname="A" and 30<=varnum<=60;
quit;