Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The syntax of the forfiles statement is:




<pre>
forfiles logical_name=file_spec
         [sortby=attribute-name[,ascending | descending]]
         [msecs=yes | no]
  ...
  UDM commands
  ...
end
</pre>
Panel
Html bobswift


logical_name is the logical name of a transfer server.

...

Note
titleNote

The file times that include a millisecond value are not available on all file systems and platforms that UDM supports. For any platform that cannot obtain a file time's millisecond value (for example, z/OS), UDM displays an error stating that the msecs parameter is not supported. For any platform that recognizes a millisecond component of file times, but the file system itself does not update it, .000 is shown.

...


Examples

To obtain a file list, sorted by creation date (earliest to latest):

<pre>
forfiles src=*.txt sortby=createdate
    # Do some stuff
end
</pre>
Panel
Html bobswift

...


Top obtain a file list, ordered by file size from largest to smallest:

<pre>
forfiles src=*.exe sortby=size,descending
    # Do some more stuff
end
</pre>
Panel
Html bobswift

 


An error would be produced if sortby was present without a value or if it referred to an attribute that does not exist for the _file variable.
 

To display modification times and timestamps for a list of files in the current directory with an extension of *.txt:

html-bobswift
Panel
<pre>
forfiles src=*.txt fileattrib=yes msecs=yes
   echo $(_file) ": " $(_file.modtime) ", " $(_file.modtimestamp)
end
</pre>

Detailed Information

The following pages provide detailed information for the Universal Data Mover forfiles statement:

...