Original Message:
Sent: Thu April 14, 2022 07:08 AM
From: Morag Hughson
Subject: MQCMD_PING_CHANNEL
Look at the timestamps on your MQSC equivalent command. I suspect you will see that it all happens within a second. An MQGET with a wait interval of 5 seconds would seem appropriate. Remember that the Wait Interval is not measured in second but milliseconds.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Wed April 13, 2022 09:30 PM
From: Debabrata Ghosh
Subject: MQCMD_PING_CHANNEL
Thank you Morag. I have one more question which is , I need wait on MQGET since channel commands are asynchronous.
But it would be a guess on wait parameter I can see. what is your thought ?
Regards
Deb
------------------------------
Debabrata Ghosh
Original Message:
Sent: Wed April 13, 2022 06:14 PM
From: Morag Hughson
Subject: MQCMD_PING_CHANNEL
You should issue MQGET until there are no more responses messages. In the case of a failed MQCMD_PING_CHANNEL, you will get three response messages.
In the MQCFH structure at the beginning of the MQGET buffer, you should see an MQCFH_COMPCODE of 2 and an MQCFH_REASON of 4010. I assume that is what you are referring to when you say "retcode" and "rsncode". Hexadecimal 0x00000FAA is decimal 4010 which is MQRCCF_HOST_NOT_AVAILABLE
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Wed April 13, 2022 10:29 AM
From: Debabrata Ghosh
Subject: MQCMD_PING_CHANNEL
Hi Morag,
so you are saying that I need to issue MQGET 3 times right? and the 2nd one will tell me the issue.
It looks like it might be working now as I see retcode:00000002 rsncode:00000FAA .
Please let me know your thought
Regards
deb
------------------------------
Debabrata Ghosh
Original Message:
Sent: Tue April 12, 2022 11:40 PM
From: Morag Hughson
Subject: MQCMD_PING_CHANNEL
So when you issue an MQCMD_PING_CHANNEL command you will get three response messages back. The first will have a CFH CompCode and Reason to tell you that the command was successfully issued (not completed, issued). Channel commands are asynchronous.
The second response in your failing case will have a CFH CompCode and Reason indicating the failure, my example is like this:-
[ 144 bytes] Message Content
[ 144 bytes] PCF Header (MQCFH XR)
Type :17 (XR Message)
Struc Length :36
Version :3
Command :26 (Ping Channel)
Sequence No. :1
Control :0 (Not last)
CompCode :2 (Failed)
Reason :4010 (Host not available)
Parm Count :2
[ 108 bytes] Bytes (MQCFBS)
Type :9 (Byte String)
Struc Length :40
Parameter Id :7004 (Response Id)
Bytes Length :24
Value :C3E2D840D4D8C7F1404040E2D4D8C7F1DB58DC7B2D011828
[ 68 bytes] String (MQCFST)
Type :4 (String)
Struc Length :68
Parameter Id :3070 (Response QMgr Name)
CCSID :500
String Length:48
Value :'MQG1 '
The third and final response will have a CFH CompCode and Reason indicating the command failed. Not interesting compared to the second response.
The CFH Reason code in the 2nd response message is the equivalent to your MQSC error message:-
CSQX202E MQG1 CSQXPING Connection or remote listener unavailable,
channel MQG1.TO.MQG2
connection localhost (127.0.0.1)
TRPTYPE=TCP RC=00000468 (ECONNREFUSED) reason=769E0291
So, you must, for channel commands, MQGET the first response (which will tell you that it is last in sequence) and then wait some more for the "real" responses, and see what they say.
When you ask if you must parse the MQGET, you must at a minimum look at the MQCFH structure at the front, this is not really parsing, just do as you were doing before to access the MQCFH, and look at the compcode and reason in there. No need to look at the following parms for this particular comand.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Tue April 12, 2022 11:23 PM
From: Debabrata Ghosh
Subject: MQCMD_PING_CHANNEL
Hi Morag.
Thank you. Problem is identified. it is the length while doing PUT. as soon as I fixed the length- Now I see MQCFH_COMPCODE = 0 , MQCFH_REASON = 0 . Now I am back to my original question. Which this PING will return to me so that I know the the issue with the channel.
do I need parse the MQGET ? which PCF type will tell me that.
Regards,
Deb
------------------------------
Debabrata Ghosh
Original Message:
Sent: Tue April 12, 2022 10:52 PM
From: Morag Hughson
Subject: MQCMD_PING_CHANNEL
Hi Deb,
Thanks for those snippets. I can't immediately spot anything wrong there. I can see that you are setting the parameter count to 2. One thing you don't show is how you calculate the position of LWA_PCFINT_PTR given that the MQCFST structure before it is variable in length. It would seem easier just to add MQCFST_STRUCLENGTH to the current R6 to calculate your new R6?
The other thing I can't check since you don't show it, is that you set the MQCFST_STRINGLENGTH to @PINGREQ_CHANNEL_LENGTH, but your MVC uses a hardcoded 20 to copy the channel name. It's possible that @PINGREQ_CHANNEL_LENGTH is also 20, but I can't tell that from what you've shown.
You also ask whether "having larger buffer length should not matter" but you don't show what your buffer length is. Are you saying that on the MQPUT call you tell the queue manager that your message is longer than it is? It would seem your message length is the simple addition of MQCFH_STRUC_LENGTH + MQCFST_STRUC_LENGTH_FIXED + MQ_CHANNEL_NAME_LENGTH + MQCFIN_STRUC_LENGTH. I don't think it will matter if the buffer length is longer so long as the buffer is also at least that long, but it should be simple to correct to rule that out as a problem.
Another thing you could do is put the message you are building to a side queue (instead of the command server queue) and look at it to see if it is correct and that might make it easier to debug. There are plenty of MQ tools out there that can format out a PCF message. If you can't get one, do a browse of the message using something like CSQ4BCG1 sample and then post the output on here so we can see.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Tue April 12, 2022 09:51 PM
From: Debabrata Ghosh
Subject: MQCMD_PING_CHANNEL
Hi Morag,
here is the code snippet. having larger buffer length should not matter correct ?
-----------------------------
setting header
-----------------------------
L R6,LWA_PCFHDR_PTR
USING MQCFH,R6
LA R1,MQCFT_COMMAND_XR
ST R1,MQCFH_TYPE
LA R1,MQCFH_STRUC_LENGTH
ST R1,MQCFH_STRUCLENGTH
LA R1,MQCFH_VERSION_3
ST R1,MQCFH_VERSION
LA R1,MQCMD_PING_CHANNEL
ST R1,MQCFH_COMMAND
LA R1,MQCFC_LAST
ST R1,MQCFH_MSGSEQNUMBER
LA R1,MQCFC_LAST
ST R1,MQCFH_CONTROL
LHI R1,2
ST R1,MQCFH_PARAMETERCOUNT
-----------------------------------
setting string parameter
----------------------------------
L R6,LWA_PCFSTR_PTR
USING MQCFST,R6
LA R1,MQCFT_STRING
ST R1,MQCFST_TYPE
LA R1,MQCFST_STRUC_LENGTH_FIXED
AL R1,=AL4(MQ_CHANNEL_NAME_LENGTH)
ST R1,MQCFST_STRUCLENGTH
LA R1,MQCACH_CHANNEL_NAME
ST R1,MQCFST_PARAMETER
LA R1,MQCCSI_DEFAULT
ST R1,MQCFST_CODEDCHARSETID
L R1,@PINGREQ_CHANNEL_LENGTH
ST R1,MQCFST_STRINGLENGTH
LR R1,R6
AL R1,=AL4(MQCFST_STRUC_LENGTH_FIXED)
MVC 0(20,R1),@PINGREQ_CHANNEL_NAME
----------------------------------
setting integer parameter
---------------------------------
L R6,LWA_PCFINT_PTR
USING MQCFIN,R6
LA R1,MQCFT_INTEGER
ST R1,MQCFIN_TYPE
LA R1,MQCFIN_STRUC_LENGTH
ST R1,MQCFIN_STRUCLENGTH
LA R1,MQIACH_DATA_COUNT
ST R1,MQCFIN_PARAMETER
LA R1,16
ST R1,MQCFIN_VALUE
------------------------------
Debabrata Ghosh
Original Message:
Sent: Tue April 12, 2022 09:47 PM
From: Morag Hughson
Subject: MQCMD_PING_CHANNEL
Hi Deb,
To allow us to help you debug why your code is going wrong, you're going to have to give us a lot more to go on than that. Which two parameters are you setting? Their types are not enough to know what they are. Are you setting the parameter count in the MQCFH to match the number of parameters in your message?
If you want further assistance, at least show us a snippet of your code showing how you are building this PCF command message.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Tue April 12, 2022 09:42 PM
From: Debabrata Ghosh
Subject: MQCMD_PING_CHANNEL
Hi Morag,
I am setting 2 parameters. string and integer but still same issue.
regards,
deb
------------------------------
Debabrata Ghosh
Original Message:
Sent: Tue April 12, 2022 07:55 PM
From: Morag Hughson
Subject: MQCMD_PING_CHANNEL
Hi Deb,
The reason code you report X'BBE' is 3006 in decimal which is MQRCCF_CFH_PARM_COUNT_ERROR. This suggests a problem with the parameters you have supplied in your MQCMD_PING_CHANNEL command to the command server. Can you tell us what parameters you supplied please? Perhaps you can show us your code, as this seems to be a coding issue with your command message.
When I issue the command from PCF, I supply two parameters, an MQCFST for the channel name, and an MQCFIN for the Data length. The second of those is optional.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Tue April 12, 2022 07:34 PM
From: Debabrata Ghosh
Subject: MQCMD_PING_CHANNEL
Hi Morag,
after the MQGET, I see MQCFH_COMPCODE =2 and MQCFH_REASON = X'BBE'
Regards
deb
------------------------------
Debabrata Ghosh
Original Message:
Sent: Tue April 12, 2022 06:34 PM
From: Morag Hughson
Subject: MQCMD_PING_CHANNEL
Hi Deb,
Some questions to clarify what you mean exactly.
- You say you received reason code = x'1' and return code = x'13' from the MQPUT. Do you mean the CompCode and Reason output parameters on the MQPUT call when putting the command message to do the MQCMD_PING_CHANNEL command to the command server queue? Or perhaps you mean the CompCode and Reason fields in the MQCFH header given to you on the response message having successfully MQPUT the message to the command server queue. Could you be more specific about which you mean? Feel free to show us a snippet of the code you are using if that makes it clearer.
- You mention encountering 769E0291 from manual ping. Could you please show us the exact output you are seeing on your manual ping.
- You haven't told us what platform or what version of MQ you are using. From prior questions, I assume this might be a z/OS queue manager, but you should certainly tell us those details too.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Tue April 12, 2022 03:25 PM
From: Debabrata Ghosh
Subject: MQCMD_PING_CHANNEL
Hello,
I am trying to issue "MQCMD_PING_CHANNEL" on z/OS for a channel.
are these followings below enough to test channel exception condition.
I issued the command against channels with retry status but , I am getting rc=0 from response header.
I am trying to see if this command actually show me the real error as we encountered769E0291 from manual ping.
MQRCCF_ALLOCATE_FAILEDAllocation failed.MQRCCF_BIND_FAILEDBind failed.
MQRCCF_CCSID_ERRORCoded character-set identifier error.
MQRCCF_CHANNEL_CLOSEDChannel closed.
MQRCCF_CHANNEL_IN_USEChannel in use.
MQRCCF_CHANNEL_NOT_FOUNDChannel not found.
MQRCCF_CHANNEL_TYPE_ERRORChannel type not valid.
MQRCCF_CONFIGURATION_ERRORConfiguration error.
MQRCCF_CONNECTION_CLOSEDConnection closed.
MQRCCF_CONNECTION_REFUSEDConnection refused.
MQRCCF_DATA_TOO_LARGEData too large.
MQRCCF_ENTRY_ERRORConnection name not valid.
MQRCCF_HOST_NOT_AVAILABLERemote system not available.
MQRCCF_NO_COMMS_MANAGERCommunications manager not available.
MQRCCF_PING_DATA_COMPARE_ERRORPing Channel command failed.
MQRCCF_PING_DATA_COUNT_ERRORData count not valid.
MQRCCF_PING_ERRORPing error.
MQRCCF_RECEIVE_FAILEDReceive failed.
MQRCCF_RECEIVED_DATA_ERRORReceived data error.
MQRCCF_REMOTE_QM_TERMINATINGRemote queue manager terminating.
MQRCCF_REMOTE_QM_UNAVAILABLERemote queue manager not available.
MQRCCF_SEND_FAILEDSend failed.
MQRCCF_STRUCTURE_TYPE_ERRORStructure type not valid.
MQRCCF_TERMINATED_BY_SEC_EXITChannel terminated by security exit.
MQRCCF_UNKNOWN_REMOTE_CHANNELRemote channel not known.
MQRCCF_USER_EXIT_NOT_AVAILABLEUser exit not available.
Regards,
Deb
------------------------------
Debabrata Ghosh
------------------------------