Find characters within a variable.
Written by Bruce Vining
Last month, in "A CL-Based Implementation of RPG Built-in %Check," we built the command Check Characters (CHKCHR). The CHKCHR command returns the position of the first character within a CL variable that is not found within a list of valid values. Based on reader requests, this month we'll look at how to implement a Scan Characters (SCNCHR) command. The SCNCHR command will return the position of the first character within a CL variable that is found in a list of valid values.