BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Toni2
Lapis Lazuli | Level 10

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;
1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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.)

 

 

View solution in original post

5 REPLIES 5
ballardw
Super User

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
Lapis Lazuli | Level 10
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?
FreelanceReinh
Jade | Level 19

@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.

Reeza
Super User

@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. 

FreelanceReinh
Jade | Level 19

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.)

 

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 5 replies
  • 2556 views
  • 4 likes
  • 4 in conversation