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 » MQGET format 'string'

Post new topic  Reply to topic
 MQGET format 'string' « View previous topic :: View next topic » 
Author Message
Sam12345
PostPosted: Thu Sep 11, 2003 5:31 am    Post subject: MQGET format 'string' Reply with quote

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
View user's profile Send private message
vmcgloin
PostPosted: Thu Sep 11, 2003 5:56 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Fri Sep 12, 2003 12:40 am    Post subject: Reply with quote

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
View user's profile Send private message
mrlinux
PostPosted: Fri Sep 12, 2003 5:32 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Sam12345
PostPosted: Fri Sep 12, 2003 10:24 am    Post subject: Thanks all for advice Reply with quote

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
View user's profile Send private message
EddieA
PostPosted: Fri Sep 12, 2003 11:31 am    Post subject: Reply with quote

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
View user's profile Send private message
mrlinux
PostPosted: Fri Sep 12, 2003 4:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Sam12345
PostPosted: Mon Sep 15, 2003 10:57 am    Post subject: Fixed - Thank you Jeff Reply with quote

Novice

Joined: 11 Sep 2003
Posts: 15

That fixed it. Thank you.
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 » MQGET format 'string'
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.