Example: Testing a power-handling CL program

Once a power-handling program has been created, you can test it by creating a simple CL program that uses the Send Program Message (SNDPGMMSG) command and the Delay Job (DLYJOB) command. Set the DLY parameter value on the DLYJOB command to meet your testing needs.

Note:
  1. When testing an uninterruptible power supply program, commands such as PWRDWNSYS, ENDJOB, and ENDSBS should be replaced with the SNDMSG command to indicate that the command has run.
Figure 1. Testing a Power-Handling Program Example
SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7....
 1.00              PGM
 2.00              DLYJOB     DLY(120) /* Wait for 2 minutes. */
 3.00              SNDPGMMSG  MSGID(CPF1816) MSGF(QCPFMSG) +
 4.00                           TOMSGQ(UPSLIB/UPSMSGQ) /* Power failure
 5.00                           message. */
 6.00              DLYJOB     DLY(5) /* Wait for 5 seconds. */
 7.00              SNDPGMMSG  MSGID(CPF1817) MSGF(QCPFMSG) +
 8.00                           TOMSGQ(UPSLIB/UPSMSGQ) /* Power restored
 9.00                           message. */
10.00              ENDPGM
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
Related tasks
Example: Power-handling CL program