DataSatge Job Logs

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
datastagedummy
Participant
Posts: 56
Joined: Thu Feb 13, 2003 6:08 pm
Location: USA

DataSatge Job Logs

Post by datastagedummy »

How do I delete JobLog from a DataStage routine ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You don't. Ever. The job log must be present, or you will never run that job again. One of the many things the DSRunJob function does is to open the log; it will abort if the log is not present.

Now, that leaves the possibility that you want to delete one or more entries from the job log. It is not clear why you want to do this from a routine. Are you trying to hide something that you're doing from auditors? :)

Much more preferable, particularly for newbies, is to use the purge and auto-purge capabilities that you will find in Director. You can specify to purge old entries based on age in days or number of runs. This can be set to happen automatically each time the job runs successfully. It can also be set on a project-wide basis from the Administrator client.

While it IS possible to clear entries from a routine, it is not a trivial task, since the routine must identify the correct log, identify the correct entries to purge, and possible reset values in control entries. Given your nick, I think it is wise to leave it at this, don't you?


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
datastagedummy
Participant
Posts: 56
Joined: Thu Feb 13, 2003 6:08 pm
Location: USA

Post by datastagedummy »

Thanks for the reply Wurlod, the reason why I want to do this is that we want to automate the process of cleaning up the log files once in 3 months Pl let me know if there is any other way to automate this process.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The usual recommended way is to use DataStage's automatic purge capability. In most cases, folks don't want to keep more than the past couple of runs; however, for particular jobs you can elect to keep up to 99 days' worth.
In the Administrator, choose your project and click Properties. On the General tab, check "Auto-purge of job log" then fill in a suitable default, for example "over 14 days".
In Director, to override these project-wide defaults, select the job for which you want different settings, choose Clear Log from the Job menu. This opens a similar dialog. Choose the "Auto purge" option, then fill in the auto-purge properties for this particular job. You will be prompted to confirm that you want to override the project-wide default settings.
And, of course, you can manually purge a job's log at any time using the same dialog in Director.


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Post Reply