How to get job name which log not cleared

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
arunverma
Participant
Posts: 90
Joined: Tue Apr 20, 2004 8:20 am
Location: MUMBAI
Contact:

How to get job name which log not cleared

Post by arunverma »

Can any body help me that how to get job name from universe which log not cleared before 3 days from sysdate .
Arun Verma
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
Can you explain why you might need this info for?

this might be better for other's opinion on the best way to acomplish what you need.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You are probably better off making sure that all of your jobs have their Auto-Purge settings correct so that this happens automatically. There is a post here with discussion of the issue plus code for a routine that will update the settings for you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Arun is at a site that has the 5.2 bug where auto-purge isn't propagated into newly-created jobs.
Probably the easiest way is to create a routine or script that retrieves the oldest message in the log file and obtains the timestamp from that entry.

Code: Select all

FUNCTION OldestEntryTimeStamp(JobNo)
Ans = @NULL
LogFileName = "RT_LOG" : JobNo
Open LogFileName to hLogFile
Then
   Command = "SELECT TIMESTAMP TO SLIST 9 FROM " : LogFileName 
   Command := "  WHERE CAST (@ID AS VARCHAR) NOT LIKE '//%' ORDER BY 1;"
   Perform Command
   ReadNext Ans FROM 9
   ClearSelect 9
   Close hFile
End
RETURN(Ans)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arunverma
Participant
Posts: 90
Joined: Tue Apr 20, 2004 8:20 am
Location: MUMBAI
Contact:

Post by arunverma »

Hi Chulett/Roy

Actualy we hacve faced problem in DS server few days back , one person run DS job with NO limit option and around 100000 log entry created and as result serevr hang , so I want to monitor DS job , Log must be 3 days only .

We have successfully migrated DS from 5.2 to 7.1 and at project level we have also seted auto purge but it is not working . so should we take export backup of whole project , clean project and set auto purge then import complete job , will it be work ?


Thanks Ray ,

In routine which given by you , we have to pass job Name ? , if so then we have to run this routine for all jobs , if it is possible from universe command ?

Regards

Arun Verma
Arun Verma
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

arunverma wrote:Actualy we hacve faced problem in DS server few days back , one person run DS job with NO limit option and around 100000 log entry created and as result serevr hang , so I want to monitor DS job , Log must be 3 days only .
That's not going to help when someone runs jobs with no warning limit that create huge logs like that. :? Better to crack down on the people doing this and make sure they don't do it again.
arunverma also wrote: We have successfully migrated DS from 5.2 to 7.1 and at project level we have also seted auto purge but it is not working . so should we take export backup of whole project , clean project and set auto purge then import complete job , will it be work ?
That setting only applies to new jobs, created after the setting was made. Are you saying that this is not happening, even after upgrading? Or is it just the old jobs that have the problem? The first would be a bug, the second would be normal.

If it is the old ones, the routine in the post I linked to will allow you to fix the problem without going to the trouble of the export/import.
-craig

"You can never have too many knives" -- Logan Nine Fingers
arunverma
Participant
Posts: 90
Joined: Tue Apr 20, 2004 8:20 am
Location: MUMBAI
Contact:

Post by arunverma »

Thanks Chulett

Yes it is true , auto purge is working for new job , I am gonging to implement that suggestion give by you and Mr. Ray.

Regards

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

Post by ray.wurlod »

There is another routine in my most recent report for your site which can load the purge settings for existing jobs that don't have them. If no-one else has this routine you can obtain a copy from Rajiv Gupta.

Someone at your site could easily adapt these routines to scan through your job logs to find those with lakhs of entries. But do you really want to get rid of these before the reason for the warnings has been diagnosed and corrected?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply