/*********************************************************************/
/*                                                                   */
/*   Break Message Handler für Test- und Debugzwecke                 */
/*   Aufruf über Command M                                           */
/*   Copyright Dieter Bender DV Beratung                             */
/*   db@bender-dv.de                                                 */
/*                                                                   */
/*********************************************************************/
PGM                                                                    +
   PARM(                                                               +
        &MSGQ         /* Message Queue                               */+
        &MSGQLIB      /* Message Queue Library                       */+
        &MSGID        /* Message ID                                  */+
       )

DCL &MSGQ         *CHAR   10
DCL &MSGQLIB      *CHAR   10
DCL &MSGID        *CHAR    4
DCL &MSG          *CHAR   75
DCL &CMDLEN       *DEC   (15 5)   75

IF  ( &MSGID = 'INIT')                                                 +
 DO
   CHKOBJ   &MSGQLIB/&MSGQ  *MSGQ
      MONMSG   CPF9801  EXEC(                                          +
       DO)
         CRTMSGQ  &MSGQLIB/&MSGQ
       ENDDO
       CHGMSGQ  &MSGQ  *BREAK  M  0
 ENDDO
ELSE                                                                   +
 DO
   RCVMSG                                                              +
      MSGQ(&MSGQLIB/&MSGQ)                                             +
      MSGKEY(&MSGID)                                                   +
      MSG(&MSG)
   IF (&MSG = 'M' *OR &MSG = 'm')                                      +
      CALL   QUSCMDLN
   ELSE                                                                +
    DO
      CALL QCMDEXC (&MSG &CMDLEN)
      MONMSG CPF0000
    ENDDO
 ENDDO
ENDPGM
