Desktop productivity for business analysts and programmers

Supressing results in EG

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

Supressing results in EG

[ Edited ]

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.

 


Accepted Solutions
Solution
‎03-22-2017 10:45 AM
SAS Employee
Posts: 14

Re: Supressing results in EG

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

View solution in original post

Attachment

All Replies
Esteemed Advisor
Posts: 6,698

Re: Supressing results in EG

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 4

Re: Supressing results in EG

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.

Trusted Advisor
Posts: 1,060

Re: Supressing results in EG

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

Trusted Advisor
Posts: 1,060

Re: Supressing results in EG

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

New Contributor
Posts: 4

Re: Supressing results in EG

Thanks a lot for checking Tom.
Solution
‎03-22-2017 10:45 AM
SAS Employee
Posts: 14

Re: Supressing results in EG

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

Attachment
New Contributor
Posts: 4

Re: Supressing results in EG

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.

 

 

☑ This topic is SOLVED.

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

Discussion stats
  • 7 replies
  • 190 views
  • 0 likes
  • 4 in conversation