The SAS Output Delivery System and reporting techniques

How to get information about opened ODS destinations and current styles?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

How to get information about opened ODS destinations and current styles?

Is there any way to save the name of current style to macro variable? I want to write a macro that draw some graphics in specific style. That's why I want to save current state of opened destinations and their styles, change style to my macro's style, run macro and turn settings back to original. I have not found any function which returns current style name or destination state (opened or not). Maybe there is another way to implement such mechanics or i missed something?


Accepted Solutions
Solution
‎01-12-2016 08:17 AM
Super User
Super User
Posts: 7,955

Re: How to get information about opened ODS destinations and current styles?

Posted in reply to lightmiker

There is a view in SASHELP which holds the output destinations and the style associated with them.  Do:

data test;
  set sashelp.vdest;
run;

And you can see them.  I would however question why you have programs which need to output things, when destinations already exist.  Sounds a bit to overcomplex.  Each program, or output component should specify its own output parameters, it keesp the information encapsulated.  Otherwise whoever has to use your code later on then has to trawl through other code trying to figure out what is going on.  

View solution in original post


All Replies
Solution
‎01-12-2016 08:17 AM
Super User
Super User
Posts: 7,955

Re: How to get information about opened ODS destinations and current styles?

Posted in reply to lightmiker

There is a view in SASHELP which holds the output destinations and the style associated with them.  Do:

data test;
  set sashelp.vdest;
run;

And you can see them.  I would however question why you have programs which need to output things, when destinations already exist.  Sounds a bit to overcomplex.  Each program, or output component should specify its own output parameters, it keesp the information encapsulated.  Otherwise whoever has to use your code later on then has to trawl through other code trying to figure out what is going on.  

Occasional Contributor
Posts: 5

Re: How to get information about opened ODS destinations and current styles?

Thanks, that's exactly what I need. My macro draws one graph with specific colors and fonts. I want that settings to be used only for that specific graph. That's why I decided to isolate that temporary change of style within the macro. I dont want to specify that temporary style by hands every time I run macro.

Super User
Super User
Posts: 7,955

Re: How to get information about opened ODS destinations and current styles?

Posted in reply to lightmiker

Not sure I am following you on the process there.  I would always specify before any output procedure, the destination options, style etc. even if calling a macro to do the graph, e.g.

%macro draw_graph();
   proc sgplot...;
%mend draw_graph;

ods _all_ close;
ods rtf file="...\file.rtf" style=statistical;
%draw_graph;
ods rtf close;

In the above code, I call a macro, but the file setup and such like is done by me, I would never rely on what is already there, or try to revert to it after the fact.

Occasional Contributor
Posts: 5

Re: How to get information about opened ODS destinations and current styles?

I got your point. Maybe I should to save my macro style as permanent and manually set it before calling the macro to make things clear... Anyway thanks for helping with sashelp.vdest. It is a new stuff for me Smiley Happy.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 428 views
  • 0 likes
  • 2 in conversation