Discussion:
PCF code for CHL Status
Roger Lacroix
2013-08-19 22:44:10 UTC
Permalink
All,

I have been beating my head against the wall all afternoon and I just
can't figure out what I have done wrong.

In Java, to get the individual channel statuses via PCF you would do:

request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, chlNameMask);
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE,
CMQC.MQOT_CURRENT_CHANNEL);
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS,
new int []
{
CMQCFC.MQCACH_CHANNEL_NAME,
CMQCFC.MQIACH_CHANNEL_STATUS,
} );

Here is my C code that gets an RC of 3016:

pPCFHeader = (MQCFH *)AdminMsg;

pPCFString = (MQCFST *)(AdminMsg + MQCFH_STRUC_LENGTH);

pPCFInteger = (MQCFIN *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED + MQ_CHANNEL_NAME_LENGTH);

pPCFIntegerList = (MQCFIL *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH) +
MQCFIN_STRUC_LENGTH;

/* Setup request header */
pPCFHeader->Type = MQCFT_COMMAND;
pPCFHeader->StrucLength = MQCFH_STRUC_LENGTH;
pPCFHeader->Version = MQCFH_VERSION_1;
pPCFHeader->Command = MQCMD_INQUIRE_CHANNEL_STATUS;
pPCFHeader->MsgSeqNumber = MQCFC_LAST;
pPCFHeader->Control = MQCFC_LAST;
pPCFHeader->ParameterCount = 3;
AdminMsgLen = pPCFHeader->StrucLength;

/* Setup parameter block */
pPCFString->Type = MQCFT_STRING;
pPCFString->StrucLength = MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH;
pPCFString->Parameter = MQCACH_CHANNEL_NAME;
pPCFString->CodedCharSetId = MQCCSI_DEFAULT;
pPCFString->StringLength = MQ_CHANNEL_NAME_LENGTH;
memset( pPCFString->String, ' ', MQ_CHANNEL_NAME_LENGTH );
memcpy( pPCFString->String, pCMQ->ChannelMask, strlen(pCMQ->ChannelName) );
AdminMsgLen += pPCFString->StrucLength;

/* Setup parameter block */
pPCFInteger->Type = MQCFT_INTEGER;
pPCFInteger->StrucLength = MQCFIN_STRUC_LENGTH;
pPCFInteger->Parameter = MQIACH_CHANNEL_INSTANCE_TYPE;
pPCFInteger->Value = MQOT_CURRENT_CHANNEL;
AdminMsgLen += pPCFInteger->StrucLength;

/* Setup parameter block */
pPCFIntegerList->Type = MQCFT_INTEGER_LIST;
pPCFIntegerList->StrucLength = MQCFIL_STRUC_LENGTH_FIXED + (2 *
sizeof(MQLONG));
pPCFIntegerList->Parameter = MQIACH_CHANNEL_INSTANCE_ATTRS;
pPCFIntegerList->Count = 2;
pPCFIntegerList->Values[0] = MQCACH_CHANNEL_NAME;
pPCFIntegerList->Values[1] = MQIACH_CHANNEL_STATUS;
AdminMsgLen += pPCFIntegerList->StrucLength;

If I set the ParameterCount to 2 and remove the pPCFIntegerList code
then the PCF command works. It returns the summary of the channels
but I want the individual channel statuses. i.e. The individual
channel statuses of when you have multiple instances of the same
channel running.

Does anyone see anything wrong with my C code?

Regards,
Roger Lacroix
Capitalware Inc.

To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
Jefferson Lowrey
2013-08-19 22:59:11 UTC
Permalink
As a start, I'd change

pPCFHeader->Version = MQCFH_VERSION_1;
to
pPCFHeader->Version = MQCFH_CURRENT_VERSION;

It's also a little hard to tell from the 7.5 Info Center, but you might
need to specify MaxResponses and ResponseRestartPoint. it says they're
required parameters, but then says that they're optional for all channels.


I'd be tempted to stop the command server on some qmgr, run the java code
to put the message on the command queue, and reverse engineer the
resulting PCF message.

Thank you,

Jeff Lowrey



From: Roger Lacroix <roger.lacroix-***@public.gmane.org>
To: MQSERIES-JX7+OpRa80QeFbOYke1v4oOpTq8/***@public.gmane.org,
Date: 08/19/2013 03:45 PM
Subject: [MQSERIES] PCF code for CHL Status
Sent by: MQSeries List <MQSERIES-JX7+OpRa80QeFbOYke1v4oOpTq8/***@public.gmane.org>



All,

I have been beating my head against the wall all afternoon and I just
can't figure out what I have done wrong.

In Java, to get the individual channel statuses via PCF you would do:

request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, chlNameMask);
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE,
CMQC.MQOT_CURRENT_CHANNEL);
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS,
new int []
{
CMQCFC.MQCACH_CHANNEL_NAME,
CMQCFC.MQIACH_CHANNEL_STATUS,
} );

Here is my C code that gets an RC of 3016:

pPCFHeader = (MQCFH *)AdminMsg;

pPCFString = (MQCFST *)(AdminMsg + MQCFH_STRUC_LENGTH);

pPCFInteger = (MQCFIN *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH);

pPCFIntegerList = (MQCFIL *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH) +
MQCFIN_STRUC_LENGTH;

/* Setup request header */
pPCFHeader->Type = MQCFT_COMMAND;
pPCFHeader->StrucLength = MQCFH_STRUC_LENGTH;
pPCFHeader->Version = MQCFH_VERSION_1;
pPCFHeader->Command = MQCMD_INQUIRE_CHANNEL_STATUS;
pPCFHeader->MsgSeqNumber = MQCFC_LAST;
pPCFHeader->Control = MQCFC_LAST;
pPCFHeader->ParameterCount = 3;
AdminMsgLen = pPCFHeader->StrucLength;

/* Setup parameter block */
pPCFString->Type = MQCFT_STRING;
pPCFString->StrucLength = MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH;
pPCFString->Parameter = MQCACH_CHANNEL_NAME;
pPCFString->CodedCharSetId = MQCCSI_DEFAULT;
pPCFString->StringLength = MQ_CHANNEL_NAME_LENGTH;
memset( pPCFString->String, ' ', MQ_CHANNEL_NAME_LENGTH );
memcpy( pPCFString->String, pCMQ->ChannelMask, strlen(pCMQ->ChannelName)
);
AdminMsgLen += pPCFString->StrucLength;

/* Setup parameter block */
pPCFInteger->Type = MQCFT_INTEGER;
pPCFInteger->StrucLength = MQCFIN_STRUC_LENGTH;
pPCFInteger->Parameter = MQIACH_CHANNEL_INSTANCE_TYPE;
pPCFInteger->Value = MQOT_CURRENT_CHANNEL;
AdminMsgLen += pPCFInteger->StrucLength;

/* Setup parameter block */
pPCFIntegerList->Type = MQCFT_INTEGER_LIST;
pPCFIntegerList->StrucLength = MQCFIL_STRUC_LENGTH_FIXED + (2 *
sizeof(MQLONG));
pPCFIntegerList->Parameter = MQIACH_CHANNEL_INSTANCE_ATTRS;
pPCFIntegerList->Count = 2;
pPCFIntegerList->Values[0] = MQCACH_CHANNEL_NAME;
pPCFIntegerList->Values[1] = MQIACH_CHANNEL_STATUS;
AdminMsgLen += pPCFIntegerList->StrucLength;

If I set the ParameterCount to 2 and remove the pPCFIntegerList code then
the PCF command works. It returns the summary of the channels but I want
the individual channel statuses. i.e. The individual channel statuses of
when you have multiple instances of the same channel running.

Does anyone see anything wrong with my C code?

Regards,
Roger Lacroix
Capitalware Inc.


List Archive - Manage Your List Settings - Unsubscribe
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com

To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
Richard Tsujimoto
2013-08-19 23:10:54 UTC
Permalink
Roger,



I dug up some of the code I used for my file transfer system and found the
PCF code for obtaining the channel status. You'll have to do the comparison
to see what's missing from your code. Have fun.



From: MQSeries List [mailto:MQSERIES-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org] On Behalf Of
Roger Lacroix
Sent: Monday, August 19, 2013 6:44 PM
To: MQSERIES-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org
Subject: PCF code for CHL Status



All,

I have been beating my head against the wall all afternoon and I just can't
figure out what I have done wrong.

In Java, to get the individual channel statuses via PCF you would do:

request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, chlNameMask);
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE,
CMQC.MQOT_CURRENT_CHANNEL);
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS,
new int []
{
CMQCFC.MQCACH_CHANNEL_NAME,
CMQCFC.MQIACH_CHANNEL_STATUS,
} );

Here is my C code that gets an RC of 3016:

pPCFHeader = (MQCFH *)AdminMsg;

pPCFString = (MQCFST *)(AdminMsg + MQCFH_STRUC_LENGTH);

pPCFInteger = (MQCFIN *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH);

pPCFIntegerList = (MQCFIL *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH) +
MQCFIN_STRUC_LENGTH;

/* Setup request header */
pPCFHeader->Type = MQCFT_COMMAND;
pPCFHeader->StrucLength = MQCFH_STRUC_LENGTH;
pPCFHeader->Version = MQCFH_VERSION_1;
pPCFHeader->Command = MQCMD_INQUIRE_CHANNEL_STATUS;
pPCFHeader->MsgSeqNumber = MQCFC_LAST;
pPCFHeader->Control = MQCFC_LAST;
pPCFHeader->ParameterCount = 3;
AdminMsgLen = pPCFHeader->StrucLength;

/* Setup parameter block */
pPCFString->Type = MQCFT_STRING;
pPCFString->StrucLength = MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH;
pPCFString->Parameter = MQCACH_CHANNEL_NAME;
pPCFString->CodedCharSetId = MQCCSI_DEFAULT;
pPCFString->StringLength = MQ_CHANNEL_NAME_LENGTH;
memset( pPCFString->String, ' ', MQ_CHANNEL_NAME_LENGTH );
memcpy( pPCFString->String, pCMQ->ChannelMask, strlen(pCMQ->ChannelName) );
AdminMsgLen += pPCFString->StrucLength;

/* Setup parameter block */
pPCFInteger->Type = MQCFT_INTEGER;
pPCFInteger->StrucLength = MQCFIN_STRUC_LENGTH;
pPCFInteger->Parameter = MQIACH_CHANNEL_INSTANCE_TYPE;
pPCFInteger->Value = MQOT_CURRENT_CHANNEL;
AdminMsgLen += pPCFInteger->StrucLength;

/* Setup parameter block */
pPCFIntegerList->Type = MQCFT_INTEGER_LIST;
pPCFIntegerList->StrucLength = MQCFIL_STRUC_LENGTH_FIXED + (2 *
sizeof(MQLONG));
pPCFIntegerList->Parameter = MQIACH_CHANNEL_INSTANCE_ATTRS;
pPCFIntegerList->Count = 2;
pPCFIntegerList->Values[0] = MQCACH_CHANNEL_NAME;
pPCFIntegerList->Values[1] = MQIACH_CHANNEL_STATUS;
AdminMsgLen += pPCFIntegerList->StrucLength;

If I set the ParameterCount to 2 and remove the pPCFIntegerList code then
the PCF command works. It returns the summary of the channels but I want the
individual channel statuses. i.e. The individual channel statuses of when
you have multiple instances of the same channel running.

Does anyone see anything wrong with my C code?

Regards,
Roger Lacroix
Capitalware Inc.



_____

List Archive <http://listserv.meduniwien.ac.at/archives/mqser-l.html> -
Manage Your List Settings
<http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1> -
Unsubscribe
<mailto:LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%
20mqseries>

Instructions for managing your mailing list subscription are provided in the
Listserv General Users Guide available at http://www.lsoft.com
<http://www.lsoft.com/resources/manuals.asp>


To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
Roger Lacroix
2013-08-20 02:19:13 UTC
Permalink
Hi Jeff,

> pPCFHeader->Version = MQCFH_CURRENT_VERSION;

That didn't make any difference.

I figured out the RC of 3016 - it was pointer arithmetic error.

Wrong:
pPCFIntegerList = (MQCFIL *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED
+ MQ_CHANNEL_NAME_LENGTH) +
MQCFIN_STRUC_LENGTH;

Correct:
pPCFIntegerList = (MQCFIL *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED
+ MQ_CHANNEL_NAME_LENGTH +
MQCFIN_STRUC_LENGTH);

The ending bracket was in the wrong spot.

It works but it only gives me the values for 1
instances of the channel and not all of them.

Also, I stopped the command server and compared
the PCF messages and it appears that Java cheats
or does some processes which is really weird.

Here is the output from the amqsbcg program (message data only):

Java PCF message:

00000000: 0000 0001 0000 0024 0000 0001 0000 0002 '.......$........'
00000010: 0000 0001 0000 0001 0000 0000 0000 0000 '................'
00000020: 0000 0001 0000 0005 0000 001C 0000 03E9 '...............T'
00000030: 0000 0003 0000 0020 0000 07DF 0000 0002 '....... ...¯....'

C PCF message:

00000000: 0100 0000 2400 0000 0100 0000 2A00 0000 '....$.......*...'
00000010: 0100 0000 0100 0000 0000 0000 0000 0000 '................'
00000020: 0300 0000 0400 0000 2800 0000 AD0D 0000 '........(...¡...'
00000030: 0000 0000 1400 0000 4D59 2E54 4553 542E '........MY.TEST.'
00000040: 4558 4954 2020 2020 2020 2020 0300 0000 'EXIT ....'
00000050: 1000 0000 F305 0000 F303 0000 0000 0000 '....=...=.......'
00000060: 0000 0000 0000 0000 0000 0000 0000 0000 '................'
00000070: 0000 0000 '.... '

The Java code sets the channel name to
'MY.TEST.EXIT' just like the C code but it does
not show up in the PCF message. Very odd.

I'll do some more research.

Regards,
Roger Lacroix
Capitalware Inc.

At 06:59 PM 8/19/2013, you wrote:
>As a start, I'd change
>
>pPCFHeader->Version = MQCFH_VERSION_1;
>to
>pPCFHeader->Version = MQCFH_CURRENT_VERSION;
>
>It's also a little hard to tell from the 7.5
>Info Center, but you might need to specify
>MaxResponses and ResponseRestartPoint. it says
>they're required parameters, but then says that
>they're optional for all channels.
>
>I'd be tempted to stop the command server on
>some qmgr, run the java code to put the message
>on the command queue, and reverse engineer the resulting PCF message.
>
>Thank you,
>
>Jeff Lowrey
>
>
>
>From: Roger Lacroix <roger.lacroix-***@public.gmane.org>
>To: MQSERIES-JX7+OpRa80QeFbOYke1v4oOpTq8/***@public.gmane.org,
>Date: 08/19/2013 03:45 PM
>Subject: [MQSERIES] PCF code for CHL Status
>Sent by: MQSeries List <MQSERIES-JX7+OpRa80QeFbOYke1v4oOpTq8/***@public.gmane.org>
>
>
>
>
>All,
>
>I have been beating my head against the wall all
>afternoon and I just can't figure out what I have done wrong.
>
>In Java, to get the individual channel statuses via PCF you would do:
>
>request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
>request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, chlNameMask);
>request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE,
>CMQC.MQOT_CURRENT_CHANNEL);
>request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS,
> new int []
> {
> CMQCFC.MQCACH_CHANNEL_NAME,
> CMQCFC.MQIACH_CHANNEL_STATUS,
> } );
>
>Here is my C code that gets an RC of 3016:
>
>pPCFHeader = (MQCFH *)AdminMsg;
>
>pPCFString = (MQCFST *)(AdminMsg + MQCFH_STRUC_LENGTH);
>
>pPCFInteger = (MQCFIN *)( AdminMsg +
> MQCFH_STRUC_LENGTH +
> MQCFST_STRUC_LENGTH_FIXED + MQ_CHANNEL_NAME_LENGTH);
>
>pPCFIntegerList = (MQCFIL *)( AdminMsg +
> MQCFH_STRUC_LENGTH +
>
>MQCFST_STRUC_LENGTH_FIXED + MQ_CHANNEL_NAME_LENGTH) +
> MQCFIN_STRUC_LENGTH;
>
>/* Setup request header */
>pPCFHeader->Type = MQCFT_COMMAND;
>pPCFHeader->StrucLength = MQCFH_STRUC_LENGTH;
>pPCFHeader->Version = MQCFH_VERSION_1;
>pPCFHeader->Command = MQCMD_INQUIRE_CHANNEL_STATUS;
>pPCFHeader->MsgSeqNumber = MQCFC_LAST;
>pPCFHeader->Control = MQCFC_LAST;
>pPCFHeader->ParameterCount = 3;
>AdminMsgLen = pPCFHeader->StrucLength;
>
>/* Setup parameter block */
>pPCFString->Type = MQCFT_STRING;
>pPCFString->StrucLength =
>MQCFST_STRUC_LENGTH_FIXED + MQ_CHANNEL_NAME_LENGTH;
>pPCFString->Parameter = MQCACH_CHANNEL_NAME;
>pPCFString->CodedCharSetId = MQCCSI_DEFAULT;
>pPCFString->StringLength = MQ_CHANNEL_NAME_LENGTH;
>memset( pPCFString->String, ' ', MQ_CHANNEL_NAME_LENGTH );
>memcpy( pPCFString->String, pCMQ->ChannelMask, strlen(pCMQ->ChannelName) );
>AdminMsgLen += pPCFString->StrucLength;
>
>/* Setup parameter block */
>pPCFInteger->Type = MQCFT_INTEGER;
>pPCFInteger->StrucLength = MQCFIN_STRUC_LENGTH;
>pPCFInteger->Parameter = MQIACH_CHANNEL_INSTANCE_TYPE;
>pPCFInteger->Value = MQOT_CURRENT_CHANNEL;
>AdminMsgLen += pPCFInteger->StrucLength;
>
>/* Setup parameter block */
>pPCFIntegerList->Type = MQCFT_INTEGER_LIST;
>pPCFIntegerList->StrucLength =
>MQCFIL_STRUC_LENGTH_FIXED + (2 * sizeof(MQLONG));
>pPCFIntegerList->Parameter = MQIACH_CHANNEL_INSTANCE_ATTRS;
>pPCFIntegerList->Count = 2;
>pPCFIntegerList->Values[0] = MQCACH_CHANNEL_NAME;
>pPCFIntegerList->Values[1] = MQIACH_CHANNEL_STATUS;
>AdminMsgLen += pPCFIntegerList->StrucLength;
>
>If I set the ParameterCount to 2 and remove the
>pPCFIntegerList code then the PCF command works.
>It returns the summary of the channels but I
>want the individual channel statuses. i.e. The
>individual channel statuses of when you have
>multiple instances of the same channel running.
>
>Does anyone see anything wrong with my C code?
>
>Regards,
>Roger Lacroix
>Capitalware Inc.
>
>
>----------
><http://listserv.meduniwien.ac.at/archives/mqser-l.html>List
>Archive -
><http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1>Manage
>Your List Settings -
><mailto:LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%20mqseries>Unsubscribe
>
>
>Instructions for managing your mailing list
>subscription are provided in the Listserv
>General Users Guide available at
><http://www.lsoft.com/resources/manuals.asp>http://www.lsoft.com
>
>
>
>----------
><http://listserv.meduniwien.ac.at/archives/mqser-l.html>List
>Archive -
><http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1>Manage
>Your List Settings -
><mailto:LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%20mqseries>Unsubscribe
>
>
>Instructions for managing your mailing list
>subscription are provided in the Listserv
>General Users Guide available at
><http://www.lsoft.com/resources/manuals.asp>http://www.lsoft.com

To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
Roger Lacroix
2013-08-20 02:19:42 UTC
Permalink
Hi Rich,

Thanks. I'll have a look.

Regards,
Roger Lacroix
Capitalware Inc.

At 07:10 PM 8/19/2013, you wrote:
>Roger,
>
>I dug up some of the code I used for my file transfer system and
>found the PCF code for obtaining the channel status. You'll have to
>do the comparison to see what's missing from your code. Have fun.
>
>From: MQSeries List [mailto:MQSERIES-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org] On
>Behalf Of Roger Lacroix
>Sent: Monday, August 19, 2013 6:44 PM
>To: MQSERIES-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org
>Subject: PCF code for CHL Status
>
>All,
>
>I have been beating my head against the wall all afternoon and I
>just can't figure out what I have done wrong.
>
>In Java, to get the individual channel statuses via PCF you would do:
>
>request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
>request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, chlNameMask);
>request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE,
>CMQC.MQOT_CURRENT_CHANNEL);
>request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS,
> new int []
> {
> CMQCFC.MQCACH_CHANNEL_NAME,
> CMQCFC.MQIACH_CHANNEL_STATUS,
> } );
>
>Here is my C code that gets an RC of 3016:
>
>pPCFHeader = (MQCFH *)AdminMsg;
>
>pPCFString = (MQCFST *)(AdminMsg + MQCFH_STRUC_LENGTH);
>
>pPCFInteger = (MQCFIN *)( AdminMsg +
> MQCFH_STRUC_LENGTH +
> MQCFST_STRUC_LENGTH_FIXED +
> MQ_CHANNEL_NAME_LENGTH);
>
>pPCFIntegerList = (MQCFIL *)( AdminMsg +
> MQCFH_STRUC_LENGTH +
> MQCFST_STRUC_LENGTH_FIXED +
> MQ_CHANNEL_NAME_LENGTH) +
> MQCFIN_STRUC_LENGTH;
>
>/* Setup request header */
>pPCFHeader->Type = MQCFT_COMMAND;
>pPCFHeader->StrucLength = MQCFH_STRUC_LENGTH;
>pPCFHeader->Version = MQCFH_VERSION_1;
>pPCFHeader->Command = MQCMD_INQUIRE_CHANNEL_STATUS;
>pPCFHeader->MsgSeqNumber = MQCFC_LAST;
>pPCFHeader->Control = MQCFC_LAST;
>pPCFHeader->ParameterCount = 3;
>AdminMsgLen = pPCFHeader->StrucLength;
>
>/* Setup parameter block */
>pPCFString->Type = MQCFT_STRING;
>pPCFString->StrucLength = MQCFST_STRUC_LENGTH_FIXED +
>MQ_CHANNEL_NAME_LENGTH;
>pPCFString->Parameter = MQCACH_CHANNEL_NAME;
>pPCFString->CodedCharSetId = MQCCSI_DEFAULT;
>pPCFString->StringLength = MQ_CHANNEL_NAME_LENGTH;
>memset( pPCFString->String, ' ', MQ_CHANNEL_NAME_LENGTH );
>memcpy( pPCFString->String, pCMQ->ChannelMask, strlen(pCMQ->ChannelName) );
>AdminMsgLen += pPCFString->StrucLength;
>
>/* Setup parameter block */
>pPCFInteger->Type = MQCFT_INTEGER;
>pPCFInteger->StrucLength = MQCFIN_STRUC_LENGTH;
>pPCFInteger->Parameter = MQIACH_CHANNEL_INSTANCE_TYPE;
>pPCFInteger->Value = MQOT_CURRENT_CHANNEL;
>AdminMsgLen += pPCFInteger->StrucLength;
>
>/* Setup parameter block */
>pPCFIntegerList->Type = MQCFT_INTEGER_LIST;
>pPCFIntegerList->StrucLength = MQCFIL_STRUC_LENGTH_FIXED + (2 *
>sizeof(MQLONG));
>pPCFIntegerList->Parameter = MQIACH_CHANNEL_INSTANCE_ATTRS;
>pPCFIntegerList->Count = 2;
>pPCFIntegerList->Values[0] = MQCACH_CHANNEL_NAME;
>pPCFIntegerList->Values[1] = MQIACH_CHANNEL_STATUS;
>AdminMsgLen += pPCFIntegerList->StrucLength;
>
>If I set the ParameterCount to 2 and remove the pPCFIntegerList code
>then the PCF command works. It returns the summary of the channels
>but I want the individual channel statuses. i.e. The individual
>channel statuses of when you have multiple instances of the same
>channel running.
>
>Does anyone see anything wrong with my C code?
>
>Regards,
>Roger Lacroix
>Capitalware Inc.
>
>
>----------
><http://listserv.meduniwien.ac.at/archives/mqser-l.html>List Archive
>-
><http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1>Manage
>Your List Settings -
><mailto:LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%20mqseries>Unsubscribe
>
>
>Instructions for managing your mailing list subscription are
>provided in the Listserv General Users Guide available at
><http://www.lsoft.com/resources/manuals.asp>http://www.lsoft.com
>
>
>----------
><http://listserv.meduniwien.ac.at/archives/mqser-l.html>List Archive
>-
><http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1>Manage
>Your List Settings -
><mailto:LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%20mqseries>Unsubscribe
>
>
>Instructions for managing your mailing list subscription are
>provided in the Listserv General Users Guide available at
><http://www.lsoft.com/resources/manuals.asp>http://www.lsoft.com

To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
Roger Lacroix
2013-08-20 03:16:58 UTC
Permalink
Hi Rich,

I had a look but that sample uses MQAI. I already have working MQAI
C code that obtains individual channel status. I need just C and PCF code.

Why you ask? As far as I can tell, the new MQIEP structure does not
support MQAI calls. Hence, MQAI code cannot be used in any exits
and/or installable services when MQ is installed in a non-default location.
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r1/index.jsp?topic=%2Fcom.ibm.mq.doc%2Fzd00140_.htm

Regards,
Roger Lacroix
Capitalware Inc.

At 07:10 PM 8/19/2013, you wrote:
>Roger,
>
>I dug up some of the code I used for my file transfer system and
>found the PCF code for obtaining the channel status. You'll have to
>do the comparison to see what's missing from your code. Have fun.
>
>From: MQSeries List [mailto:MQSERIES-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org] On
>Behalf Of Roger Lacroix
>Sent: Monday, August 19, 2013 6:44 PM
>To: MQSERIES-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org
>Subject: PCF code for CHL Status
>
>All,
>
>I have been beating my head against the wall all afternoon and I
>just can't figure out what I have done wrong.
>
>In Java, to get the individual channel statuses via PCF you would do:
>
>request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
>request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, chlNameMask);
>request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE,
>CMQC.MQOT_CURRENT_CHANNEL);
>request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS,
> new int []
> {
> CMQCFC.MQCACH_CHANNEL_NAME,
> CMQCFC.MQIACH_CHANNEL_STATUS,
> } );
>
>Here is my C code that gets an RC of 3016:
>
>pPCFHeader = (MQCFH *)AdminMsg;
>
>pPCFString = (MQCFST *)(AdminMsg + MQCFH_STRUC_LENGTH);
>
>pPCFInteger = (MQCFIN *)( AdminMsg +
> MQCFH_STRUC_LENGTH +
> MQCFST_STRUC_LENGTH_FIXED +
> MQ_CHANNEL_NAME_LENGTH);
>
>pPCFIntegerList = (MQCFIL *)( AdminMsg +
> MQCFH_STRUC_LENGTH +
> MQCFST_STRUC_LENGTH_FIXED +
> MQ_CHANNEL_NAME_LENGTH) +
> MQCFIN_STRUC_LENGTH;
>
>/* Setup request header */
>pPCFHeader->Type = MQCFT_COMMAND;
>pPCFHeader->StrucLength = MQCFH_STRUC_LENGTH;
>pPCFHeader->Version = MQCFH_VERSION_1;
>pPCFHeader->Command = MQCMD_INQUIRE_CHANNEL_STATUS;
>pPCFHeader->MsgSeqNumber = MQCFC_LAST;
>pPCFHeader->Control = MQCFC_LAST;
>pPCFHeader->ParameterCount = 3;
>AdminMsgLen = pPCFHeader->StrucLength;
>
>/* Setup parameter block */
>pPCFString->Type = MQCFT_STRING;
>pPCFString->StrucLength = MQCFST_STRUC_LENGTH_FIXED +
>MQ_CHANNEL_NAME_LENGTH;
>pPCFString->Parameter = MQCACH_CHANNEL_NAME;
>pPCFString->CodedCharSetId = MQCCSI_DEFAULT;
>pPCFString->StringLength = MQ_CHANNEL_NAME_LENGTH;
>memset( pPCFString->String, ' ', MQ_CHANNEL_NAME_LENGTH );
>memcpy( pPCFString->String, pCMQ->ChannelMask, strlen(pCMQ->ChannelName) );
>AdminMsgLen += pPCFString->StrucLength;
>
>/* Setup parameter block */
>pPCFInteger->Type = MQCFT_INTEGER;
>pPCFInteger->StrucLength = MQCFIN_STRUC_LENGTH;
>pPCFInteger->Parameter = MQIACH_CHANNEL_INSTANCE_TYPE;
>pPCFInteger->Value = MQOT_CURRENT_CHANNEL;
>AdminMsgLen += pPCFInteger->StrucLength;
>
>/* Setup parameter block */
>pPCFIntegerList->Type = MQCFT_INTEGER_LIST;
>pPCFIntegerList->StrucLength = MQCFIL_STRUC_LENGTH_FIXED + (2 *
>sizeof(MQLONG));
>pPCFIntegerList->Parameter = MQIACH_CHANNEL_INSTANCE_ATTRS;
>pPCFIntegerList->Count = 2;
>pPCFIntegerList->Values[0] = MQCACH_CHANNEL_NAME;
>pPCFIntegerList->Values[1] = MQIACH_CHANNEL_STATUS;
>AdminMsgLen += pPCFIntegerList->StrucLength;
>
>If I set the ParameterCount to 2 and remove the pPCFIntegerList code
>then the PCF command works. It returns the summary of the channels
>but I want the individual channel statuses. i.e. The individual
>channel statuses of when you have multiple instances of the same
>channel running.
>
>Does anyone see anything wrong with my C code?
>
>Regards,
>Roger Lacroix
>Capitalware Inc.
>
>
>----------
><http://listserv.meduniwien.ac.at/archives/mqser-l.html>List Archive
>-
><http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1>Manage
>Your List Settings -
><mailto:LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%20mqseries>Unsubscribe
>
>
>Instructions for managing your mailing list subscription are
>provided in the Listserv General Users Guide available at
><http://www.lsoft.com/resources/manuals.asp>http://www.lsoft.com
>
>
>----------
><http://listserv.meduniwien.ac.at/archives/mqser-l.html>List Archive
>-
><http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1>Manage
>Your List Settings -
><mailto:LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%20mqseries>Unsubscribe
>
>
>Instructions for managing your mailing list subscription are
>provided in the Listserv General Users Guide available at
><http://www.lsoft.com/resources/manuals.asp>http://www.lsoft.com

To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
Loading...