ERR Control Statement -- Define Action Taken During Error Processing
This control statement determines the processing required when a panel is being redisplayed following an error condition.
nwmsol
This control statement determines the processing required when a panel is being redisplayed following an error condition.
An error condition can be detected either by Panel Services internal validation or by the processing NCL procedure. If detected by internal validation (and &CONTROL PANELRC is not in effect), Panel Services invokes error processing automatically. If detected by the processing NCL procedure, error processing is invoked in one of two ways:
- By using the &ASSIGN OPT=SETERR verb
- By nominating the name of the variable that identifies the invalid input field on the ERRFLD operand of the #OPT statementThis is dynamically invoked by using a symbolic variable with the ERRFLD operand and setting this variable to the name of the variable (minus the ampersand) that identifies the field in error.
When #ERR processing is initiated, the cursor is positioned to the first field in error. The panel is redisplayed, applying the attributes defined on the #ERR statement to the fields in error. This technique provides the panel user with a simple means of drawing the terminal operator's attention to the field in error. This is particularly effective on color terminals where the color of any field in error can be altered and reverts to normal when the error condition is rectified.
Normally only one #ERR statement is defined. However, if required to accommodate the operands, multiple statements can be defined. They can be defined in any order. However, as with #OPT, #FLD, and #NOTE statements, any #ERR statement must precede the start of the panel, as determined by the first line that is not a control statement.
This control statement has the following format:
#ERR [ INTENS={ HIGH | LOW } ] [ { COLOR | COLOUR }={ BLUE | RED | PINK | GREEN | TURQUOISE | YELLOW | WHITE | DEFAULT } ] [ { HLIGHT | HLITE }={ USCORE | REVERSE | BLINK | NONE } ] [ ALARM={ YES | NO } ]
- INTENS={ HIGH | LOW }
- Determines the intensity of the error field when displayed. The INTENS operand is ignored for terminals with extended color and highlighting when either the COLOR or HLIGHT operand is specified.
- HIGH
- Specifies that the field is displayed in double intensity.
- LOW
- Specifies that the field is displayed in low or standard intensity.
- { COLOR | COLOUR }={BLUE | RED | PINK | GREEN | TURQUOISE | YELLOW | WHITE| DEFAULT}
- Determines the color of the field. The operand applies only to IBM terminals with seven-color support and Fujitsu terminals with three- or seven-color support.
- If the terminal does not support extended color, the COLOR operand is ignored. This feature enables COLOR to be specified on panels that are displayed on both color and non-color terminals. COLOR can be used with the HLIGHT operand.
- For Fujitsu terminals that support extended color data streams, but support only three colors, the following color relationships are used:
Specified
| Result (on Fujitsu three-color terminal)
|
GREEN | GREEN |
RED | RED |
PINK | RED |
BLUE | GREEN |
TURQUOISE | GREEN |
YELLOW | WHITE |
WHITE | WHITE |
DEFAULT | GREEN |
Fujitsu seven-color terminals are treated the same as IBM seven-color terminals.
The DEFAULT keyword indicates that the color of the field is to be determined from the INTENS operand. This feature is useful if you want to set the color from an NCL procedure (that is, COLOR=&COLOR is specified and the NCL procedure can set the &COLOR variable to DEFAULT).
- { HLIGHT | HLITE }={ USCORE | REVERSE | BLINK | NONE }
- Applies only to terminals with extended highlighting support, and determines the highlighting to be used for the field.
- The HLIGHT operand is ignored if the terminal does not support extended highlighting, so HLIGHT can be specified on panels that are displayed on terminals that do not support extended highlighting. HLIGHT can be used with the COLOR operand.
- When NONE is specified, the HLIGHT operand is ignored and no extended highlighting is performed for this field.
- ALARM={ YES | NO }
- Determines whether to ring the terminal alarm when the panel is displayed with an error condition. This alarm works independently of the ALARM operand on the #OPT control statement.
Examples: #ERR Control Statement
#ERR COLOR=RED HLIGHT=REVERSE ALARM=YES #ERR COLOR=YELLOW HLIGHT=BLINK INTENS=HIGH
- Only those attributes defined on the #ERR statement are modified for the field in error. All other attributes associated with the original field, such as internal validation, remain intact.
- Symbolic variables can be included in a #ERR statement. Variable substitution is performed before processing the statement, by using variables available to the NCL procedure at the time the &PANEL statement is issued.
- When &CONTROL PANELRC is in effect, internal validation does not automatically reshow the panel with the error message, and so on. In this case, the procedure regains control following the &PANEL statement with the &RETCODE system variable set to 8 to indicate that an error has occurred. The &SYSMSG variable contains the text of the error message that describes the error and the &SYSFLD variable contains the name of the field in error. This name is the name of the variable in an input field that would receive the data entered into that field.
- The &ASSIGN statement SETERR option provides a mechanism for assigning #ERR field attributes to multiple (input field) variables before displaying a panel. This feature lets you accept input from a number of different fields on a panel, validate all the fields, and redisplay the panel with all incorrect fields displayed with the #ERR attributes. The user sees all the errors at one time, rather than field by field.