Page 1 of 1

Capture of Job Log Entries

Posted: Wed Jul 07, 2004 3:18 pm
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

Posted: Wed Jul 07, 2004 4:01 pm
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.

Posted: Wed Jul 07, 2004 4:06 pm
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';