%CHECK()
compare-value : data-to-search { : start-position }
First position in the searched-data that contains a character not in the list of the characters in the compare value.
%CHECKR()
compare-value : data-to-search { : start-position }
Last position in the searched-data that contains a character not in the list of the characters in the compare value. (Search begins with the right-most character and proceeds to the left. Basically does the same thing as %CHECK() but goes from right to left in the string data.
Example for %CHECK() and %CHECKR()
D $source S 20A
D $pos S 5U 0
/FREE
$source = 'AABC1ABD2AB3A';
$pos = %check ('ABCD' : %trim($source));
dsply $pos; //DSPLY 5
$pos = %check ('ABCD' : %trim($source) :6);
dsply $pos; //DSPLY 9
$pos = %checkr ('ABCD' : %trim($source));
dsply $pos; //DSPLY 12
$pos = %checkr ('ABCD' : %trim($source) : 11);
dsply $pos; //DSPLY 9
*inlr = *on;
/END-FREE
文章標籤
全站熱搜
