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 » Decimal removal from Incoming Message

Post new topic  Reply to topic
 Decimal removal from Incoming Message « View previous topic :: View next topic » 
Author Message
kunal07
PostPosted: Tue Nov 26, 2013 5:46 am    Post subject: Decimal removal from Incoming Message Reply with quote

Acolyte

Joined: 05 Dec 2012
Posts: 72

Hi All,

i need urgent help on this, i have to modify my incoming Decimal value to integer.
Code:
<OrderQty>6000.000</OrderQty>


i need output in only this format
Code:
<OrderQty>6000</OrderQty>


can any one plz help.....
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Nov 26, 2013 6:03 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

1) Search for the presence of a '.' character in the string
2) substring from position 1 to the position of the '.' (less 1)

That is how to do it. I'll leave the details of the exact bits of ESQL you need to use to your experience.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Nov 26, 2013 6:12 am    Post subject: Reply with quote

Grand High Poobah

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

Or Cast the Decimal to an Integer ?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kunal07
PostPosted: Tue Nov 26, 2013 6:23 am    Post subject: Reply with quote

Acolyte

Joined: 05 Dec 2012
Posts: 72

@fjb_saper: that is giving error.
Code:
SET OrderQty = CAST(SPOrderQty AS DECIMAL);
SET OrderQty1 = CAST(SPOrderQty AS INTEGER);


this is giving error,
Exception list :
Code:

ExceptionList
   RecoverableException
         File:CHARACTER:/build/slot1/S800_P/src/DataFlowEngine/ImbDataFlowNode.cpp
         Line:INTEGER:1154
         Function:CHARACTER:ImbDataFlowNode::createExceptionList
         Type:CHARACTER:ComIbmMQInputNode
         Name:CHARACTER:SAP_SPALLOCATION_TO_ECV_MF#FCMComposite_1_1
         Label:CHARACTER:SAP_SPALLOCATION_TO_ECV_MF.MQ Input
         Catalog:CHARACTER:BIPmsgs
         Severity:INTEGER:3
         Number:INTEGER:2230
         Text:CHARACTER:Node throwing exception
         RecoverableException
               File:CHARACTER:/build/slot1/S800_P/src/DataFlowEngine/ImbComputeNode.cpp
               Line:INTEGER:497
               Function:CHARACTER:ImbComputeNode::evaluate
               Type:CHARACTER:ComIbmComputeNode
               Name:CHARACTER:SAP_SPALLOCATION_TO_ECV_MF#FCMComposite_1_2
               Label:CHARACTER:SAP_SPALLOCATION_TO_ECV_MF.Compute
               Catalog:CHARACTER:BIPmsgs
               Severity:INTEGER:3
               Number:INTEGER:2230
               Text:CHARACTER:Caught exception and rethrowing
               RecoverableException
                     File:CHARACTER:/build/slot1/S800_P/src/DataFlowEngine/ImbRdl/ImbRdlStatementGroup.cpp
                     Line:INTEGER:666
                     Function:CHARACTER:SqlStatementGroup::execute
                     Type:CHARACTER:
                     Name:CHARACTER:
                     Label:CHARACTER:
                     Catalog:CHARACTER:BIPmsgs
                     Severity:INTEGER:3
                     Number:INTEGER:2488
                     Text:CHARACTER:Error detected, rethrowing
                     Insert
                           Type:INTEGER:5
                           Text:CHARACTER:.SAP_SPALLOCATION_TO_ECV_MF_Compute.Main
                     Insert
                           Type:INTEGER:5
                           Text:CHARACTER:41.4
                     Insert
                           Type:INTEGER:5
                           Text:CHARACTER:SET SPOrderQty1 = CAST(SPOrderQty AS INTEGER);
                     RecoverableException
                           File:CHARACTER:/build/slot1/S800_P/src/DataFlowEngine/ImbRdl/ImbRdlTypeCast.cpp
                           Line:INTEGER:350
                           Function:CHARACTER:SqlTypeCast::evaluate
                           Type:CHARACTER:
                           Name:CHARACTER:
                           Label:CHARACTER:
                           Catalog:CHARACTER:BIPmsgs
                           Severity:INTEGER:3
                           Number:INTEGER:2521
                           Text:CHARACTER:Error casting from %3 to %4
                           Insert
                                 Type:INTEGER:5
                                 Text:CHARACTER:.SAP_SPALLOCATION_TO_ECV_MF_Compute.Main
                           Insert
                                 Type:INTEGER:5
                                 Text:CHARACTER:41.22
                           Insert
                                 Type:INTEGER:5
                                 Text:CHARACTER:'505.000'
                           Insert
                                 Type:INTEGER:5
                                 Text:CHARACTER:INTEGER
                           ConversionException
                                 File:CHARACTER:/build/slot1/S800_P/src/CommonServices/ImbUtility.cpp
                                 Line:INTEGER:471
                                 Function:CHARACTER:imbWcsToInt64
                                 Type:CHARACTER:
                                 Name:CHARACTER:
                                 Label:CHARACTER:
                                 Catalog:CHARACTER:BIPmsgs
                                 Severity:INTEGER:3
                                 Number:INTEGER:2595
                                 Text:CHARACTER:Invalid characters
                                 Insert
                                       Type:INTEGER:2
                                       Text:CHARACTER:-1
                                 Insert
                                       Type:INTEGER:5
                                       Text:CHARACTER:S22018
                                 Insert
                                       Type:INTEGER:5
                                       Text:CHARACTER:505.000
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Nov 26, 2013 6:32 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

What is the datatype of your input?

If it is a character then my suggestion will work.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
kunal07
PostPosted: Tue Nov 26, 2013 6:38 am    Post subject: Reply with quote

Acolyte

Joined: 05 Dec 2012
Posts: 72

Code:

DECLARE SPOrderQty  CHARACTER;
DECLARE SPOrderQty1 CHARACTER;



Incoming value is 500.00
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Nov 26, 2013 10:09 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

smdavies99 wrote:

What is the datatype of your input?


_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Nov 26, 2013 10:22 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kunal07 wrote:
Code:

DECLARE SPOrderQty  CHARACTER;
DECLARE SPOrderQty1 CHARACTER;



Incoming value is 500.00


Have you considered a) using a FORMAT in the CAST & b) use the suggestion of my worthy associate?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Nov 26, 2013 2:13 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I would vote for a) - use CAST with a FORMAT clause.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
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 » Decimal removal from Incoming Message
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.