Page 1 of 1

Check for open file before processing.

Posted: Mon Oct 10, 2005 6:42 pm
by lclapp
The folder stage gives me the filenames of the MSSQL log files. But I need some way to determine if a file is still be dumped to by the MSSQL logger. Does anyone have any suggestions for checking to see if a DOS file is open before beginning to read from it. I have tested with the Folder stage and I didn' see anyway there. I also looked at the DOS DIR command but did not see anything there.

Any help for the DSX-people would be appreciated.

leslie :?:

Posted: Tue Oct 11, 2005 1:01 am
by ArndW
Doesn't the MKS Toolkit get installed as well as part of DS 7.5x on Windows? If that is the case, you can use the UNIX command "fuser" on the file to see if any other process has it open. I don't think that the DOS cmd shell has a similar command, so installing MKS toolkit on the DataStage server might be your simplest solution.

File open testing using Folder stage

Posted: Tue Oct 11, 2005 9:44 am
by lclapp
I will take a look at fuser. Doing more testing with the Folder stage I found that if a file in the folder is open with an editor package, in this case UltraEdit; running the job will result in the filename being passed to the transformer. Since my files are quite large, 25+ meg or greater, I found that if the file is being copied into the folder what is passed to the transform is an empty string. If I constrain on len=0 for the filename then I get only the filenames that are not inflight. I tested this quite a bit last night and I think this is going to give me what I want; which is files I can process.

If anyone comes up with something else let me know.

leslie

Posted: Tue Oct 11, 2005 3:07 pm
by ray.wurlod
I fear that you may be relying on a behavior that might be fixed in a later release.