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

I am working on moving a program from base SAS to EG.

The program outputs many files, 500+ using the following setup:

ods noresults;
ods pdf file="&File";

This works fine in base SAS, however in EG it seems it ignores the noresults and loads up those 500 files.

I tried:

ods results=off;
ods _ALL_ close;

But that does not change the fact that it still loads them.

I tried:

ods exclude all;

But this supresses all output so my files do not even get generated this way.

 

Going to Tools -> Options -> Results Viewer and disabling Automatically open data or results when generated solves the problem, but I am trying to figure out if I can do this through the code.

 

Going to Tools -> Options -> Project Views and disabling Show Generated Results prevents SAS from opening the files, but than they get opened automaticly by the operating system (This is still way faster than letting them load in EG by the way), but again the previous solution works better but is impractical.

 

I am running EG 7.12 with base SAS build M3.

Any input or advice is greatly appreceated.

 

1 ACCEPTED SOLUTION

Accepted Solutions
fifthand57th
SAS Employee

@Renn

 

Hi,

 

Where are you putting your ods results=off; statement? In EG ods results=off; suppresses the RESULTS tab from appearing. It doesn't stop the ODS PDF file from being created but they should not load in EG.

 

Here's my test code:

 

ods results=off;

ods pdf file="c:\temp\odstest.pdf";

proc print data=sashelp.class;

run;

ods pdf close;

 

I've attached a screenshot that shows the log which indicates that the PDF was created but no RESULTS tab appears in EG. Tested in EG 7.12 and EG 7.13.

 

My EG options settings are the default meaning "automatically open data or results when generated' is enabled.


2017-03-21_14-59-54.png

View solution in original post

7 REPLIES 7
Kurt_Bremser
Super User

Please define what you mean by "files". EG creates results depending on the settings in Options - Results, and sends the respective ODS code before (and after, to close) every project node that is executed. If you de-select all result types, no output is created by EG, and then only your ODS statements have effect.

Renn
Fluorite | Level 6

Thank you for responding.

As you might have guessed the program is looping and creating multiple PDFs.

In base SAS it disables all ODS, including  the results and populate the files via ods obj expressions.

 

EG has indeed no problem generating the files, my only issue is with them being loaded as results on the process flow, which takes at least twice longer than the actual program to run.

 

At the moment I am going through options to disable results, however since I want to share this with others I wanted to automate the supression on results and not push whoever will run the program to disable results to run this than re-enable them for a different program. I also may have assumed it was an easy one liner, just as in base SAS.

TomKari
Onyx | Level 15

You won't be able to use SAS code to automate opening or not opening the results; that's because all that the SAS code knows is that it created and wrote the result dataset. What happens after that is totally EG functionality, which if desired retrieves the results from the SAS server and opens it in EG.

 

There might be a way to do it using the EG automation facilities, that's the only way I can think of.

 

Tom

TomKari
Onyx | Level 15

Further to this, I just did a quick test.

 

If I turn off Tools | Project Views | Show generated results, it doesn't add my PDF to the process flow. So that solves part of your problem.

 

I think you can get everything you want statically; I'm doubtful that you can automate changing the state.

 

Tom

Renn
Fluorite | Level 6
Thanks a lot for checking Tom.
fifthand57th
SAS Employee

@Renn

 

Hi,

 

Where are you putting your ods results=off; statement? In EG ods results=off; suppresses the RESULTS tab from appearing. It doesn't stop the ODS PDF file from being created but they should not load in EG.

 

Here's my test code:

 

ods results=off;

ods pdf file="c:\temp\odstest.pdf";

proc print data=sashelp.class;

run;

ods pdf close;

 

I've attached a screenshot that shows the log which indicates that the PDF was created but no RESULTS tab appears in EG. Tested in EG 7.12 and EG 7.13.

 

My EG options settings are the default meaning "automatically open data or results when generated' is enabled.


2017-03-21_14-59-54.png
Renn
Fluorite | Level 6

First and foremost, Thank you so much about digging into this, thanks to you I got some motivation to do some extensive testing. After trying many different setups all of which worked fine outside my program, meaning I cannot replicate this, I started putting

ods results = off;

all over the program.

 

In order to work with multiple files in the project I was creating macros of each file being called by another file instead of using %include, this helped me keep the program with no static program references outside the project. For some reason turning off results on the last program before any macro that creates PDF is called, took effect.

 

Wierdly enough I was not able to replicate this on a new project (made two files one with a macro, one that calls it). So I am assuming there is some wierd stuff going on with my program, however I do not think is worth investigating seing as turning off results does work, is just an issue of making the call on the right place and in my case calling it right before ods pdf file did not work.

 

 

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 7 replies
  • 7350 views
  • 1 like
  • 4 in conversation