Declarations must be made in the declaration blocks (program, window or procedure).
If a declaration has to be made in a management rule not in a declaration block (program or window), it must be preceded by the keyword DECL.
If you want a declaration to have a generalized scope, you must end the instruction with the reserved word *GLOBAL. Unless you specify *GLOBAL, the declaration will only affect the declaration block closest to the management rule.
Declaring variables and arrays by reference
Declaring alphanumeric variables and arrays
Declaring extended or packed numeric variables and arrays
Declaring binary numeric variables and arrays
Declaring simple variables and arrays
Declaring data structures
Declaring data areas
Declaring LDAs
Declaring lists
Declaring load types for graphical lists
Declaring variables of graphic object type
Declaring views
Declaring control breaks
Declaring cursors
Declaring parameters
Declaring a new name for an entity, access or join entity field
Declaring indexes for a list