SAS,打印报表中的语句



我有数据A,然后我将运行一些代码并将报告打印为pdf。

ods pdf file="path/name.pdf";
if table A doesn't have any obs, then print the statement "No observations" to the final pdf report, 
else if table has obs, then print the statement "here is the table A" to the final pdf report. 
proc print data =TableA;run;
ods pdf close;
data _NULL_;
    file print;
    if e then put 'No observations';
    set TableA end=e;
    put 'here is the table A';
    stop;
run;

当表为空时,执行在 set 处停止,但 e 在设置之前设置为 1,因此第一个 if 语句执行。当它不为空时,执行在停止处停止。

最新更新