D********************************************************************************************* D* Program ID.: D_MSGDS D* Author.....: D* Function...: Defines the MSGDTA Data Structure which Declares Several Messaging-Related D* Variables and Several Messaging-Related Constants. D* Updated....: 13-Feb-2006 D********************************************************************************************* D* MSGDTA - messaging-related data structure D* MSGID - message id D* MSGF - message file D* MSGL - message library D* MSGFL - message file and library MSGF + MSGL D* MSGTXT - message variable text D* MSGLEN - length of variable text D* MSGTYP - message type D* MSGQ - message queue D* MSGSTK - message stack D* MSGKEY - message key D* MSGNTY - message number type D* MSGPQ - mesage program queue D* MSGRMV - messages to remove D* MSGCNT - message count D* Messaging-related constants: D* MSBLK - Blank D* MSNUL - Null D* MSALL - *ALL D* MSDIAG - *DIAG D* MSESC - *ESCAPE D* MSCSTK - Current program stack (0) D* MSPSTK - Previous program stack (1) D* MSCURQ - Current program queue (*) D* MSLAST - Last message sentinel text D* MSMAXM - Maximum occurrences in ERRTBL data structure D********************************************************************************************* D Msgdta DS INZ D Msgid 1 7 INZ(' ') D Msgf 8 17 INZ(' ') D Msgl 18 27 INZ(' ') D Msgfl 8 27 D Msgtxt 28 106 INZ(' ') D Msglen 107 110B 0 INZ(79) D Msgtyp 111 120 INZ(' ') D Msgq 121 130 INZ('*') D Msgstk 131 134B 0 INZ(0) D Msgkey 135 138 INZ(' ') D Msgnty 157 160B 0 INZ(1) D Msgpq 161 170 INZ('*') D Msgrmv 171 180 INZ(' ') D Msgcnt 181 190 0 INZ(0) D********************************************************************************************* D Msblk C CONST(' ') D Msnul C CONST(0) D Msall C CONST('*ALL') D Msdiag C CONST('*DIAG') D Msesc C CONST('*ESCAPE') D Mscstk C CONST(0) D Mspstk C CONST(1) D Mscurq C CONST('*') D Mslast C CONST('*LAST') D Msmaxm C CONST(99) C********************************************************************************************* C* Program ID.: C_MSGCLR C* Author.....: C* Function...: Remove all messages from program message queue. C* Remarks....: Requires copy modules:- C* D_ERRDS - Error data structure C* D_MSGDS - Messaging-related data structure C* Returns:- C* ERRDS - Standard API error data structure C* Updated....: 13-Feb-2006 C********************************************************************************************* CSR /MSGCLR BEGSR C* /free MSGQ = MSCURQ ; MSGSTK = MSCSTK ; MSGRMV = MSALL ; clear MSGKEY ; /end-free C* C CALL 'QMHRMVPM' C PARM MSGQ C PARM MSGSTK C PARM MSGKEY C PARM MSGRMV C PARM ERRDS C* CSR ENDSR C********************************************************************************************* C* Program ID.: C_MSGSND C* Author.....: C* Function...: Send a message to a program message queue. C* Remarks....: Requires copy modules: C* D_ERRDS - Error data structure C* D_MSGDS - Messaging-related data structure C* Returns: C* ERRDS - Standard API error data structure C* Updated....: 13-Feb-2006 C********************************************************************************************* CSR /MSGSND BEGSR C* C CALL 'QMHSNDPM' C PARM MSGID C PARM MSGFL C PARM MSGTXT *Optional C PARM MSGLEN *Optional C PARM MSGTYP C PARM MSGQ C PARM MSGSTK C PARM MSGKEY *Always blanks C PARM ERRDS C* CSR ENDSR *** DDS *** A ALTHELP(CA01) A CA24(24) A DSPSIZ(24 80 *DS3) A CHGINPDFT A CSRINPONLY A ENTFLDATR((*DSPATR RI)) A HELP A MOUBTN(*URP CA12) A PRINT A************************************************************************** A R MSGSFL SFL A SFLMSGRCD(24) A MSGKEY SFLMSGKEY A PSPGM SFLPGMQ A********************************************************************** A R MSGCTL SFLCTL(MSGSFL) A OVERLAY A N29 SFLDSP SFLDSPCTL SFLINZ SFLEND A SFLSIZ(2) SFLPAG(1) A PSPGM SFLPGMQ A********************************************************************** *** RPGLE *** D/COPY D_MSGDS C/COPY C_MSGCLR C/COPY C_MSGSND CSR *INZSR BEGSR C* C*--- Turn off all indicators. C* C MOVEA *OFF *IN C* C*--- Setup message file. C* /free MSGF = 'MESSAGE' ; MSGL = '*LIBL' ; MSGTYP = MSDIAG ; MSGQ = MSCURQ ; MSGSTK = MSCSTK ; /end-free C* C* C EXSR /OPEN *Open file C EXSR /MAIN *Main step C* C EVAL *INLR = *ON *End of program C RETURN C* CSR ENDSR C IF X1CUR = *BLANKS C EVAL *IN30 = *ON C EVAL MSGTXT = %trim(X1CUR) C EVAL MSGLEN = 3 C EVAL MSGID = 'MSG0109' C EXSR /MSGSND C LEAVESR C ENDIF