You are here: Functions > FILEDATE()

FILEDATE()

FILEDATE() returns the date of last change and time of a file.

Use FILEDATE() to determine the creation date and time of a file as a character string. Typically, this function is used to compare the creation date and time of two files to determine the most current version. It may also be used to control the execution of a procedure, particularly when determining whether to refresh a file.

Function Format

FILEDATE(filename)

filename is the name of the file for which you want to determine the creation date.

This function does not support relative pathing. Always specify the fully pathed (fully qualified) filename. For more information see Literal File Names.

FILEDATE() returns the file date as a character string in the format:

YYYY/MM/DD hh:mm:ss

where YYYY= year, MM=month, DD=day, hh=hour, mm=minutes and ss=seconds. If the specified file is not found, the function returns the string " * File Not Found *"

Note: Filedate() is not intended for use on zSeries files because the zSeries operating system doesn’t support accessing the date of last change (or any other date) for a file. If used on zSeries files, the Filedate() function will return the file not found message described above or " # Not Available #" if the file does exist.

Examples

To execute the procedure TEST only if the file Demo.dat is newer than Demo2.dat:

DO TEST IF FILEDATE("c:/Demo.dat")>FILEDATE("c:/Demo2.dat")

In the Expression Builder, you can select FILEDATE() from the Functions drop-down list by double-clicking that item in the list. The selected function is inserted in the Expression text box. If the file to be sized is not in the same directory, you must insert either a relative path or an absolute path for the file.

FILEDATE("c:\directory\subdirectory\Demo.dat")