Glb.Status is a read-writable built-in segment attribute that indicates the result status of some logic commands. It can be set to one of a range of values, depending upon the circumstances in which it is set. The most common values are spaces when there is no error, and five asterisks ("*****") when there is an error.
Glb.Status can be set (to a non-space value) in the following situations:
A LookUp, Determine Last, Determine Total, or ForEach logic statement that does not find any records.
A DateConvert logic statement fails.
Arithmetic overflow occurs.
An invalid index is used to access an array.
An array-field with an invalid index is referenced by a DoWhen logic statement.
An invalid logic statement involving the complex variant of the Move logic command is executed.
Execution of a Callable Global Logic fails
An automatic entry within ispec logic fails.
An external automatic entry (between applications) fails.
An external automatic entry is rejected by the destination application.
An AccessExt command fails (MCP-based systems only).
A Start logic statement fails, and the report cannot be started.
A Run logic statement fails, and the report cannot be started.
A Match logic statement finds both extract files empty.
Notes:
Some logic commands do not automatically set Glb.Status, but it can be explicitly set using the GS command option in conjunction with those logic commands. The arithmetic logic commands, Add, Subtract, Multiply, and Divide are of this type.
When using arrays, do not use Glb.Status for anything other than index verification. Instead, use the GS variant of the DateConvert logic command.
Refer to the relevant logic commands for more information on the values to which Glb.Status might be set.
Initialization
Glb.Status is set to the <Glb.Spaces> built-in segment attribute before the following logic commands are executed:
Determine variants
LookUp variants (except the singleton LookUp variant in ispec logic)
AccessExt(MCP-based systems only)
Run
Start
Match
Wake
Glb.Status is also set to Glb.Spaces before the Store built-in method is invoked, and when an array member with a valid index is referenced by a DoWhen logic statement.
Overwriting status values
The Glb.Status value can be changed in a DoWhen logic statement. You should exercise caution when coding complex decision logic that involves more than one logical expression.
Consider the following logic:
DoWhen Glb.Status NOT = Glb.Spaces AND ARRAY-ITEM[INDEX] NOT = VALUE
You might be checking the result of a previous action in the first logical expression, but the test on an array variable in the second logical expression also affects Glb.Status, and overwrites the Glb.Status value that you intended to check. You might control this by ensuring that expressions are set out in the order that you expect them to be evaluated (generally left to right) and by judicious use of parentheses to control the order of evaluation.
Properties
Length = 5
Primitive = String