Hello,
I have a strange problem with respect to the wait for file activity:
i am trying to write to a sequential file from a table giving the status of the job sucessfully run or not,
i put the constraint on the trnsformer that if the count(status)=0 write to the file with single column as "sucessful"which means that if the count of "N" (i.e NO) = 0 then it writes to the file at a specified location (it creates a dat file)
but when the count is > 0 then it should not write to the file, and it should not generate a file, but to my surprise the job is creating a 0kb file which the wait for file activity takes as present and the runs the next step.
If it were to be in unix i would have used test-s command to check the size of file>0, but i am working on NT.
Is there any DOS commond to check the size of the file greater than 0kb and to delete the file?
or is there a better way to do this.
Thanks
Satya
wait for file activity
Moderators: chulett, rschirm, roy
Welcome. :D
You can't stop the stage from creating the file, it does so when the stage cranks up or 'opens'. If you don't write to it, what you are left with is a zero byte file. As you've found.
Given the path you've been taking with this, I'd suggest you write your output file to a different name, one the Wait For File activity is not polling for. Take the mechanism you are using for the constraint right now and pass that count or status out to an 'after job' script. Based on that parameter, have the script either rename the file to what the wait activity is expecting or... delete it.
I would think something like that would work.
You can't stop the stage from creating the file, it does so when the stage cranks up or 'opens'. If you don't write to it, what you are left with is a zero byte file. As you've found.
Given the path you've been taking with this, I'd suggest you write your output file to a different name, one the Wait For File activity is not polling for. Take the mechanism you are using for the constraint right now and pass that count or status out to an 'after job' script. Based on that parameter, have the script either rename the file to what the wait activity is expecting or... delete it.
I would think something like that would work.
-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:
If you're on 7.5 with MKS toolkit, or have MKS toolkit anyway, then you can write a UNIX script to do this. Something like:Is there any DOS command to check the size of the file greater than 0kb and to delete the file?
Code: Select all
if [ -z $filename ] then
rm $filename
fi
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.