BookmarkSubscribeRSS Feed
rkumar23
Calcite | Level 5

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 ;

2 REPLIES 2
jakarman
Barite | Level 11

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.     

---->-- ja karman --<-----
rkumar23
Calcite | Level 5

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...

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 967 views
  • 0 likes
  • 2 in conversation