Search for text within a string in CL/400
Wath function can I use to find a text into other? I mean how caon I find the Position for -B- in the text -AABAA-

Software/Hardware used:
ASKED: December 11, 2008  12:28 AM
UPDATED: December 11, 2008  8:15 PM

Answer Wiki:
Not sure if their is a function but here's some code to do it DCL &pos DEC (3 0) loop; chgvar &pos 1 if (%substring(&myvar &pos 1) = 'B') then do... enddo else chg var &pos (&pos + 1) if (&pos < 10) goto loop
Last Wiki Answer Submitted:  December 11, 2008  2:11 pm  by  philpl1jb   44,630 pts.
All Answer Wiki Contributors:  philpl1jb   44,630 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _