|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQSI MRM and LOW VALUES |
« View previous topic :: View next topic » |
Author |
Message
|
jrannis |
Posted: Thu Mar 07, 2002 2:37 pm Post subject: |
|
|
Novice
Joined: 04 Nov 2001 Posts: 10 Location: Waterloo Ontario
|
Is there a way to fill an MRM string with all low values, that is, HEX ZEROS without using the padding rule of NUL.
The following does not work, but it might give you an idea of what I trying to accomplish:
SET OutputRoot.MRM.testnumber = COALESCE(InputRoot.XML.testnumber, X'0000000000')
where MRM.testnumber is defined as STRING LENGTH 5, right justified PAD ZERO.
Essentially, if I get a <testnumber> element in my XML I want to send it right justified padded with leading zeros.
If I don't get a <testnumber> element in my XML I still must assign something to the MRM.testnumber, and we want it to be low-values.
This is my attempt at implementing something that mimics conditional padding which does not exist in the product (that I know of!)
The error I get from this is that I'm trying to assign a BLOB to a STRING field.
Any help would be great!
Thanks,
Jason. |
|
Back to top |
|
 |
kirani |
Posted: Thu Mar 07, 2002 2:55 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
What version of WMQI are you using? You can assign default valie to MRM fields in WMQI 2.1
Why do you want to assign a numeric value to STRING data type? If you are not going to receive any char type data into XML.testnumber then You could define MRM.testnumber as Integer (Extended decimal) of length 5 (right justify). I think all numberic fields are padded by 0 by default. Use following ESQL in your compute node,
IF (InputRoot.XML.testnumber IS NOT NULL ) THEN
SET OutputRoot.MRM.testnumber = CAST (InputRoot.XML.testnumber as INT);
ELSE
SET OutputRoot.MRM.testnumber = 0;
END IF;
This may solve your problem.
Regards,
Kiran
|
|
Back to top |
|
 |
jrannis |
Posted: Fri Mar 08, 2002 5:13 am Post subject: |
|
|
Novice
Joined: 04 Nov 2001 Posts: 10 Location: Waterloo Ontario
|
Thanks Kiran!
Were still on MQSI v2.0.1.2
The reason I'm assigning a numeric value to a string is because we want to indicate in the MRM that a certain element in the XML did not arrive. We don't simply want to assign zero because zero could be the value.
By making it STRING we have the option of assigning it LOW-VALUES or the actual value right justified padded with zeros (which looks numeric).
You cannot assign a NULL value to a numeric element.
In short, it is a NULL indicators without having to having a seperate MRM elements to indicate this.
Regards,
Jason.
|
|
Back to top |
|
 |
pchan |
Posted: Tue Apr 22, 2003 7:50 am Post subject: |
|
|
Newbie
Joined: 20 Feb 2002 Posts: 3
|
Jason,
We're trying to do something similar.
Wondering if you've found a solution to your problem. Any help is appreciated. Thanks.
Perry |
|
Back to top |
|
 |
kirani |
Posted: Tue Apr 22, 2003 9:57 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Perry,
Try this:
a) set Padding char to NUL for your MRM string element.
b) Use following ESQL code:
Code: |
SET OutputRoot.MRM.testnumber = COALESCE(InputRoot.XML.testnumber,'')
|
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|