ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Examples of PCF Filtering in Cobol?

Post new topic  Reply to topic
 Examples of PCF Filtering in Cobol? « View previous topic :: View next topic » 
Author Message
72dolfan
PostPosted: Fri Aug 04, 2006 7:58 am    Post subject: Examples of PCF Filtering in Cobol? Reply with quote

Acolyte

Joined: 02 May 2006
Posts: 53

I've read throught the Programmable Command Formats and Administration Interface Guide until I'm blue in the face, and I'm still no closer finding out how to actually code a filter on QDepth for an Inquire_Q_Status command in Cobol, or any other language for that matter.

The following is how I built the Inquire_Q_Status PCF through to the Put call in Cobol:

MOVE MQCFT-COMMAND TO MQCFH-TYPE.
MOVE MQCFH-STRUC-LENGTH TO MQCFH-STRUCLENGTH.
MOVE MQCFH-CURRENT-VERSION TO MQCFH-VERSION.
MOVE MQCMD-INQUIRE-Q-STATUS TO MQCFH-COMMAND.
MOVE MQCFC-LAST TO MQCFH-MSGSEQNUMBER.
MOVE MQCFC-LAST TO MQCFH-CONTROL.
MOVE 2 TO MQCFH-PARAMETERCOUNT.

MOVE MQCFT-STRING TO MQCFST-TYPE.
MOVE MQCFST-STRUC-LENGTH-FIXED TO MQCFST-STRUCLENGTH.
ADD 48 TO MQCFST-STRUCLENGTH.
MOVE MQCA-Q-NAME TO MQCFST-PARAMETER.
MOVE MQCCSI-DEFAULT TO MQCFST-CODEDCHARSETID.
MOVE 48 TO MQCFST-STRINGLENGTH.
MOVE MQCFT-INTEGER TO MQCFIN-TYPE.
MOVE MQCFIN-STRUC-LENGTH TO MQCFIN-STRUCLENGTH.
MOVE MQIA-Q-TYPE TO MQCFIN-PARAMETER.
MOVE MQQT-LOCAL TO MQCFIN-VALUE.
STRING PCF-HEADER PCF-STRING PARM-QNAME PCF-INTEGER
DELIMITED BY SIZE
INTO COMMAND-TEXT.
SET MQM-FORMAT-ADMIN TO TRUE.
MOVE MQCFH-STRUCLENGTH TO COMMAND-LENGTH.
ADD MQCFST-STRUCLENGTH TO COMMAND-LENGTH.
ADD MQCFIN-STRUCLENGTH TO COMMAND-LENGTH.
DISPLAY COMMAND-TEXT(1:COMMAND-LENGTH).
SET MQM-PUT-CALL TO TRUE.
MOVE LOW-VALUES TO MQM-MSGID.
MOVE LOW-VALUES TO MQM-CORRELID.
MOVE COMMAND-LENGTH TO MQM-MESSAGE-LENGTH.
IF PARM-REPLY-CHAR = SPACE
MOVE 'MVSE' TO REPLY-QUEUE-SYSTEM
ELSE
STRING 'MVS' PARM-REPLY-CHAR DELIMITED BY SIZE
INTO REPLY-QUEUE-SYSTEM
END-IF.
MOVE REPLY-QUEUE-NAME TO MQM-REPLYTOQ.
MOVE PARM-QSYS TO REPLY-QMGR-SYSTEM.
MOVE REPLY-QMGR-NAME TO MQM-REPLYTOQMGR.
PERFORM L8-CALL-MQ
THRU L8-CALL-MQ-EXIT.


Does anyone know where and how in this code I would put a filter so that I only received stats for queues that had depth, and queues that had at least one input processor? I understand you cannot code two filters per command, so I'd have to build and send two separate commands, but I need to know how to code the filters that I'm looking for.

Thanks in advance!!!!
Bill
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Aug 04, 2006 8:17 am    Post subject: Re: Examples of PCF Filtering in Cobol? Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

72dolfan wrote:
The following is how I built the Inquire_Q_Status PCF through to the Put call in Cobol:


PCF in COBOL?
72dolfan wrote:
Does anyone know where and how in this code I would put a filter so that I only received stats for queues that had depth, and queues that had at least one input processor? I understand you cannot code two filters per command, so I'd have to build and send two separate commands, but I need to know how to code the filters that I'm looking for.


You'll need to add either a ByteStringFilterCommand, IntegerFilterCommand, or StringFilterCommand to the Inquire_Q_Status message.

For a Integer filter like "qdepth gt 0", I'm going to give some pseudo-code. I have no way to test anything with COBOL.

Add a parameter of MQCFIF type to the command.
Set the MQCFIF-PARAMETER to MQIA_CURRENT_Q_DEPTH
Set the MQCFIF-OPERATOR to MQCFOP_GREATER
Set the MQCFIF-FILTERVALUE to 0
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
72dolfan
PostPosted: Fri Aug 04, 2006 9:40 am    Post subject: Reply with quote

Acolyte

Joined: 02 May 2006
Posts: 53

Thanks for responding.

I put the following code into my prog;

MOVE MQCFT-INTEGER TO MQCFIF-TYPE.
MOVE MQCFIF-STRUC-LENGTH TO MQCFIF-STRUCLENGTH.
MOVE MQIA-CURRENT-Q-DEPTH TO MQCFIF-PARAMETER.
MOVE MQCFOP-GREATER TO MQCFIF-OPERATOR.
MOVE 0 TO MQCFIF-FILTERVALUE.

and modified the string command from

STRING PCF-HEADER PCF-STRING PARM-QNAME PCF-INTEGER
DELIMITED BY SIZE
INTO COMMAND-TEXT.

to

STRING PCF-HEADER PCF-STRING PARM-QNAME PCF-INTEGER-FILTER
DELIMITED BY SIZE
INTO COMMAND-TEXT.

I didn't need the Integer-Filter because it was set up with MQIA-Q-TYPE with a value set to local. Since Inquire_Q_Status only returns local queues, it was no longer needed.

However, the filter I coded still brought back all local queues instead of local queues with depth. Can you see any glaring mistakes, besides coding this in cobol?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Aug 04, 2006 3:15 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Try it from mqsc first, and see if the command itself is valid "inq qstats(*) where(currentdepth gt 0)" (it might not be currentdepth).
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
72dolfan
PostPosted: Wed Aug 09, 2006 6:11 am    Post subject: Reply with quote

Acolyte

Joined: 02 May 2006
Posts: 53

I ran the "Display QStatus(*) Where(Curdepth gt 0)" against a Windows qmgr and received only queues with depth.

We can also filter on depth using the MQ.OC panels on z/OS, which uses MQSC behind the scenes.

I've showed IBM the code that I pasted earlier in this thread and told them I'm not asking them to debug it, just to let me know how to code for a filter. I explained that the maunals are not detailed enough, and that I was hoping they could supply me with an example.

Their response was they do not debug code (already told them that's not what I wanted) and that we should get with their consulting folks. Am I wrong in thinking that the manuals should be a little more detailed (samples, etc....)?

Anyway, does anyone know how to filter on QDepth in an Inquire_Q_Status PCF command using Cobol.

Thanks,
Bill
Back to top
View user's profile Send private message
wschutz
PostPosted: Wed Aug 09, 2006 6:31 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

My cobol is a tad rusty...any chance you can capture the message you're creating in the cobol program and then dump it in hex (with something like amqsbcg)?
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
72dolfan
PostPosted: Wed Aug 09, 2006 6:53 am    Post subject: Reply with quote

Acolyte

Joined: 02 May 2006
Posts: 53

That's not something I've ever done before. Not sure I'd know how.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 09, 2006 6:57 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Change what queue you put it onto to a test queue. I think on z the CSQUTIL can be run to produce a similar output of the message as the amqsbcg program produces on distributed. amqsbcg produces a hex character and regular character view of the message data, along with the message headers.

I know there is something that can be done to produce a similar view of a message on Z.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
72dolfan
PostPosted: Mon Aug 14, 2006 5:07 am    Post subject: Reply with quote

Acolyte

Joined: 02 May 2006
Posts: 53

Hi,

Thanks for your help. I was able to figure out the problem. Apparently, I was truncating my command record length, and cutting off the filter portion as a result. I ended up commenting out the following lines;

MOVE MQCFH-STRUCLENGTH TO COMMAND-LENGTH
ADD MQCFST-STRUCLENGTH TO COMMAND-LENGTH
ADD MQCFIN-STRUCLENGTH TO COMMAND-LENGTH

And ended up coding it like the follwing;

MOVE +1 TO COMMAND-LENGTH.
STRING
PCF-HEADER
PCF-STRING
PARM-QNAME
PCF-INTEGER-FILTER
DELIMITED BY SIZE
INTO COMMAND-TEXT
WITH POINTER COMMAND-LENGTH
END-STRING.
SUBTRACT +1 FROM COMMAND-LENGTH.


Go figure.

Anyway, I really appreciate all of your help!!!!

Bill
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Examples of PCF Filtering in Cobol?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.