Capturing Job log

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
Sridhar G
Participant
Posts: 2
Joined: Wed Dec 22, 2004 2:32 am

Capturing Job log

Post by Sridhar G »

Hi all,
We have a requirement in our project to capture job log for each job in a sequential file. The following routine returns the log for a particular job for the last ran day.

Code: Select all

DSGetLogSummary(JobHandle,DSJ.LOGANY,DSGetJobInfo(JobHandle,DSJ.JOBSTARTTIMESTAMP),DSGetJobInfo(JobHandle,DSJ.JOBLASTTIMESTAMP),0)
Can anybody give an idea on how to get the log for only the last run and not for the entire day.

Thanks in advance,
Sridhar G
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

This is a very popular topic lately. I'm still somewhat at a loss as to why people would want to capture and save all of this information. Metrics, yes, but entire job logs? :? Ok, if that's what you need to do...

Basically, you need to tell it when to start as by default it will give you everything in the log. There is syntax for determining the starting timestamp of the most recent job run, from what I remember. Search the forum. The topic has been discussed alot and various solutions are waiting here, depending on the approach you want to take.
-craig

"You can never have too many knives" -- Logan Nine Fingers
prabu
Participant
Posts: 146
Joined: Fri Oct 22, 2004 9:12 am

Re: Capturing Job log

Post by prabu »

Sridhar G wrote:Hi all,
We have a requirement in our project to capture job log for each job in a sequential file. The following routine returns the log for a particular job for the last ran day.

Code: Select all

DSGetLogSummary(JobHandle,DSJ.LOGANY,DSGetJobInfo(JobHandle,DSJ.JOBSTARTTIMESTAMP),DSGetJobInfo(JobHandle,DSJ.JOBLASTTIMESTAMP),0)
Can anybody give an idea on how to get the log for only the last run and not for the entire day.

Sridhar G
Hi <B>Unfortunately</B> , the above code gives you only the last log detail for the day and not the complete log. :D
or do you want it for the whole day :o
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You quoted their requirements:
Sridhar G wrote:Can anybody give an idea on how to get the log for only the last run and not for the entire day.
Searching the forum will turn up lots of advice on this, including this post. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
prabu
Participant
Posts: 146
Joined: Fri Oct 22, 2004 9:12 am

Post by prabu »

chulett wrote:You quoted their requirements:
Sridhar G wrote:Can anybody give an idea on how to get the log for only the last run and not for the entire day.
Searching the forum will turn up lots of advice on this, including this post. :wink:
The Code Sridhar has given does exactly what he wants , ie, if there are 10 runs on a given day , it will give me only the details for the 10th run (ie, the last run) and not the previous ones :? . please let me know if this is <b>NOT</b> the requirement
prabu
Participant
Posts: 146
Joined: Fri Oct 22, 2004 9:12 am

Post by prabu »

Code: Select all

DSGetLogSummary(hJob1,DSJ.LOGANY,DSGetJobInfo(hJob1,DSJ.JOBSTARTTIMESTAMP)[1,10]:' 00:00:00',  DSGetJobInfo(hJob1,DSJ.JOBLASTTIMESTAMP),0)
the above code will give the etntries for the last run day
and the below code only the last run (and not the last run day)

Code: Select all

DSGetLogSummary(hJob1,DSJ.LOGANY,DSGetJobInfo(hJob1,DSJ.JOBSTARTTIMESTAMP),  DSGetJobInfo(hJob1,DSJ.JOBLASTTIMESTAMP),0)
hope i have got it this time or am I???? :D [/code]
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Search the Forum for //JOB.STARTED.NO which you will find to be a particuarly useful nugget of knowledge in your current quest.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Bryceson
Charter Member
Charter Member
Posts: 88
Joined: Wed Aug 03, 2005 1:11 pm
Location: Madison, WI

Post by Bryceson »

Folks,

I would like to make use of the DSGetLogSummary function, but I guess I have not quite understood where in DataStage I need to palce this function and extract the information it returns. I see the info in Diretor by viewing the log, but I want to get a dump of that where else.

Preferably I want to do it in Unix if at all possible.

Code: Select all

[color=red]DSGetLogSummary[/color][color=green](JobHandle,DSJ.LOGANY,DSGetJobInfo(JobHandle,DSJ.JOBSTARTTIMESTAMP),  DSGetJobInfo(JobHandle,DSJ.JOBLASTTIMESTAMP),0)[/color]
Any suggestion will be appreciated.
Bryceson
Charter Member
Charter Member
Posts: 88
Joined: Wed Aug 03, 2005 1:11 pm
Location: Madison, WI

Post by Bryceson »

Folks,

I would like to make use of the DSGetLogSummary function, but I guess I have not quite understood where in DataStage I need to palce this function and extract the information it returns. I see the info in Diretor by viewing the log, but I want to get a dump of that where else.

Preferably I want to do it in Unix if at all possible.

Code: Select all

DSGetLogSummary(JobHandle,DSJ.LOGANY,DSGetJobInfo(JobHandle,DSJ.JOBSTARTTIMESTAMP),DSGetJobInfo(JobHandle,DSJ.JOBLASTTIMESTAMP),0)
Any suggestion will be appreciated.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

All of the DSGet* functions have an equivalent option in 'dsjob' from the command line. For example, DSGetLogSummary is the -logsum option from what I recall. So it is perfectly feasible to script something rather than code up a routine to do this.

Bone up on it by reading the Server Job Developer's Guide section on the Command Line Interface which is kind of buried down near the bottom of the 'DataStage Development Kit (Job Control Interfaces)' Chapter.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Bryceson
Charter Member
Charter Member
Posts: 88
Joined: Wed Aug 03, 2005 1:11 pm
Location: Madison, WI

Post by Bryceson »

Thanks Craig!! Will dive in that section of the Server Developer to get more light.

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

Post by ray.wurlod »

What ever happened to sridarg, the original poster? :?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Two posts in December 2004 and then gone, it seems. :(
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply