Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the date of a file

Status
Not open for further replies.

Wholsea

Programmer
Jun 16, 2004
138
US
Is there a simple way in DS to find the date of a file, say, from an FTP source?

We have a process that can only run when all the required files (26 of them) are current, as of the first of this month.

Any help would be appreciated.

Thanks.

ASP, VB, VBS, Cold Fusion, SQL, DTS, T-SQL, PL-SQL, IBM-MQ, Crystal Reports, Crystal Enterprise
 
You can do this in an operating system script, such as a Unix shell script, DataStage would pass the script the date to be checked and the script would return a success or failure status that tells DataStage whether to proceed.

If you wanted to code it inside DataStage you could pass the date to each job as a job parameter and put the job parameter into the file name, any job that doesn't find the file would abort the sequence.

You could write a DataStage routine that retrieves the list of file names and checks them for the correct date. The openpath command retrieves filenames in DataStage BASIC. It was briefly covered in this thread:
OpenPath dirpath To dir.fvar
Then
Select dir.fvar To 9
Loop
While ReadNext TheFileName From 9
TheFileDate = Left(TheFileName, 1, 10)
* etc
Repeat
Close dir.fvar
End
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top