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 » TDS:Compute node

Post new topic  Reply to topic
 TDS:Compute node « View previous topic :: View next topic » 
Author Message
nicojvr
PostPosted: Mon Jun 23, 2003 2:03 am    Post subject: TDS:Compute node Reply with quote

Apprentice

Joined: 04 Jun 2003
Posts: 45

Hi all,
here's the scenario
I get a message into an input node. I then pass it to a compute node and
want to do some text manipulation.

the message comes in in Tagged/ Delimited format with one element(UNB).
I am trying to get the message into a string

Code:
SET outputString = "InputBody"."UNB"[0];
SET OutputRoot = outputString;


I get an exception Output message contains no data.

Please help

thanks

Nico
Back to top
View user's profile Send private message
Craig B
PostPosted: Mon Jun 23, 2003 2:25 am    Post subject: Reply with quote

Partisan

Joined: 18 Jun 2003
Posts: 316
Location: UK

Hi,

The outputString is a scalar variable and therefore only represents a single variable and not a subtree. When you do the assignment SET outputString = "InputBody"."UNB"[0]; then you are just copying the value of this single field to the variable outputString and not the subtree it represents. Therefore when you SET OutputRoot = outputString; then you are copying a single value to OutputRoot. This will set the root node value of the OutputRoot message tree to the value in the scalar variable. When building an output message then it is normal practice to create fields in the message body folder such as OutputRoot.MRM, OutputRoot.XML etc. Once again it is unusual to set the values of these folders and you would set the value of these folders, normally fields would be created under these such as SET OutputRoot.MRM.field1 = outputString;.

If you intended to copy a subtree with SET outputString = InputBody.UNB[0], then left hand side of the expression needs to be modifiable tree. In this case you could do something like SET Environment.Variables.mySubTree = InputRoot.UNB[0]; and then compliment that later with SET OuptutRoot.MRM.mySubTree = Environment.Variables.mySubtree; etc.

It should also be noted that in field references indexing starts at 1 not 0, there InputBody.UNB[0] will cause problems in itself.
_________________
Regards
Craig
Back to top
View user's profile Send private message
nicojvr
PostPosted: Mon Jun 23, 2003 2:50 am    Post subject: Reply with quote

Apprentice

Joined: 04 Jun 2003
Posts: 45

So how do I copy the entire input mrm into a String ?
Back to top
View user's profile Send private message
Craig B
PostPosted: Mon Jun 23, 2003 2:54 am    Post subject: Reply with quote

Partisan

Joined: 18 Jun 2003
Posts: 316
Location: UK

It depends on what you mean by Copy the whole MRM input into a string? The whole point of the message tree is to give the user access to their message information in a hierarchy of fields. Are you saying that you want to access the incoming message as-is in a text format? It would be helpful if you uexplained what you are trying to do by giving a brief example.
_________________
Regards
Craig
Back to top
View user's profile Send private message
nicojvr
PostPosted: Mon Jun 23, 2003 3:19 am    Post subject: Reply with quote

Apprentice

Joined: 04 Jun 2003
Posts: 45

I'm sorry i was trying to do something the stupid way around.
New question same topic:

if my input is a BLOB. how do I get the entire BLOB into a String ?

thanks

Nico

apologies again..
Back to top
View user's profile Send private message
Craig B
PostPosted: Mon Jun 23, 2003 3:25 am    Post subject: Reply with quote

Partisan

Joined: 18 Jun 2003
Posts: 316
Location: UK

Code:

DECLARE myChar CHAR;
DECLARE myMsg BLOB BITSTREAM( InputRoot."BLOB"."BLOB" );
SET myChar = CAST( myMsg CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding );

_________________
Regards
Craig
Back to top
View user's profile Send private message
Craig B
PostPosted: Mon Jun 23, 2003 3:29 am    Post subject: Reply with quote

Partisan

Joined: 18 Jun 2003
Posts: 316
Location: UK

You can tell Im not awake this morning. In the previous example, you dont need to use the Bitstream function since if your message is already in the BLOB domain then it is already a BLOB. Therefore in this case, the following will work :

Code:

DECLARE myChar CHAR;
SET myChar = CAST( InputRoot."BLOB"."BLOB" CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding );


Or to make it more efficient by doing the assignment on the declaration step

Code:

DECLARE myChar CHAR CAST( InputRoot."BLOB"."BLOB" CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding );

_________________
Regards
Craig
Back to top
View user's profile Send private message
nicojvr
PostPosted: Mon Jun 23, 2003 3:31 am    Post subject: Reply with quote

Apprentice

Joined: 04 Jun 2003
Posts: 45

thanks !

Nico
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 » TDS:Compute node
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.