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 » REFERENCE to CHARACTER

Post new topic  Reply to topic Goto page 1, 2  Next
 REFERENCE to CHARACTER « View previous topic :: View next topic » 
Author Message
pdrabik
PostPosted: Wed Oct 03, 2007 4:25 am    Post subject: REFERENCE to CHARACTER Reply with quote

Apprentice

Joined: 29 Sep 2006
Posts: 31
Location: poland

Hello, Im trying put whole InputRoot scope into one reference, so as string (character).

by this code:

Code:

SET OutputRoot.XML.Body.Log = '' ;

WHILE I < J DO

EVAL('SET tmp = FIELDNAME(' || rootname || '.*[I]);');

WHILE II < JJ DO
            EVAL ('SET fname = FIELDNAME(' || rootname ||'.*[I].*[II]);');
            
            EVAL( 'SET fval = FIELDVALUE(' || rootname || '.*[I].*[II]);');

            SET OutputRoot.XML.Body.Log = OutputRoot.XML.Body.Log || tmp || ':' || fname || ':' || 'value' ||nl;
                              SET II = II + 1 ;


Where rootname is usual InputRoot.
This all works fine, it produces something like that:
Properties:MessageSet:value
Properties:MessageType:value ...etc

Yet, instead value it shoudl be the value of that field included.
But, while Im trying to concate this LOG reference with FVAL variable like this:
Code:
OutputRoot.XML.Body.Log = OutputRoot.XML.Body.Log || tmp || ':' || fname || ':' || fval ||nl;

it all crashes, with no error. Output looks like this then:
</Body>

What can be the issue ?

Ive been trying to CAST that fval to CHARACTER, no use. FIELDVALUE function either - the same effect (both: FIELDVALUE and CAST either).

Any suggestions ?

Regards
_________________
---

cc: poltreak@o2.pl
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
jefflowrey
PostPosted: Wed Oct 03, 2007 4:40 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You're going a long way down a complicated road that is a lot simpler to avoid entirely.

If you wish to convert an entire message to a string, then use asbitstream and cast the result to character.

If you wish to convert an entire message into a string that is formatted in a particular way, then create an MRM model of the formatted message, populate that, and then use asbitstream...

Do not use EVAL in places where {} is usable.

Don't use the XML domain, use XMLNS or XMLNSC.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
pdrabik
PostPosted: Thu Oct 04, 2007 9:41 am    Post subject: Reply with quote

Apprentice

Joined: 29 Sep 2006
Posts: 31
Location: poland

I dont know, somehow ASBITSTREAM and CAST gives me only BLOB
_________________
---

cc: poltreak@o2.pl
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
elvis_gn
PostPosted: Thu Oct 04, 2007 9:47 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi pdrabik,
pdrabik wrote:
I dont know, somehow ASBITSTREAM and CAST gives me only BLOB
Could you paste what you've tried with the ASBITSTREAM...

Regards.
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Thu Oct 04, 2007 2:53 pm    Post subject: Reply with quote

Grand High Poobah

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

pdrabik wrote:
I dont know, somehow ASBITSTREAM and CAST gives me only BLOB

Use ASBITSTREAM to get a BLOB. Use the BLOB to CAST to a CHARACTER...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
pdrabik
PostPosted: Thu Oct 04, 2007 10:47 pm    Post subject: Reply with quote

Apprentice

Joined: 29 Sep 2006
Posts: 31
Location: poland

do u have such a code on ur mind:
Code:

SET somevariable = CAST ( ASBITSTREAM(some_reference) AS CHARACTER)

??

should there be any specific options included with ASBITSTREAM ?
_________________
---

cc: poltreak@o2.pl
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
elvis_gn
PostPosted: Fri Oct 05, 2007 1:09 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi pdrabik,

http://www.mqseries.net/phpBB2/viewtopic.php?t=31346

Regards.
Back to top
View user's profile Send private message Send e-mail
pdrabik
PostPosted: Fri Oct 05, 2007 1:21 am    Post subject: Reply with quote

Apprentice

Joined: 29 Sep 2006
Posts: 31
Location: poland

so CCSID InputRoot.Properties.CodedCharSetId option should do the work.. i ll try though.. thx a lot.. i ll update
_________________
---

cc: poltreak@o2.pl
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
pdrabik
PostPosted: Mon Oct 08, 2007 10:15 pm    Post subject: Reply with quote

Apprentice

Joined: 29 Sep 2006
Posts: 31
Location: poland

Ok Ive analised this:
ydsk wrote:
Jeff,
Your last suggestion didn't work.
Since we can't modify Root structure in the database node I replaced the database node with a Compute node and inserted the same ESQL ( of course replacing Root with Input/Output Root, and ExceptionList with Input/Output Exceptionist as needed).

Then instead of copying ExceptionList into Environment ( as Environment too doesn't have a parser ) I copied it into OutputRoot as the last child as given below and it finally worked:

Create LASTCHILD of OutputRoot DOMAIN('XML') Name 'XML';
SET OutputRoot.XML.ExceptionList = InputExceptionList;
DECLARE EXCEPTIONBLOB BLOB ASBITSTREAM(OutputRoot.XML.ExceptionList);
DECLARE FULLEXCEPTION CHAR CAST(EXCEPTIONBLOB AS CHAR CCSID InputRoot.Properties.CodedCharSetId);

Thank you all for your inputs.


yeah and it worked for ExceptionList, thx ydsk .

However, why it doesnt work with InputRoot ?

Code:
CREATE LASTCHILD of OutputRoot DOMAIN('XML') Name 'Log2';
      SET OutputRoot.Log2.XML = rootname;
      DECLARE messageBlob BLOB ASBITSTREAM(rootname);
      DECLARE messageChar CHAR CAST(messageBlob AS CHAR CCSID InputRoot.Properties.CodedCharSetId);
      Set OutputRoot.Log2.XML = messageChar;

I know it dont work, because it is propagated to Failure terminal, with converter error for value "45.3". Propably from the timestamp. So why is so big problem with converting 45.3 to CHAR


Some option needed with ASBITSTREAM, more options for CAST ?
_________________
---

cc: poltreak@o2.pl


Last edited by pdrabik on Mon Oct 08, 2007 10:29 pm; edited 1 time in total
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
AkankshA
PostPosted: Mon Oct 08, 2007 10:28 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

Quote:
Some option needed with ASBITSTREAM, more options for CAST ?


not really

try
DECLARE messageChar CHAR
SET messageChar = CAST(messageBlob AS CHAR CCSID InputRoot.Properties.CodedCharSetId);

ensure that InputRoot.Properties.CodedCharSetId contains the right value

good luck..!
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
pdrabik
PostPosted: Mon Oct 08, 2007 10:30 pm    Post subject: Reply with quote

Apprentice

Joined: 29 Sep 2006
Posts: 31
Location: poland

I've discovered that is converting issue.

(previous post updated)
_________________
---

cc: poltreak@o2.pl
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
jefflowrey
PostPosted: Tue Oct 09, 2007 1:46 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

jefflowrey wrote:
Don't use the XML domain, use XMLNS or XMLNSC.

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
pdrabik
PostPosted: Tue Oct 09, 2007 6:04 am    Post subject: Reply with quote

Apprentice

Joined: 29 Sep 2006
Posts: 31
Location: poland

still dont work
_________________
---

cc: poltreak@o2.pl
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
jefflowrey
PostPosted: Tue Oct 09, 2007 6:09 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Well, that's not the specific problem. So, no, it doesn't solve the specific problem.

But it prevents lots and lots of other specific problems.

It's not clear what your input to the ASBITSTREAM is. So it's not clear where the conversion issue is coming from - it's also not clear if the exception is coming from ASBITSTREAM or CAST.

You almost certainly want to include Encoding on the CAST.

Post your current code.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
pdrabik
PostPosted: Tue Oct 09, 2007 6:26 am    Post subject: Reply with quote

Apprentice

Joined: 29 Sep 2006
Posts: 31
Location: poland

Input is from InputRoot. Can one past InputRoot for operations like ASBITSTREAM, CAST, MOVE, etc ? Or should it be something like
Set THISROOT = InputRoot, and work on THISROOT ?

And exception is from CAST.

It seems that it is conversion issue, as I mentioned before... cus in exception trace, there is mentioned :
Error while casting:
.converter_Compute.CopyEntireMessage
Text: '46.28'
... then...
Unconvertable character
Text: 'ff'
_________________
---

cc: poltreak@o2.pl
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
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 » REFERENCE to CHARACTER
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.