|
YES. Under V4R4 the %CHAR built-in function was implemented as it was originally requested. Prior to V4R4 %CHAR only converted date field values to character. Effectively the same function as the MOVEL opcode. Bob Cozzi www.rpgiv.com ----- Original Message ----- From: <bellis@ORIENTAL.COM> To: <RPG400-L@midrange.com> Sent: Wednesday, July 07, 1999 11:09 AM Subject: Re: EDTCDE(Z) in a alfa field > > > The %EDITC BIF works well for this type of application. > However, I'm not sure that the %CHAR would work. I know under V4R1 that %CHAR > is meant for converting only Date fields or Date Literals to Character > representation. > Has that been changed in later releases? > Thank you. > ____________________________________________________________________________ _______________________ > > > Silvio wrote: > >I have an integer (3,0) that I need to CONCAT with another field to send to the > screen as an >alfa field. > >When I do a MOVELVNT VALF, if my variable as the value "56" when it will > happens that the VALF >will > >have the "056" value. My question is how can I eliminate the "0" and therefore > have the value >"56 " in VALF ? > > If you are using ILE RPG, it's easy. On V3R7 or above, use > %TRIML(%EDITC(VNT:'Z')). On V4R4, it's even easier: %CHAR(VNT). > > If you're still using the old RPG, use CVTRPGSRC to convert your > program to RPG IV, then use one of the above techniques. > > If you really need to stick with the old RPG, then you could use > opcode CHECK to locate the first non-zero character, then SUBST > to get the actual digits. > > Cheers! Hans > > Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com > > > > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * This is the RPG/400 Discussion Mailing List! To submit a new * > * message, send your mail to "RPG400-L@midrange.com". To unsubscribe * > * from this list send email to MAJORDOMO@midrange.com and specify * > * 'unsubscribe RPG400-L' in the body of your message. Questions should * > * be directed to the list owner / operator: david@midrange.com * > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the RPG/400 Discussion Mailing List! To submit a new * * message, send your mail to "RPG400-L@midrange.com". To unsubscribe * * from this list send email to MAJORDOMO@midrange.com and specify * * 'unsubscribe RPG400-L' in the body of your message. Questions should * * be directed to the list owner / operator: david@midrange.com * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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.