Interpreting Debug Information for Conditional Logic

This subsection describes debug information for the following commands used in conditional logic (see 4.24):

Test mode displays each IF, ELSEIF, ELSE, and ENDIF command. IF and ELSEIF are followed by the result (RSLT) of the expression and the actions that would be executed. ELSE and ENDIF are followed by the actions that would be executed and logged.

Example

The following example is a group of logged debug messages. Explanations of these messages follow the example.

[1]   LG $AMS-DISP$ HANDLING RUN RUNIDA
[2]   LG $AMS-CMD $ RC RUNIDA
[3]   LG $AMS-IF  $1$ _RUNID = "RUNIDA"
[4]   LG $AMS-RSLT$1$ 1
[5]   LG $AMS-CMD $1$ DN DSK25
[6]   LG $AMS-EXE $1$ SCRIPT5
[7]   LG $AMS-IF  $2$ \_TOKEN7\ = "FINISHED"
[8]   LG $AMS-RSLT$2$ 0
[9]   LG $AMS-ELSE$2$
[10]  LG $AMS-ALRM$2$ 0
[11]  LG $AMS-DISP$2$ Application Failed - Starting Recovery
[12]  LG $AMS-CMD $2$ ST,/X RECVR,,,APP1/RCM
[13]  LG $AMS-ENDI$2$
[14]  LG $AMS-ENDI$1$
[15]  LG $AMS-DISP$ FINISHED HANDLING RUN RUNIDA

Explanations

Message [1] is the result of a DISPLAY action, and message [2] is the result of a COMMAND action. These messages do not show nested levels because the actions are not part of a conditional construction.

Message [3] begins the set of messages that result from the first level nested conditional construction. In message [4], 1 is the result of the evaluated expression, _RUNID = "RUNIDA".

Messages [5] and [6] log the actions that would be executed when the result of the first level IF condition is true. The nested level of each of these messages is 1.

Message [7] begins the set of messages that result from the second level nested conditional construction. In message [8], 0 is the result of the evaluated expression, \_TOKEN7\ = FINISHED. Since the expression evaluates to false (0), none of the actions associated with the IF command are executed or logged. CP-AMS proceeds with the ELSE command, shown in message [9]. Messages [10], [11], and [12] log the ALARM, DISPLAY, and COMMAND actions that are executed as a result of the ELSE command.

Message [13] logs the end of the second level nested conditional construction. Message [14] logs the end of the first level nested conditional construction.

Message [15] logs a DISPLAY action that does not have a nested level number because it is not part of a conditional construction.