Q: Is there a string scanning facility similar to RPG's SCAN operation that I can use in CL programs?
A: What you're looking for is the QCLSCAN API, which is described in the in
IBM's InfoCenter at
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/qclscan.htm.
Herman Van der Staey and Clive Shergold posted some helpful source code
showing how to use QCLSCAN in the iSeries Network forums. That info is
located online at
http://www.iseriesnetwork.com/Forums/Thread.cfm?CFApp=55&Thread_ID=31191&mc=4#Message111372 .