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 » Difference between CAST and ASBITSTREAM

Post new topic  Reply to topic Goto page 1, 2  Next
 Difference between CAST and ASBITSTREAM « View previous topic :: View next topic » 
Author Message
ruchir123
PostPosted: Thu Feb 02, 2012 9:32 pm    Post subject: Difference between CAST and ASBITSTREAM Reply with quote

Acolyte

Joined: 04 Jan 2012
Posts: 58

Hi All,

I have a small doubt about working with CAST and ASBITSTREAM function

1. CAST(Variable as BLOB CCSID InputProperties.CodedCharSetId);

2. ASBITSTREAM(Variable CCSID InputProperties.CodedCharSetId);

Please tell if there is any basic difference between functionality of these two statements.

Thanks a ton in advance.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Feb 03, 2012 2:20 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Please read the documentation of both functions in the info center. If you cannot understand the difference after that, then please tell us exactly what you are confused about.
Back to top
View user's profile Send private message
ruchir123
PostPosted: Sun Feb 05, 2012 3:16 am    Post subject: Reply with quote

Acolyte

Joined: 04 Jan 2012
Posts: 58

Hi Kimbert,

Thanks for your response.

My confusion is both the statements will return BLOB for Variable. In that case is there any difference in both the BLOB.

Please tell.
Back to top
View user's profile Send private message
Esa
PostPosted: Sun Feb 05, 2012 7:45 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

ruchir123 wrote:
My confusion is both the statements will return BLOB for Variable. In that case is there any difference in both the BLOB.


Yes, they both return a BLOB. But take a closer look at the input variables and you may see the light...
Back to top
View user's profile Send private message
ruchir123
PostPosted: Sun Feb 05, 2012 9:44 pm    Post subject: Reply with quote

Acolyte

Joined: 04 Jan 2012
Posts: 58

Hi Esa,

Thanks for reply.

I think you are talking about, Asbitstream function only take FieldReference as input. But what i tried is i stored some string in an environment variable and then i gave as input for both the functions stated above.

If i am right then will there be any difference in the output for both the functions.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Feb 06, 2012 1:28 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
both the statements will return BLOB for Variable. In that case is there any difference
Yes, there is a difference. The two functions do different things. Read the info center to find out what each function does.
Back to top
View user's profile Send private message
ruchir123
PostPosted: Mon Feb 06, 2012 1:48 am    Post subject: Reply with quote

Acolyte

Joined: 04 Jan 2012
Posts: 58

Hi kimbert,

Thanks. I read the info center and what i could find out is

ASBITSTREAM returns a value of type BLOB that contains a bitstream representation of the field that is pointed to by FieldReference and its children BUT CAST transforms one from one data type into another.

i couldn't find the proper difference. Please
Back to top
View user's profile Send private message
adubya
PostPosted: Mon Feb 06, 2012 2:13 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

Quote:
pointed to by FieldReference and its children


We're getting there
Back to top
View user's profile Send private message Send e-mail
ruchir123
PostPosted: Mon Feb 06, 2012 2:25 am    Post subject: Reply with quote

Acolyte

Joined: 04 Jan 2012
Posts: 58

adubya thanks for reply. So in that case if i give Input as

Code:
SET Environment.test = '12345678';


and i give this Environment.test as input to both the functions then there will be no differnce.
Please tell.
Back to top
View user's profile Send private message
adubya
PostPosted: Mon Feb 06, 2012 2:27 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

Why don't you try it ? Experimentation is a great way to learn (that and reading the manual )
Back to top
View user's profile Send private message Send e-mail
ruchir123
PostPosted: Mon Feb 06, 2012 2:34 am    Post subject: Reply with quote

Acolyte

Joined: 04 Jan 2012
Posts: 58

Actually i tried , there is some differnce , but i couldn't find the real difference.

What i tried is i set my Environment.test = '000000000000000000000000'(24 zeros)

Then i used it as an input for both the functions.

Output for both the functions i provide as correlation id for MQMD.

For CAST function it accpeted but for ASBITSTREAM function it gave error saying not of required/proper length.

So i got confused where is the diff.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Feb 06, 2012 2:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

ruchir123 wrote:
So i got confused where is the diff.

It's very simple.

CAST works on values.

ASBITSTREAM works on trees.

That is to say, these are two separate functions because they do two separate things.

If they did THE SAME thing they would be THE SAME function.
Back to top
View user's profile Send private message
ruchir123
PostPosted: Mon Feb 06, 2012 3:28 am    Post subject: Reply with quote

Acolyte

Joined: 04 Jan 2012
Posts: 58

mqjeff thanks for your reply. i aggreed to your view. So in that case i shouldn't be getting error in the above scenario.
But i got.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Feb 06, 2012 3:35 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

ruchir123 wrote:
mqjeff thanks for your reply. i aggreed to your view. So in that case i shouldn't be getting error in the above scenario.
But i got.


I'm confused. How is Environment.test a message tree?

It's a single node with a single value.

It also doesn't have a parser associated with it.

It's also already a bitstream.
Back to top
View user's profile Send private message
ruchir123
PostPosted: Mon Feb 06, 2012 4:13 am    Post subject: Reply with quote

Acolyte

Joined: 04 Jan 2012
Posts: 58

yes it is not a message tree but a single value.

But we can provide such input to ASBITSTREAM function, right.

And it is not giving any error while converting it to BLOB which means it is converting it to BLOB.

So here the issue is if both are BLOB at the end, then whats the difference in both BLOBs.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Difference between CAST and 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.