With my PCF coding, I also count the reply messages I get back and validate that number matches the msgSeqNumber in the MQCFC_LAST message, and report an error if those numbers do not match up.
------------------------------
Tim Zielke
------------------------------
Original Message:
Sent: Wed May 04, 2022 09:11 AM
From: Debabrata Ghosh
Subject: MQRC_NO_MSG_AVAILABLE for channel commands via PCF
Hi Richard.
thank you. Richard.
Regards
Deb
------------------------------
Debabrata Ghosh
Original Message:
Sent: Wed May 04, 2022 02:33 AM
From: Rich Harran
Subject: MQRC_NO_MSG_AVAILABLE for channel commands via PCF
Hi Deb,
It is possible to get MQRC_NO_MSG_AVAILABLE before getting the last message if not all the responses have arrived on the queue yet. You would also have to do one extra MQGET after you have processed the last response, which can be avoided if you check the Control field.
Perhaps I misunderstood your question as I thought you were trying to avoid relying on MQRC_NO_MSG_AVAILABLE. Are you asking if there is a predetermined number of expected responses for each PCF command that could be documented and hard-coded in the application? If so then there is not in general.
Thanks
------------------------------
Rich Harran
Original Message:
Sent: Tue May 03, 2022 05:02 PM
From: Debabrata Ghosh
Subject: MQRC_NO_MSG_AVAILABLE for channel commands via PCF
Hi Richard,
thank you.. , but can I not read until i get a message MQRC_NO_MSG_AVAILABLE from MQGET ?
regards,
deb
------------------------------
Debabrata Ghosh
Original Message:
Sent: Tue May 03, 2022 03:25 PM
From: Rich Harran
Subject: MQRC_NO_MSG_AVAILABLE for channel commands via PCF
Hi Deb,
You don't know in advance how many times you will need to do MQGET, but the last PCF response will have the Control field in the PCF header set to MQCFC_LAST (1), so you can tell when you have all the responses. There is also a MsgSeqNumber field in the PCF header which is one in the first response, two in the second response and so on.
See this https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mq-extended-responses document page for some more information about the PCF extended response returned by a z/OS queue manager, and https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mq-standard-responses for the PCF standard responses returned on other platforms.
Thanks
------------------------------
Rich Harran
Original Message:
Sent: Tue May 03, 2022 02:48 PM
From: Debabrata Ghosh
Subject: MQRC_NO_MSG_AVAILABLE for channel commands via PCF
Hi Colin.
thank you. I am issuing MQCMD_INQUIRE_CHANNEL_INIT, I wanted to know how many times I have to do MQGET.
regards,
deb
------------------------------
Debabrata Ghosh
Original Message:
Sent: Tue May 03, 2022 12:08 PM
From: Colin Paice
Subject: MQRC_NO_MSG_AVAILABLE for channel commands via PCF
Hi Debabrata,
Do you mean
how many messages are on the queue if so you can use inq queue-depth,
or did you mean there was one PCF query, how many responses did it send? There could be responses from 2 PCF queries, so you cannot just look at the curdepth.
Colin
------------------------------
Colin Paice
Original Message:
Sent: Tue May 03, 2022 10:33 AM
From: Debabrata Ghosh
Subject: MQRC_NO_MSG_AVAILABLE for channel commands via PCF
As we know channel related 'query' PCF commands put multiple messages. is there way we know that how many messages are in the queue up front from PCF structures before reading it?
regards,
deb
------------------------------
Debabrata Ghosh
------------------------------