Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

VERIFY( ) Verify strings

&pagelevel(3)&pagelevel

Domain: String functions

The VERIFY( ) function compares two strings and returns the position of the first character in the string (STRING) which is not contained in the search string (PATTERN). The number and the order of the characters in the two strings are ignored. The search direction can be freely selected; the returned position value is always with respect to the beginning of the first string.

Format

VERIFY( )

STRING = string_expression1

,PATTERN = string_expression2

,DIRECTION = *FORWARD / *REVERSE

Result type

INTEGER

Input parameters

STRING = string_expression1
Designates the compare string to be searched for characters which do not exist in the search string specified for PATTERN.

PATTERN = string_expression2
Designates the search string.

DIRECTION =
Designates the search direction.

DIRECTION = *FORWARD
The search starts at the beginning of string_expression1, i.e. string_expression1 is searched from left to right.

DIRECTION = *REVERSE
The search starts at the end of string_expression1, i.e. string_expression1 is searched from right to left.

Result

Positive integer which indicates the position of the first character in the compare string which is not contained in the search string.

0
All characters in the compare string are contained in the search string.

Error message

SDP0413     ILLEGAL LENGTH

Example 1

/A = '314!59'
/B = '0123456789'
/C = VERIFY(STRING = A, PATTERN = B)
/SHOW-VARIABLE C
C = 4

Example 2

A string is to be searched for the first non-blank character.

/A = 'xyz'
/B = VERIFY(STRING = A, PATTERN = ' ')
/SHOW-VARIABLE B
B = 1