+

Search Tips | Advanced Search

MQSTAT (Retrieve status information) on IBM i

Use the MQSTAT call to retrieve status information. The type of status information returned is determined by the STYPE value specified on the call.


Syntax

MQSTAT (HCONN, STYPE, STAT, CMPCOD, REASON)


Usage notes

  1. A call to MQSTAT specifying a type of STATAPT returns information about previous asynchronous MQPUT and MQPUT1 operations. The MQSTAT structure passed on the call is completed with the first recorded asynchronous warning or error information for that connection. If further errors or warnings follow the first, they do not normally alter these values. However, if an error occurs with a completion code of CCWARN, a subsequent failure with a completion code of CCFAIL is returned instead.
  2. If no errors have occurred since the connection was established or since the last call to MQSTAT then a CMPCOD of CCOK and REASON of RCNONE are returned.
  3. Counts of the number of asynchronous calls that have been processed under the connection handle are returned by using three counters; STSPSC, STSPWC, and STSPFC. These counters are incremented by the queue manager each time an asynchronous operation is processed successfully, has a warning, or fails (note that for accounting purposes a put to a distribution list counts once per destination queue rather than once per distribution list).
  4. A successful call to MQSTAT results in any previous error information or counts being reset.


Parameters

The MQSTAT call has the following parameters:


RPG Declaration

     C*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
     C                      CALLP     MQSTAT(HCONN : ETYPE : ERR :
     C                                       CMPCOD : REASON)
The prototype definition for the call is:
     D.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
     DMQSTAT           PR                  EXTPROC('MQSTAT')
     D* Connection handle
     D HCONN                         10I 0 VALUE
     D* Status information type
     D STYPE                         10I 0 VALUE
     D* Status information
     D STATUS                       296A
     D* Completion code
     D CMPCOD                        10I 0
     D* Reason code qualifying CompCode
     D REASON                        10I 0