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 » Prooblem in Decimal Datatype

Post new topic  Reply to topic
 Prooblem in Decimal Datatype « View previous topic :: View next topic » 
Author Message
Balaji_P
PostPosted: Thu Sep 13, 2007 11:57 pm    Post subject: Prooblem in Decimal Datatype Reply with quote

Apprentice

Joined: 05 Sep 2006
Posts: 36
Location: Chennai

Hello all

I have a scenario where i am having a source side field with datatype(xsd:double) and i am mapping the field to target side which is of type decimal defined with precision(12,2).

In doing so, i am casting the field to decimal. I am able to see the exact value in debug i.e) if my source is 100.00 , i am able to see 100.00 but while wirting to queue it is cmng as 100.

Basically i am losing the deciaml point. i browsed the message in rfhutil and i am not bale to see the decimal point in the value.

any suggestion on this?
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Sep 14, 2007 1:33 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Which domain? If MRM, which physical format ( CWF / TDS / XML? )
Back to top
View user's profile Send private message
Balaji_P
PostPosted: Fri Sep 14, 2007 1:57 am    Post subject: Reply with quote

Apprentice

Joined: 05 Sep 2006
Posts: 36
Location: Chennai

Hi kimbert

My domain is MRM and my physical format is CWF1
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Sep 14, 2007 7:45 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Review the CWF settings for the element. You have probably specified a virtual decimal point.
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ad15380_.htm
Back to top
View user's profile Send private message
sri
PostPosted: Mon Mar 16, 2009 9:33 pm    Post subject: xsd:decimal - precision getting truncated when .00 Reply with quote

Apprentice

Joined: 14 Mar 2004
Posts: 32
Location: Chennai - India

Hi all

I too face the same problem of precision getting truncated when precision value is 0.

for example.

if the decimal field value is 24.89, it is coming correctly to the output queue. if the value is 24.00, in debug mode, i could see the field value as 24.00, but the same message when droped into the queue, it becomes 24.

.00 is getting truncated. But, as part of requirement i need to preserve the .00 also.

Iam using the MRM message set with XML parser.

field type is defined as xsd:decimal.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Mar 17, 2009 1:49 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Your problem is not the same as Balaji_P's. He is using CWF, whereas you are using MRM XML. The MRM XML parser does not allow you to control the output format of decimals. I suggest that you

- Change the data type of your element/attribute to xs:string
- Set the output value in your ESQL/Java. There are good facilities for parsing and writing numbers in both languages.
and
- Consider switching to XMLNSC if you are on v6.1 ( standard advice, nothing to do with this question )
Back to top
View user's profile Send private message
sri
PostPosted: Wed Mar 18, 2009 11:20 pm    Post subject: Reply with quote

Apprentice

Joined: 14 Mar 2004
Posts: 32
Location: Chennai - India

I have no option to change the field type to xsd:string.

I have tried the option of changing the mset to support xmlnsc and used xmlnsc instead of MRM, Still the parser trims off the zeros at the precision end. 2001.00 is getting converted to 2001.

If the domain is simple XML it is working as expected (2001.00 is coming out as 2001.00)

Is this the inbuilt feature of WMB to trim of the zeros at end of the precisions if the domain is MRM.
Back to top
View user's profile Send private message
MQEnthu
PostPosted: Thu Mar 19, 2009 12:14 am    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

sri wrote:
I have tried the option of changing the mset to support xmlnsc and used xmlnsc instead of MRM, Still the parser trims off the zeros at the precision end. 2001.00 is getting converted to 2001.


kimbert wrote:
Consider switching to XMLNSC if you are on v6.1 ( standard advice, nothing to do with this question )


He just suggested to use XMLNSC domain for parsing XML messages if you are on V6.1 broker.

Do not use XML domain it is deprecated..

There is no option to keep the zeros after decimal in MRM-XML and in XMLNSC (as you said it is not working for XMLNSC).. where as you can control this in MRM-TDS message..

You will have to change the datatype to String to get the desired result... I do not think you have any other choice..
_________________
-----------------------------------------------
It is good to remember the past,
but don't let past capture your future
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Mar 19, 2009 1:38 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I have no option to change the field type to xsd:string
Why not? Can't you simply edit the message definition and change the data type of this element/attribute?
Quote:
I have tried the option of changing the mset to support xmlnsc
That will change nothing. The runtime parser is selected by the input node properties, or by an RFH2 header. The message set 'Primary domain' property is only used by the toolkit. In any case, that advice was not intended to be a solution this problem.
Quote:
If the domain is simple XML it is working as expected (2001.00 is coming out as 2001.00)
That's because the (deprecated) XML domain treats *everything* as a string. So does the XMLNSC domain, unless you enable validation and ask it to build the tree with non-string data types.
So switching to XMLNSC might still be a useful thing to do.

Quote:
Is this the inbuilt feature of WMB to trim of the zeros at end of the precisions if the domain is MRM.
It is not 'trimming' anything. The MRM parser reads the string value and puts it into the message tree as an INTEGER. That INTEGER value needs to be converted back to a string when the message hits an output node. The MRM parser outputs a correct string representation of the INTEGER value. There is no setting to allow you to specify the minimum precision, because very few applications would care.
It sounds as if your receiving application is being rather fussy about trailing zeros.
Back to top
View user's profile Send private message
WMBEAI
PostPosted: Thu Mar 19, 2009 3:34 am    Post subject: Reply with quote

Acolyte

Joined: 02 Mar 2009
Posts: 66

I guess using pattern #0.00 should work.
If the application is so stringent we can write a xsl function to implement this logic.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Mar 19, 2009 3:57 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

WMBEAI: I'm confused. Are you working with Balaji_P, and trying to solve the same problem?

If your remarks were important, please post again with much more explanation.
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 » Prooblem in Decimal Datatype
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.