After Job Subroutine executing before the job completes

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
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

After Job Subroutine executing before the job completes

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

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

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

Post 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.
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