Check for open file before processing.

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
lclapp
Premium Member
Premium Member
Posts: 21
Joined: Wed May 19, 2004 2:43 pm

Check for open file before processing.

Post 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 :?:
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
lclapp
Premium Member
Premium Member
Posts: 21
Joined: Wed May 19, 2004 2:43 pm

File open testing using Folder stage

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I fear that you may be relying on a behavior that might be fixed in a later release.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply