%let dsid = %sysfunc(open(&data&where));
 %let varnum = %sysfunc(varnum(&dsid,&var));
 %if %length(&label) gt 0
     %then %let varlabel = %sysfunc(varnum(&dsid,&label));
 %else %let varlabel = &varnum;
 %let vartype1 = %sysfunc(vartype(&dsid,&varnum));
 %let vartype2 = %sysfunc(vartype(&dsid,&varlabel));

Open the data set and use the %SYSFUNC macro with the SCL data access functions to get the variable numbers and types.

Return