Roopanwita wrote:How can I capture the status of job from job Log(basically a part of log msg like 'no of recorded inserted in table') and send it as subject of mail notification in DS sequence stage,using routine (BASIC/C code)
You are mixing terminology up, I think - job status is very different to the row count. There are DS Basic functions that return various information about a job given the name. Here is my Routine for job status:
Arguments: JobName, InfoID
$INCLUDE DSINCLUDE JOBCONTROL.H
Ans = 0
handleJob = DSAttachJob(JobName, DSJ.ERRNONE)
If NOT(handleJob) Then
Ans = -99
End
Else
Ans = DSGetJobInfo(handleJob, InfoID)
End
DetachResult = DSDetachJob(handleJob)
and my Routine for link count:
Arguments: JobName, StageName, LinkName
$INCLUDE DSINCLUDE JOBCONTROL.H
Ans = 0
handleJob = DSAttachJob(JobName, DSJ.ERRNONE)
If NOT(handleJob) Then
Ans = -99
End
Else
Ans = DSGetLinkInfo (handleJob, StageName, LinkName, DSJ.LINKROWCOUNT)
End
DetachResult = DSDetachJob(handleJob)
The Link Count routine needs to be passed the job name, and the name of an active stage and link. Active stages in a Server job would be Transformer, Sort, etc., but not Sequential File for instance. So you need to know the job design to get the row count info through this route - it doesn't use the Job Log, and you can only get info about the latest run.
InfoID can be passed such as DSJ.JOBSTATUS, DSJ.JOBSTARTTIMESTAMP, DSJ.JOBLASTTIMESTAMP, DSJ.JOBELAPSED.
I'm sure the gurus will correct me if this information is not applicable or different for PX jobs.