Example: Creating an exit program for Operational Assistant backup
This example shows a user-written exit program, written in CL, for doing Operational Assistant backup.
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
/***************************************************************/
/***************************************************************/
/* */
/* FUNCTION: User-written exit program for doing Operational */
/* Assistant backup. */
/* */
/* LANGUAGE: CL */
/* */
/* APIs USED: None */
/* */
/***************************************************************/
/***************************************************************/
PGM PARM(&PRODID &FLAG &OPTIONS &DEVS &TAPSET &RETCODE)
DCL VAR(&PRODID) TYPE(*CHAR) LEN(10) /* Calling product. +
Will be 'QEZBACKUP' when called from +
Operational Assistant. */
DCL VAR(&FLAG) TYPE(*CHAR) LEN(10) /* Indicates whether +
before or after backup. */
DCL VAR(&DEVS) TYPE(*CHAR) LEN(40) /* Devices used. */
DCL VAR(&TAPSET) TYPE(*CHAR) LEN(4) /* Tape set name */
DCL VAR(&RETCODE) TYPE(*CHAR) LEN(7) /* Return code */
DCL VAR(&OPTIONS) TYPE(*CHAR) LEN(10) /* Options used */
DCL VAR(&MSG) TYPE(*CHAR) LEN(512) /* Message text */
IF COND(&FLAG *EQ '*BEFORE ') THEN(DO)
/*--------------------------------------------------------*/
/* Insert commands to be run before the backup here. */
/*--------------------------------------------------------*/
ENDDO
IF COND(&FLAG *EQ '*AFTER ') THEN(DO)
/*--------------------------------------------------------*/
/* Insert commands to be run after the backup here. */
/*--------------------------------------------------------*/
ENDDO
ENDPGM