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

 

data Data1;
do ID=1 to 63;

do Outcome=1 to 0 by -1;
input Gall Hyper @@;
output;
end;
end;
datalines;
0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 0 0 1
0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 1 1 0 0 1 1 0 1 0 1 0 0 1
0 1 0 0 0 0 1 1 0 0 1 1 0 0 0 1 0 1 0 0
0 0 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 0 0 1 0 0 0 1 1 0 0 0 0 1 0 0
0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 1 1
0 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 0
0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0
0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1
0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 0 0
0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0
1 0 1 0 0 1 0 0 1 0 0 0
;

proc logistic data=Data1;
strata ID;
model outcome(event='1')=Gall;
run;

On default, the Result Window displayed 7 tables

WX20181222-173632.png

 

How to manage to display one or some rather than all of the 7 tables?

 

Any help would be much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:
With the Output Delivery System, you generally use ODS SELECT or ODS EXCLUDE to only see some of the output created by a procedure.

To use ODS SELECT, you have to know the output table names that ODS will create. You do this using ODS TRACE ON/OFF. Once you know the table names for your procedure of interest, then you either SELECT or EXCLUDE them. And, you can also use these same ODS table names for your procedure to create output datasets for one or more than one table.

 

  Here's an example of using ODS TRACE with PROC UNIVARIATE:

ods_trace_univ.png

Here's some code to try. It uses PROC UNIVARIATE, but the concepts would be the same for PROC LOGISTIC or any other procedure that produces output. Let's say that I want to create and name an HTML and an RTF file, but I want to use ODS SELECT to choose which output table or output object goes to which destination.

title; footnote;

** Before you start, find the TABLE names created by PROC UNIVARIATE;
** look in the log to see the TABLE names. For SAS/STAT procedures, you can;
** also look in the documentation for the procedure;
ods html;
ods trace on / label;
proc univariate data=sashelp.class;
var height;
run;
ods trace off;

  
** 1) just do ODS SELECT for HTML AND RTF;
** to get only two objects into the output files for HTML and RTF;
** ODS SELECT without a destination sends the objects to ALL open destinations;
ods html path='c:\temp' file='get_two.html';
ods rtf file='c:\temp\get_two.rtf';
ods select moments basicmeasures;
proc univariate data=sashelp.class;
var height;
run;
ods html close;
ods rtf close;

** 2) now send moments table to HTML;
** and send basicmeasures table to RTF;
ods html path='c:\temp' file='get_moments.html';
ods rtf file='c:\temp\get_basicmeasures.rtf';
ods html select moments;
ods rtf select basicmeasures;
proc univariate data=sashelp.class;
var height;
run;
ods html close;
ods rtf close;

** 3) now make datasets for moments and basic measures;
ods html;
ods output moments=work.mymoments basicmeasures=work.mymeasures;
proc univariate data=sashelp.class;
var height;
run;


** 4) print the datasets created by ods output;
ods html path='c:\temp' file='from_data.html';
proc print data=work.mymoments;
title 'MyMoments';
run;

proc print data=work.mymeasures;
title 'MyMeasures';
run;
ods html close;
title;


Hope this helps explain the concepts of controlling the output from your procedures.

 
Cynthia

View solution in original post

3 REPLIES 3
micahwilliams12
Calcite | Level 5

With the Automated Test Framework (ATF), you create and run automated tests on your ServiceNow instance. When you upgrade or modify an instance, run these tests to confirm that the instance still works as designed. Read here.

Cynthia_sas
SAS Super FREQ

Hi:
With the Output Delivery System, you generally use ODS SELECT or ODS EXCLUDE to only see some of the output created by a procedure.

To use ODS SELECT, you have to know the output table names that ODS will create. You do this using ODS TRACE ON/OFF. Once you know the table names for your procedure of interest, then you either SELECT or EXCLUDE them. And, you can also use these same ODS table names for your procedure to create output datasets for one or more than one table.

 

  Here's an example of using ODS TRACE with PROC UNIVARIATE:

ods_trace_univ.png

Here's some code to try. It uses PROC UNIVARIATE, but the concepts would be the same for PROC LOGISTIC or any other procedure that produces output. Let's say that I want to create and name an HTML and an RTF file, but I want to use ODS SELECT to choose which output table or output object goes to which destination.

title; footnote;

** Before you start, find the TABLE names created by PROC UNIVARIATE;
** look in the log to see the TABLE names. For SAS/STAT procedures, you can;
** also look in the documentation for the procedure;
ods html;
ods trace on / label;
proc univariate data=sashelp.class;
var height;
run;
ods trace off;

  
** 1) just do ODS SELECT for HTML AND RTF;
** to get only two objects into the output files for HTML and RTF;
** ODS SELECT without a destination sends the objects to ALL open destinations;
ods html path='c:\temp' file='get_two.html';
ods rtf file='c:\temp\get_two.rtf';
ods select moments basicmeasures;
proc univariate data=sashelp.class;
var height;
run;
ods html close;
ods rtf close;

** 2) now send moments table to HTML;
** and send basicmeasures table to RTF;
ods html path='c:\temp' file='get_moments.html';
ods rtf file='c:\temp\get_basicmeasures.rtf';
ods html select moments;
ods rtf select basicmeasures;
proc univariate data=sashelp.class;
var height;
run;
ods html close;
ods rtf close;

** 3) now make datasets for moments and basic measures;
ods html;
ods output moments=work.mymoments basicmeasures=work.mymeasures;
proc univariate data=sashelp.class;
var height;
run;


** 4) print the datasets created by ods output;
ods html path='c:\temp' file='from_data.html';
proc print data=work.mymoments;
title 'MyMoments';
run;

proc print data=work.mymeasures;
title 'MyMeasures';
run;
ods html close;
title;


Hope this helps explain the concepts of controlling the output from your procedures.

 
Cynthia

hulinhui
Calcite | Level 5

Very helpful, Many many thanks to Cynthia.

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!

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.

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
  • 3 replies
  • 730 views
  • 0 likes
  • 3 in conversation