Skip to Content
avatar image
Former Member

how to kill Data services second instance of the job

Hi All,

is there a way to kill automatically the second instance of the job which has been kicked off accidentally or scheduled to run ?

we have a situation - job needs to be killed if its kicked while first instance of the job is running .

Thanks 

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Oct 21, 2015 at 06:45 AM

    Hi Surya,

    The best way is make a control table with job_name and it's run status. Add a script in job that whenever job starts execution the status will be set to 1 in the control table and after successful execution of job status will set back to 0 again. And before job starts execution it will check for the run status in that control table and if it's 1 then that means a instance of a job is already running, So if it's already running don't execute the job.

    Regards,

    Gokul

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2015 at 05:54 PM

    Why do you need to kill the job? Better stop the execution of second job until the first one is completed successfully. Add a script after the dataflow of first job to capture the job execution status of first job. Check this SAP Data Services script to schedule batch jobs conditionally, trigger jobs after successful execution

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2015 at 06:34 PM

    You could use a conditional to check that there's only one instance of the job running (perhaps by checking the repository tables/views), and if so then the job started manually or scheduled would quit automatically. We use something similar to schedule a second instance of a particular job in case the first one fails, and when it runs the second time checks the repository table to see if the first one finished, has errors, or is still running and then acts accordingly.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 22, 2015 at 01:45 AM

    Great.!!! Please close the thread.

    Add comment
    10|10000 characters needed characters exceeded