Check to see if a file exists
Moderators: chulett, rschirm, roy
Check to see if a file exists
I have a case where I do not know at runtime if an input file will exist. Is there a way to dynamically test from datastage if a file exists and continue on if it does not exist? I am running a sequence, and if the file does not exist, I do not want the job accessing it to abort, which would cause the sequence to abort. Any thoughts?
You could use the Execute Command stage to do (off the top of my head) a "test -f filename" on the file and then conditionally run the job based on the result. Or perhaps "-s" if you need to check if it exists and is not empty as well.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A Routine activity that did the same thing - either with a command or via BASIC statements such as OpenSeq - might be more flexible in terms of logging informative/alert messages. Of course you could also direct a trigger from the Execute Command activity to a logging routine activity.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.