DS Job hagging when called an After Job routine
Posted: Sat Feb 26, 2011 2:58 am
Hi All,
I have written an After-Job routine to retrive the Job statistics. My job is hanging when it is encoutering the command DSAttachJob and the State of the job is always running. I am not sure why it is behaving this way.
Here is my roUtine:
Can any one please help me to resolve the issue. I have used the Job control macros in After Job Subroutine
I have written an After-Job routine to retrive the Job statistics. My job is hanging when it is encoutering the command DSAttachJob and the State of the job is always running. I am not sure why it is behaving this way.
Here is my roUtine:
Code: Select all
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
*** Get the Statistics for the Current Job
JOBNAME= DSJobName
Call DSLogInfo ( "JobName ":JOBNAME,"dsrAuditCntrlInfo")
Hjob = DSAttachJob(JOBNAME,DSJ.ERRFATAL)
if NOT(Hjob) then
call DSLogFatal( "Job Failed ":JOBNAME,"dsrAuditCntrlInfo")
ABORT
end
Return= SOURCE_NAME matches "0X'TB_ODS_ZINC'0X"
Call DSLogInfo ( "Value of Return Code ":Return,"dsrAuditCntrlInfo")
if Return = 1 then
SUBJECT='ABC'
end
else
SUBJECT='XYZ'
end
Call DSLogInfo ( "Value of SUBJECT ":SUBJECT,"dsrAuditCntrlInfo")
EXECSTATUS = DSGetJobInfo (Hjob, DSJ.JOBSTATUS)
Call DSLogInfo ( "Value of EXECSTATUS ":EXECSTATUS,"dsrAuditCntrlInfo")
JOBSTARTTIME = DSGetJobInfo (Hjob, DSJ.JOBSTARTTIMESTAMP)
Call DSLogInfo ( "Value of JOBSTARTTIME ":JOBSTARTTIME,"dsrAuditCntrlInfo")
JOBENDTIME = DSGetJobInfo (Hjob, DSJ.JOBLASTTIMESTAMP)
Call DSLogInfo ( "Value of JOBENDTIME ":JOBENDTIME,"dsrAuditCntrlInfo")
JOBELAPSTIME = DSGetJobInfo (Hjob, DSJ.JOBELAPSTIMESTAMP)
Call DSLogInfo ( "Value of JOBELAPSTIME ":JOBELAPSTIME,"dsrAuditCntrlInfo")
DetachResult = DSDetachJob(Hjob)