判断数据集中,某个变量是否存在

%macro clas(data=,);

proc contents data=&data. out=class1 noprint;run;

proc sql noprint;

select name into:name1 separated by " " from class1;

quit;

%if %index(%upcase(&name1.),AGE)=0 %then %put no age here;

/*!!!!!!age不加引号*/

%else  %do;

data class2;

set class;

run;

%end;

%mend;

%clas(data=sashelp.class);

你可能感兴趣的:(判断数据集中,某个变量是否存在)