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 IndexWebSphere Message Broker (ACE) Supportset MsgId as file name

Post new topicReply to topic
set MsgId as file name View previous topic :: View next topic
Author Message
sangminli
PostPosted: Tue Aug 31, 2010 12:29 am Post subject: set MsgId as file name Reply with quote

Voyager

Joined: 26 Aug 2008
Posts: 75
Location: Hangzhou, China

I have a requirement here that I need to set the MsgId as the file name.
but you know MsgId is BLOB. So how can I extract MsgId as chars?
Back to top
View user's profile Send private message MSN Messenger
kimbert
PostPosted: Tue Aug 31, 2010 1:05 am Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Use the CAST function.
Back to top
View user's profile Send private message
sangminli
PostPosted: Tue Aug 31, 2010 1:18 am Post subject: Reply with quote

Voyager

Joined: 26 Aug 2008
Posts: 75
Location: Hangzhou, China

kimbert wrote:
Use the CAST function.

i tried to use CAST, but it doesn't work well.
Say, if i want to use a msg whose MsgId is '414d5120424d534744345132202020204c59c2cd20c66a02', if I CAST it, the result is like 'AMQ BMSGD4Q2 LYÂÍ Æj', which is really not I want. What I want is a string '414d5120424d534744345132202020204c59c2cd20c66a02'.

so if i use CAST, which CCSID and Encoding should i use to keep the BLOB MsgId stay the same after the CAST?
Back to top
View user's profile Send private message MSN Messenger
sangminli
PostPosted: Tue Aug 31, 2010 3:05 am Post subject: Reply with quote

Voyager

Joined: 26 Aug 2008
Posts: 75
Location: Hangzhou, China

I just searched this forum and got a solution to my issue, the post is this: http://www.mqseries.net/phpBB2/viewtopic.php?p=228935&sid=2740ea80c088f07fc54f28ae2fd742b3

and the solution to my issue is:
DECLARE MsgId_str CHAR MsgId_str = SUBSTRING(CAST(InputRoot.MQMD.MsgId AS CHAR) FROM 3 FOR 4;

so you can just CAST the BLOB to CHAR by not specifying CCSID or ENCODING.
Back to top
View user's profile Send private message MSN Messenger
mqjeff
PostPosted: Tue Aug 31, 2010 3:08 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

sangminli wrote:
I just searched this forum and got a solution to my issue,


sangminli wrote:
so you can just CAST the BLOB to CHAR by not specifying CCSID or ENCODING.

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 IndexWebSphere Message Broker (ACE) Supportset MsgId as file name
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.