I have a following Macro which I am calling with in another Macro to write down observations via PROC Tabulate in to the PDS member however what happening is even if we don't have any observation to write down in the proc tabulate it's creating a ***Blank*** member in the PDS dataset ...
Does anybody know way to supress even member creation in the PDS dataset if there's no observacation written via Proc tabulate ????
%macro htmlout(objtype=,filename=,odsmem=,title=) ;
ods trace on;
ods noproctitle;
ods listing close ;
ods &Objtype
path=&filename
Base="xxxxxx"
body="&odsmem"
record_seperator=none
style=barrettsblue
newfile=page;
%mend htmlout ;
There are many that have asked for giving information there is nothing to print. The reason is you know the program has run (that is also some information) but no results are output.
Do you not want to run anyting you could test there are non-zero observations (nobs) and than not run that code. Remember to delete all previous run results first.
I found the answer did check for the Observation and put the PROC Tabulate within IF DO loop to check if OBS > 0 if so only then execute else exit....that worked...
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.