Hi, In your SAS Code, if you bother about selecting DATA or VIEW, then take it in a Macro Variable and note that these values are always in upparcase... See the modified code as foolow... %macro t (dataset=, varname=, type =); %if %INDEX(&dataset,.) eq 0 %then %do; %let libname = WORK ; %let setname = &dataset ; %end; %else %do; %let libname = %SUBSTR(&dataset,1,%INDEX(&dataset,.)-1); %let setname = %SUBSTR(&dataset,%INDEX(&dataset,.)+1) ; %end; proc sql noprint; select type into :vartype from sashelp.vcolumn where libname = %upcase("&libname") and memname = %upcase("&setname") and memtype = %upcase("&type.") and upcase(name) = %upcase("&varname") ; quit; %mend; %t(dataset=sashelp.class, varname=age, type =data); Thanks, Urvish
... View more