Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Using the Output Delivery System

Example 15.3: Determining the Names of ODS Tables

In order to select or exclude a table, or to render it as a SAS data set, you must first know its name. You can obtain the table names in several ways (see the section "Using the Output Delivery System" for more information).

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 LIFETEST Procedure

Output Added:
-------------
Name:       ProductLimitEstimates
Label:      Product-Limit Estimates
Template:   Stat.Lifetest.ProductLimitEstimates
Path:       Lifetest.Stratum1.ProductLimitEstimates
-------------


                                   Stratum 1: Treatment = 1

                                Product-Limit Survival Estimates

                                                  Survival
                                                  Standard     Number      Number
                 Days     Survival    Failure      Error       Failed       Left

                0.000       1.0000           0           0        0          20
              171.000       0.9500      0.0500      0.0487        1          19
              179.000       0.9000      0.1000      0.0671        2          18
              217.000       0.8500      0.1500      0.0798        3          17
              224.000*           .           .           .        3          16
              225.000       0.7969      0.2031      0.0908        4          15
              255.000            .           .           .        5          14
              255.000       0.6906      0.3094      0.1053        6          13
              256.000            .           .           .        7          12
              256.000            .           .           .        8          11
              256.000            .           .           .        9          10
              256.000       0.4781      0.5219      0.1146       10           9
              262.000       0.4250      0.5750      0.1135       11           8
              264.000       0.3719      0.6281      0.1111       12           7
              287.000       0.3188      0.6813      0.1071       13           6
              319.000            .           .           .       14           5
              319.000       0.2125      0.7875      0.0942       15           4
              325.000            .           .           .       16           3
              325.000       0.1063      0.8938      0.0710       17           2
              355.000       0.0531      0.9469      0.0517       18           1
              378.000*           .           .           .       18           0

                  NOTE: The marked survival times are censored observations.


                           Summary Statistics for Time Variable Days

Output Added:
-------------
Name:       Quartiles
Label:      Quartiles
Template:   Stat.Lifetest.Quartiles
Path:       Lifetest.Stratum1.TimeSummary.Quartiles
-------------

                                       Quartile Estimates

                                       Point     95% Confidence Interval
                          Percent    Estimate      [Lower      Upper)

                               75     319.000     262.000     325.000
                               50     256.000     255.000     319.000
                               25     255.000     217.000     256.000


As you can see in Output 15.3.1, the ODS TRACE ON statement writes the name, label, template, and path name of each generated ODS table. For more information on names, labels, and qualified path names, see the discussion in the section "Using the Output Delivery System".

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
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.