BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
TashaChapman14
Obsidian | Level 7

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

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

TashaChapman14
Obsidian | Level 7

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...

Cynthia_sas
SAS Super FREQ
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
TashaChapman14
Obsidian | Level 7

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

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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