DSAttachJob

Use the DSAttachJob function to run a job in job control sequence. When you attach this function to a job, a handle is returned that is used for addressing the job. There can only be one handle open for a particular job at any one time.

Syntax


JobHandle = DSAttachJob (JobName, ErrorMode)

JobHandle is the name of a variable to hold the return value which is subsequently used by any other function or routine when referring to the job. Do not assume that this value is an integer.

JobName is a string giving the name of the job to be attached to.

ErrorMode is a value specifying how other routines using the handle should report errors. It is one of:

  • DSJ.ERRFATAL Log a fatal message and abort the controlling job (default).
  • DSJ.ERRWARNING Log a warning message but carry on.
  • DSJ.ERRNONE No message logged - caller takes full responsibility (failure of DSAttachJob itself will be logged, however).

Remarks

A job cannot attach to itself.

The JobName parameter can specify either an exact version of the job in the form job%Reln.n.n, or the latest version of the job in the form job. If a controlling job is itself released, you will get the latest released version of job. If the controlling job is a development version, you will get the latest development version of job.

Example

This is an example of attaching to Release 11 of the job Qsales:


Qsales_handle = DSAttachJob ("Qsales%Rel1", 
→ DSJ.ERRWARN)