Page 1 of 1

Storing log files

Posted: Tue Nov 16, 2004 11:58 am
by yaminids
Hello there,

I have 5 jobs in my project and I want to store all the log files generated while executing the jobs. To be precise, when I execute a job 'A' for example, I want to store the log file generated for this job in a directory. Similarly, I want to store all the log files generated when I execute other jobs in the same directory.
Can anyone suggest me any methods to accomplish this please.

Thanx in advance
-Yamini

Posted: Tue Nov 16, 2004 2:38 pm
by ray.wurlod
DataStage job logs are not files; they are database tables in the Repository (hashed files).

Search the archive for "archiving log files"; code for achieving this was posted eons ago (probably on the Oliver site, so check this archive too).

If you don't want to write code you could capture the log with an SQL query in the DataStage (TCL) environment, redirecting the output to your specific file.

Storing log files

Posted: Tue Nov 16, 2004 5:09 pm
by yaminids
Hi Ray,

Thank you very much for your reply. Can you elaborate about the SQL code in DataStage(TCL) Environment.
I appreciate your time.

-Yamini

Posted: Tue Nov 16, 2004 6:12 pm
by kduke
TCL is like sqlplus for Universe. Universe is the database DataStage uses. If you telnet into your DataStage server then you need to run uv. This command is in the DSEngine/bin directory. You need to be in the project directory before you run uv. Do a search this has been covered a lot. Anyway you can run SQL against DataStage tables like DS_JOB and DS_JOBOBJECTS. There is a JOBNO or job number stored in DS_JOBS for each job. The log files are called RT_LOGxxx where xxx is this job number. Here is how you list this file.

Code: Select all

select
   TIMESTAMP,
   SEVERITY,
   FULL.TEXT
from
   RT_LOG1370
where
   EVAL "@ID" NOT LIKE '//%'
order by 
   TIMESTAMP
;
In this example 1370 is the job number of the job I want to list the log on.

At the UNIX prompt you can use uvsh instead on uv to execute one TCL command at a time. Like this:

Code: Select all

uvsh "select TIMESTAMP, SEVERITY, FULL.TEXT from RT_LOG1370 where EVAL \"@ID\" NOT LIKE '//%' order by TIMESTAMP;" > LogList.txt

Posted: Tue Nov 16, 2004 8:27 pm
by ray.wurlod
... provided, of course, that the directory for uvsh ($DSHOME/bin) is in your search path (PATH).
Otherwise $DSHOME/bin/uvsh will do it for you, provided you've already executed $DSHOME/dsenv 8)