Adding an If Statement

The If statement executes a block of statements based on the results of a previous statement. The results are categorized by a return code. The If statement checks the value of the return code and executes the block if the statement is true.

You must use the Eif statement (endif) with the If statement. If the conditions of the If statement are not satisfied, use an Else statement to designate the execution of alternate instructions.

  1. Select Process > Insert > If.
  2. Enter the statement label in the If Statement Label field.
  3. Select a step label on which to base the operator and value.
  4. Select the type of comparison statement in the Operator field.
  5. Select one of the following return codes in the Value field:
    Return Code Description
    0

    Indicates successful completion of the stop.

    4

    Indicates a warning.

    8

    Indicates an error condition.

    16

    Indicates a catastrophic error.

  6. To add optional comments, click the Comments control tab.
  7. Click OK to save the statement. The If statement is displayed in the Process window.
  8. Create the block of statements that executes based on the If statement. You can add an Else statement to execute a block of statements if the condition in the If statement is not satisfied.
  9. Add an Eif statement to the end of the block to designate the end of the block of statements.