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

Is there anyway to suppress ODS completely, or is there anyway to delete an html output or sas report using code?  My problem is when I run the code below, SAS still produces an HTML  file and SAS report with nothing in it.  I want to either suppress the creation of these output files or delete them after they have been produced.  My motivation is that I'm trying to create a process flow branch in SAS Enterprise Guide that only includes SAS programs and datasets.  I find that the creation of this html file and SAS report makes the branch look messy, especially since these files are blank anyway.

 

Thank you for any help you can provide.

 

Sincerely,

 

Bill

 

 

ODS EXCLUDE ALL;
ODS OUTPUT PARAMETERESTIMATES(PERSIST=RUN)=EST;

PROC REG DATA = DATA
MODEL Y = X;

RUN;

ODS OUTPUT CLOSE;
ODS EXCLUDE NONE;

1 ACCEPTED SOLUTION
6 REPLIES 6
Kurt_Bremser
Super User

Execute conditionally?

proc sql noprint;
select nobs into :nobs
from dictionary.tables
where libname = 'WORK' and memname = 'DATA';
quit;

%if &nobs. > 0
%then %do;

ODS EXCLUDE ALL;
ODS OUTPUT PARAMETERESTIMATES(PERSIST=RUN)=EST;

PROC REG DATA = DATA
MODEL Y = X;

RUN;

ODS OUTPUT CLOSE;
ODS EXCLUDE NONE;

%end;
whs278
Quartz | Level 8
Thanks for the quick reply. However, I need the code to run in order to create the dataset EST. I just don't need any HTML or ODS output.
Kurt_Bremser
Super User

Then you could conditionally create the NOPRINT option in the PROC REG statement:

%let nobs=0;

proc sql noprint;
select nobs into :nobs
from dictionary.tables
where libname = 'WORK' and memname = 'DATA';
quit;

proc reg data=data
%if &nobs. = 0
%then %do
  noprint
%end;
;
whs278
Quartz | Level 8
Okay, I realize that for this program i used proc reg, so i can use an output statement to save the parameter estimates into a dataset without using ODS.

However, I have a similar program where I use proc surveyreg instead. As far as I know, there is no way to save the parameter estimates from proc survey reg without using ODS OUTPUT. However, I don't want to actually print anything or create any html files, hence the ODS exclude statement. All I want to do is save the parameter estimates into a dataset. The problem is that even when using the ODS exclude statement, a blank html file is still created. I want to know if there is any way to use the ODS OUTPUT statement without creating an html file, or, at the very least, if there is a way to delete the html file after it is created using some SAS procedure.
whs278
Quartz | Level 8
Thank you. Running the ODS _ALL_ CLOSE statement before the ODS OUTPUT statement did the trick.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 6 replies
  • 1571 views
  • 1 like
  • 2 in conversation