|
jstevens@xxxxxxxxxxxxxx wrote:
AHH!! Now that looks like it'll work. And, much cleaner than the Array method. Wayne, I didn't know that the CAT did a Right Justification? Jeff Stevens Mize, Houser & Co. P.A. 913 451 1882 JStevens@xxxxxxxxxxxxxxWayne McAlpine <wayne.mcalpine@xxxxxxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx02/08/2007 03:19 PM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To rpg400-l@xxxxxxxxxxxx cc Subject Re: RPG III You need a right-adjusted character field to move to your numeric field.If the number of digits can vary, you will need to get the length of the string of digits first. This code will do what you want:C ' ' CHEKRVAR10 LEN 40 C 10 SUB LEN L 40 C CAT VAR10:L VAR10R 10 C MOVE VAR10R VAR7 70Douglas Palme wrote:I am in the process of modifying an RPG III program that I am notpermittedto convert to ILE.One of the fields is a 10 character field that only contains numericnumbersand will never have more than seven digits..I know I could change thefieldlength to 7 but I was told no to that as well as it might blow up other programs.Here is the delimna, I need to move the value to a 7 digit numeric. Itispossible that it can have anywhere from 1 to seven digits. Example: '116769 ' - Charcter value I have a new field defined as 7,0When I do a move on it it shows up as 1167690 and a movel gives me7690000.Suggestions? Hints? Converting it is not an option. Douglas****************************************************************************This transmission may contain information that is privileged, Confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you.****************************************************************************
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.