...
To list all of the members in a PDS on a z/OS system, you can issue the following commands:
Panel |
---|
Html bobswift |
---|
<pre>
forfiles zos=MYHLQ.MYPDS(*)
print msg=$(_file)
end
</pre>
|
|
This would print the name of each member in a PDS called
MYHLQ.MYPDS.
For Windows, UNIX, and IBM i systems (as well as the HFS file system under z/OS), you can list all of the files in the current directory with the following UDM commands:
Panel |
---|
Html bobswift |
---|
<pre>
forfiles local=*
print msg=$(_file)
end
</pre>
|
|
To find all of the files ending in
.txt in a particular directory,
mydir in this example, issue the following
forfiles statement:
Panel |
---|
Html bobswift |
---|
<pre>
forfiles local=mydir/*.txt
print msg=$(_file)
end
</pre>
|
|
A question mark (
? ) can be used as a wildcard for a single character. In the previous example, lets assume
mydir contains the files:
file,
file1,
file2, and
file3.txt.
Executing the following:
Panel |
---|
Html bobswift |
---|
<pre>
forfiles local=mydir/file?
print msg=$(_file)
end
</pre>
|
|
Will result in the following output:
Panel |
---|
Html bobswift |
---|
<pre>
file1
file2
</pre>
|
|
Tip |
---|
|
The forfiles file specification can contain wildcards for any UDM files system. Under z/OS, however, the wildcards only can be used to reference a member of a PDS or PDS/E. |
...