Problem solve Get help with specific problems with your technologies, process and projects.

Processing several MQ related messages in CICS

How do you process several MQ related messages in CICS? Front-end servers send >1 related message to a local queue defined in CICS, assuming the number of messages sent to CICS varies depending on user transaction requests.

The >1 message may be sent to CICS in different intervals too. Upon the very first message that arrives at the local queue, a CICS transaction will be trigger. The CICS pgm is supposed to get all related messages and do some processing before replying to that particular user.

How do you code the CICS pgm so it is able to get all related messages for that particular user? We have to assume that there will be other users who will also send >1 related messages from server to CICS.

One of the basic things to note about MQ operation is that the messages are not guaranteed to arrive in the same order that they were sent. Although I'm not excessively familiar with MQ, I do remember that the way to cope with this is to the relevant fields in the message headers (?MSGID or ?CORRELID but I'm too out of MQ activity to know if these are correct). I suggest you bash up some sort of formatting which records the total number of messages to be sent and then put this max number along with the actual number in these fields. Then you can know within CICS that you have got all you are interested in before continuing processing. Observe that the Message in the TriggerQ will give you the info you need to collect the set of messages in the InputQ.

Robert Harris
CICS Technical Strategist -- CICS expert at Search390.com

Editor's note: Do you agree with this expert's response? If you have more to share, post it in one of our .VO7aaqqaAFk.0@/search390>discussion forums.

Dig Deeper on IBM system z and mainframe systems

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.