Versions Compared

Key

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

...


The following script segment prints the file name and absolute path of each file in the directory:

Panel
forfiles nt=C:\Example\*
    echo "Filename: $(_file) Abs. Path: $(_path)"
end
echo "Number of files processed: " $(_filecount)


Executing this would build a file list containing the files: file1.txt, file2.txt, and file3.txt. Since there are three files in the list that was built, UDM would iterate through the loop three times:

...


This script segment would result in the following output:

Panel

...

Filename: file1.txt Abs. Path: C:\Example\file1.txt
Filename: file2.txt Abs. Path: C:\Example\file2.txt
Filename: file3.txt Abs. Path: C:\Example\file3.txt

Number of files processed: 3



Anchor
_file Variable Attributes
_file Variable Attributes
_file Variable Attributes

...

For efficiency reasons, all of these attributes - other than name and type - are retrieved only as requested. You can request to retrieve the file attributes by adding fileattrib=yes to the end of the forfiles call.

For example:

Panel
forfiles src=*.txt fileattrib=yes
    echo "$(_file) is $(_file.size) bytes in size."
end



If the information for an attribute cannot be obtained, its value is set to an empty string.

...

Info
titlez/OS

z/OS datasets store only createdate and accessdate. There is no time (createtime and accesstime) associated with these dates, nor do z/OS datasets store moddate or modtime.

...