Provides
a method of obtaining information about a stage, which can be used generally
as well as for job control. It can refer to the current job, or a controlled
job, depending on the value of JobHandle.
Syntax
Result = DSGetStageInfo (JobHandle, StageName, InfoType)
JobHandle is the handle for
the job as derived from DSAttachJob, or it might be DSJ.ME to refer to the current
job.
StageName is the name of the
stage to be interrogated. It might also be DSJ.ME to refer to the current stage
if necessary.
InfoType specifies the
information required and might be one of:
DSJ.LINKLIST
DSJ.STAGELASTERR
DSJ.STAGENAME
DSJ.STAGETYPE
DSJ.STAGEINROWNUM
DSJ.VARLIST
DSJ.STAGESTARTTIMESTAMP
DSJ.STAGEENDTIMESTAMP
DSJ.STAGEDESC
DSJ.STAGEINST
DSJ.STAGECPU
DSJ.LINKTYPES
DSJ.STAGEELAPSED
DSJ.STAGEPID
DSJ.STAGESTATUS
DSJ.STAGEEOTCOUNT
DSJ.STAGEEOTTIMESTAMP
DSJ.CUSTINFOLIST
DSJ.STAGEEOTSTART
Result depends on the specified InfoType,
as follows:
- DSJ.LINKLIST - comma-separated list of link names in the
stage.
- DSJ.STAGELASTERR String - last error message (if any) reported
from any link of the stage in question.
- DSJ.STAGENAME String - most useful when used with JobHandle =
DSJ.ME and StageName = DSJ.ME to discover your own name.
- DSJ.STAGETYPE String - the stage type name (for example, "Transformer",
"BeforeJob").
- DSJ. STAGEINROWNUM Integer - the primary link's input row
number.
- DSJ.VARLIST - comma-separated list of stage variable names.
- DSJ.STAGESTARTTIMESTAMP - date/time that stage started
executing in the form YYY-MM-DD HH:NN:SS.
- DSJ.STAGEENDTIMESTAMP - date/time that stage finished executing
in the form YYY-MM-DD HH:NN:SS.
- DSJ.STAGEDESC - stage description.
- DSJ.STAGEINST - comma-separated list of instance ids (parallel
jobs).
- DSJ.STAGECPU - integer percentage of CPU used.
- DSJ.LINKTYPES - comma-separated list of link types.
- DSJ.STAGEELAPSED - elapsed time in seconds.
- DSJ.STAGEPID - comma-separated list of process ids.
- DSJ.STAGESTATUS - stage status.
- DSJ.STAGEEOTCOUNT - Count of EndOfTransmission blocks processed
by this stage so far.
- DSJ.STAGEEOTTIMESTAMP - Data/time of last EndOfTransmission
block received by this stage.
- DSJ.CUSTINFOLIST - custom information generated by stages
(parallel jobs).
- DSJ.STAGEEOTSTART - row count at start of current EndOfTransmission
block.
Result might also return error conditions
as follows:
- DSJE.BADHANDLE JobHandle was invalid.
- DSJE.BADTYPE InfoType was unrecognized.
- DSJE.NOTINSTAGE StageName was DSJ.ME
and the caller is not running within a stage.
- DSJE.BADSTAGE StageName does not refer
to a known stage in the job.
Remarks
When referring
to a controlled job, DSGetStageInfo 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.
Example
The following
command requests the last error message for the loader stage of the job qsales:
stage_status = DSGetStageInfo(qsales_handle, "loader",
→ DSJ.STAGELASTERR)