The OPTMODEL Procedure

PUT Statement

PUT [ put-item(s) ] [ @ | @@ ];

The PUT statement writes text data to the current output file. The syntax of the PUT statement in PROC OPTMODEL is similar to the syntax of the PROC IML and DATA step PUT statements. The PUT statement contains a list of items that specify data for output and provide instructions for formatting the data.

The current output file is initially the SAS log. This can be overridden with the FILE statement. An output file can be closed with the CLOSEFILE statement.

Normally the PUT statement outputs the current line after processing all items. Final @ or @@ operators suppress this automatic line output and cause the current column position to be retained for use in the next PUT statement.

Put-item can take any of the following forms.

identifier-expression [ = ] [format]
outputs the value of the parameter or variable that is specified by the identifier-expression. The equal sign (=) causes a name for the location to be printed before each location value.

Normally each item value is printed in a default format. Any leading and trailing blanks in the formatted value are removed and the value is followed by a blank space. When an explicit format is specified, the value is printed within the width determined by the format.

name[*] [ .suffix ] [ = ] [format]
outputs each defined location value for an array parameter. The array name is specified as in the identifier-expression form except that the index list is replaced by an asterisk (*). The equal sign (=) causes a name for the location to be printed before each location value along with the actual index values to be substituted for the asterisk.

Each item value normally prints in a default format. Any leading and trailing blanks in the formatted value are removed and the value is followed by a blank space. When an explicit format is specified, the value is printed within the width determined by the format.

(expression ) [ = ] [format]
outputs the value of the expression enclosed in parentheses. This produces similar results to the identifier-expression form except that the equal sign (=) uses the expression to form the name.

'quoted-string'
copies the string to the output file.

@integer
@identifier-expression
@(expression)
sets the absolute column position within the current line. The literal or expression value determines the new column position.

+integer
+identifier-expression
+(expression)
sets the relative column position within the current line. The literal or expression value determines the amount to update the column position.

/
outputs the current line and moves to the first column of the next line.

_PAGE_
outputs any pending line data and moves to the top of the next page.

Previous Page | Next Page | Top of Page