× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



In RPGIV, one would do the following (at least I would):
EVAL CHARAVAR2 = ALL'0'
EVAL WKCOUNT2 = 0
EVAL WKCOUNT1 = %LEN(CHARVAR1)
DOW WKCOUNT1 > 0
IF %SUBST(CHARVAR:WKCOUNT1:1) >= '0' and
    %SUBST(CHARVAR:WKCOUNT1:1) <= '9'
EVAL WKCOUNT2 = WKCOUNT2 + 1
EVAL %SUBST(CHARVAR2:WKCOUNT2:1) =
           %SUBST(CHARAVAR1:WKCOUNT1:1)
ENDIF
EVAL WKCOUNT1 = WKCOUNT1 - 1
ENDDO
MOVE CHARVAR2 NUMERIC1

CHARVAR1 and CHARVAR2 would be defined as alphnumeric and NUMERIC1 would be
9P2.

There are probably many ways to do this, including the use of arrays, but
this is how I, with my limited knowledge, would do it.  I didn't line up the
columns, but this should work.

Donald R. Fisher, III
Project Manager
The Roomstore Furniture Company
(804) 784-7600 ext. 2124
DFisher@roomstoreeast.com

<clip>
I have a character field (CHRG) that is 10 long. It contains formatted
dollar amounts. Example:  'bb2,205.00' (b = blank).
I want to convert that to a numeric field (FEE) that is 9,2 long. So when
I'm done, I have FEE = 000220500
What is the fastest easiest way to do this?
<clip>


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.