Page 1 of 1

Director Job Log

Posted: Mon Jul 28, 2003 9:22 pm
by calvinlo
Hi all,

I have a job(interfaceControl) running many instances at the same time, and so i use the invocation id to differentiate them.
e.g. interfaceControl.Accounts, interfaceControl.Customer
but if i hope to modify this job, i found that all instance logs will be cleared once i compile it. Any things i can do to preserve these logs? Thank you.

Cal

Posted: Mon Jul 28, 2003 10:17 pm
by kduke
Cal

You need to copy these records out before you compile the job. There are DataStage routines to read the log files or you can read these directly. Each job has an associated job number. If you telnet into your DataStage server then LIST DS_JOBS "jobname" to find a specific job's number or LIST DS_JOBS to see all the records. If the job number is "17" then the log file is named "RT_LOG17". LIST RT_LOG17 to see these records. To archive these records then:

JobName = "whatever"
open "MyArchiveFile" to Archive else stop
read NextId from Archive, "NextId" else NextId = 0
open "DS_JOBS" to DsJobs else stop
read DsJobsRec from DsJobs, JobName then
JobNo = DsJobsRec
RtLogName = "RT_LOG" : JobNo
open RtLogName to RtLog else stop
SELECT RtLog
loop while readnext RtLogId do
read LogRec from RtLog, RtLogId then
NextId += 1
write LogRec to Archive, NextId
repeat
write NextId on Archive, "NextId"
end


This should get you close.

Kim.

Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com

Posted: Mon Jul 28, 2003 10:20 pm
by ray.wurlod
You can archive the job logs to text file before compiling.

Techniques for doing this have been published - check the archives here, search all forums (so that you pick up the Oliver list).

Essentially the algorithm is:
(1) determine name of log file (RT_LOGnn, where nn is job number)
(2) open log file (Open)
(3) open output file (OpenSeq)
(4) generate "select list" of log events in key order
(5) loop through list of keys, read event, construct and write line
(6) close output file (CloseSeq)
(7) close log file

Alternately, you could use SQL, capturing the output.
SELECT TIMESTAMP, WAVE.NO, SEVERITY, FULL.TEXT
FROM RT_LOGnn
ORDER BY @ID;


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518

Posted: Tue Jul 29, 2003 12:26 am
by spracht
Cal

my experience is that only the invocations are deleted if you compile the job. The logs will be still there in the very job (without invocation) unless they are deleted manually or by auto purge. View the logs of the job without invocation and drag the column border in the heading between '>On date' and 'Type' and 2 additional columns 'Wave' and 'Invocation' will appear.

Nevertheless the techniques outlined by Kim and Ray are very interesting.

Stephan

Posted: Tue Jul 29, 2003 2:09 pm
by ariear
After a compile of a multiple instance job you don't have entries in the director for any of it's former instances. However the Unqualified job (the master) has all the log records of all it's executed instances.

Posted: Tue Jul 29, 2003 11:53 pm
by calvinlo
Thanks all of you!
I know the master job got the log but it is quite difficult to read~
and now i am trying to archive the log before i compile jobs~

Cal