Multiple input files can be processed at once by using wildcard patterns as input filename and recursion into directories. It is also possible to select only certain members of FLAMFILEs by pattern or index and to specify how directories are traversed.
The wildcards are supported on subprogram level, i.e. wildcards are available in the batch utility and in subprogram calls. Wildcards are currently not supported on record or byte interface level.
If one of the wildcard characters is part of the filename itself, you
can escape the wildcard character with the caret (^
). For MVS datasets
each qualifier is separated with a period (.
). If you want to let the
asterisk (*
) or plus sign (+
) match more than one qualifier, you
must put it twice (i.e. **
or ++
). On non dataset based systems
(UNIX, Windows, USS, Linux) this mechanism is not available as there are
no qualifiers in filenames and hence periods are handled like any other
character. Below you can find some examples:
file='*.txt' - all files with extension .txt including the file named .txt file='+.txt' - all files with extension .txt and at least one other character file='?.txt' - all files with one character and the extension .txt file='dat^*.txt' - the file "dat*.txt" file='**.G====V==' - all datasets ending with GnnnnVnn (all GDG datasets) file='<SYSUID>.**(my*)' - all members starting with "MY" of all PO datasets under current user file='<SYSUID>.**(-1)' - all previous generation of all GDG datasets under current user
The directory support for MVS includes Generation Data Groups (GDG). If you want to read only the previous generation of all GDG's under your SYSUID, you must type as follows:
file='~.**(-1)' - all GDG's with generation -1 under my SYSUID
Is a wildcard used at read and the different files should be written into a generation data group as several versions. The file index in minimal amount of digest '[ind0]' could be used the define the next generations '(+[ind0])'.
infile='/path/to/*.txt' pattern='<SYSUID>.GDG(+[ind0])' outfile='USER.GDG(+n)'
The enclosing quotation marks are required because the file name string contains parenthesis. Strings without quotation marks are terminated at the first space character or paraenthesis or square bracket.
If you use a wildcard in the first/high level qualifier, the catalog search interface (CSI) is used to return each dataset in the catalog. All these datasets are then compared against the corresponding pattern. This can consume a lot of time. Be careful with wildcards in the first/high level qualifier at ZOS dataset names.
Using wildcards at the beginning of a pattern (for example '**(MEMBER)') could result in opening a dataset which is stored on a tape which is not available immediately. This could result in the process waiting for console input. By default, datasets on tapes are not included in the dataset list retrieved by the wildcard mechanism. If you want to include datasets on tapes, then you must enable the corresponding switch. However, this will not prevent a console request. Files in catalog where the volume is not available, will result in the same behavior. Be careful with wildcards at the beginning of the search pattern.
The escape character can be used for datasets, but this is not required.
If the match string contains parenthesis ()
, only PO datasets are
matched. To match GDG, the first character inside the parenthesis must
be +
, -
or a number. In all other cases, a PO dataset is assumed.
Relative generation numbers are currently not supported for PO datasets.
To process only certain members inside archives, a match string for
members can be used. A member can be defined as part of the URL with ?
as separator. Alternatively, for FLAMFILEs, a dedicated member
specification can be used. In this case a leading question mark (?
) is
ignored. For a question mark as first wildcard, specify two of them.
file='test*.adc/?*FLAM*' - All members that have "FLAM" in their name in files starting with "test" and ending with ".adc" file='*.adc member=*FLAM' - All members that have "FLAM" at the end of their name in all files ending with ".adc" file='*.adc member=?FLAM*' - All members whose names start with "FLAM" in all files ending with ".adc" file='*.adc member=??FLAM*' - All members whose names start with any character followed by "FLAM" in all files ending with ".adc"
To use wildcards (for a single character or a digit) after a slash,
you must use %
or =
, as otherwise the ?
indicates a member and the
#
an index specification.
You can also select members from archives based on the member index. In
this case, the member name must start with a hash (#
) or colon (:
)
and can contain a list of indexes and/or index ranges (two indices
separated by minus (-
), inclusive) separated by comma. For example:
read.flam(file=*.adc/#3,5,8-10,15) read.flam(file=*.adc/:3,5,8-10,15) read.flam(file=*.adc member=:3,5,8-10,15) read.flam(file=*.adc member=#3,5,8-10,15)
All four variants read the 3rd, 5th, 8th, 9th, 10th and 15th member from files in the current directory that end with ".adc".
To define how wildcard strings are matched, there is an object called 'DIR' that contains some switches. These include recursion into sub-directories, recursion into archives, inclusion of hidden files, symbolic link, etc. See the chapter to the 'DIR' object below for more information.
Since version 5.2.0, FLAM supports directory entries in the new archives and therefore also in all other components. To ensure that FLAM remains downwards compatible here, the separate handling of directories can be activated via the DIRS switch. This means that the directories are entered separately in FLAM5 archives and in ZIP archives. In FLAM4 archives, directory entries are ignored and the normal I/O components simply create the directories here when writing. This ensures that empty directories can also be archived and restored. When reading from an archive, the DIRS switch must be activated again at this point so that the directory entries are also read. It must be noted here that the input-output name mapping is also applied to the directory entry. This should therefore only be used primarily for 1-to-1 recovery when reading the archives.
Missing directories are created automatically. To prevent this the switch 'NOMKDAR' must be activated. Overwriting of existing files can be prevented with the 'REMAIN' switch (see below).
To convert the file names matched to a certain file name for writing see INPUT TO OUTPUT NAME MAPPING.