Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

WILDCARD( ) Search for pattern

&pagelevel(3)&pagelevel

Domain: String functions/test functions

The WILDCARD( ) function compares a string with a pattern string. The pattern string is subject to the general rules for patterns in BS2000 (“BS2000 wildcards (SDF syntax representation )” see the additional “with-wild” data type qualification on "SDF syntax representation "), or the general rules for patterns in POSIX (“POSIX wildcards (SDF syntax representation )” see the additional “with-wild” data type qualification on "SDF syntax representation ").

Format

WILDCARD( )

STRING = string_expression1

,PATTERN = string_expression2

,WILDCARD-MODE = *BS2000 / *POSIX

Result type

BOOLEAN

Input parameters

STRING = string_expression1
Designates the string to be checked.

PATTERN = string_expression2
Designates the pattern.

WILDCARD-MODE = *BS2000 / *POSIX
Specifies how wildcards are to be interpreted during replacement; either in the BS2000 wildcard syntax or in the POSIX wildcard syntax.

Result

TRUE
The checked string matches the pattern indicated in PATTERN.

FALSE
The checked string does not match the pattern indicated in PATTERN.

Error message

SDP0443  SYNTAX OF PATTERN IS NOT A CORRECT WILDCARD SYNTAX

Example

/A = 'This is the text to be checked. Search for umlauts.'
/B = 'ue'
/C = 'ae'
/D = WILDCARD(STRING = A, PATTERN = B)
/SHOW-VARIABLE D
D = FALSE
/B = '*ue*'
/D = WILDCARD(STRING = A, PATTERN = B)
SHOW-VARIABLE D
D = TRUE
/C = '*ae*'
/D = WILDCARD(STRING = A, PATTERN = C)
/SHOW-VARIABLE D
D = FALSE