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

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;

1 ACCEPTED SOLUTION

Accepted Solutions
MichelleHomes
Meteorite | Level 14

Try using:

ods _all_ close;

Kind Regards,

Michelle

//Contact me to learn how Metacoda software can help keep your SAS platform secure - https://www.metacoda.com

View solution in original post

3 REPLIES 3
MichelleHomes
Meteorite | Level 14

Try using:

ods _all_ close;

Kind Regards,

Michelle

//Contact me to learn how Metacoda software can help keep your SAS platform secure - https://www.metacoda.com
UHO
Calcite | Level 5 UHO
Calcite | Level 5

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;

ChrisHemedinger
Community Manager

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

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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