DSGetJobInfo

Use the DSGetJobInfo function to obtain information about a job. You can use this information generally as well as for job control. The DSGetJobInfo function can refer to the current job or a controlled job, depending on the value of the JobHandle variable.

Syntax


Result = DSGetJobInfo (JobHandle, InfoType)

JobHandle is the handle for the job as derived from DSAttachJob, or it might be DSJ.ME to refer to the current job.

InfoType specifies the information required and can be one of:

DSJ.JOBSTATUS

DSJ.JOBNAME

DSJ.JOBCONTROLLER

DSJ.JOBSTARTTIMESTAMP

DSJ.JOBWAVENO

DSJ.PARAMLIST

DSJ.STAGELIST

DSJ.USERSTATUS

DSJ.JOBCONTROL

DSJ.JOBPID

DSJ.JPBLASTTIMESTAMP

DSJ.JOBINVOCATIONS

DSJ.JOBINTERIMSTATUS

DSJ.JOBINVOCATIONID

DSJ.JOBDESC

DSJ.JOBFULLDESC

DSJ.STAGELIST2

DSJ.JOBELAPSED

DSJ.JOBEOTCOUNT

DSJ.JOBEOTTIMESTAMP

DSJ.JOBRTISERVICE

DSJ.JOBMULTIINVOKABLE

DSJ.JOBFULLSTAGELIST

Result depends on the specified InfoType, as follows:

  • DSJ.JOBSTATUS Integer. Current status of job overall. Possible statuses that can be returned are currently divided into two categories:

    Firstly, a job that is in progress is identified by:

    DSJS.RESET Job finished a reset run.

    DSJS.RUNFAILED Job finished a normal run with a fatal error.

    DSJS.RUNNING Job running - this is the only status that means the job is actually running.

    Secondly, jobs that are not running might have the following statuses:

    DSJS.RUNOK Job finished a normal run with no warnings.

    DSJS.RUNWARN Job finished a normal run with warnings.

    DSJS.STOPPED Job was stopped by operator intervention (can't tell run type).

    DSJS.VALFAILED Job failed a validation run.

    DSJS.VALOK Job finished a validation run with no warnings.

    DSJS.VALWARN Job finished a validation run with warnings.

  • DSJ.JOBNAME String. Actual name of the job referenced by the job handle.
  • DSJ.JOBCONTROLLER String. Name of the job controlling the job referenced by the job handle. Note that this might be several job names separated by periods if the job is controlled by a job which is itself controlled.
  • DSJ.JOBSTARTTIMESTAMP String. Date and time when the job started on the engine in the form YYYY-MM-DD hh:nn:ss.
  • DSJ.JOBWAVENO Integer. Wave number of last or current run.
  • DSJ.PARAMLIST. Returns a comma-separated list of parameter names.
  • DSJ.STAGELIST. Returns a comma-separated list of active stage names.
  • DSJ.USERSTATUS String. Whatever the job's last call of DSSetUserStatus last recorded, else the empty string.
  • DSJ.JOBCONTROL Integer. Current job control status, that is, whether a stop request has been issued for the job.
  • DSJ. JOBPID Integer. Job process id.
  • DSJ.JOBLASTTIMESTAMP String. Date and time when the job last finished a run on the engine in the form YYYY-MM-DD HH:NN:SS.
  • DSJ.JOBINVOCATIONS. Returns a comma-separated list of Invocation IDs.
  • DSJ.JOBINTERIMSTATUS. Returns the status of a job after it has run all stages and controlled jobs, but before it has attempted to run an after-job subroutine. (Designed to be used by an after-job subroutine to get the status of the current job).
  • DSJ.JOBINVOCATIONID. Returns the invocation ID of the specified job (used in the DSJobInvocationId macro in a job design to access the invocation ID by which the job is invoked).
  • DSJ.STAGELIST2. Returns a comma-separated list of passive stage names.
  • DSJ.JOBELAPSED String. The elapsed time of the job in seconds.
  • DSJ.JOBDESC string. The Job Description specified in the Job Properties dialog box.
  • DSJ.JOBFULLDESSC string. The Full Description specified in the Job Properties dialog box.
  • DSJ.JOBRTISERVICE integer. Set to true if this is a Web service job.
  • DSJ.JOBMULTIINVOKABLE integer. Set to true if this job supports multiple invocations
  • DSJ.JOBEOTCOUNT integer. Count of EndOfTransmission blocks processed by this job so far.
  • DSJ.JOBEOTTIMESTAMP timestamp. Date/time of the last EndOfTransmission block processed by this job.
  • DSJ.FULLSTAGELIST. Returns a comma-separated list of all stage names.

Result might also return error conditions as follows:

DSJE.BADHANDLE JobHandle was invalid.

DSJE.BADTYPE InfoType was unrecognized.

Remarks

When referring to a controlled job, DSGetJobInfo can be used either before or after a DSRunJob has been issued. Any status returned following a successful call to DSRunJob is guaranteed to relate to that run of the job.

Examples

The following command requests the job status of the job qsales:


q_status = DSGetJobInfo(qsales_handle, DSJ.JOBSTATUS)

The following command requests the actual name of the current job:


whatname = DSGetJobInfo (DSJ.ME, DSJ.JOBNAME)