Page 1 of 1

info msg in job log:Unable to unlink operating system file

Posted: Thu Mar 24, 2005 12:22 pm
by katz
While running a job from an After Job Subroutine I occasionally get a message in the Job's log like:

From previous run
DataStage Job 65 Phantom 3064
Program "DSD.RUN": Line 490, Unable to unlink the operating system file "DSD.RUN_64235_13598".


It appears that I get this msg when the job invoked by the After Job Subroutine needs to be reset before it can be run (e.g. I get the msg "Job <job name> must be reset before it can run." a few lines earlier in the log). The routine deals with a "job must be reset" condition and my routine completes normally.

However, I do not know why I get the "Unable to unlink..." message, and therefore unsure if there is some additonal clean-up that I should perform.

Posted: Thu Mar 24, 2005 2:35 pm
by Sainath.Srinivasan
As the error message suggests, try to reset the job as you may have some links left over from previous run. It may return more useful message.

Posted: Mon Mar 28, 2005 6:58 pm
by davidnemirovsky
Perhaps try running the jobs in a Job Sequencer, not as an After Job subroutine.

Posted: Thu Mar 31, 2005 11:26 am
by katz
Thanks for your responses. My working hypothesis is that the "unable to unlink" msg is related to the concurrency/timing of the executions of the job.

The after routine collects information about the job just run (status, timing, parameters, link row counts, etc..) writes these to a sequential file and then calls a common server job to read the seq. file and load the information into a set of oracle tables.

The "unable to unlink" msg only occurs when several server jobs complete at the same time and each runs their after routine, and each after routine launches the common server job to load the data into oracle. It is the common server job which gets the msg in its log.

The routine is already coded to wait for the job if its already running, reset the job if necessary, etc.. and it appears to work well (i.e. I always get the data into the oracle tables), only sometimes I get this "unable to unlink" msg.

I better approach might be to load the data into a FIFO queue structure and set-up the job as a single threaded process against the data queue. Anyone have a method for setting up a queue and associating a server job with it? I have considered writing a sequence job with a Wait for File Activity, but it seems a little inelegant.

Mostly, I want to understand the consequences of getting the "unable to unlink..." msg. The file object referred to in the msg is left remaining in the &PH& folder after the job completes - and that can't be good.

thx again.

Posted: Thu Mar 31, 2005 12:10 pm
by roy
Hi,
instead debating on is it wise to run after routine for this rather then use a seuence and run it after the job finishes....

at the begining of the routine lock 1 of the 64 built in semaphores so the routine will never run in parallel if it suites you:
i.e:

Code: Select all

Lock 1
< routine code >
...
...
...
Unlock 1