Example: Using the operational assistant exit program for operational assistant backup

This example contains a user-written exit program for doing Operational Assistant backup.

Note: Read the Code license and disclaimer information for important legal 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