Author |
Message
|
MQDeveloper |
Posted: Tue Dec 13, 2005 1:44 pm Post subject: Problem getting CCSID from QMgr |
|
|
Newbie
Joined: 21 Oct 2005 Posts: 7
|
I have written a Java client application that connects to a queue manager and puts and gets messages to/from queues.
Up until now, I've been testing only on Windows but I am required to support multiple platforms so I installed WebSphere MQ on the iSeries (AS/400) V5R2. From the "green screen", I see that the QMgr's CCSID is 37, but when I connect to this QMgr from Java and query its CCSID, it is returning 819. I see that the MQEnvironment.CCSID field is that of the client (which is 819) so I haven't changed it because I really don't know what my target QMgr's CCSID will be....
This is my snippet of code:
this.qMgr = new MQQueueManager("QM_AS400");
System.out.println("Qmgr CCSID: " + this.qMgr.getCharacterSet());
Does anyone know how to query a QMgr for its CCSID? |
|
Back to top |
|
 |
vennela |
Posted: Tue Dec 13, 2005 1:49 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
You have to use PCF to query the QMGR's CCSID.
Why do you want to do it anyway?
What is the problem
What kind of data are you trying to send and what platforms. |
|
Back to top |
|
 |
MQDeveloper |
Posted: Tue Dec 13, 2005 2:06 pm Post subject: |
|
|
Newbie
Joined: 21 Oct 2005 Posts: 7
|
In the Application Programming Guide (Chapter 3), the section "Format of Message Data", it states that when I get a message from the queue, I should compare the CCSID of the QMgr against my expected CCSID to determine whether I should convert the data. I am using the MQC.MQGMO_CONVERT option on the GET so is this a moot point?
Maybe the bigger question is, do I ever need to do data conversion? Can I assume that on different platforms, MQ will always convert the data for me? (I'm guessing no.) Since I am using a SvrConn channel, there is no data conversion on the channel....
As part of my GUI, I've added the option to allow my user to convert to/from EBCDIC and allow them to enter their desired CCSID. Is this overkill? |
|
Back to top |
|
 |
wschutz |
Posted: Tue Dec 13, 2005 5:20 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Well yeah, it does say that doesn't it?
The best practice is to let MQ convert the data for you. There are some rules, like the sender of the message must set the Format field in the MQMD and MQ must know how to convert that format. But if your payload is all character (like xml), then there is no problem.
So, you should always code GMO_CONVERT on the get method. If MQ can't do the conversion, an exception will be thrown with a 2119 (or some such) reason code. If no conversion is necessary (because the ccsids already match) then no conversion is done.
I think matching the CCSIDs is overkill and would ignore the manual's recommendation. _________________ -wayne |
|
Back to top |
|
 |
MQDeveloper |
Posted: Wed Dec 14, 2005 6:36 am Post subject: |
|
|
Newbie
Joined: 21 Oct 2005 Posts: 7
|
Should I also code GMO_CONVERT on the PUT method or is that done automatically? I am using a SVRCONN channel so there is no data conversion on the channel. |
|
Back to top |
|
 |
wschutz |
Posted: Wed Dec 14, 2005 6:49 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
MQDeveloper wrote: |
Should I also code GMO_CONVERT on the PUT method or is that done automatically? I am using a SVRCONN channel so there is no data conversion on the channel. |
Well, that would have to be a PMO_CONVERT, and there is no such thing. The philosphy in MQ has always been "the receiver makes good".... _________________ -wayne |
|
Back to top |
|
 |
MQDeveloper |
Posted: Wed Dec 14, 2005 7:03 am Post subject: |
|
|
Newbie
Joined: 21 Oct 2005 Posts: 7
|
So is channel conversion necessary? I worked on a system several years ago using an older version of MQSeries going from Unix to a mainframe and we were required to use channel conversion.
Is this no longer necessary with newer verions of the product?
Thanks for answering all my questions and all your knowledge and expertise. |
|
Back to top |
|
 |
wschutz |
Posted: Wed Dec 14, 2005 7:25 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
I can't think of any situations where you need to use channel conversion anymore (but perhaps others will )
In the early days, MQ on distributed was provided by the ezBridge family of products. They didn't know how to convert messages, so if you were using a zOS qmgr to connect to them, you had the specify convert(yes) on the channel. _________________ -wayne |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Dec 14, 2005 7:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
wschutz wrote: |
I can't think of any situations where you need to use channel conversion anymore (but perhaps others will ) |
Where developers refuse to specify MQGMO_CONVERT, of course.
Why would they refuse? Because they're developers. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wschutz |
Posted: Wed Dec 14, 2005 8:02 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
jefflowrey wrote: |
Where developers refuse to specify MQGMO_CONVERT, of course.
Why would they refuse? Because they're developers. |
Well, you could FORCE GMO_CONVERT with an API crossing exit. _________________ -wayne |
|
Back to top |
|
 |
|