Dictionary of ODS Language Statements |
Valid: | in a DATA step |
Category: | File-handling |
Type: | Executable |
Requirement: | If you use the _ODS_ option in the PUT statement, then you must use the FILE PRINT ODS statement. |
Syntax | |
Options | |
Details | |
ODS Column Pointer Controls | |
ODS Line Pointer Controls | |
When the Pointer Moves Past the End of a Line | |
See Also |
Syntax |
PUT <specification><_ODS_><@|@@>; |
Note:
This syntax shows only the ODS form of the PUT statement when you are binding to a template. For the complete syntax, see the PUT statement in SAS Language Reference: Dictionary.
specifies one or more variables to write and where to write them. Specification has the following form:
<ods-pointer-control-1> variable-1 <...<ods-pointer-control-n>variable-n> |
moves the pointer in the buffer to a specified line or column.
See also: | When the Pointer Moves Past the End of a Line |
identifies the variable to write.
Featured in: | Example 4: Creating and Using a User-Defined Table Definition Template |
specifies that the PUT statement writes values to the data component for each of the variables that were defined as columns with the FILE PRINT ODS COLUMNS= statement.
Default: | The order of these columns is determined by the order that is specified by the COLUMNS= suboption in the FILE PRINT ODS statement. If you omit the COLUMNS= suboption, then the order of the variables in the program data vector determines their order in the output object. |
Requirement: | If you specify the _ODS_ option, then you must use the FILE PRINT ODS statement and the FILE PRINT ODS statement must precede the PUT _ODS_ statement. For more information, see ODS<=(ODS-suboptions)>. |
Interaction: | You can use _ODS_ in a PUT statement that specifies the placement of individual variables. _ODS_ writes to a particular row and column only if another PUT statement has not already written a variable to that same row and column. The position of _ODS_ in the PUT statement does not affect the outcome in the data component. |
Tip: | By default, the order of the columns in the data component matches the order of the columns in the buffer. However, if you have specified a table definition, it might override this order. For more information, see the discussion of ORDER_DATA in TEMPLATE Procedure: Creating Tabular Output . |
holds an output line for the execution of the next PUT statement across iterations of the DATA step. The line-hold specifiers are called trailing @ and double trailing @.
Default: | If you do not use @ or @@, then each PUT statement in a DATA step writes a new line to the buffer. |
Main discussion: | When the Pointer Moves Past the End of a Line |
Details |
ODS column pointer controls differ slightly from column pointer controls in a PUT statement that does not use ODS. An ODS column refers not to a single character space but to a column that contains an entire variable value. Therefore, an ODS column pointer control moves from one entire value to the next, not from one character space to another. Column 1 contains values for the first variable in the output; column 2 contains values for the second variable, and so on.
ODS column pointer controls have the following general forms:
moves the pointer to the specified ODS column. ods-column is a number, a numeric variable, or an expression that identifies the column to write to.
Requirement: |
If ods-column is a number, then it must be a positive integer.
If ods-column is a numeric variable or an expression, then SAS treats it as follows:
|
||||||
Default: | If ods-column exceeds the number of columns in the data component, then ODS does the following: | ||||||
Tip: | You can alter the default behavior with options in the FILE PRINT ODS statement. For more information, see the discussion of overflow control. | ||||||
Featured in: | Example 4: Creating and Using a User-Defined Table Definition Template |
moves the pointer by the specified number of ODS columns. ods-column is a number, a numeric variable, or an expression that specifies the number of columns to move the pointer.
Requirement: |
If ods-column is a number, then it must be an integer.
If ods-column is a numeric variable or an expression, then it does not have to be an integer. If it is not an integer, then SAS truncates the decimal portion and uses only the integer value.
|
||||||||
Tip: | If the current column position becomes less than 1, then the pointer moves to column 1. If the current column position exceeds the number of columns in the data component, then ODS does the following: | ||||||||
See also: | Example 4: Creating and Using a User-Defined Table Definition Template |
moves the pointer to the ODS column identified by 'column-name'. The column name is a data component variable name.
Requirement: | column-name must be enclosed in quotation marks. |
Line pointer controls in a DATA step that uses ODS are the same as line pointer controls in a DATA step that does not use ODS. However, you can use only those listed below with ODS. Line pointer controls have the following general forms:
moves the pointer to the specified line. line is a number, a numeric variable, or an expression that identifies the line that specifies where to write.
moves the pointer to the first column of the next line.
Featured in: | Example 4: Creating and Using a User-Defined Table Definition Template |
Note: If you use a line pointer control to skip lines in ODS output, then SAS sets to a missing value all columns that are not referenced on the current line or skipped lines to a missing value. Columns that contain numeric values will display a period for the missing value. If you prefer not to include these periods in your ODS output, you can display missing numeric values as a blank by using the MISSING statement or the MISSING= system option. For more information about the MISSING statement or the MISSING= option, see SAS Language Reference: Dictionary.
In a DATA step that uses ODS, the number of columns in the buffer and in the data component are determined in one of three ways:
By default, the number of variables in the program data vector determines the number of ODS columns.
You can override the default by defining ODS columns with the COLUMNS= suboption in the FILE PRINT ODS statement.
If you associate a template with the data component, then the specifications in the template take precedence and might change the number of columns that actually appear in the output object.
When using pointer controls and the @ or @@, you might inadvertently position the pointer beyond the last ODS column. You can control how SAS handles this situation with options in the FILE PRINT ODS statement. For more information see the discussion of overflow control.
See Also |
Statement: | |||
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.