┌◄────────────── , ──────────────┐ ── CONSTANT ─┴─<constant declaration element>─┴────────────────────────┤
<constant declaration element>
──┬─ <Boolean constant identifier> = <Boolean constant expression> ─┬──┤ ├─ <integer constant identifier> = <integer constant expression> ─┤ ├─ <real constant identifier> = <real constant expression> ───────┤ └─ <string constant identifier> = <string constant expression> ───┘
Explanation
A constant declaration declares one or more constant identifiers and assigns their value. A constant identifier can be one of the following type:
-
Boolean
-
Integer
-
Real
-
String
The constant declaration enables constant values to be referenced by name rather than by specifying the actual values throughout the job.
The type of each constant identifier being declared is determined by the type of the constant expression to the right of the equal sign (=). The constant expression can be specified using literal values, previously declared constant identifiers, and job parameters.
The values of constant identifiers are retained across a halt/load.
Example
The following example represents the use of constant identifiers:
CONSTANT NAME = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-_", NUMBERS = "0123456789", PI = 3.14159, DEBUG = FALSE, MAXRETRY = 10, MAXSTRINGCHARS = 256, UC = "GEORGE", INPUTNAME = "INPUT/1", PK = "USERS", INPUTTITLE = "(" & UC & ")" & INPUTNAME & " ON " & PK;