Chapter Contents |
Previous |
Next |
Using the Output Delivery System in the DATA Step |
Requirements: | If you use the ODS option, you must use the fileref PRINT in the FILE statement. |
Restriction: | The DELIMITER= and DSD options have no effect on the ODS option. The FOOTNOTES | NOFOOTNOTES, LINESIZE, PAGESIZE, and TITLES | NOTITLES options have an effect only on the listing destination. You cannot use _FILE_=, FILEVAR=, HEADER=, or PAD with the ODS option. |
FILE PRINT <ODS<=(ODS-suboption(s))>><overflow-control><N=number> ; |
Note:
This syntax shows only the ODS portion of the FILE statement.
For the complete syntax of the FILE statement, see SAS Language Reference: Dictionary.
File Statement Arguments and Options |
The arguments and options listed here can be specified in any order in the FILE statement.
Default: | If you do not specify
any ODS suboptions, the DATA step uses a default table definition (base.datastep.table)
that is stored in the SASHELP.TMPLMST template store. This definition defines
two generic columns: one for character variables and one for numeric variables.
ODS associates each variable in the DATA step with one of these columns and
displays the variables in the order in which they are defined in the DATA
step.
Without suboptions, the default table definition uses the variable's label as its column header. If no label exists, the definition uses the variable's name as the column header. |
Featured in: | All examples |
Default: | FLOWOVER |
Restriction: | You must use PRINT in a FILE statement that uses the ODS option. |
Featured in: | Using the Default Table Definition |
ODS Suboptions |
To do this ... | Use this suboption | |
---|---|---|
Specify one or more columns for the data component | COLUMNS= or VARIABLES= | |
Specify default values for column attributes that exist in the table definition, but that get their values from the data component | DYNAMIC= | |
Assert that all column definitions in the table definition can or cannot be used by more than one variable | GENERIC= | |
Specify a column header to use for any column that does not have a column header specified in the COLUMNS= or VARIABLES= suboption | LABEL= | |
Specify a name for the output object that the DATA step produces | OBJECT= | |
Specify a label for the output object that the DATA step produces | OBJECTLABEL= | |
Specify the table definition to use with the data component to produce the output object | TEMPLATE= |
Note: By default, the order
of the columns in the output object is determined by their order in the table
definition, not by their order in the data component. You can override this
order by using the ORDER_DATA= table attribute in the PROC TEMPLATE step that
creates the definition. The default DATA step table definition uses this attribute.
(See the discussion of ORDER_DATA=.)
Each column-specification has this general form:
column-name<=variable-name><(attribute(s))> |
Restriction: | column-name must conform to the rules for SAS variable names. For information on these rules, see "Rules for Words and Names" in SAS Language Reference: Dictionary. |
Tip: | You can use list notation
(for example, score1 -score5 ) to specify multiple column names. |
Featured in: | Using a Simple User-Defined Definition |
Default: | If you omit variable-name, ODS looks for a DATA step variable named column-name to place in the specified column. If no such variable exists, ODS returns an error. |
Tip: | You can use list notation
(for example, score1 -score5 ) to specify a range of variable names. |
Featured in: | Using a Simple User-Defined Definition |
Featured in: | Using a Simple User-Defined Definition |
Default: | ODS uses the first of
these formats for the variable that it finds:
|
Featured in: | Using a Simple User-Defined Definition |
Note: Formats
for generic columns that are specified
in the table definition are ignored by the DATA step interface to ODS.
Default: | OFF |
Featured in: | Using a Simple User-Defined Definition |
Featured in: | Specifying Attributes for a Column |
Default: | If you do not specify COLUMNS= or VARIABLES=, the order of columns in the data component matches the order of the corresponding variables in the program data vector. |
Restriction: | You can use only one COLUMNS= suboption in a FILE statement. |
Interaction: | You can use either the COLUMNS= suboption or the VARIABLES= suboption to associate variables with columns. However, you cannot use both suboptions in the same FILE statement. |
A dynamic attribute value is defined in the table definition. Its name serves as a placeholder for the value that is supplied to the data component with the DYNAMIC= suboption. When ODS creates the output object from the table definition and the data component, it substitutes the appropriate value from the data component for the value's name in the table definition.
Each dynamic-specification has the following form:
dynamic-value-name<=variable-name | constant> |
Tip: | By default, DYNAMIC= applies to all columns in the data component. You can override this specification for an individual column by specifying DYNAMIC= as an attribute for that column in the COLUMNS= or the VARIABLES= suboption. |
Default: | OFF |
Interaction: | If you do not specify a table definition (see TEMPLATE=), GENERIC= is set to ON. |
Restriction: | Unless GENERIC=ON is specified in the COLUMNS= option, in the ODS= option, and in the table definition that you are using, ODS does not recognize the column names as a match. |
Tip: | By default, GENERIC= applies to all columns in the data component. You can override this specification for an individual column by specifying GENERIC= as an attribute for that column in the COLUMNS= or the VARIABLES= suboption. |
Default: | ODS uses for the column
header the first of these labels that it finds:
If no label is specified, the contents of the table definition determines whether the column header contains the variable name or is blank. |
Featured in: | Using a Simple User-Defined Definition |
The Results window and the HTML contents file both contain a description of, and a link to, each output object. The description contains the first of these items that ODS finds:
FilePrint#
,
where # increases by 1 for each DATA step that you run in the
current SAS process without specifying an object name or an object label.
Restriction: | object-name must conform to the rules for SAS variable names. For information on these rules, see "Rules for Words and Names" in SAS Language Reference: Dictionary. |
The Results window and the HTML contents file both contain a description of and a link to each output object. The description contains the first of these items that ODS finds:
FilePrint#
,
where # increases by 1 for each DATA step that you run in the
current SAS process without specifying an object name or an object label.
Featured in: | Specifying Attributes for a Column |
Default: | base.datastep.table |
Interaction: | When you use the default table definition, GENERIC= is set to ON for all columns in the data component. (See GENERIC=.) |
Featured in: | Using a Simple User-Defined Definition |
Note: By default, the order
of the columns in the output object is determined by their order in the table
definition, not by their order in the data component. You can override this
order by using the ORDER_DATA table attribute in the PROC TEMPLATE step that
creates the definition. The default DATA step table definition uses this attribute.
(See the discussion of the ORDER_DATA=.)
Each variable-specification has this general form:
variable-name<=column-name><(attribute(s))> |
Tip: | You can use list notation
(for example, score1 -score5 ) to specify a range of variable names. |
Featured in: | Selecting Variables for the Data Component and Specifying Attributes for a Column |
Default: | If you omit column-name, ODS looks for a column in the table definition that is named variable-name and places the variable in that column. If no such column exists, ODS returns an error. |
Restriction: | column-name must match a column name in the table definition that you are using. It must also conform to the rules for SAS variable names. For information on these rules, see "Rules for Words and Names" in SAS Language Reference: Dictionary. |
Tip: | You can use list notation
(for example, score1 -score5 ) to specify a range of column
names. |
Default: | If you do not specify COLUMNS= or VARIABLES=, the order of columns in the data component matches the order of the corresponding variables in the program data vector. |
Restriction: | You can use only one VARIABLES= suboption in a FILE statement. |
Interaction: | You can use either the COLUMNS= suboption or the VARIABLES= suboption to associate variables with columns. However, you cannot use both suboptions in the same FILE statement. |
Tip: | VARIABLES= is primarily for use with the default DATA step table definition. When you are using the default definition, the DATA step can map variables to the appropriate column in the definition so you don't need to specify a column name. |
Featured in: | Selecting Variables for the Data Component and Specifying Attributes for a Column |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.