Author |
Message
|
kunal07 |
Posted: Tue Nov 26, 2013 5:46 am Post subject: Decimal removal from Incoming Message |
|
|
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 |
|
 |
smdavies99 |
Posted: Tue Nov 26, 2013 6:03 am Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Tue Nov 26, 2013 6:12 am Post subject: |
|
|
 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 |
|
 |
kunal07 |
Posted: Tue Nov 26, 2013 6:23 am Post subject: |
|
|
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 |
|
 |
smdavies99 |
Posted: Tue Nov 26, 2013 6:32 am Post subject: |
|
|
 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 |
|
 |
kunal07 |
Posted: Tue Nov 26, 2013 6:38 am Post subject: |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
Code: |
DECLARE SPOrderQty CHARACTER;
DECLARE SPOrderQty1 CHARACTER;
|
Incoming value is 500.00 |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Nov 26, 2013 10:09 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Tue Nov 26, 2013 10:22 am Post subject: |
|
|
 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 |
|
 |
kimbert |
Posted: Tue Nov 26, 2013 2:13 pm Post subject: |
|
|
 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 |
|
 |
|