VERIFYR Function

Purpose

Compares a string with a test string and verifies that all characters appearing in the string also appear in the test string. The verification is done from right to left.

Syntax

VERIFYR(s,c,[l])

Parameters

s and c are both either character-string or picture values. l is an optional expression that specifies the location within x where processing begins.

Description

The VERIFYR function compares a string s with a test string c and verifies that all characters appearing in the string also appear in the test string. The verification is done from right to left. If each of the characters in s occurs in c, the result is 0. If all of the characters in s do not occur in c, the result is a fixed-point binary integer that indicates the leftmost character in s that is not found in c. If only s is null, a 0 is returned. If only c is null, a 1 is returned. If both s and c are null, a 0 is returned.

l specifies the location within x where processing begins. Its default value is LENGTH(x)

Examples

VERIFYR('2a56b','0123456789')
/* returns the value 5 to indicate the first */
/* non-numeric character in the string '2a56b' */

Restrictions

None.