Desktop productivity for business analysts and programmers

How to control output in EG inside a SAS program?

Accepted Solution Solved
Reply
New Contributor UHO
New Contributor
Posts: 2
Accepted Solution

How to control output in EG inside a SAS program?

Hi,

I have written a sas BASE program that does a lot of data transformations and then finally, a report. I’m using PROC TABULATE for many of the summaries and only using the out dataset option to create a dataset that I then do further transformations on. I’m not interested in the output first tabulate steps and I have closed the output using ods html close and ods listing close. When I come to the final output step I turn on ods HTML and there I have my report.

Now I want to implement the logic in EG, still just wanting the final report. Now I encounter problem. In EG it is not possible to turn off the output as in SAS BASE, the output end up default in the SAS report.

Does anyone know how to turn off the output to the SAS REPORT in EG in code (not in options) and then turn it on in a later step?

The simple example below tries to explain. I only want the SAS report from the last tabulate.

Best Regards

Ulf

/* From this tabulate I only want the outdataset. No SAS report */

proc tabulate data = data.analysdata missing out = tot1(where = (q6_1 NE .keep = q6_1 flag_PctSum_0);

                  var flag;

                  class q6_1;

                  table q6_1, (colpctsum * flag);

                  format flag best4.1;

run;

/* And from this tabulate I want to have the SAS report */

proc tabulate data = data.analysdata missing out = tot1;

                  var flag;

                  class q6_2;

                  table q6_2, (colpctsum * flag);

                  format flag best4.1;

run;


Accepted Solutions
Solution
‎01-10-2014 06:30 AM
Super User
Posts: 1,231

Re: How to control output in EG inside a SAS program?

Try using:

ods _all_ close;

Kind Regards,

Michelle

View solution in original post


All Replies
Solution
‎01-10-2014 06:30 AM
Super User
Posts: 1,231

Re: How to control output in EG inside a SAS program?

Try using:

ods _all_ close;

Kind Regards,

Michelle

New Contributor UHO
New Contributor
Posts: 2

Re: How to control output in EG inside a SAS program?

Thanks,

First ods _all_ close then I applied ods tagsets as below.

Great!

Best regards

Ulf

ods _all_ close; /* Close all output to SAS report */

proc tabulate data = data.analysdata missing out = tot1(where = (q6_1 NE .)  keep = q6_1 flag_PctSum_0);

   var flag;

   class q6_1;

   table q6_1, (colpctsum * flag);

   format flag best4.1;

run;

/* Open output to SAS report */

ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR STYLE=HtmlBlue

STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/5.1/Styles/HtmlBlue.css") NOGTITLE NOGFOOTNOTE GPATH=&sasworklocation ENCODING=UTF8 options(rolap="on");

/* And from this tabulate I want to have the SAS report */

proc tabulate data = data.analysdata missing out = tot1;

   var flag;

   class q6_2;

   table q6_2, (colpctsum * flag);

   format flag best4.1;

run;

Community Manager
Posts: 2,707

Re: How to control output in EG inside a SAS program?

For more information about controlling ODS output from within SAS Enterprise Guide, read this paper:

Destination Known: Programmatically Controlling Your Output in SAS® Enterprise Guide®, by Aaron Hill

Chris

☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 274 views
  • 0 likes
  • 3 in conversation