Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!

SAS EG and ODS

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 10
Accepted Solution

SAS EG and ODS

Hey all!

 

Long time SAS programmer still getting used to the EG environment...

 

I have a question about how ODS works in the EG world.  I know that you can automatically set your results settings (Tools > Options > Results > Results General) to display your format in multiple destinations, and I use this for a good chunk of my day-to-day ad hoc work.  However, sometimes the options available are limited, so I want to use ODS code to explicitly get exactly the output that I want.

 

So, here's the question... If I have my results generator set to automatically create an Excel file, but then I also use ODS Excel to create an Excel file, does it create two separate files with two separate sets of options?  I believe it does, but I wanted to hear from the community with invariably more EG experience than I have...

 

Tasha

 

 


Accepted Solutions
Solution
4 weeks ago
SAS Super FREQ
Posts: 9,436

Re: SAS EG and ODS

Posted in reply to TashaChapman14

Hi:

  If you turn on the ODS EXCEL choice in the Results Window and then you also use explicit ODS EXCEL statements in your code, you will see 2 outputs inside EG, as shown below:

eg_ods_excel.png

Hope this helps,

Cynthia

View solution in original post


All Replies
Solution
4 weeks ago
SAS Super FREQ
Posts: 9,436

Re: SAS EG and ODS

Posted in reply to TashaChapman14

Hi:

  If you turn on the ODS EXCEL choice in the Results Window and then you also use explicit ODS EXCEL statements in your code, you will see 2 outputs inside EG, as shown below:

eg_ods_excel.png

Hope this helps,

Cynthia

Occasional Contributor
Posts: 10

Re: SAS EG and ODS

Posted in reply to Cynthia_sas

Yes, Cynthia that does help.  Thank you!  So, just to make sure I'm 100% clear on how this works, is it fair to say that the two Excel files would be controlled by different options?  I.E., the file created through the ODS Excel code would be controlled by the options in my ODS Excel code, and the automatic generated file would be controlled by options selected through the EG menus...

SAS Super FREQ
Posts: 9,436

Re: SAS EG and ODS

Posted in reply to TashaChapman14
Hi:
I'm not sure what you mean by "EG menus" -- to the extent that you change options or included code in the Results options, then yes, the automatic generated file would be controlled by options there.

I was answering your question in the context of writing code. The code in my ODS "sandwich" was typed into the Program Editor, so there were no other EG menu choices at play other than what I set in the Results window.

To make sure you are really clear about which options control which output, I'd recommend just running a few experiments...typically, however, the automatic results are fairly "vanilla" without any special options at play.

When I think of EG menu choices, I think of them in terms of tasks, like the LIST data task or the frequency or means or summary table tasks. But I thought if you were talking about writing your own ODS EXCEL statements, that you'd have code inside those statements (in which case, EG menu options for Results wouldn't impact the explicit "full control" output).

Of course, in all honesty, when I know I am going to take full control of the output and make an explicit ODS EXCEL output file, I tend to put
ODS _ALL_ CLOSE; before my first ODS EXCEL statement and I just turn off all the automatic output for that program. So, in that case, I only ever get the output I expect. I don't like to "spend" the time creating all the other output, if I don't really care about it.

Cynthia
Occasional Contributor
Posts: 10

Re: SAS EG and ODS

Posted in reply to Cynthia_sas

Thank you, Cynthia.  Yeah, I was referring to the results options.

 

 

☑ This topic is solved.

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

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