Page 1 of 1

Capturing Job log

Posted: Wed Dec 29, 2004 5:38 am
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

Posted: Wed Dec 29, 2004 8:30 am
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.

Re: Capturing Job log

Posted: Wed Dec 29, 2004 10:36 am
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

Posted: Wed Dec 29, 2004 11:05 am
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:

Posted: Wed Dec 29, 2004 11:25 am
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

Posted: Wed Dec 29, 2004 11:48 am
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]

Posted: Wed Dec 29, 2004 3:03 pm
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.

Posted: Fri Jun 22, 2007 1:05 pm
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.

Posted: Fri Jun 22, 2007 1:08 pm
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.

Posted: Fri Jun 22, 2007 1:12 pm
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.

Posted: Fri Jun 22, 2007 1:39 pm
by Bryceson
Thanks Craig!! Will dive in that section of the Server Developer to get more light.

Bryceson

Posted: Sat Jun 23, 2007 6:50 am
by ray.wurlod
What ever happened to sridarg, the original poster? :?

Posted: Sat Jun 23, 2007 9:10 am
by chulett
Two posts in December 2004 and then gone, it seems. :(