SAS Programming

DATA Step, Macro, Functions and more
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 2 replies
  • 1032 views
  • 0 likes
  • 3 in conversation