*** Get the 3rd variable of sashelp.class;
proc sql noprint;
select name into :var
from dictionary.columns
where libname="SASHELP" and memname="CLASS" and varnum=3;
quit;
*** Get the 7th value of the variable;
data _null_;
set sashelp.class(firstobs=7 obs=7);
put &var=;
run;