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
How to manage to display one or some rather than all of the 7 tables?
Any help would be much appreciated.
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:
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
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:
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
Very helpful, Many many thanks to Cynthia.
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.