Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

IF-CMD-ERROR Initiate command error handling

&pagelevel(4)&pagelevel

Domain: PROCEDURE

Command description

IF-CMD-ERROR initiates a command sequence which is executed when an error occurs in the directly preceding command. This permits specific error handling for this command, thus avoiding block error handling.

IF-CMD-ERROR is ignored after the following commands:

  • IF / END-IF

  • FOR

  • WHILE

  • REPEAT

  • BEGIN-BLOCK

  • GOTO

  • CYCLE

  • EXIT-BLOCK

The ELSE command can be used in the IF-CMD-ERROR block to define an ELSE branch. In addition, a SAVE-RETURNCODE command is executed implicitly in the ELSE branch, which means that the latest return code from the command is available even if the
command was executed without errors. The IF-CMD-ERROR block is terminated with the END-IF command.

If IF-CMD-ERROR is called even though an error did not occur, the ELSE branch is executed - if present - or command execution resumed after the corresponding END-IF.

Format

IF-CMD-ERROR


Command return codes

(SC2)

SC1

Maincode

Meaning


0CMD0001No error

1CMD0202Syntax error

1SDP0118Command in false context

1SDP0223Incorrect environment

3CMD2203Incorrect syntax file

32CMD0221System error (internal error)

130SDP0099No further address space available

Example

See section “Error handling”.

Note

The command preceding IF-CMD-ERROR and the IF-CMD-ERROR block effectively form a BEGIN block.