MEMVERIFY
MEMVERIFY returns a size_t 1 value that specifies the position in a buffer of the first (from the left) character, graphic, uchar, or widechar that is not in a specified string.
- p
- Address of buffer to be searched.
- n
- Length of buffer to be searched.
- x
- String-expression.
The buffer length must be nonnegative and must have a computational type. The buffer length is converted to type size_t.
The string-expression x must have type CHARACTER (including PICTURE), GRAPHIC, UCHAR, or WIDECHAR. The buffer length is interpreted as the number of units of that string type.
The address p and the length n specify the "string" in which to search for any character, graphic, uchar, or widechar that does not appear in x.
If either the buffer length n is zero or x is the null string, the result is zero.
If all the characters, graphics, uchars, or widechars in the buffer do appear in x, the result is zero.
Example
dcl cb(128*1024) char(1);
dcl wb(128*1024) widechar(1);
dcl pos fixed bin(31);
/* 128K bytes searched from the left for a non-numeric */
pos = memverify( addr(cb), stg(cb), '012345789' );
/* 256K bytes searched from the left for the a non-blank widechar */
pos = memverify( addr(wb), stg(wb), '0020'wx );