LIKE -- Present on part of a value
To select character or graphic data when you only know part of a value,
use LIKE plus a symbol for the unknown data.
- An underscore (_) is the symbol for any single
character. Use more than one underscore in succession to represent an exact
number of missing characters in their specific location.
- A percent sign (%) is the symbol for any number
of characters, or none.
You can use both symbols in the same value.
You can only use LIKE with character or graphic data.
- For character data, you must always enclose the value after LIKE in single quotation marks. (MVS requires single quotation marks around
an all-digit value of character data.)
- For graphic data, you must always precede the value after LIKE by
the single-byte character "G."
[ Previous Page | Next Page | Contents | Index ]