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;
Try using:
ods _all_ close;
Kind Regards,
Michelle
Try using:
ods _all_ close;
Kind Regards,
Michelle
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;
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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.