I have a procedure(function) in RPG that accepts two strings. One is the original string, the second a comparison string.
It returns a string that contains only the characters found in the comparison string. Use it all the time for just this thing.
Numeric = Txt_Scrb(yourfield:'0123456789');
Alpha = Txt_Scrb(yourfield:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefgh.....');
Greg
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Thomas Burrows
Sent: Wednesday, October 10, 2018 5:14 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Fwd: Question on %scan
If one has a field with values like
10QT
100QT
100 QT
The number part can be any length - okay something reasonable like less than 10K.
Can and/or cannot have a space in the field.
Then the start of alpha characters. Only the American 26 character alphabet. Upper or lower case.
Can I solve the problem of taking the numeric part and putting into another field by itself AND then putting the character part into an additional field. At the moment I do not think we need to convert the CASE on the alpha part.
=================================================
Or would this problem better be solved in COBOL using the INSPECT statement?
Open to sending a Home Depot Card of a reasonable amount of $$$ "say $40"
to anyone who can give me a quick solution.
The COBOL Kid - Actually Thomas
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.