Running scripts on log files

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
freef1yer
Participant
Posts: 12
Joined: Thu Sep 25, 2003 3:01 am
Location: London
Contact:

Running scripts on log files

Post 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
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post 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
Optico
Participant
Posts: 23
Joined: Thu Sep 18, 2003 9:32 am

Post 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
freef1yer
Participant
Posts: 12
Joined: Thu Sep 25, 2003 3:01 am
Location: London
Contact:

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

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