Hello
I want to print a message in results window If the data set is empty .
I also want to add title to print in case that data set not empty.
Error:
75 call execute(Title 'information class_tbl';'proc print data=work.class_tbl2 noobs; run;');
_______________________ ______________________________________________
388 180
200
ERROR 388-185: Expecting an arithmetic operator.
ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR 200-322: The symbol is not recognized and will be ignored.
data class_tbl;
set sashelp.class;
run;
data class_tbl2;
set sashelp.class;
run;
proc sql noprint;
delete from work.class_tbl2
where Age < 20;
quit;
data use_this_if_no_obs;
msg='No Data';
run;
data _null_;
dsnid=open('work.class_tbl');
if dsnid then do;
nobs=attrn(dsnid, 'nobs');
end;
if nobs=0 then do;
call execute(Title 'information class_tbl'; 'proc print data=use_this_if_no_obs noobs; run;');
end;
else do;
call execute('proc print data=work.class_tbl noobs; run;');
end;
rc = close(dsnid);
run;
data _null_;
dsnid=open('work.class_tbl2');
if dsnid then do;
nobs=attrn(dsnid, 'nobs');
end;
if nobs=0 then do;
call execute('proc print data=use_this_if_no_obs noobs; run;');
end;
else do;
call execute(Title 'information class_tbl';'proc print data=work.class_tbl2 noobs; run;');
end;
rc = close(dsnid);
run;