×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




I'm not clear on how the dash is being used but if you just want to
move valid digits to another field then I would do something like the
following:

a =10;
newfield := *all'0';
for b = 10 downto 1;
if $subst(alphafield:b:1) >= '0' and %subst(alphafield:b:1) <= '9';
%subst(newfield:a:1) = %subst(alphafield:b:1);
a = a - 1;
endif;
endfor;


On Tue, Feb 7, 2012 at 9:54 AM, Willie J. Moore <WJMoore@xxxxxxxxxxxx> wrote:
We have a size field (alph) that is 10 characters long.  Data has been
entered like '123-098'or '12345-987'.  This file and field has been in
production for over 30 years.  Being free form, you have no idea what
has been entered. In fact I have found the following entered 'not to
big' in the size field!

What I need to do is scan the size field for an '-'.  Then do a move
specifying the starting and ending field position in to a new numeric
field.

The scan I have got down. What I am having problems with is the 'move'.
How do I move from the size field into to new size field with a starting
and ending position?



Thanks in advance for any and all suggesting and examples.



William Moore

California fine Wire, Co.

805-489-5144



--
This is the RPG programming on the IBM i / System i (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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.