In this example, the system operator recovers from an abnormal end.
PGM DCL &SWITCH *CHAR LEN(1) RTVSYSVAL SYSVAL(QABNORMSW) RTNVAR(&SWITCH) IF (&SWITCH *EQ '1') THEN(DO) /*CALL RECOVERY PROGRAMS*/ SNDPGMMSG MSG('Recovery programs in process. + Do not start subsystems until notified') + MSGTYPE(*INFO) TOMSGQ(QSYSOPR) CALL PGMA CALL PGMB SNDPGMMSG MSG('Recovery programs complete. + Startup subsystems') + MSGTYPE(*INFO) TOMSGQ(QSYSOPR) RETURN ENDDO ENDPGM