Director Job Log

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
calvinlo
Participant
Posts: 31
Joined: Thu Jul 17, 2003 2:55 am

Director Job Log

Post 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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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
spracht
Participant
Posts: 105
Joined: Tue Apr 15, 2003 11:30 pm
Location: Germany

Post 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
ariear
Participant
Posts: 237
Joined: Thu Dec 26, 2002 2:19 pm

Post 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.
calvinlo
Participant
Posts: 31
Joined: Thu Jul 17, 2003 2:55 am

Post 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
Post Reply