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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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