Dear AS/400 Lovers!
I need to convert a string containing Numeric-value with two-decimal places into a "Numeric".
Alternatively the string may contain a minus-sign('-') in the beginning of the numeric-string(e.g. '-4321007.86').
The result should be pure numeric i.e. -4321007.86
The string's total length is 11-char, including minus-sign('-') & decimals.
I tried using %TRIM and then %DEC on it to convert the same, but iam not getting the desired/expected result.
Thanks a million in advance for your help.
Svanky.
Software/Hardware used:
AS/400, OS/400, RPGILE
ASKED:
June 30, 2010 2:51 PM
UPDATED:
July 5, 2010 10:15 PM
in COBOL, there is the intrinsic functions of NUMVAL and NUMVAL-C that will do the conversion for you in a single statement.
I tried using %TRIM and then %DEC on it to convert the same, but iam not getting the desired/expected result.
Have you solved your problem? Did the example work for you? If not, you need to show us how you tried to use %TRIM and %DEC. Without seeing your code, there is no way to help you correct the problem.
Tom