#include <lcstring.h> char *strscan(const char *str, const char *table);
strscan
scans a null-terminated string (str
) using a
translate table (table
). A translate table is an array of
256 bytes, one for each EBCDIC character. The scan terminates at the
first character in the string whose table entry is not 0. The entry for
the null character in the table (the first byte) should be nonzero to
avoid scanning past the end of the string.
str
is a pointer to the string to be scanned, and table
addresses the first byte (corresponding to the character '\0') of the
translate table. If any character in the string has a
nonzero table entry, then the scan terminates at the first such
character, and the address of that character is returned. If no
character in the string before the terminating-null character has a
nonzero table entry, the address of the null character is returned.
strscan
returns a pointer to the first character in the string
whose table entry is nonzero, or the address of the terminating-null
character if there is no such character and the table entry for '\0' is
nonzero.
str
argument is not null terminated,
strscan
may search indefinitely for a character with a nonzero table
entry. This may cause an 0C4 or 0C5 ABEND.
strscan
is implemented as a built-in function and uses the TRT
instruction to search for a character with a nonzero entry in the table.
Tables generated by the strscntb
function always define a nonzero
table entry for the null character.
strscntb
.
memscan
, strscntb
Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.