Capture of Job Log Entries

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
avenki77
Participant
Posts: 25
Joined: Wed Jul 07, 2004 2:55 pm

Capture of Job Log Entries

Post by avenki77 »

I want to capture all the job log entries into a text file. How can I do it from within a Server Job? Are there some builtin routines or DS functions available to accomplish this task ?

Thanks in advance
Venkatesh
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is a series of functions for capturing log information.
  • DSGetLogSummary
    DSGetNewestLogId
    DSGetLogEntry
You can use these within DataStage BASIC code, for example in a job control routine or in a before/after subroutine. Statements for working with text files include OpenSeq, WeofSeq, WriteSeq , Seek and CloseSeq.

From the command line there are options to the dsjob command that perform similar functions, namely -logsum, -logdetail and -lognewest.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Since a job log is a table in the Repository, you can also use SQL, executed within the DataStage environment on the server or through the Administrator client Command window.

Code: Select all

SELECT TIMESTAMP, SEVERITY, FULL.TEXT 
FROM RT_LOGnnn
WHERE @ID NOT LIKE '//%'
ORDER BY @ID;
where nnn is the job number obtained from the DS_JOBS table

Code: Select all

SELECT NAME, CATEGORY, JOBNO
FROM DS_JOBS
WHERE NAME = 'MyJobName';
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply