When selecting files with wild-card characters, the following railroad diagrams are used for <usercode> and <name> in place of those defined in Basic Constructs.
<usercode>
──┬─<unquoted name>─┬──────────────────────────────────────────────────┤ └─<quoted name>───┘
<name>
──┬─<unquoted name>───────────┬────────────────────────────────────────┤ ├─────┬─<quoted name>─┬─────┤ └─ = ─┘ └─ = ─┘
<unquoted name>
──┬─────────┬─┬─<digit>──────────────┬─────────────────────────────────► ├─ = ─────┤ ├─<letter>─────────────┤ └─<tilde>─┘ ├─ ? ──────────────────┤ └─<bracket expression>─┘ ►─┬─────────────────────────────────────┬──────────────────────────────┤ │ ┌◄────────────────────────────────┐ │ └─┴─┬─/16\─┬─<digit>──────────────┬─┴─┘ │ ├─<letter>─────────────┤ │ ├─<hyphen>─────────────┤ │ ├─<underscore>─────────┤ │ ├─ ? ──────────────────┤ │ └─<bracket expression>─┤ ├─ = ─────────────────────────┤ └─<tilde>─────────────────────┘
<quoted name>
┌◄───────────────────────────────────────┐ ── " ─┴─┬─/17\─┬─<nonquote EBCDIC character>─┬─┴─ " ───────────────────┤ │ ├─ ? ─────────────────────────┤ │ └─<quoted bracket expression>─┤ ├─ = ────────────────────────────────┤ └─<tilde>────────────────────────────┘
Explanation
When only part of a file name is known, wild-card characters provide a good method for searching through file names.
When files have been organized and named with groups or subdirectories in mind, searching for similarly grouped files is easier because part of each file name is the same. Wild-card characters are useful for finding similarly grouped files.
The wild-card characters that follow provide a flexible and easy method for selecting files.
Character Matching with Wild-Card Characters
A wild-card character is a special character that can be used to replace none, one, or multiple characters in a file name.
The FILES command accepts wild-card characters, when properly used, to list file names that match the files request. The valid wild-card characters are the following:
-
The equal sign (=)
-
The tilde ( )
-
The question mark (?)
Any number and combination of the wild-card characters can be used to suit your purpose.
A /= suffix is considered part of the wild-card string. For example, FILES X /= does not return the file XXX because the file name does not contain a forward slash character (/).
Using the = (Equal Sign) Wild-Card Character
The = (equal sign) wild-card character matches none, one, or multiple characters, including the forward slash character (/), of a file name. The = wild-card character does not match the left parenthesis and the right parenthesis of the file name's usercode.
Example 1: Using the = Wild-Card Character
The file names that match the following file specification with the = wild-card character are listed:
*=SYSTEM= 40SYSTEM/CANDE *40/SYSTEM/CANDE *"4.1"/SYSTEM/CANDE *SYSTEM/COMS *SYSTEM *SYSTEMTEST
Example 2: Using the = Wild-Card Character
The following file names do not match the file specification in Example 1:
SYSTEM/CANDE (UC)SYSTEM SYSTEMTEST
Example 3: Using the = Wild-Card Character
The following example shows various file specifications with the = wild-card character that selects the following file:
*SYSTEM/MCP/DIAGNOSTICS *= *SYS=MCP=ICS *S=S *=MCP= *SYSTEM/= *SYSTEM/MCP/= *SYSTEM/MCP/D= *S=/MCP/=T=ICS *S= *=S=Y=S=T=E=M=M=C=P=D=I=A=G=N=O=S=T=I=C=S=
Using the (Tilde) Wild-Card Character
The (tilde) wild-card character matches none, one, or multiple characters. However, the wild-card character does not match a forward slash character (/), the left parenthesis, and the right parenthesis of the file name's usercode.
Example 1: Using the Wild-Card Character
The file names that match the following file specification with the wild-card character are listed:
* SYSTEM *40SYSTEM *40SYSTEMCANDE *SYSTEM4_0 *SYSTEMTEST
Example 2: Using the Wild-Card Character
The following file names do not match the file specification in Example 1:
*40SYSTEM/CANDE *40/SYSTEM/CANDE *"4.1"/SYSTEM/CANDE (UC)SYSTEM
Example 3: Using the Wild-Card Character
File names that match the following file specification with the wild-card character are listed:
(UC)S~Y~M~B~O~L~ (UC)SYMBOL (UC)SYMBOL_40 (UC)SYS40_SYMBOL (UC)SYMBOLIC
Example 4: Using the Wild-Card Character
The following file names do not match the file specification in Example 3:
*S/Y/M/B/O/L (UC)SYM/BOLIC (UC)S/Y/M/BOL (UC)SYMBOL/WC
Example 5: Using the Wild-Card Character
The following example shows various file specifications with the wild-card character that selects the following file:
*SYSTEM/MCP/DIAGNOSTICS *~/~/~ *SYS~/MCP/~ICS *S~/~/~S *~/MCP/~ *SYSTEM/~/~ *SYSTEM/MCP/~ *SYSTEM/MCP/D~ *S~/MCP/~T~ICS *S~/~/~ *~S~Y~S~T~E~M~/~M~C~P~/~D~I~A~G~N~O~S~T~I~C~S~
Using the ? (Question Mark) Wild-Card Character
The ? (question mark) wild-card character matches a single character in a file name. However, the ? wild-card character does not match a forward slash (/), a quotation mark ("), or the left and right parentheses of a file name's usercode name.
Example 1: Using the ? Wild-Card Character
The file names that match the following file specification with the ? wild-card character are listed:
*??/SYSTEM *40/SYSTEM *41/SYSTEM *4_/SYSTEM
Example 2: Using the ? Wild-Card Character
The following file names do not match the file specification in Example 1:
*SYSTEM/CANDE *41/SYSTEM/CANDE *"4.1"/SYSTEM (UC)SYSTEM
Example 3: Using the ? Wild-Card Character
The following example shows a variety of file specifications with the ? wild-card character that selects the following file:
*SYSTEM/MCP/DIAGNOSTICS *SYS???/MCP/DI????????? *SYSTEM/???/????????ICS *S?????/???/??????????S *??????/MCP/??????????? *SYSTEM/???/??????????? *SYSTEM/MCP/??????????? *SYSTEM/MCP/D?????????? *S?????/MCP/???????TICS *S?????/???/??????????? *??????/???/???????????