Versions Compared

Key

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

...

The syntax of the forfiles statement is:




Panel
forfiles logical_name=file_spec
         [sortby=attribute-name[,ascending | descending]]
         [msecs=yes | no]
  ...
  UDM commands
  ...
end


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):

Panel

...

forfiles src=*.txt sortby=createdate
    # Do some stuff
end


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

Panel

...

forfiles src=*.exe sortby=size,descending
    # Do some more stuff
end


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:

Panel
forfiles src=*.txt fileattrib=yes msecs=yes
   echo $(_file) ": " $(_file.modtime) ", " $(_file.modtimestamp)
end

Detailed Information

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

...