Previous Topic: COUNT OptionNext Topic: LOGICAL Option


FORMAT Option

Use the FORMAT option to define the length of an output field or to specify how many decimal positions it contains.

The FORMAT option can also be used with ID options to control the number of characters printed for each identifier. For more information about formatting identifiers, see the chapter “ID Options.”

The FORMAT option has the following syntax:

FORMAT (outputformat)
outputformat

Specifies one of the following, for numeric or alphanumeric output:

For numeric data: Specifies up to 15 Ns with or without a period to indicate the placement of the decimal point. For example, FORMAT(NN.NNN) indicates a five-digit output rounded to three decimal places. You can include any constants other than the letters N and C in the string. For example, specify FORMAT(NN.NNN%) to include a percent sign with each value in your report.

For alphanumeric data: Specifies nC, where n is the number of characters to appear in the output. For example, FORMAT(4C) indicates an output of four characters. The value of n has no limit.

Note: If a value for a variable is greater than the output format you specify, an asterisk replaces the value. For example, if you specify FORMAT(NN.NN) with a variable, asterisks replace all values greater than 99.99 for that variable in your report.

Examples: FORMAT Option

The following are FORMAT option examples and the result of each:

TRAN LIFE FORMAT(NNN.NN)

By default, the output of the variable TRAN LIFE appears in the format N.NNN, NN.NN, or NNNNN, depending on the size of the value. The FORMAT option here forces the output to two decimal places.

TRAN USE RATE FORMAT(NN.N)

The RATE option used with the variable TRAN USE defaults to two decimal positions. The FORMAT option here alters the output to one decimal place.