Previous Topic: Syntax DiagramsNext Topic: Commands


Masking

You use masking when you want to display all records with names that share common characters. You can include masking characters anywhere in a search string.

Some commands accept a generic mask. The mask can contain one or more asterisks, one or more question marks, or both all in any position in the mask.

An asterisk matches any number of characters, including zero characters. A question mark matches only a single nonblank character.

The following table provides examples of masks, and shows data strings that would qualify as matches and not matching for each:

Mask

Strings that match

Strings that do not match

*

Everything

Nothing

ABC*

ABC
ABCC
ABCXYZ

AB
ABXC

*ABC

ABC
AABC
XYZABC

ABCD

AB?

ABC
ABD

ABCD
AB

A*B

AB
AXXB

ABC

*ABC*

ABC
ABCD
XABC
XABCD

ABXC

A??B

AXXB
ABBB

AB
ABB

A*B*C

ABC
AABBCC

ACB
AC

Wildcard characters can be in any position, including the first. Know that having the first character a wildcard can slow down the first display. The entire file is sometimes read before the display starts.

In general, the longer the initial string of characters that are not wildcards, the faster the initial display is. In other words, ABC* usually displays faster than A*.