hi, the below code prints the results even thought i have places ods close statement.
I mean it print in HTML which i don't want
Could you please anyone advise how to stop printing ?
/*R_squared*/
ods html close;
proc logistic data=data1.;
ods Output rsquare=r2.;
model bad=good/rsquare;
run;
ods html close;
Hi @Toni2,
You can use the ODS SELECT statement (or similarly the ODS EXCLUDE statement) to restrict the output to the dataset requested in the ODS OUTPUT statement.
ods select none; proc logistic ... ... ods output ...; ... run; ods select all;
The ODS OUTPUT statement can also precede the PROC LOGISTIC statement, but must be inside the pair of ODS SELECT statements.
(The period after "r2" is incorrect, btw.)
Which ODS destination is open? To use ODS OUTPUT you must have at least one ODS Destination open or no output will be created.
Or for some procedures you may be able to get what you want with an output statement but that may not have all the bits that you want.
@Toni2 wrote:
My issue here is i want to run the code in loop and it is going to take ages to print results.
If performance is an issue, you may even want to go a step further and also use ODS NORESULTS (and ODS GRAPHICS OFF if your procedure creates unwanted graphs): see Rick Wicklin's macros ODSOff and ODSOn in his blog article Turn off ODS when running simulations in SAS.
@Toni2 wrote:
i am not sure which destination is open. My issue here is i want to run the code in loop and it is going to take ages to print results. i need them only in the output table. Is there any workaround?
You need to use the ODS SELECT option demo'd by @FreelanceReinh
And in case you missed it, you'll need to pick a unique name for your output data set otherwise it will get overwritten each run.
Hi @Toni2,
You can use the ODS SELECT statement (or similarly the ODS EXCLUDE statement) to restrict the output to the dataset requested in the ODS OUTPUT statement.
ods select none; proc logistic ... ... ods output ...; ... run; ods select all;
The ODS OUTPUT statement can also precede the PROC LOGISTIC statement, but must be inside the pair of ODS SELECT statements.
(The period after "r2" is incorrect, btw.)
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.