BookmarkSubscribeRSS Feed
JMo
Calcite | Level 5 JMo
Calcite | Level 5
I have a macro that requires ods listing to be on to produce results, however, I don't usually run SAS with ods listing b/c I'm just creating tables or sending the output to Excel. What I need to do is check the status of ods listing, turn it on if necessary and return it to the original state once the macro is finished. Thank you.
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
I do not believe there's a way to check the "existing" open/close status of the LISTING destination. This might be a question for Tech Support. ODS LISTING is -always- on when you start an interactive session or start a batch job....so unless you have explicitly issued an ODS _ALL_ CLOSE; or ODS LISTING CLOSE; (or put those statements in an AUTOEXEC program), you can generally be certain that the LISTING destination is on. One best practice that we recommend in our classes is to close the LISTING destination if you are creating other ODS output, but then to issue "housekeeping statements" at the end of every program to turn ODS LISTING back on:
[pre]
ODS LISTING;
[/pre]

cynthia

ps..TEXT or LISTING output is turned OFF by default for SAS Enterprise Guide. That is the one exception to the above rule.
Peter_C
Rhodochrosite | Level 12
JMo

don't make difficult work for your macro!

why not just leave it to the routine that is calling your macro
As "listing" is a prerequisite of your macro, it's not much different than requiring a parameter to be defined. The environment calling your macro will/should know whether the status of the listing destination is important.

good luck
PeterC

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
  • 657 views
  • 0 likes
  • 3 in conversation