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 » WebSphere Message Broker (ACE) Support » Convert Character to Blob

Post new topic  Reply to topic
 Convert Character to Blob « View previous topic :: View next topic » 
Author Message
rohank84
PostPosted: Wed Sep 15, 2010 5:35 am    Post subject: Convert Character to Blob Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

Hi Guys,

I need to convert a Character string to Blob.

I tried using ASBITSTREAM and it gave following error.

I tried doing this -
DECLARE Message BLOB;
DECLARE MessageBody CHARACTER;
SET Message = ASBITSTREAM(MessageBody OPTIONS options CCSID 1208);

It seems it does not expect a character input.

Error - "Illegal type for parameter '1' of the function 'ASBITSTREAM'. A non-list field reference is required. "

I there any way to convert character to blob.

I am using WMB 6.1.

Thanks in advance
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Sep 15, 2010 5:50 am    Post subject: Re: Convert Character to Blob Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

rohank84 wrote:
I need to convert a Character string to Blob.


Why?

rohank84 wrote:
It seems it does not expect a character input.


No it doesn't.

rohank84 wrote:
I there any way to convert character to blob.


You could cast it. It really depends why you feel you need to do this.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rohank84
PostPosted: Wed Sep 15, 2010 11:41 am    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

Hi Vitor,

Thanks for the reply.

The reason why i need this is because i am making an application where message body is not relevant and it should be a any alphanumeric characters of specific size.
The destination application where i am putting this message expects it as a BLOB and and I am setting this character string into BLOB.

SET MessageBody = '@@@@@@@@@';
SET OutputRoot.BLOB.BLOB = MessageBody;

And ofcourse this gives an error as you cannot do that.


I tried casting it but there seems no way to cast a CHARACTER to BLOB.

I know BLOB can take any inputs but the destination system expects a BLOB and I unfortunately i cant change that .
I can say this because i have made a sample application where i set BLOB and the destination system works ...

The message which i construct have a RFH2 header and the body. I tried putting RCD node and configured it to take BLOB domain and reset the message domain option.

When i try this the message which is played is crappy. It has the RFH2 header and Message Body but the destination system doesnt understand that the message has a RFH2 header and fails.

Do you feel the setting the MQMD format to MQRFH2 might help.



Thanks in advance


Last edited by rohank84 on Wed Sep 15, 2010 11:47 am; edited 1 time in total
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 15, 2010 11:43 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You use the CAST statement to CAST a CHARACTER to a BLOB.

As documented.

Happy Reading.
Back to top
View user's profile Send private message
rohank84
PostPosted: Wed Sep 15, 2010 11:51 am    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

Hi mqjeff,

I read the IBM docs but there seems no option to do that .... do you have a link which might help ...
I read this link

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak05610_.htm

and tried this

SET Message = CAST(MessageBody AS BLOB CCSID 1208);

But this gives an error
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Sep 15, 2010 12:03 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Tut. What is the error?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Sep 15, 2010 12:14 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

rohank84 wrote:
Hi mqjeff,

I read the IBM docs but there seems no option to do that .... do you have a link which might help ...
I read this link

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak05610_.htm

and tried this

SET Message = CAST(MessageBody AS BLOB CCSID 1208);

But this gives an error

MessageBody is a BAD choice of identifier for a Character variable.
See the default Tree identifiers in the infocenter.
Use something like mymsgtxt or anything else that does not map to a tree or a reference with children...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rohank84
PostPosted: Thu Sep 16, 2010 10:31 am    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

Hi Guys,

The casting thing worked. I did the same thing but broker seems to be not taking the change.
I changed the variable name as well.

Thanku guys for your time and help ...

Enjoy
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 » WebSphere Message Broker (ACE) Support » Convert Character to Blob
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.