|
Hi, I was trying to get some inputs on conversion of values from char/hex/dec to char/hex/decimal/binary etc thru RPG. Came across one of the interesting codes in ILE RPG. ---------------------------------------------------------------------------- ------------------------------------------- We need to convert a hexadacimal value in a decimal value. E.g. Hex 'C0' has to be convertet in '192'. Has anyone a code example how to do that? ---------------------------------------------------------------------------- ---- Chris Ringer12-21-1998, 12:54 AM For RPG IV: D IntDS DS D IntNum 5I 0 INZ(0) D IntChar 1 Overlay(IntNum:2) * C MOVE X'C0' IntChar Now, IntNum will contain 192. Chris. ---------------------------------------------------------------------------- -------------------------------------------- This one was the simplest n superb soln I could ever find for such conversions. But, not very well aware of OVERLAY keyword, so wondering how this might have returned a decimal value in 'IntNum'. Can anybody please help in getting this point ? Thanks and Regards, Gauri. http://www.patni.com World-Wide Partnerships. World-Class Solutions. _____________________________________________________________________ This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin@xxxxxxxxx and delete this mail. _____________________________________________________________________
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.