Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Block-oriented error recovery

&pagelevel(5)&pagelevel

In contrast to non-S procedures, problem-specific error recovery is possible in S procedures, namely at command level.

Error recovery in S procedures is block-oriented, i.e. it is implemented on block level. In the case of nested blocks, error recovery can be performed for each block level. However, it can also be called exclusively for higher-ranking, surrounding blocks. In this case, the errors detected in inner blocks are passed to these blocks and processed there.

In SDF-P-BASYS the IF-BLOCK-ERROR command makes it possible to initiate block oriented error recovery in an S procedure. The command block initiated in this way must be terminated by an END-IF command.

When error recovery is initiated, control branches in SDF-P-BASYS to the next IF-BLOCK-ERROR command (only the current command block or, in the case of nested blocks, also the higher-ranking command blocks are searched in the direction of the end of the procedure file). If no IF-BLOCK-ERROR is found, the procedure terminates when the end of the procedure file is reached. The error is passed to the caller. The error situation ends when an IF-BLOCK-ERROR block is encountered or when procedure level zero is reached.

For reasons of compatibility, the error situation is ended when a SET-JOB-STEP command is reached. In non-S procedures error recovery is still controlled via spin-off (see error recovery with the SET-JOB-STEP command).

Type of error recovery

The type of error recovery in an S procedure depends on what is specified in the ERROR-MECHANISM operand of the SET-PROCEDURE-OPTIONS command.

If nothing has been specified in the procedure with regard to ERROR-MECHANISM or if ERROR-MECHANISM=*SPIN-OFF-COMPATIBLE has been defined, SDF-P triggers error recovery if a command returns spin-off. In this case, error recovery is not dependent on the command return code. This error mechanism is preset and means that S procedures do not change their error behavior if commands in the procedures return a command-specific return code in a follow-up version for the first time.

If ERROR-MECHANISM=*BY-RETURNCODE has been set, SDF-P triggers error recovery if a command returns a return code with a subcode not equal to zero. In this case, error recovery is not dependent on the command's spin-off behavior. This error mechanism must be defined explicitly.