Pathway/iTS TCP and Terminal Programming Guide
Programming for Intelligent Devices
Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide—426751-001
6-15
Error Processing and Debugging Techniques
When the MSG-IN-FLAVOR2 template is used for receiving incoming messages, the
fields PRESENCE-MASK through ZIP are always physically present. Each single-bit
elementary item within PRESENCE-MASK determines whether one of the ALIAS
fields (following ZIP) is present. For example, a value of 1 in the ALIAS-STATE-PM
field indicates that the ALIAS-STATE field is present, a value of 0 in the ALIAS-
NAME-PM field indicates that the ALIAS-NAME field is not present, and so forth.
Error Processing and Debugging Techniques
Use the ON ERROR clause to detect errors that occur on input or output of the message
to or from working storage. Use the FIELD STATUS clause to test for edit errors.
ON ERROR Processing
If an error is detected in either phase of the SEND MESSAGE operation, the ON
ERROR path is taken. The processing of the ON ERROR clause for the SEND
MESSAGE statement is the same as that for the CALL and SEND statements.
TERMINATION-STATUS values for the SEND MESSAGE statement are summarized
in the Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual.
As part of the ON ERROR processing you need to check for a TERMINATION-
STATUS of 5 or 15; 5 indicates input phase and 15 indicates output phase. If
TERMINATION-STATUS is 5 or 15, you can then process the FIELD STATUS data
item to detect an edit error.
FIELD STATUS Processing
The FIELD STATUS clause identifies a working-storage data group or item that
receives status information about the field during SEND MESSAGE operations.
The FIELD STATUS clause is used to obtain information on editing errors in fields
where editing is specified.
The method of deciding which message template the FIELD STATUS data item belongs
to differs for input and output messages.
Message Template Input Case
For input messages, you need to know which of the message templates of the YIELDS
list you were processing when the errors occurred.
The relative position of the YIELDS list is returned in TERMINATION-SUBSTATUS.
The position is returned in TERMINATION-SUBSTATUS instead of TERMINATION-
STATUS because this is the ON ERROR case. At this point TERMINATION-
STATUS holds the error number. If this were the normal case, rather than ON ERROR,
TERMINATION-STATUS would be used to define the relative position in the
YIELDS list.