Hallo Jürgen,
probably the easiest way might be to generate a listing of the target
directory first, parse it and then find the newest file in the list ...
/* rexx */
/* assumes you have a NETRC file ... */
queue "cd remotetargetdirectory"
queue "dir"
queue "quit"
call outtrap "ftpout."
address tso "ftp targethost targetportifneeded"
call outtrap "OFF"
Then parse the output look for the youngest file, generate your GET commands
and connect again.
Should be quite simple :-)
Cheers
Wolfgang
----- Original Message -----
From: "Jürgen Kehr" <[EMAIL PROTECTED]>
Newsgroups: bit.listserv.ibm-main
To: <[email protected]>
Sent: Monday, September 22, 2008 11:16 AM
Subject: Logic in FTP procedure
Hello,
I have a small problem with the following job:
a FTP batch jobs runs on a daily base and it should pick up some data,
which has the month and year of the preceding month in its name, for
example in july 08 it may pick up the dataset XXX0608.
This dataset is available around the 8th of july, but I don't know the
exact date.
I would like to build a procedure which check the actual date and checks
if the latest dataset is available, if yes it should get this one, if no
it should get the one from the preceding month.
Thanks in advance for any help.
--
___________________________________________________________________
Freundliche Gruesse / Kind regards
Dipl.Math. Juergen Kehr, IT Schulung & Beratung, IT Education + Consulting
Tel. +49-561-9528788 Fax +49-561-9528789 Mobil +49-172-5129389
ICQ 292-318-696 (JKehr)
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
___________________________________________________________________
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html