1,955 pts.
 Numeric string in Character field with commas
I have a character field with value '9,405.000000'. I want to convert it to numeric. But the ',' is causing issue in %Dec. . How can I get the value 9405.000000 in a numeric field?

Software/Hardware used:
AS400
ASKED: October 18, 2012  9:30 AM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question. RamvishakRamesh   1,955 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Did you try to search at all for a solution? An answer was given in the forum just a week ago. — Tom

 108,135 pts.

 

 

I use %xlate inside %dec so the decimal can float.  This replaces commas with spaces that are ignored by %dec
MyNumField = %DEC(%XLATE(‘,’:’ ‘:MyCharField):15:5)

 3,115 pts.

 

Search for Bob Cozzi’s CharToNum procedure.  Works great.  He even includes the source code in the posting.

 5,525 pts.