Elena -

This is a known bug in the current .NET support pac.  What is happening is
that by default the MQQueue class attempts to get the message with a 1 byte
buffer.  This of course fails (unless you just happen to be passing a 1 or 0
byte message!!) with a truncation failure.  The class then resizes its
internal buffer and retries the MQGET call, and since the buffer is now
large enough the message is retrieved.  (BTW, the ActiveX classes do the
same thing, but they start with a 2K buffer).

The problem with the .NET classes is that after the first MQGET call the
MQMD-CCSID field has been updated with the value from the message - which is
the value from the mainframe queue manager.  When the second call is made,
this field is not reinitialized.  This tells MQ to convert the data into the
code page from the mainframe.  Since the data is already in this code page,
no conversion takes place.

One way to work around this problem is to instruct the class to use a bigger
default buffer size.  You do this on the put method.  For example, to use a
5000 byte buffer in VB.NET code the following

          myQueue.Get(myMsg, myGMO, 5000)

This does, however, require you to know what the largest size message will
be.

>Steve Gies
Safeco Insurance
IT Specialist - WebSphere MQ



-----Original Message-----
From: Elena Nanos [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 8:23 AM
To: [EMAIL PROTECTED]
Subject: Data conversion with MA7P using .NET application


Hello,
we are using Support pack MA7P - WebSphere MQ classes for Microsoft .NET,
which allows MQ  to be invoked from Microsoft .NET applications.

We ran into a problem with data conversion.  The data coming from mainframe
going to distributed, is not being converted to ASCII.

Is any one else using this support pack and can share the experience with
us?

Thank you.

Elena Nanos
Sr. Software and System Architect
IBM Certified Solution Expert in CICS WEB Enablement and MQSeries Zurich NA

******************* PLEASE NOTE *******************
This E-Mail/telefax message and any documents accompanying this transmission
may contain privileged and/or confidential information and is intended
solely for the addressee(s) named above.  If you are not the intended
addressee/recipient, you are hereby notified that any use of, disclosure,
copying, distribution, or reliance on the contents of this E-Mail/telefax
information is strictly prohibited and may result in legal action against
you. Please reply to the sender advising of the error in transmission and
immediately delete/destroy the message and any accompanying documents.
Thank you.

Instructions for managing your mailing list subscription are provided in the
Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

Reply via email to