Previous Topic

Next Topic

Book Contents

Book Index

Example

If the string SEVERE ERROR FOUND, RC= is issued by a program that updates an accounting database, user routine RESTORDB is called by statement DO CALLUSER. This user routine restores the accounting database to its previous state.

The return code from the update program is passed as an argument to the user routine.

EXECUTE block FINISH is executed only if the return code from the user routine is greater than zero.

Figure 188 DO CALLUSER Statement Example

         LIBRARY : CTB.PROD.RULES                                RULE : ACCTUPDT

 COMMAND ===>                                                    SCROLL===> CRSR

 +-----------------------------------------------------------------------------+

   =========================================================================== 

   EXECUTE CHECK    UPON                                                   C   

   ON SYSOUT     PROCST         PGMST STEP03    DDNAME REPORT   JOBNM         

      MODE PG    LINECT 0060   

DATASTAMP                                      

   WHEN LINE 001     - 060     COL 001     - 132              STOP    AND/OR   

        STRING = SEVERE ERROR FOUND, RC=                                       

     DO EXTRACT  = RETCODE                                                     

                   LEVEL 0 LINE +000 COL +023 - +026 PROCESS          TYP      

     DO CALLUSER = RESTORDB ARG RETCODE                                    C   

     DO                                                                        

   WHEN LINE         -         COL         -                  STOP    AND/OR   

        STRING =                                                               

     DO                                                                        

   =========================================================================== 

   EXECUTE FINISH   UPON SYSURC>0                                          C   

   ON DATA                                                                     

   ALWAYS                                                                      

     DO SHOUT    TO OPER2               URGENCY R                              

      = SEVERE PROBLEMS WITH ACCOUNTS DATABASE !! CALL ACC.DEPT NOW            

     DO                                                                        

  PLEASE FILL IN RULE DEFINITION.                                        14.06.28

Parent Topic

DO CALLUSER: Automated Balancing Statement