Extracting Only Numbers from String in AS400
5 pts.
0
Q:
Extracting Only Numbers from String in AS400
I have thousands of address records in AS400 and need to extract only the numbers from the records.

Example:
5770 South 900 West #2
and I want it to look like
57709002

Is there any way to do this in AS400? Thank you.
ASKED: Jan 7 2009  4:15 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
24610 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Yes an RPG/COBOL/JAVA program could do it

- the RPG routine might look something like this.

NumFld = blanks

For X = 1 to 80 <-- length of address field
StringChar = %subst(AddFld : X : 1);
if StringChar >= '0' and StringChar <= '9'
Eval NumFld = %Trim(NumFld) + StringChar
endif
EndFor
Last Answered: Jan 7 2009  4:41 PM GMT by Philpl1jb   24610 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0