Chapter Contents |
Previous |
Next |
Using the Output Delivery System |
This example uses the ODS TRACE statement with the LISTING option to obtain the names of the created output objects. By default, the ODS TRACE statement writes its information to the SAS log. However, you can specify the LISTING option to have the information interleaved with the procedure output in the SAS listing.
Suppose that you perform a randomized trial on rats that have been exposed to a carcinogen. You divide them into two groups and give each group a different treatment. In the following example, interest lies in whether the survival distributions differ between the two treatments. The data set Exposed contains four variables: Days (survival time in days from treatment to death), Status (censoring indicator variable: 0 if censored and 1 if not censored), Treatment (treatment indicator), and Sex (gender: F if female and M if male).
data Exposed; input Days Status Treatment Sex $ @@; datalines; 179 1 1 F 378 0 1 M 256 1 1 F 355 1 1 M 262 1 1 M 319 1 1 M 256 1 1 F 256 1 1 M 255 1 1 M 171 1 1 F 224 0 1 F 325 1 1 M 225 1 1 F 325 1 1 M 287 1 1 M 217 1 1 F 319 1 1 M 255 1 1 F 264 1 1 M 256 1 1 F 237 0 2 F 291 1 2 M 156 1 2 F 323 1 2 M 270 1 2 M 253 1 2 M 257 1 2 M 206 1 2 F 242 1 2 M 206 1 2 F 157 1 2 F 237 1 2 M 249 1 2 M 211 1 2 F 180 1 2 F 229 1 2 F 226 1 2 F 234 1 2 F 268 0 2 M 209 1 2 F ; ods trace on/listing; proc lifetest data=Exposed; time Days*Status(0); strata Treatment; run; ods trace off;
The purpose of these statements is to obtain the names of the ODS tables produced in this PROC LIFETEST run. The ODS TRACE ON statement writes the trace record of ODS output tables. The LISTING option specifies that the information is interleaved with the output and written to the SAS listing.
The LIFETEST procedure is invoked to perform the analysis, the SAS listing receives the procedure output and the trace record, and the trace is then disabled with the OFF option.
Output 15.3.1: The ODS Trace, Interleaved with LIFETEST Results: Partial Results
|
The information obtained with the ODS TRACE ON statement enables you to request output tables by name. The examples that follow demonstrate how you can use this information to select, exclude, or create data sets from particular output tables.
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.