Author |
Message
|
Sam12345 |
Posted: Thu Sep 11, 2003 5:31 am Post subject: MQGET format 'string' |
|
|
Novice
Joined: 11 Sep 2003 Posts: 15
|
I have been told I need to set my format type to 'string' on my MQGET. This is needed to convert the message from ascii to EBCDIC. However, I have gone through the manuals available to me and do not see how to do this. Can soemone just point me in the right direction? Thanks. |
|
Back to top |
|
 |
vmcgloin |
Posted: Thu Sep 11, 2003 5:56 am Post subject: |
|
|
Knight
Joined: 04 Apr 2002 Posts: 560 Location: Scotland
|
If you want to to a GET with Convert then you need the MQMD Format field of the recieved message to have a valid value i.e. the constant MQFMT_STRING or 'MQSTRbbb'. This will need setting in the application that sends the message.
From the Application Programming Guide section on Application Data conversion:
Quote: |
Application data is converted within an application program when the MQGMO_CONVERT option is specified in the Options field of the MQGMO structure passed to an MQGET call, and all of the following are true:
The CodedCharSetId or Encoding fields set in the MQMD structure associated with the message on the queue differ from the CodedCharSetId or Encoding fields set in the MQMD structure specified on the MQGET call.
The Format field in the MQMD structure associated with the message is not MQFMT_NONE.
The BufferLength specified on the MQGET call is not zero.
The message data length is not zero.
The queue manager supports conversion between the CodedCharSetId and Encoding fields specified in the MQMD structures associated with the message and the MQGET call. See WebSphere MQ Application Programming Reference for details of the coded character set identifiers and machine encodings supported.
The queue manager supports conversion of the message format. If the Format field of the MQMD structure associated with the message is one of the built-in formats, the queue manager is able to convert the message. If the Format is not one of the built-in formats, you need to write a data-conversion exit to convert the message. |
Hope that helps,
Vicky |
|
Back to top |
|
 |
zpat |
Posted: Fri Sep 12, 2003 12:40 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
It's really the MQPUT that sets the message format to MQSTR.
The MQGET with CONVERT will then convert to the local character set automatically.
It's a good idea to always set the format to MQSTR instead of allowing it to default. This makes messages more cross-platform compatible. |
|
Back to top |
|
 |
mrlinux |
Posted: Fri Sep 12, 2003 5:32 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Assuming there is no binary data in the message _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
Sam12345 |
Posted: Fri Sep 12, 2003 10:24 am Post subject: Thanks all for advice |
|
|
Novice
Joined: 11 Sep 2003 Posts: 15
|
I am still doing something wrong. I am using Perl to generate my MQPUTand the acutal code is below. The result is still not string format according to the recipient.
my $MsgDesc = {MQFMT_STRING}; # MQGet message descriptor
my $PutMsgOpts = {MQPMO_DEFAULT}; # Put message options
MQPUT($Hconn,
$Hobj_send,
$MsgDesc,
$PutMsgOpts,
$test_msg,
$CompCode,
$Reason);
Is my syntax wrong?
Any help greatly appreciated! |
|
Back to top |
|
 |
EddieA |
Posted: Fri Sep 12, 2003 11:31 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
I'm not a Perl person (so I may be a bit off base here), but the MQFMT_STRING is not the MsgDesc. It is just one field, MQMD_FORMAT within the MsgDesc.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
mrlinux |
Posted: Fri Sep 12, 2003 4:49 pm Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Change to this.
my $MsgDesc = {Format => MQFMT_STRING}; _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
Sam12345 |
Posted: Mon Sep 15, 2003 10:57 am Post subject: Fixed - Thank you Jeff |
|
|
Novice
Joined: 11 Sep 2003 Posts: 15
|
That fixed it. Thank you. |
|
Back to top |
|
 |
|