Page 1 of 1

Purge all job logs

Posted: Thu Feb 20, 2003 1:01 am
by rwolancz
Hi All,

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

Thanks,
Robert

Posted: Thu Feb 20, 2003 1:53 am
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

Posted: Fri Feb 21, 2003 2:58 am
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