DEFINE (define variable attributes: optional)
DEFINE fixes the picture of a variable for the duration of the PRL run.
This occurs on the first use; it is ignored for subsequent uses. The use of this verb causes the variable attribute length and decimal significance to be unalterable. In addition, it provides you with the means to specify an edited pattern for display of fields. This is particularly useful if the variable is to appear on the report with USING.
This function also can be particularly useful when used with the SUMMARY or DETAIL functions. DEFINE ensures that the column width accommodates the totals without decimal truncation or alteration.
DEFINE can be used only with alphabetic or numeric fields. It cannot be used with DATE, TIME, or HEX fields.
Syntax
where
- variable is a symbolic variable. The symbolic variable can be predefined or user-defined. User-defined variables must start with an alphabetic character, can be up to eight characters long, and can comprise any alphanumeric character. For a further discussion about variables, see SET-assign-a-value.
- CHAR nn identifies the verb as a DEFINE for a character variable; nn specifies the number of characters to be shown.
EDIT ZZ,ZZ9.99 identifies the verb as a DEFINE for a numeric variable; ZZ,ZZ9.99 are symbols representing the digits in the number. The description can contain up to 25 characters or symbols (but only 15 digits). The following symbols are supported:
Symbol
Description
'.'
decimal placement and representation
,
numerical editing
9
decimal significance
'Z'
decimal significance (zero suppresses digits)
' '
blanks
-
sign characters
Usage
Use the DEFINE statement only once per variable. Define the variable before using it in another statement.
A DEFINE statement should be inserted before a COMPUTE or SET statement when the COMPUTE or SET statements are used with DETAIL, SUMMARY, or USING.
Example
SELECT TYPE 6E RECORDS FROM CMRDETL
USING T6ETRID T6ERESP
SUMMARY
REPORT
END