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 » using ASBITSTREAM

Post new topic  Reply to topic
 using ASBITSTREAM « View previous topic :: View next topic » 
Author Message
karsusi
PostPosted: Sat Dec 26, 2009 11:15 pm    Post subject: using ASBITSTREAM Reply with quote

Newbie

Joined: 26 Dec 2009
Posts: 7

Hi,

I am using ASBITSTREAM to achieve RCD node's job. I want to get the message in BLOB format irrespective of any type message(xml,edifact etc.,).
I am using the below code. And when the message is parsed, the below code works fine. But if it is parsed then, im getting "INVALID WIRE FORMAT".
Could someone help me.
DECLARE vinCCSID INT InputProperties . CodedCharSetId;
DECLARE vinEncoding INT InputProperties . Encoding ;
DECLARE vinBitStream BLOB ASBITSTREAM ( InputRoot.MRM , vinEncoding , vinCCSID );
SET InputMsg = CAST ( vinBitStream . "BLOB" AS CHARACTER CCSID 1208 ENCODING vinEncoding );

Thanks in advance.
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Sun Dec 27, 2009 1:16 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Have you reated a physical wire format? As you are using the MRM parser then you will need to do that.
Also, InputBody might help you here. Take a look at the docs for this and what it means.

I oten read the message as a BLOB and convert/parse it later into MRM, XMLNSC or whatever format I need. PErhaps this is a solution to your problem?

Finally, a good tip for the future would be to put the ESQL inside
Code:
 esql
tags. It really helps readability.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Sun Dec 27, 2009 4:22 am    Post subject: Re: using ASBITSTREAM Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

I also dont think that you need the ."BLOB" on the vinBitStream variable:

karsusi wrote:
SET InputMsg = CAST ( vinBitStream . "BLOB" AS CHARACTER CCSID 1208 ENCODING vinEncoding );


Happy to be corrected though.
Back to top
View user's profile Send private message
karsusi
PostPosted: Thu Dec 31, 2009 5:26 am    Post subject: Reply with quote

Newbie

Joined: 26 Dec 2009
Posts: 7

Thanks shaman for the reply.

I achieved this by using BITSTREAM function. Earlier , I have used ASBITSTREAM to cast the parsed message to blob. But it is thrown an error since it is required propery structure. As I am parsing the message with MRM msgset, BITSTREAM is the perfect option.

Code :

SET Inputmsg = CAST(BITSTREAM(InputBody) AS CHARECTER CCSID 2208);
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Thu Dec 31, 2009 6:15 am    Post subject: Reply with quote

Grand High Poobah

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

karsusi wrote:
As I am parsing the message with MRM msgset, BITSTREAM is the perfect option.


No it isn't for a number of reasons. One of which is (as shown here) that function is depreciated. Which means one day in the foreseeable future this code will stop working when it's finally removed from the product.

You were right to be using ABITSTREAM, which does everything BITSTREAM does.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Thu Dec 31, 2009 12:45 pm    Post subject: Re: using ASBITSTREAM Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

karsusi wrote:
Code:
SET Inputmsg = CAST(BITSTREAM(InputBody) AS CHARECTER CCSID 2208);

That certainly doesn't work as-is. It's better to copy-paste directly from the ESQL when posting, to avoid introducing typos.

Vitor wrote:
You were right to be using ASBITSTREAM, which does everything BITSTREAM does.

I agree. Don't use BITSTREAM in new code; it's deprecated. Use ASBITSTREAM.
Back to top
View user's profile Send private message
servi
PostPosted: Mon Jan 04, 2010 12:21 am    Post subject: Reply with quote

Novice

Joined: 19 Mar 2008
Posts: 22
Location: Madrid, España

It's better read InputRoot.MQMD.CodedCharSetId (or InputPropeties) CCSID, than force encoding to 1208:

DECLARE Inputmsg CHARACTER;
DECLARE bSourceText BLOB ASBITSTREAM(InputBody);
-- OPTIONS iBSoptions CCSID InputRoot.MQMD.CodedCharSetId);
SET Inputmsg = CAST(bSourceText AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId);
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 » using ASBITSTREAM
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.