Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Macro name changed from html to html-bobswift during server to cloud migration processing.

...


Anchor
1089450
1089450
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>

Anchor
1089454
1089454
This would print the name of each member in a PDS called MYHLQ.MYPDS.


Anchor
1089456
1089456
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>


Anchor
1089461
1089461
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>


Anchor
1089466
1089466
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.

Anchor
1089467
1089467
Executing the following:

Panel

Html bobswift

<pre>
forfiles local=mydir/file?
  print msg=$(_file)
end
</pre>


Anchor
1089471
1089471
Will result in the following output:

Panel

Html bobswift

<pre>
file1
file2
</pre>


Tip
titleA Stonebranch Tip

Anchor
1089475
1089475
The forfiles file specification can contain wildcards for any UDM files system.

Anchor
1089421
1089421
Under z/OS, however, the wildcards only can be used to reference a member of a PDS or PDS/E.

...