Page 1 of 1

After Job Subroutine executing before the job completes

Posted: Wed Sep 21, 2011 4:58 am
by harshada
Hello,
We are facing an issue where in after job subroutine script is getting executed before job completion.
The job creates a header, detail and trailer and there is a DOS script called in after job subroutine to concat all three.
There has been 2-3 instances when the file only contained Header and Trailer. In this case the log file had info in the after job subroutine below the detail file name in ***Output From Command**** that -

"The process cannot access the file because it is being used by another process."

Hence we doubt that the detail file creation was still happening and the DOS script was fired hence the issue.

The settings in general tab of job proporties were:
Only run after-job subroutine has successfully completed
and
Enabled Hash File Cashing
The performance tab has 'Enable Row Buffer'->'Inter Process' been selected.

Anyone can suggest why is this happening.

Posted: Wed Sep 21, 2011 3:40 pm
by ray.wurlod
Can you guarantee that someone isn't viewing the file with, say, Notepad?

This is not the behaviour of after-job subroutine that I understand; it is not invoked until all stages have closed. Could you try introducing a short sleep into your DOS command, in case it's just a timing issue with operating system buffering?

Posted: Thu Sep 22, 2011 4:17 am
by harshada
Yes Ray, no one is viewing the file. We are also planning to introduce a sleep and try out. This issue is facing only in prod and not able to replicate in any other environment.

Another thing observed that this job has inter process buffering enabled as it uses a link collector stage and its a requirement that this inter process buffering be enabled for this stage.

For all other jobs the setting is 'Use project default'. Can this be the suspect?

Posted: Thu Sep 22, 2011 3:16 pm
by ray.wurlod
Row buffering can not be the culprit directly, but the timing issue might be related to clearing those buffers. But I don't think so - the stages should not close until the buffers have been cleared.