只需添加另一个步骤,当没有符合您选择标准的观察时,该步骤将打印出来。
ods rtf file="test"; title "how many obs"; proc print data = test; var a; where a=2; run; data _null_; file print; if eof then put 'No observations match criteria.'; else stop; set test end=eof; where a=2; run; ODS rtf close;