Usage Note 22949: Saving a specific table or statistic displayed by a procedure to a data set
You can use an ODS OUTPUT statement to save any table created by any procedure to a data set. The ODS OUTPUT statement is a global statement, so it can be placed anywhere before the termination of the procedure. Here is the form of the ODS OUTPUT statement:
ods output <table-name> = <data-set-name>;
To save a particular table to a data set, you first need to find the name of the table. Most procedures have an "ODS Table Names" section in their documentation that lists the names of the tables that the procedure can create. Or simply right-click in the Results window on the table's icon and select Properties. Yet another way is to specify the following statement before your procedure statements. The names of the displayed tables will be listed in the Log.
ods trace on;
The listing of table names stays on until you turn it off. You can turn off the listing of table names by using the following statement:
ods trace off;
The following statements list the names of the PROC REG results tables in the Log window:
ods trace on;
proc reg;
model y = x;
run; quit;
ods trace off;
For example, to write the parameter estimates table from PROC REG to a data set, the ODS TRACE statement or the "ODS Table Names" section of the PROC REG documentation shows you that the table name is ParameterEstimates. To save this table to a data set named PARMS, specify the following statements:
ods output ParameterEstimates=parms;
proc reg;
model y = x;
run; quit;
Multiple tables can be saved in one ODS OUTPUT statement. For example this statement saves both the ParameterEstimates table and the ANOVA table in data sets.
ods output ParameterEstimates=parms ANOVA=anvar;
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | low |
Topic: | SAS Reference ==> ODS (Output Delivery System)
|
Date Modified: | 2015-07-01 13:04:47 |
Date Created: | 2002-12-16 10:56:48 |