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 IndexIBM MQ API SupportMQAX200 objects to get Process Definition Application Id

Post new topicReply to topic
MQAX200 objects to get Process Definition Application Id View previous topic :: View next topic
Author Message
williad
PostPosted: Wed Jul 19, 2006 4:40 am Post subject: MQAX200 objects to get Process Definition Application Id Reply with quote

Apprentice

Joined: 08 Sep 2005
Posts: 40
Location: London

Hi
I am about to attempt to use MQAX with VBScripting, and in my investigations, on how to actually start, and achieve what i want, i think i come across a problem.

what i want to do, is connect to a QManager, and then get the details of the process definition Application Identifier field.

Using the VB OLEView tool, i viewed all the objects on my PC, and found the MQAX200 objects. when i looked at these i didnt see any with a propety named Application Identifier.

So my question is, is there a way of getting the details of the Application Identifier using the MQAX200 objects

Thanks in advance
Back to top
View user's profile Send private message
williad
PostPosted: Wed Sep 06, 2006 11:12 am Post subject: [solved] MQAX200 objects to get Process Definition ApplId Reply with quote

Apprentice

Joined: 08 Sep 2005
Posts: 40
Location: London

Hi Guys

I have the solution to the problem i posted. I initially scanned the web for examples and help, and using those i cobbled together a script, which i thought should of worked, but didnt. . so in my furstartion i raised a call with IBM, whoi showed me a script using MQAX200 to create a Q.

I then reread the manual to see how their script worked, and then i noticed there are 2 parts of the manual that you have to read in order to understand how to use the MQBag Object, and the example in C in the manual actually started to make sense.

the 2 manuals i reread were
WebSphere MQ Using the Component Object Model Interface
Chapter 5. ActiveX interface to the MQAI
Programmable Command Formats and Administration Interface
Chapter 17. MQAI reference
Inquiring about queues and printing information (amqsailq.c)

If you read chapter 5 as above and it tells you for example about the Item Property of the MQBag class,

Item property
Purpose
The Item property represents an item in a bag. It is used to set or inquire about the
value of an item. Use of this property corresponds to the following MQAI calls:
v mqSetString
v mqSetInteger
v mqInquireInteger
v mqInquireString
v mqInquireBag

Read the associated bits about the mqSetString etc in the other manual and when you when try to follow the example, it begins to make some sense.

Also you see in the script is uses constants these are from
cmqb.bas for all the MQCA and MQIA Character and interger selectors
and cmqcfb.bas for all the MQCMD commands

The script that i cobbled together ( thank you to those that may recognise their bits of code below ) is shown below. forgive me for not tyding it up, but hopefully you will get the gist of what is going on.

And i hope this makes some sense. its made me a happier geezer!

Thank you
williad

(note the command server for the qmanager needs to be up and running for this to work.Need to create the reponse queue before starting. this worked for a local non default qmgr on my pc, i am assuming that it will work also for remote qmgrs)

====CODE BELOW====
dim sess
dim qm
dim opt
Dim requestQ
Dim replyQ
Dim mqadminbag
Dim mqreplybag
dim optsbag
'Global Const MQCA_PROCESS_DESC = 2011
'Global Const MQCA_PROCESS_NAME = 2012
'Global Const MQCA_ENV_DATA = 2007
'Global Const MQCA_USER_DATA = 2021
'Global Const 'MQCA_APPL_ID = 2001
'Global Const MQIA_APPL_TYPE = 1

set sess = CreateObject("mqax200.MQSession")
set qm = sess.AccessQueueManager("WBRK_QM")
Set requestQ = qm.AccessQueue("SYSTEM.ADMIN.COMMAND.QUEUE", 16 or 32 or 8192) 'MQOO_OUTPUT Or MQOO_INQUIRE Or MQOO_FAIL_IF_QUIESCING)
Set replyQ = qm.AccessQueue("COMMAND.RESPONSE.LOCAL", 2 or 32 or 8192) 'MQOO_INPUT_SHARED Or MQOO_FAIL_IF_QUIESCING Or MQOO_INQUIRE)


Set mqadminbag = CreateObject ("MQBag.MQBag")
Set optsbag = CreateObject ("MQBag.MQBag")


mqadminbag.Options = 1 'MQCBO_ADMIN_BAG
mqadminbag.Add "PROC*", 2012 'MQCA_PROCESS_NAME
mqadminbag.AddInquiry 2001 'MQCA_APPL_ID


WScript.Echo "Count = " & mqadminbag.Count

Set mqreplybag = mqadminbag.Execute(qm,7,optsbag,requestQ,replyQ) 'MQCMD_INQUIRE_PROCESS
WScript.Echo "Count = " & mqreplybag.Count

for i=0 to mqreplybag.Count - 1
Set RmqBag = mqreplybag.item(4001,i) 'MQHA_BAG_HANDLE = 4001
hello = RmqBag(2001) ' Get MQCA_APPL_ID
name = RmqBag(2012) ' Get MQCA_PROCESS_NAME
WScript.Echo "Hello " & i & " (" & TRIM(name) & "-" & TRIM(hello) & ")"

Next
Back to top
View user's profile Send private message
williad
PostPosted: Tue Sep 12, 2006 2:34 am Post subject: Reply with quote

Apprentice

Joined: 08 Sep 2005
Posts: 40
Location: London

Hi

appologies , this will only work local Qmanagers defined with MQ Server component. To get this working with Remote Qmanagers you need to use it with MQClient.

Williad
Back to top
View user's profile Send private message
williad
PostPosted: Mon Feb 05, 2007 2:46 am Post subject: Reply with quote

Apprentice

Joined: 08 Sep 2005
Posts: 40
Location: London

Hi

Please read the below:

This is what i got back from IBM Support when i raised a case regarding MQBag and MQClient.

===========
Sorry, but I think the customer has hit a deficiency in the support
provided by the MQBag class.
.
The MQAX200 classes can be configured to use a client connection by use
of MQSERVER and GMQ_MQ_LIB, however only a server version of the dll
providing the MQBag class (amqzaix.dll) is provided. This means that it
cannot use a client connection handle obtained by MQAX. It does not use
the GMQ_MQ_LIB variable.
.
The MQBag class is not shipped on the client which is why a different
set of symptoms is seen if only the client is installed.
.
Probably all that can be done is to put in a requirement for a client
version, or a version that understands GMQ_MQ_LIB, of the MQBag class to
be be provided.


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

MQSeries.net Forum IndexIBM MQ API SupportMQAX200 objects to get Process Definition Application Id
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.