5.1.15 MQSeries Programs
All programs will return at least a status and message. The status is a string value or an MQ API reason code prefixed with the string MQR.
- OK
- ERROR
- FATAL
- MQR2058 - Queue manager name not valid or not known
- MQR2086 - Unknown Queue Manager
- etc..
JSMMQDEPTH - Depth of queue
|
The JSMMQDEPTH program is standalone and can be called without a JSM service being opened.
Example
CALL PGM(JSMMQDEPTH) PARM(#JSMQMGR #JSMQNAME #JSMDEPTH #JSMSTS #JSMMSG) NUM_LEN(*DEFINED)
JSMMQGET - Get message from queue
|
When the LANSA function or RPG program receives the Message Id and Correlation Id, do not send these values across to the loaded JSM service, because they do not contain valid EBCDIC characters.
The Message Id and Correlation Id can be used to get a message that matches one or both of these input values, if you require the next message set the message id and correlation id fields to *BLANK before calling the JSMMQGET program.
Example
CHANGE FIELD(#JSMQMGR) TO('MY.QMANAGER')
CHANGE FIELD(#JSMQNAME) TO('MY.QUEUE')
CHANGE FIELD(#JSMWAIT) TO(-1)
CHANGE FIELD(#JSMSIZE) TO(0)
CHANGE FIELD(#JSMMID) TO(*BLANK)
CHANGE FIELD(#JSMCID) TO(*BLANK)
CALL PGM(JSMMQGET) PARM(#JSMQMGR #JSMQNAME #JSMWAIT #JSMMSIZE #JSMMID #JSMCID #JSMRQMGR #JSMREPLYQ #JSMMTYPE #JSMSTS #JSMMSG) NUM_LEN(*DEFINED)
JSMMQPUT - Put message on queue
|
When you use the optional JSMEXPIRY parameter, you must also pass the JSMUSER parameter as well. Failing to pass the JSMUSER parameter will cause the JSMMQPUT operation to fail.
Example
CHANGE FIELD(#JSMCCSID) TO(0)
CHANGE FIELD(#JSMMTYPE) TO(8)
CHANGE FIELD(#JSMMID) TO(*BLANK)
CHANGE FIELD(#JSMCID) TO(*BLANK)
CHANGE FIELD(#JSMPST) TO(Y)
CHANGE FIELD(#JSMPTY) TO(4)
CHANGE FIELD(#JSMRQMGR) TO(*BLANK)
CHANGE FIELD(#JSMREPLYQ) TO(*BLANK)
CALL PGM(JSMMQPUT) PARM(#JSMQMGR #JSMQNAME #JSMCCSID #JSMPST #JSMPTY #JSMMID #JSMCID #JSMMTYPE #JSMRQMGR #JSMREPLYQ #JSMSTS #JSMMSG) NUM_LEN(*DEFINED)
If the MQSeries MQCONN or MQPUT API call fails the current message is put to a recovery file JSMMQPUT if it exists. If the message length exceeds 32000 bytes the data is truncated.
The DDS source for physical file JSMMQPUT is in QDDSRC file in the JSM library.
DATE 8A CCYYMMDD
TIME 6A HHMMSS
JOBNUMBER 6A 000000
QUEUE 48A
MANAGER 48A
CCSID 8P 0
PERSIST 1A
PRIORITY 8P 0
USERID 12A
EXPIRY 9P 0
MESSAGEID 24A
CORRLATEID 24A
MSGTYPE 9P 0
RELYMGR 48A
RELYQUEUE 48A
MSGLENGTH 9P 0
MESSAGE 32000A
Also see