I tried to extract the log using below routine. Here i am able to fetch the last row which will have the job status log entry.
Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
JobName = Arg1
hJob = DSAttachJob(JobName, DSJ.ERRNONE)
LatestStartId = DSGetNewestLogId(hJob, DSJ.LOGSTARTED)
LatestLogId = DSGetNewestLogId(hJob, DSJ.LOGANY)
For iEventID = LatestStartId to LatestLogId Step-1
vEventDetail<-1> = FIELD(DSGetLogEntry(hJob, iEventID), "", 1)
next iEventID
Mail = DSSendMail("From:hari@removed.com\nTo:hari@removed.com\nServer:removed.com\nSubject:\nBody:Please find the log":vEventDetail )
Ans = Mail
iIgnore = DSDetachJob(hJob)
Looking forward for the suggestion which will help in getting the complete log entries for the latest run.