Getting Job Elapsed time using shell script

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mandar84
Participant
Posts: 6
Joined: Sat Aug 18, 2007 4:32 am

Getting Job Elapsed time using shell script

Post by mandar84 »

I am trying to get the elapsed times for a list of DS Jobs using a shell script. The command used is -

ExecTime=`dsjob -server :$Server -report $Project $JobName |grep "Job elapsed time="`

The problem is...this is showing incorrect results. Can anyone please suggest some other way(routines or some other command) to do this.
v2kmadhav
Premium Member
Premium Member
Posts: 78
Joined: Fri May 26, 2006 7:31 am
Location: London

Re: Getting Job Elapsed time using shell script

Post by v2kmadhav »

what do you mean by incorrect results.... can you please quote an example...
AmeyJoshi14
Participant
Posts: 334
Joined: Fri Dec 01, 2006 5:17 am
Location: Texas

Post by AmeyJoshi14 »

Strange! :? When I use the following query it gave me desired results:

Code: Select all

$ dsjob -report $PROJECT_NAME $JOB_NAME BASIC

**************************************************
STATUS REPORT FOR JOB: $JOBNAME
Generated: 2009-02-17 06:00:30
   Job start time=2009-02-15 18:20:18
   Job end time=2009-02-15 18:20:54
   Job elapsed time=00:00:36

val=`dsjob -report $PROJECT_NAME $JOBNAME BASIC | egrep "Job elapsed time"` 

Status code = 0

$ echo $val
Job elapsed time=00:00:36
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
mandar84
Participant
Posts: 6
Joined: Sat Aug 18, 2007 4:32 am

Post by mandar84 »

If the Job is run multiple times(more than one log entries for Job run)...it is showing start time of the first run and end time of the last run.
Post Reply