The Reference Message samples run as follows:
For the purposes of describing how to set up the Reference Message example this refers to the sending machine as MACHINE1 with a queue manager called QMGR1 and the receiving machine as MACHINE2 with a queue manager called QMGR2.
The application that receives the Reference Message (AMQSGRM or AMQSGRMA on i5/OS) is triggered using the initiation queue INITQ and process PROC. Ensure that the CONNAME fields are set correctly and the MSGEXIT field reflects your directory structure, depending on machine type and where the WebSphere MQ product is installed.
The MQSC definitions have used an AIX(R) style for defining the exits, so if you are using MQSC on i5/OS you need to modify these accordingly. It is important to note that the message data FLATFILE is case sensitive and the sample will not work unless it is in uppercase.
On machine MACHINE1, queue manager QMGR1
MQSC syntax
define chl(chl1) chltype(sdr) trptype(tcp) conname('machine2') xmitq(xmitq) msgdata(FLATFILE) msgexit('/usr/lpp/mqm/samp/bin/amqsxrm(MsgExit) ') define ql(xmitq) usage(xmitq) define chl(report) chltype(rcvr) trptype(tcp) replace define qr(qr) rname(dq) rqmname(qmgr2) xmitq(xmitq) replace
i5/OS command syntax
CRTMQMCHL CHLNAME(CHL1) CHLTYPE(*SDR) MQMNAME(QMGR1) + REPLACE(*YES) TRPTYPE(*TCP) + CONNAME('MACHINE2(60501)') TMQNAME(XMITQ) + MSGEXIT(QMQM/AMQSXRM4) MSGUSRDATA(FLATFILE) CRTMQMQ QNAME(XMITQ) QTYPE(*LCL) MQMNAME(QMGR1) + REPLACE(*YES) USAGE(*TMQ) CRTMQMCHL CHLNAME(REPORT) CHLTYPE(*RCVR) + MQMNAME(QMGR1) REPLACE(*YES) TRPTYPE(*TCP) CRTMQMQ QNAME(QR) QTYPE(*RMT) MQMNAME(QMGR1) + REPLACE(*YES) RMTQNAME(DQ) + RMTMQMNAME(QMGR2) TMQNAME(XMITQ)
On machine MACHINE2, queue manager QMGR2
MQSC syntax
define chl(chl1) chltype(rcvr) trptype(tcp) msgexit('/usr/lpp/mqm/samp/bin/amqsxrm(MsgExit)') msgdata(flatfile) define chl(report) chltype(sdr) trptype(tcp) conname('MACHINE1') xmitq(qmgr1) define ql(initq) define ql(qmgr1) usage(xmitq) define pro(proc) applicid('/usr/lpp/mqm/samp/bin/amqsgrm') define ql(dq) initq(initq) process(proc) trigger trigtype(first)
i5/OS command syntax
CRTMQMCHL CHLNAME(CHL1) CHLTYPE(*RCVR) MQMNAME(QMGR2) + REPLACE(*YES) TRPTYPE(*TCP) + MSGEXIT(QMQM/AMQSXRM4) MSGUSRDATA(FLATFILE) CRTMQMCHL CHLNAME(REPORT) CHLTYPE(*SDR) MQMNAME(QMGR2) + REPLACE(*YES) TRPTYPE(*TCP) + CONNAME('MACHINE1(60500)') TMQNAME(QMGR1) CRTMQMQ QNAME(INITQ) QTYPE(*LCL) MQMNAME(QMGR2) + REPLACE(*YES) USAGE(*NORMAL) CRTMQMQ QNAME(QMGR1) QTYPE(*LCL) MQMNAME(QMGR2) + REPLACE(*YES) USAGE(*TMQ) CRTMQMPRC PRCNAME(PROC) MQMNAME(QMGR2) REPLACE(*YES) + APPID('QMQM/AMQSGRM4') CRTMQMQ QNAME(DQ) QTYPE(*LCL) MQMNAME(QMGR2) + REPLACE(*YES) PRCNAME(PROC) TRGENBL(*YES) + INITQNAME(INITQ)
-m | Name of the local queue manager; this defaults to the default queue manager |
-i | Name and location of source file |
-o | Name and location of destination file |
-q | Name of queue |
-g | Name of queue manager where the queue, defined in the -q parameter exists This defaults to the queue manager specified in the -m parameter |
-t | Object type |
-w | Wait interval, that is, the waiting time for exception and COA reports from the receiving queue manager |
For example, to use the sample with the objects defined above you would use the following parameters:
-mQMGR1 -iInput File -oOutput File -qQR -tFLATFILE -w120
Increasing the waiting time allows time for a large file to be sent across a network before the program putting the messages times out.
amqsprm -q QR -m QMGR1 -i d:\x\file.in -o d:\y\file.out -t FLATFILE
CALL PGM(QMQM/AMQSPRM4) PARM('-mQMGR1' + '-i/refmsgs/rmsg1' + '-o/refmsgs/rmsgx' '-qQR' + '-gQMGR1' '-tFLATFILE' '-w15')This assumes that the original file rmsg1 is in IFS directory /refmsgs and that you want the destination file to be rmsgx in IFS directory /refmsgs on the target system.
For example:
amqsprm /i d:\files\infile.dat /o e:\files\outfile.dat /q QR /m QMGR1 /w 30 /t FLATFILE
amqsprm -i /files/infile.dat -o e:\\files\\outfile.dat -q QR -m QMGR1 -w 30 -t FLATFILE
Running the put Reference Message program does the following:
msgexit('<pathname>\amqsxrm.dll(MsgExit)')
This is defined on WebSphere MQ for AIX, WebSphere MQ for HP-UX, and WebSphere MQ for Solaris as follows:
msgexit('<pathname>/amqsxrm(MsgExit)')
If you specify a pathname, specify the complete name. If you omit the pathname, it is assumed that the program is in the path specified in the qm.ini file (or, on WebSphere MQ for Windows, the path specified in the registry). This is explained fully in WebSphere MQ Intercommunication.
Notices |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
csqzal10175 |