Page 1 of 1

Running scripts on log files

Posted: Thu Sep 25, 2003 5:08 am
by freef1yer
Hi

I'm looking at recovery techniques for cases such as DB failure, a DS crash and so on. I intend to write an informational message to the log file intermittently to reflect the progress which a job has made.

Can anybody tell me if I can then access the log file outside of Director (ie. is it written as a txt file somewhere?), so that I might run a script over the file to determine which data had been processed and which remained to be done at the point of failure?

Thanks

ff

Posted: Thu Sep 25, 2003 7:11 am
by WoMaWil
Hi free flyer,

on the opertion system level you can write in your logfile with:

dsjob -log [-info | -warn] &nbsp &nbsp "text"


anything to your logfile.

Wolfgang Huerter
=====================
Cologne, Germany

Posted: Thu Sep 25, 2003 7:30 am
by Optico
Hello ff

You can indeed get to the log-info of a job. It does require some knowledge about the log-file though.

Each job you have in your project has a set of files created by Datastage.

The files are hash-files type 30 (dynamic) and the names are :
DS_TEMPnn, RT_CONFIGnn, RT_LOGnn and RT_STATUSnn where nn is a sequential number starting with 1 for the first job in your project.

There are also some other files but they are not important for your task.

You can use the LIST command (as in LIST RT_LOGnn) to get to the records. You can also create another Datastage job that reads the logfile of another job. You can get to the filelayout by using the command LIST DICT RT_LOGnn.

The RT_STATUSnn reflects what you would normally see in the monitor.

I hope this helps.



B. Sorensen,
Optico IT ApS

Posted: Thu Sep 25, 2003 7:55 am
by freef1yer
Hi Optico

Thanks very much for your post, that answers me perfectly.

I will probably follow your advice and use an additional job to read and process the file.

Thanks again

Posted: Thu Sep 25, 2003 4:30 pm
by ray.wurlod
You may find it easier to use the log-inspection options of the dsjob command.
-logsum returns a summary of log contents
-lognewest returns the newest event number of a particular type
-logentry returns the detail of a particular entry


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518