Page 1 of 1

How to ceate a Signal-File when a job has finished OK

Posted: Tue Sep 16, 2008 9:55 am
by yserrano
I need to create an empty file when a Job has finished OK.

I was trying with an After Job Routine, but the function DSGetJobInfo(DSJ.ME, DSJ.JOBSTATUS) always returns DSJS_RUNNING and I am expecting DSJS_RUNOK.
So, DataStage considers the After Job routine as part of the job process, right?
Any ideas on how to create this file will be appreciated.

The objective of this file is to serve as trigger for another Job in a different job sequence. Do you know of any other common solution to acomplish these dependences? Where one job is waiting for two or more other jobs to finish (without errors).

Posted: Tue Sep 16, 2008 10:03 am
by chulett
Your expectation is faulty. :wink:

Technically, 'after job' the job is still running. You have to check the JOBINTERIMSTATUS to find out what status it will end up with (assuming your after job routine doesn't blow up, of course) and create your file based on that.

Posted: Tue Sep 16, 2008 10:18 am
by mcs@rajesh
Have you tried creating the empty file using Touch Command in After Job Routine.

Re: How to ceate a Signal-File when a job has finished OK

Posted: Tue Sep 16, 2008 11:02 am
by mddw08
Create a signal file in your after-job subroutine without running DSGetJobInfo and check "Only run after-job subroutine on successful job completion" checkbox.

Posted: Tue Sep 16, 2008 12:40 pm
by yserrano
I modified my after-job subroutine as mddw08 suggested.

Code: Select all

JobName = DSGetJobInfo(DSJ.ME,DSJ.JOBNAME) 
Comandd = "touch " :SomePath: "\" :JobName: ".OK"
Call DSExecute("DOS", Command, Output, Result) 
And, checked On the "Only run after-job subroutine on succesful job completion" property.

I am going to try it with different scenarios and if it does not work, I am going to try Chulett's suggestion.

Thank you for your answers.