1
votes

I am working inside a SAS macro application, and get the following warning before running a proc compare:

WARNING: No output destinations active.

Using the noprint option of proc compare does not suppress the warning. Am pretty sure the only way to get rid of this warning is to open an ODS destination (eg ods listing;) before running the proc, however I do not want to disrupt existing settings as there may be different ODS states at run time.

Is there any way to determine the ODS state programmatically? eg:

%let state=%sysfunc(getODSSTATE(listing)); /* for example */
ods listing;
proc compare base=x compare=y noprint; run;
ods listing &state; /* either %str(CLOSE) or %str() */
1

1 Answers

2
votes

I had thought ODS SHOW; would be a solution, but that tracks the select/exclude, not the open destination.

One solution might be to choose a destination that is unlikely to be open - an obscure tagset perhaps - and open that to a dummy file, then close it. ODS PREFERENCES;also seems like a good compromise; it will open up whatever your default destination is, at least.

Honestly though, if you're writing a macro application, I would just leave the ODS alone; it should be up to the programmer using your macro to properly set up ODS ahead of time.