|
You do NOT have to use MOVE to get a character value into a numeric field or vis versa. My RPG ToolKit (www.rpgiv.com/toolkit) uses an MI instruction to provide the CharToNum() function that works at V4R4 and alter levels. There are also a few other routines posted on the web to do the same thing (including one that I wrote). IBM can't do everything at once (although I wish they would <g>)) so you may either (A) have to create your own routines or (B) buy a 3rd party add-on library for RPG. So I don't see a problem here. Bob Cozzi Cozzi Consulting www.rpgiv.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Carel Teijgeler Sent: Saturday, August 16, 2003 10:54 AM To: rpg400-l@xxxxxxxxxxxx Subject: Re: Character to Numeric can it be cleaned up Hans, I know that. But I think the work was half done, as those BIFs only worked with values known at compile time (literals, constants) and not with values from fields in database files. So a statement like "Eval MyNumber = %DEC(MyCharacterField)" will not compile on V5R1 and older OS releases. This can be done at V5R2 (I hope). To get a numeric value in a character field into a numeric field you have to use MOVE. At V5R1 with /free at my disposal. (Joe Pluta's arguments are still standing!) So, I still consider those BIFs useless at those OS levels. I would have been better, if IBM had not introduced them at that time. Regards, Carel Teijgeler *********** REPLY SEPARATOR *********** On 16-8-03 at 9:37 Hans Boldt wrote: >> Unfortunately, %DEC is not fully matured on V5R1 and only accept values >> known at compilte time (read: hard coded values). This BIF is therefore rather useless at this OS level. >> >> And to think of it: this BIF (and its cousins) were developed to dump MOVE in /free. (sic!) > >Sorry for the nitpicking, but %DEC, %INT, %UNS, etc. were added to the language several releases before /FREE. _______________________________________________ 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-2025 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.