BookmarkSubscribeRSS Feed
pblls
Calcite | Level 5

It's pretty well known that disabling unnecessary output will speed up most SAS PROCs, in particular when processing large amounts of (by-grouped) data. My standard go-to inside a macro that *only* has to produce a dataset (no actual result output) besides targeted ODS EXCLUDE statements is to check SASHELP.VDEST for open destinations, turn those into macro variables and close them, and then re-open the closed destinations.

 

The one thing that still clutters up the SAS Foundation Results window is ODS output datasets, which when numbering in the tens of thousands can really slow things down. I can get rid of those with an ODS RESULTS OFF (or ODS NORESULTS), but ideally I'd like to restore settings to whatever they were before the call when finished - not forcing things back open if previously closed by the user. Is there any way to programmatically check the ODS RESULTS status like you can do for other destinations? In a similar vein, can this be done for ODS GRAPHICS, or the ODS EXCLUDE list?

1 REPLY 1
FreelanceReinh
Jade | Level 19

Hello @pblls,

 

The status of ODS GRAPHICS (ON=1, OFF=0) is stored in the SYSODSGRAPHICS automatic macro variable.

 

ODS SELECT or EXCLUDE lists can be retrieved with the ODS SHOW statement. It writes to the log, which can be read programmatically (cf. Re: Macro Variable for SAS/STAT version?).

 

I don't know a solution for the ODS RESULTS status. The 2016 post Re: Catch current setting of "ods escapechar" suggests that there was no simple solution back then. However, things might have changed. In particular, now there is the SYSODSESCAPECHAR automatic macro variable, which contains the current setting of ODS ESCAPECHAR.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 425 views
  • 3 likes
  • 2 in conversation