× 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.



How about this:

         Dou Pos = 0;                                    
           Pos = %CHECK('01234567890.':ChrIn);                   
           If Pos > 0;                                   
             ChrOut = %REPLACE('':ChrIn:Pos:1); 
           Endif;                                        
         Enddo;  
         EvalR ChrOut = %XLATE(' ':'0':ChrOut);




Francis Lapeyre
IS Dept. Programmer/Analyst
Stewart Enterprises, Inc.
Voice: (504) 729-1468 or (800) 257-1610, ext. 1468
FAX: (504) 729-1457
E-mail: flapeyre@xxxxxxxx 


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
jstevens@xxxxxxxxxxxxxx
Sent: Friday, November 03, 2006 3:52 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: using %replace to remove ',' from text field

I'm trying to remove the commas in a field using the folling code...

     D CHRIn           s             17a   INZ('1,100.70')
     D CHROut          s              5a
      /free
        DoW ChrIn <> 'QUIT';
            ChrOut = %replace('':ChrIN:1:%scan(',':ChrIN)+1  );
            DSPLY ChrOUT ' ' ChrIN;
        EndDo;
       *INLR = *On;
      /end-free 


And it Produces the following result...

 DSPLY  00.70    1,100.70 


But I want it to produce
DSPLY    1100.70     1,100.70


Can anyone see where I'm going wrong?


Thanks!

Jeff Stevens
Mize, Houser & Co. P.A.
913 451 1882
JStevens@xxxxxxxxxxxxxx

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.