Purpose
Defines one name and describes its attributes.
Syntax
DECLARE identifier[attribute];
Parameters
-
identifier
- A user-supplied name of 1 – 32 characters that is unique within the current block and can consist of any alphanumeric character
A through Z, a through z, 0 through 9, @, #, $, and _, but must begin with a letter, dollar sign ($), at sign (@), or underscore
(_).
-
attribute
- One or more valid attributes of the name, each of which must be separated by a space, but can appear in any order.
Example
DECLARE COUNTER FIXED BINARY (8);
DECLARE TEXT_STRING CHARACTER (60) VARYING BASED (P);
In this example, the variable COUNTER is declared with the data type attribute FIXED and BINARY (8) , and the variable TEXT_STRING
is declared with the attribute CHARACTER (60), VARYING, and BASED (P).
Description
A simple declaration defines one name and describes its attributes. (For more information on attributes, see the chapter Declarations and Attributes.)