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).
How to ceate a Signal-File when a job has finished OK
Moderators: chulett, rschirm, roy
Your expectation is faulty.
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.
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.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 46
- Joined: Mon Sep 24, 2007 12:37 am
- Location: INDIA
Re: How to ceate a Signal-File when a job has finished OK
Create a signal file in your after-job subroutine without running DSGetJobInfo and check "Only run after-job subroutine on successful job completion" checkbox.
I modified my after-job subroutine as mddw08 suggested.
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.
Code: Select all
JobName = DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
Comandd = "touch " :SomePath: "\" :JobName: ".OK"
Call DSExecute("DOS", Command, Output, Result)
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.