Guardian Programmer's Guide

Table Of Contents
Manipulating File Names
Guardian Programmer’s Guide 421922-014
13 - 3
Working With File-Name Patterns
Defining a File-Name “Piece”
A piece of a file name contains one or more consecutive parts of a file name. Many
file-name manipulation procedures require a piece parameter. When a file-name
piece consists of just one part, the level parameter is enough to specify the desired
part.
You can supply a file-name suffix as a piece. Here, the piece consists of the part
identified by the level parameter plus all parts to the right of that part.
Similarly, you can specify a prefix as a file name piece. Here, the piece consists of
the part identified by the level parameter and all parts to the left of that part.
To specify the suffix or prefix, you use the options parameter of the procedure. The
following example shows the use of level numbers to identify file-name pieces:
Defining a File-Name “Subpart”
Some file-name parts split into smaller elements called subparts. This applies to
named and unnamed process descriptors. A subpart is an element of a part separated
from the next subpart by a colon (:). For example, the level 0 part of an unnamed
process descriptor is made up of a dollar sign ($), a IPU designator, a process
identification number (PIN), and a sequence number. These subparts are separated
by colons.
Some procedures, such as FILENAME_DECOMPOSE_, accept a subpart
parameter.
Working With File-Name Patterns
The procedures described in this section deal not only with file names, but also with
file-name patterns that contain asterisk (*) and question mark (?) wild-card characters.
These wild-card characters have the following meanings:
Wild-card characters can appear in any part of a name, as many times as there can be
characters in the part. Because an asterisk can match zero characters, the pattern of
a file-name part can be twice the size of the corresponding file-name part, including
ordinary characters and wild cards. For example, a subvolume pattern could be
16 characters long.
File name: \SYSA.$OURVOL.MYSUB.PROGA
Level 1 piece: MYSUB
Level 1 piece with suffix: MYSUB.PROGA
Level 1 piece with prefix: \SYSA.$OURVOL.MYSUB
* Matches zero or more letters, digits, dollar signs ($), or pound signs (#)
? Matches exactly one letter, digit, dollar sign ($), or pound sign (#)