Pattern Matching FILES Syntax
<bracket expression>
┌◄────────────────────────────────────────┐ ── [ ─┴─/17\─┬─<digit>────────────────────────┬─┴─ ] ──────────────────┤ ├─<letter>───────────────────────┤ ├─<range expression>─────────────┤ ├─<collating symbol>─────────────┤ ├─<equivalence class expression>─┤ └─<character class expression>───┘
<range expression>
──┬─<digit>────────────┬─<hyphen>─┬─<digit>────────────┬───────────────┤ ├─<letter>───────────┤ ├─<letter>───────────┤ └─<collating symbol>─┘ └─<collating symbol>─┘
<quoted bracket expression>
┌◄────────────────────────────────────────┐ ── [ ─┴─/17\─┬─<EBCDIC character>─────────────┬─┴─ ] ──────────────────┤ ├─<quoted range expression>──────┤ ├─<collating symbol>─────────────┤ ├─<equivalence class expression>─┤ └─<character class expression>───┘
<quoted range expression>
──┬─<EBCDIC character>─────────────┬─<hyphen>──────────────────────────► ├─<collating symbol>─────────────┤ └─<equivalence class expression>─┘ ►─┬─<EBCDIC character>─────────────┬───────────────────────────────────┤ ├─<collating symbol>─────────────┤ └─<equivalence class expression>─┘
<collating symbol>
── [. ──<collating element>── .] ──────────────────────────────────────┤
<equivalence class expression>
── [= ──<collating element>── =] ──────────────────────────────────────┤
<character class expression>
── [: ─┬─ ALNUM ─┬─ :] ────────────────────────────────────────────────┤ ├─ DIGIT ─┤ ├─ ALPHA ─┤ ├─ LOWER ─┤ ├─ UPPER ─┤ └─ GRAPH ─┘
Explanation
Although wild-card characters provide a good method for selecting files, bracket expressions can provide a more focused search for file names. A succinct range of characters (alphabetic, numeric, or graphic) can be specified with bracket expressions. Even special characters for languages other than English can be specified with bracket expressions.
Although only a single character of a file name can be substituted with the characters specified within a bracket expression, several bracket expressions can be used in a FILES command.
A bracket expression can contain the following character-matching expressions:
-
Character class expression
-
Collating symbol
-
Equivalence class expression
-
Range expression
Bracket Expression
A bracket expression can contain several unique character-matching expressions, which define classes of characters. Those character expressions are described later in this section.
The bracket expression defines a small set of characters to match characters of a file name. The characters delimited by the square brackets ([ ]) are matched to the characters of file names. Spaces are unnecessary to separate each character.
Example 1: Bracket Expression
The listed files match the following bracket expression; the characters within the square brackets only are to be matched.
PATCH[2 7 Y Z] or PATCH[27 YZ] PATCH2 PATCHY PATCH7 PATCHZ
Example 2: Bracket Expression
The following list of file names do not match the file specification in Example 1:
PATCH27 PATCHYZ
The character class bracket expression matches a discrete set of characters. A character class expression is specified by enclosing a character class set with delimiters composed of the square bracket-colon ([: :]) combination.
The following character classes can be represented in a character class bracket expression:
Character Class |
Character Representation |
[:ALNUM:] |
a through z, A through Z, 0 through 9 |
[:ALPHA:] |
a through z, A through Z |
[:LOWER:] |
a through z |
[:UPPER:] |
A through Z |
[:DIGIT:] |
0 through 9 |
[:GRAPH:] |
all printable characters excluding a through z, A through Z, and 0 through 9 |
Note: | Character class expressions represent actual characters only, and thus avoids the blanks and special characters embedded in EBCDIC character value representation. For example, the blanks between i through j, r through s, I through J, and R through S are not considered when a character class expression is specified. If a range expression is used, those blanks would be applied for character-matching purposes. Refer to range expressions later in this section. |
Character Class Expression Examples
The listed file names match the following file name with the embedded character class expression:
*4[[:DIGIT:]]/SYSTEM/COMS *40/SYSTEM/COMS *41/SYSTEM/COMS *43/SYSTEM/COMS
The following file names do not match the file name with the embedded character class expression in the previous example:
*4/SYSTEM/COMS *DIGIT/SYSTEM/COMS *4DIGIT/SYSTEM/COMS
To accommodate character sets of languages other than English, the collating symbol enables you to identify multi-character elements that exist in languages to be considered as a single element.
The collating symbol encloses a multi-character collating element with delimiters composed of the square bracket-period ([. .]) combination.
The following example shows how the double-L (LL) combination of letters in Spanish can be represented as a single character:
SOURCE/[[.LL.]]/SPANISH
The following bracket expression matches the strings that follow:
[[.AB.]L] AB L
The following strings do not match the bracket expression in the previous example:
A B AL BL
The equivalence class expression is similar to the collating symbol; however, it is used to identify two or more characters that have the same collating value.
Equivalence class expressions are used to accommodate character sets of languages other than English.
For example, the letter c and the letter c with a grave accent (c`) can belong to the same equivalence class and have the same collating value.
An equivalence class expression is identified with delimiters composed of a square bracket-equal sign ([= =]) combination. To equate two characters to the same collating value, consider the following example:
[[=c=]] [[=c`=]]
A range expression enables you to determine a range of characters for file name matching purposes. The square brackets ([ ]) delimit the range, and a hyphen (–) must separate the starting and ending range points.
The ending range point must have a collating value that is higher than or equal to the starting range point's collating value; otherwise the file specification is invalid.
Example 1: Using the Range Expression
The files names that match the following file name with embedded range expressions are listed:
WFL/CANDE3[7-9]/[D-F] WFL/CANDE37/D WFL/CANDE38/D WFL/CANDE39/D WFL/CANDE37/E WFL/CANDE38/E WFL/CANDE39/E WFL/CANDE37/F WFL/CANDE38/F WFL/CANDE39/F
Example 2: Using the Range Expression
The following list of file names do not match the file specification in Example 1:
WFL/CANDE3789/DEF WFL/CANDE37-9/D-F WFL/CANDE3/789/DEF WFL/CANDE373839/DEF
Example 3: Using the Range Expression
The file names that match the following file name with an embedded range expression with graphic characters are listed:
*"[-#]"/SYSTEM/COMS *"-"/SYSTEM/COMS *"#"/SYSTEM/COMS
Example 4: Using the Range Expression
The following list of file names do not match the file specification in Example 3:
*"?"/SYSTEM/COMS *" "/SYSTEM/COMS
Example 5: Using the Range Expression
The file names that match the following file name with an embedded range expression with graphic characters are listed:
*"[û?]"/SYSTEM/COMS *"-"/SYSTEM/COMS *"%"/SYSTEM/COMS *">"/SYSTEM/COMS *"|"/SYSTEM/COMS *"?"/SYSTEM/COMS *"/"/SYSTEM/COMS
Example 6: Using the Range Expression
The following list of file names do not match the file specification in Example 5:
*SYSTEM/COMS *"û?"/SYSTEM/COMS *"û"/SYSTEM/COMS
Example 7: Specifying the Exclamation Point (!) in a Range Expression
Sometimes, it can be easier to define characters that you do not want matched within a file name. The exclamation point (!) excludes specified characters from the character matching process. Precede the character range you do not want matched with the exclamation point.
For example, the listed files can result from the following bracket expression:
PATCH/[!C-E] PATCH/A PATCH/B PATCH/F PATCH/G
Example 8: Specifying an Exclamation Point (!) in a Range Expression
The files names that match the following file name with embedded range expressions that includes the exclamation point (!) are listed:
WFL/CANDE3[!7-9]/[D-F] WFL/CANDE34/D WFL/CANDE35/D WFL/CANDE36/D WFL/CANDE34/E WFL/CANDE35/E WFL/CANDE36/E WFL/CANDE34/F WFL/CANDE35/F WFL/CANDE36/F
Example 9: Specifying an Exclamation Point (!) in a Range Expression
The following list of file names do not match the file specification in Example 8:
WFL/CANDE37/D WFL/CANDE38/E WFL/CANDE38/E WFL/CANDE38/F
Example 10: Specifying an Exclamation Point (!) in a Range Expression
The file names that match the following file name with embedded range expressions are listed:
PATCH[!1-3 6-8]/[!A 1] PATCH0/B PATCH4/B PATCH5/B PATCH9/B PATCHA/B PATCHB/B PATCH0/2 PATCH4/2 PATCH5/2 PATCH9/2 PATCHA/2 PATCHB/2
Example 11: Specifying an Exclamation Point (!) in a Range Expression
The following list of file names do not match the file specification in Example 10:
PATCH1/A PATCH2/A PATCH3/A PATCH6/A PATCH7/A PATCH8/A PATCH1/1 PATCH2/1 PATCH3/1 PATCH6/1 PATCH7/1 PATCH8/1
Quoted File Names and Expressions
Quotation marks ("") can be used to delimit special characters in names and bracket expressions. Because several characters have special properties, such as wild-card characters, these characters must be represented in another fashion if they are part of a file name that is being sought.
The backslash character (\) causes the special properties of wild-card characters and bracket expressions to be disregarded so that the question mark (?), tilde ( ), equal sign (=), and left bracket ([) are taken literally. The special character must be preceded by the backslash (\) and enclosed within quotation marks ("").
Example 1: Quoted File Names and Expressions
The file names that match the file specification follow:
"\="/AFILE matches "="/AFILE "\\"/AFILE matches "\"/AFILE "\"/AFILE is invalid
Example 2: Quoted File Names and Expressions
The listed file names match the file specification with the equal sign because it is not preceded by the backslash:
"="/SYSTEM/CANDE "4.1"/SYSTEM/CANDE "old"/SYSTEM/CANDE "A15"/SYSTEM/CANDE
Example 3: Quoted File Names and Expressions
The listed file name treats the left bracket literally and not as the beginning of a bracket expression because the left bracket is preceded by the backslash.
REL/"\[REMARK]=" matches REL/"[REMARK]ABLE"
Example 4: Quoted File Names and Expressions
The listed file name matches both following file names because the second left bracket is not preceded by a backslash, which treats the second left bracket as the beginning of a bracket expression to match the characters D and R.
REL/"\[[DR]EMARK]=" matches both REL/"[DEMARK]ABLE" and REL/"[REMARK]ABLE"
Example 5: Quoted File Names and Expressions
The listed file name is valid but contains a right bracket that is unnecessary because a right bracket has no special meaning without a bracket expression.
REL/"\[REMARK\]="