clearing log files at one shot
Moderators: chulett, rschirm, roy
clearing log files at one shot
Hi,
I have read somewhere that clear.&ph& command would clear all log files of a particular project at one shot, if executed at command line at datastage admin .
I tried in vain.Any suggestions about that command would be helpful
I have read somewhere that clear.&ph& command would clear all log files of a particular project at one shot, if executed at command line at datastage admin .
I tried in vain.Any suggestions about that command would be helpful
-
- Premium Member
- Posts: 232
- Joined: Fri Aug 04, 2006 1:20 am
- Location: Bangalore
CLEAR.&PH& wont clear the log files, as you are thinking.
For clearing the log file , you need to execute the command
where XXX is the job number. you can get the job number by querying DS_JOBS. but if you just execute this , it will clear your auto purge settings also.
For clearing the Job log, with preserving Auto Purge Settings, Our DS Masters have posted the routines already, Do a search in the forum.
For clearing the log file , you need to execute the command
Code: Select all
CLEAR.FILE RT_LOGXXX
For clearing the Job log, with preserving Auto Purge Settings, Our DS Masters have posted the routines already, Do a search in the forum.
Could you post it? I've been searching in dsxchange and found several references to the ADN one, but haven't been able to find any solution to clear all the log files in a project.kduke wrote:There was one on the ADN. It would take a while and each each job's log file. It might be on my tips page. If not then I could post it.
I don't see it on your tips page.
Be aware of what it is doing - getting a list of job numbers and issuing a CLEAR.FILE for each one in a loop, which means you'll lose all of your auto purge information. However, there is another Ken Bland utility out there to set them all as well. Not 'preserve' but set.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
(May as well just add to this thread rather than starting a new one)
So I read this thread, and also
viewtopic.php?t=82586, and
viewtopic.php?t=106690
See also
viewtopic.php?t=128396&highlight=
Plagiarizing from viewtopic.php?t=82586 above, I've written this simple routine:
Using the same approach as in viewtopic.php?t=128396&highlight= to loop over the jobs in the project, I can clear the desired logs in the project. Further enhancements are parsing the Ans text to write to the log or sequential file, etc.
However, I read this also deletes auto purge settings, etc.
Is there a better way, or is this best practice to, as the subject says, "clear logs files in one shot"?
Thanks,
Scott
So I read this thread, and also
viewtopic.php?t=82586, and
viewtopic.php?t=106690
See also
viewtopic.php?t=128396&highlight=
Plagiarizing from viewtopic.php?t=82586 above, I've written this simple routine:
Code: Select all
TCL = "CLEAR.FILE RT_LOG" : pJobNumber
Call DSExecute("TCL", TCL, ScreenOutput, SystemReturnCode)
Ans = ScreenOutput : @VM : SystemReturnCode
However, I read this also deletes auto purge settings, etc.
Is there a better way, or is this best practice to, as the subject says, "clear logs files in one shot"?
Thanks,
Scott
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues
I just spent weeks writing a program which manages log files - you can choose whether by date, or runs or number of log entries and it cleans up broken multi-instance and job run data plus it reorganizes remaining data and performs other housekeeping. Entries removed are archived to an Oracle database. All this work because this site doesn't want to lose log entries. The CLEAR.FILE approach works quite well and is fast and efficient. If you wanted to be clean, you could read or copy the //PURGE.SETTINGS record prior to clearing the file and then writing it back to the new and pristine log file. The other control records in the log file, "//SEQUENCE.NO" and "//JOB.STARTED.NO" don't need to be kept if all of the log entries that they refer to are cleared.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use the auto-purge settings. Maybe with tighter rules than you currently have in place. That's what I'd regard as best practice.Scott wrote:Is there a better way, or is this best practice to, as the subject says, "clear logs files in one shot"?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Thanks Ray. I'm currently just using this utility in our DEV environment, where job creation is very dynamic, and the large logs (usually due to thousands of warnings) make reading the logs slow.ray.wurlod wrote:Use the auto-purge settings. Maybe with tighter rules than you currently have in place. That's what I'd regard as best practice.Scott wrote:Is there a better way, or is this best practice to, as the subject says, "clear logs files in one shot"?
I'll ensure we set proper auto-purge settings for our PRD environment.
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues