finding unix file
Moderators: chulett, rschirm, roy
finding unix file
How to check file is found in a specific direcotry using datastage sequence.
i am using find #path#/Test.txt in execute command in sequence how do check the status.. if file found i need to do one process if not found another process... problem i encounter here is if file is not found , it is throug warning like this "file can't open ... no such file in directory' insteadchulett wrote:You could also investigate the WaitForFile stage, which actually doesn't have to wait at all. You can use it as a file existance checker, for example, and branch accordingly.
yes i try with WaitForFile stage this success for file exits if file is not found i need to run another job. here in trigger what value do i need to checkchulett wrote:Did you give the WaitForFile stage a shot?
Don't use 'find' as the command, try using something like 'test' instead. Check your man pages.
beceause if file is not there job through warning and got aborted .
rv
Set the WaitForFile to not wait and it will simply check for existance. Two links out - one 'Ok' link for the file being found and an 'Otherwise' link for when the file isn't found. By itself it should throw a warning, from what I recall.
Pretty much the same thing you'd do for the Execute Command stage with the 'test' command...
Pretty much the same thing you'd do for the Execute Command stage with the 'test' command...
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There may be another advantage to using the test command: we found that WaitForFile requres read permission on the file. That could be a problem if the process you are waiting for has sent the trigger file to your server via FTP in which case the file permissions may be such that your process cannot read it.ray.wurlod wrote:You could also use an Execute Command activity and use the test command. Again, supply two triggers, driven by the exit status of the command.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Welcome aboard! :D
And thank you for a useful contribution. Your observation makes a point that I know about, and should have mentioned rather than assuming everyone knows all there is to know about UNIX commands.
And thank you for a useful contribution. Your observation makes a point that I know about, and should have mentioned rather than assuming everyone knows all there is to know about UNIX commands.
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.
Thanks a lot to every body.vincentph wrote:There may be another advantage to using the test command: we found that WaitForFile requres read permission on the file. That could be a problem if the process you are waiting for has sent the trigger file to your server via FTP in which case the file permissions may be such that your process cannot read it.ray.wurlod wrote:You could also use an Execute Command activity and use the test command. Again, supply two triggers, driven by the exit status of the command.
Hi veni,
Also be aware of the fact that, if you it is designed to wait for a file which is about to produce by any other job, the WaitForFile stage will trigger the its sequence as soon as the file appear in the folder. But it is not sure the file present may or may not be a full file.
To overcome this you can produce a indicator file and you can check for that.
-Kumar
Also be aware of the fact that, if you it is designed to wait for a file which is about to produce by any other job, the WaitForFile stage will trigger the its sequence as soon as the file appear in the folder. But it is not sure the file present may or may not be a full file.
To overcome this you can produce a indicator file and you can check for that.
-Kumar