Hey.. It pretty much simple. data check_var; dsname=open("sashelp.class"); varname_=varnum(dsname,'AGE'); if varname_ >0 then flag="Y"; else flag="N"; /* if flag="Y";*/ run; ** If you want to create a macro then use the below code . data _NULL_; call symputx("Checkv", varnum(open("sashelp.class"),'AGE')); run; %put &Checkv.;
... View more