× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



/Free

// Probably close...
Start = %Scan('-' : OldStrField);
If Start > 0;
Length = %Len(OldStrField); // 10...you might want to %TrimR
If Length > 0 And
Start < Length;
Monitor;
NewNumField = %SubSt(OldStrField:StartLoc:Length);
On-Error;
DSPLY 'Error!';
EndMon;
EndIf;
EndIf;

So you'll need to find the start location (probably where the scan
found the dash + 1), and the length (probably the length of the string
minus the dash location). Then use the %SubSt BIF. Be careful that
you've actually found something, and it's not at the end.

On Tue, Feb 7, 2012 at 12:54 PM, 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-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.