Hi all
Could i do sth like Wait For file in a Directory?
Since the input file always comes with a timestamp, e.g. accounts20030805.dat and the timestamp is arbitrary....how can i make use of the "WaitForFile" stage instead of writing DS script.
Thanks
Cal
Wait For File Activity
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If it still follows the original code I have for WaitForFile, it does an 'OpenSeq' to check for the existence of the file so wildcards are out.
If you are opposed to writing job control, can what you are being sent be changed? We use semaphore or 'flag files' which are ftp'd *after* the data file. We wait for the flag file to appear before processing the corresponding data file. In your case, that file could have a constant name. Depending on your situation, you could have the name of the data file as a record in the flag file and pull it from there (we typically have control totals in it that are verified).
Also, what about using the Folder stage? I haven't played with it much, but it supports wildcards. Not pretty, but you could run the job in a loop until it finds something to process. [:p]
Or you could just bite the bullet, write some looping job control to get wildcard listings from the target directory and when the file shows up, pull the filename from the output and pass it off to your job stream.
-craig
If you are opposed to writing job control, can what you are being sent be changed? We use semaphore or 'flag files' which are ftp'd *after* the data file. We wait for the flag file to appear before processing the corresponding data file. In your case, that file could have a constant name. Depending on your situation, you could have the name of the data file as a record in the flag file and pull it from there (we typically have control totals in it that are verified).
Also, what about using the Folder stage? I haven't played with it much, but it supports wildcards. Not pretty, but you could run the job in a loop until it finds something to process. [:p]
Or you could just bite the bullet, write some looping job control to get wildcard listings from the target directory and when the file shows up, pull the filename from the output and pass it off to your job stream.
-craig