Purge all 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
rwolancz
Participant
Posts: 14
Joined: Fri May 31, 2002 1:30 am
Location: Japan

Purge all job logs

Post by rwolancz »

Hi All,

Is there any practical way to purge all logs for all jobs in the project?

Thanks,
Robert
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, but it involves writing DataStage BASIC.

Do you want the purge to heed the project-default and job-specific purge settings, or just clear all log files?

Please ignore responses that suggest the use of CLEAR.FILE - this command also destroys the control records in the log file and may lead to run time errors.

The algorithm, in essence, is as follows.

For each job in the project
determine the job's log file name (it's a hashed file)
preserve the control entries
clear the hashed file (this is very fast)
place a "zero" entry in the log file
update the control entry //SEQUENCE.NO
update the control entry //JOB.STARTED
write the control entries back to the file
(end of loop)


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

CleanupJob suffers from the same problems I described above - it deletes the control records from the log, so you lose any purge settings. Further, it clears the jobs' status file too, which may not be what is required. And it clears the &PH& directory, which may result in the loss of important diagnostic information.
What the world really needs is a new, improved version of CleanupJob.


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