Callable Procedures > Job Status - Enhanced
  
Job Status - Enhanced
1
On Hold - The job is on hold. It can be edited and its state changed in order to release the job.
2
Waiting - The job is waiting to start, or waiting for its scheduled time to arrive, or waiting for a scheduler to become available.
3
Blocked - The job is blocked as a previous instance of the same job is still running.
4
Pending - This is the first stage of a running job. The scheduler has identified the job as ready to start and has allocated a thread, or sub task to process the job. If a job stays in this state then the scheduler thread has failed for some reason. Check logs.
5
Running - The job is currently running, no tasks have failed and there are no warnings.
6
Running with Errors - The job is currently running and some completed tasks have failed. When all tasks not dependent on the failed tasks have completed, the job will fail.
7
Running with Warnings - The job is currently running and some tasks have warnings.
8
Failed - A failed job is one that had a problem.
9
Completed - The job has successfully completed, without warnings. Once in this state a job cannot be restarted.
10
Completed with Warnings - The job has successfully completed, with warnings. Once in this state a job cannot be restarted.
11
Failed - Aborted - The job has been aborted after having failed. Once in this state a job cannot be restarted.
12
Error Completion - Internal error.
 
Note: The following situations will cause a 0 simple status code (and will also return 0 in the other status codes):
1. If one or more time based parameters have been specified and a sequence number parameter has been specified.
2. If both time based parameters have been specified.
3. If one time based parameter has been specified and the job name has not been.
4. If the job sequence parameter has been specified and it is not in the control, run or log tables.
5. If the job name parameter could not be found in the control, run or log tables.
6. If the job exists but has not started in the last specified X minutes.
7. If the job exists but has not started since the specified date and time.
8. A SQL Error occurs.
In each case, a different message will be returned in the second output parameter, p_return_msg.
 
Examples
The following examples all check the status of a job called Daily Run that started in the last 10 minutes: