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 » Problems with CAST as decimal

Post new topic  Reply to topic
 Problems with CAST as decimal « View previous topic :: View next topic » 
Author Message
devil1998
PostPosted: Thu Apr 07, 2005 11:11 pm    Post subject: Problems with CAST as decimal Reply with quote

Novice

Joined: 07 Apr 2005
Posts: 17

Hi,

I have some problems with CAST as decimal.
I need to cast the input 1001.000 to 1001.0000 - that means I need 4 decimal places behind the decimal point.

My statement is:
'SET ref_productionOrder.quantiteLancee = CAST(CAST(ref_IDOCHeader.FEU_ECLIPSE_SAP_z2mak165loipro01_z2e1afkol000:GAMNG AS DECIMAL(7, 4)) AS CHAR);
The result is 'INFINITY'! Why? What means this?

My debugger said this:
Executing statement 'SET ref_productionOrder.quantiteLancee = CAST(CAST(ref_IDOCHeader.FEU_ECLIPSE_SAP_z2mak165loipro01_z2e1afkol000:GAMNG AS DECIMAL(7, 4)) AS CHARACTER);' at (.FEU_2004W44A_I001_MAK165ToGemenosOF_Compute.ProcessMapHeader, 10.3).
2005-04-08 09:00:09.984880 3596 UserTrace BIP2538I: Node 'Z2MAK165PRODORDGovernor.Mapping': Evaluating expression 'CAST(CAST(ref_IDOCHeader.FEU_ECLIPSE_SAP_z2mak165loipro01_z2e1afkol000:GAMNG AS DECIMAL(7, 4)) AS CHARACTER)' at (.FEU_2004W44A_I001_MAK165ToGemenosOF_Compute.ProcessMapHeader, 10.44).
2005-04-08 09:00:09.985260 3596 UserTrace BIP2538I: Node 'Z2MAK165PRODORDGovernor.Mapping': Evaluating expression 'CAST(ref_IDOCHeader.FEU_ECLIPSE_SAP_z2mak165loipro01_z2e1afkol000:GAMNG AS DECIMAL(7, 4))' at (.FEU_2004W44A_I001_MAK165ToGemenosOF_Compute.ProcessMapHeader, 10.50).
2005-04-08 09:00:09.985627 3596 UserTrace BIP2538I: Node 'Z2MAK165PRODORDGovernor.Mapping': Evaluating expression 'ref_IDOCHeader.FEU_ECLIPSE_SAP_z2mak165loipro01_z2e1afkol000:GAMNG' at (.FEU_2004W44A_I001_MAK165ToGemenosOF_Compute.ProcessMapHeader, 10.56).
2005-04-08 09:00:09.986035 3596 UserTrace BIP2539I: Node 'Z2MAK165PRODORDGovernor.Mapping': Finished evaluating expression 'CAST(ref_IDOCHeader.FEU_ECLIPSE_SAP_z2mak165loipro01_z2e1afkol000:GAMNG AS DECIMAL(7, 4))' at (.FEU_2004W44A_I001_MAK165ToGemenosOF_Compute.ProcessMapHeader, 10.50). This resolved to 'CAST('1001.100' AS DECIMAL(7, 4) )'. The result was 'INFINITY'.
2005-04-08 09:00:09.986462 3596 UserTrace BIP2539I: Node 'Z2MAK165PRODORDGovernor.Mapping': Finished evaluating expression 'CAST(CAST(ref_IDOCHeader.FEU_ECLIPSE_SAP_z2mak165loipro01_z2e1afkol000:GAMNG AS DECIMAL(7, 4)) AS CHARACTER)' at (.FEU_2004W44A_I001_MAK165ToGemenosOF_Compute.ProcessMapHeader, 10.44). This resolved to 'CAST(INFINITY AS CHARACTER )'. The result was ''INFINITY''.
2005-04-08 09:00:09.986925 3596 UserTrace BIP2566I: Node 'Z2MAK165PRODORDGovernor.Mapping': Assigning value ''INFINITY'' to field / variable 'ref_productionOrder.quantiteLancee'.

THANKS and REGARDS
devil
Back to top
View user's profile Send private message
chenulu
PostPosted: Fri Apr 08, 2005 12:03 pm    Post subject: Reply with quote

Voyager

Joined: 27 Mar 2002
Posts: 87
Location: Research Triangle Park, NC

Hi,

What version and CSD level are you at? If you are using v2.1 this is a known problem which is fixed in v5.0.

Alternately you can use the following workaround:

CAST DECIMAL to CHAR
TRIM LEADING ZEROS and
CAST CHAR TO DECIMAL.

Regards, Chenulu
Back to top
View user's profile Send private message Send e-mail
devil1998
PostPosted: Sat Apr 09, 2005 10:35 am    Post subject: Reply with quote

Novice

Joined: 07 Apr 2005
Posts: 17

Hi Chenulu,

I'm on version 5.0.4
I need the number as character because otherwise the message set will later cut the zeros behind the comma.

More help please???

thanks and regards
devil
Back to top
View user's profile Send private message
damianharvey
PostPosted: Mon May 16, 2005 3:22 pm    Post subject: Reply with quote

Acolyte

Joined: 05 Aug 2003
Posts: 59
Location: Sydney, Australia

I also had this problem when attempting to CAST('100000.00000' AS DECIMAL(7, 2)

This sort of makes sense in a weird "IBM" way as I'm essentially only taking the first 5 numbers as whole and then asking for 2 decimals.

Not surprisingly this was fixed with a CAST('100000.00000' AS DECIMAL(10, 3)

(And I'm on Message Broker v5 FP2)
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 » Problems with CAST as decimal
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.