|
If you want to remove the leading blanks, wrap the %EDITC() with a %TRIML(). Bob Cozzi Cozzi Consulting www.rpgiv.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bill Hopkins Sent: Thursday, August 14, 2003 12:04 PM To: RPG programming on the AS400 / iSeries Subject: Re: Character to Numeric can it be cleaned up Thanks Marco I'm starting to think it will only work at v5r2 :( What about this? Can any one see any problems? Just a quick test program. Num1and Num2 at 15S 0 is twice the size needed for any numeric coming in and CHAR at 70A is ok. D CHAR S 70 D NUM2 S 15 0 INZ(20) C C Evalr CHAR = '123456789' C MOVE CHAR NUM1 15 0 C Evalr CHAR = %editc((Num1 + Num2):'4') C MOVE *ON *INLR Result ' whole bunch of blanks right adjusted 123456809' Thanks Bill Hopkins Marco Facchinetti <facchinetti@xxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 08/14/2003 12:25 PM Please respond to RPG programming on the AS400 / iSeries To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc: Subject: Re: Character to Numeric can it be cleaned up This is working, but we are at V5R2: d t s 8 inz('12345678') c eval t=%char(%dec(t:%size(t):0)+1) c t dsply c eval *inlr=*on c return HTH Marco --- Bill Hopkins <BHopkins@xxxxxxxxxxxxxxxxxxx> wrote: > I was wondering if can I do this on v5r1 or am I stuck > with 'C' functions > and procedures (that do 50 times more than I need on > this). > > Eval CHAR1 = %editc((%dec(CHAR1) + > NUM1):'4') > > Just wanted to add a number to a character field with a > number in it and > no decimals in it's value. Result in character. > > Any suggestions > > Thanks > > Bill Hopkins > _______________________________________________ > 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. > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com _______________________________________________ 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. _______________________________________________ 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 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.