This chapter provides information about how to make use of the support provided by Mainframe Express for batch programs that use MQSeries to communicate with other processes.
You can run batch programs that use IBM's MQSeries to communicate with other processes. MQSeries is IBM software that provides communication facilities between clients and a wide range of service providers, including both traditional mainframes and network servers. Mainframe Express supports MQSeries Version 2.0 server, and MQSeries Version 5.x both client and server.
You must have IBM MQSeries for Windows NT installed and configured on your PC.
No configuration is required within Mainframe Express to enable support for batch MQSeries.
Your program must establish an explicit connection to MQSeries using the call MQCONN before issuing any other MQSeries calls.
Mainframe Express does not support:
Mainframe Express itself takes care of translating all the system fields in each message. However, it is the responsibility of your application program to perform data conversion on the user data in each message. You do this by specifying the MQGMO_CONVERT option in the MQGMO structure passed to a MQGET call. More details are provided in the IBM manual MQSeries Application Programming Guide (SC33-0807) .
Note: If you run your communicating programs on the same PC using the same queue manager, user data is not correctly converted.
Two sample programs, mfmqsput.cbl and mfmqsget.cbl, and corresponding JCL, mfmqsbat.jcl, are provided in the folder \mfe\mfide\source. Program mfmqsput adds messages to a specified queue, and program mfmqsget retrieves messages from a specified queue.
Each demonstration program reads input data from the PARM parameter to the JCL EXEC statement that initiates the program.
The parameters for program mfmqsput are:
qmgr | Name of the queue manager |
qname | Name of the queue to which messages will be written |
count | Number of messages to be written, in the range 1 through 99999999 |
string | Message data. If string is longer than size, then the data is replicated to fill size bytes |
size | Length of message |
persist | Whether or not the message is persistent. Specify P for persistent or N for non-persistent |
The parameters for program mfmqsget are:
qmgr | Name of the queue manager |
qname | Name of the queue from which messages will be read |
count | Number of messages to be read, in the range 1 through 99999999 |
get | Type of MQGET. Specify B for browse (read-only) or D for destructive (read-and-remove) |
sync | Whether or not a syncpoint is to be taken. Specify S for syncpoint or N for no syncpoint |
Before you can run the sample programs you need to:
mfmqsput | PARM=('QM_TEST,TESTQ2,1,Teststring,20,N') |
mfmqsget | PARM=('QM_TEST,TESTQ2,1,D,S') |
You can now run the demonstration programs:
You can view the job output on the Spool tab of the Project View. Typical output is:
MQCONN successful MQOPEN successful 000000001 message(s) put to queue MQCLOSE successful MQDISC successful . MQCONN successful MQOPEN successful Teststring Teststring 000000001 message(s) got from queue MQCMIT successful MQCLOSE successful MQDISC successful
Copyright © 2001 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.