calculate Job EndDateTime and Job ElapsedTime.

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

ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

This documentation error has been known by IBM/Ascential for a while; I know I reported it over a year ago and got some tracking number for it. The BASIC Guide is actually pretty solid and doesn't contain many errors or omissions (unlike the PX ones).
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

ray.wurlod wrote:Yes. Notify the documentation fault via your support provider. Use the tokens in JOBCONTROL.H.
My JOBCONTROL.H has DSJ.JOBLASTTIMESTAMP

In my DS Constants, going through the drop down list from the Expression Editor menu, I find DSJ.JOBLASTIMESTAMP but no DSJ.JOBLASTTIMESTAMP.

If I use DSJ.JOBLASTTIMESTAMP in the derivation it complains, it does not complain for DSJ.JOBLASTIMESTAMP.(But get the warning in the logs for undefined InfoType.

So what is the correct usage? I am Confused :(
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

Post by vsi »

me too confused. :(

Thanks
vsi
Last edited by vsi on Fri Nov 17, 2006 2:13 pm, edited 1 time in total.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Can you please go for a new post for this, it is not related to the discussion in this thread.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Post by Nagin »

narasimha wrote:Can you please go for a new post for this, it is not related to the discussion in this thread.
Can you please tell me how do I look up the new post, if you've started it. Its an interesting topic, I would like to know more about it.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

One way would be to click on the poster's name and in their profile you can 'find all posts' by them. They are sorted in reverse date order, so hopefully it would be somewhere near the top and easily recognizable. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Nagin wrote:
narasimha wrote:Can you please go for a new post for this, it is not related to the discussion in this thread.
Can you please tell me how do I look up the new post, if you've started it. Its an interesting topic, I would like to know more about it.
I am still waiting on sombody who has encountered similar problems. This is not yet resolved :cry:
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What exactly is the problem you are waiting on a resolution for? With cryptic messages and obviously edited posts from other folks, I can't really tell at this point. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

im addressing VSI's original query here

I feel you cannot get the end time of a job within a job itself, because the job run cycle would not have completed . You would need to write a routine that attaches the job , and reads the job info , using DSGetJobInfo, after the job has completed a run. I use a routine activity stage in the sequencer, that runs after every job and gets the job start time, end time , status, warning and fatal error messages etc and write it to a 'LOG FILE'( One of the crazy 'business requirements'). As noted you can also try the ETl Stats package. For the routine's code you can try this piece of junk

Code: Select all


$INCLUDE DSINCLUDE JOBCONTROL.H 

DET = 0 
hJob = Trim(Job) 
DirName = Field(FileVar,';',1,1) 
File = Field(FileVar,';',2,1) 

ReportText = ''
PathName = ''
RetVal = 0
*----------Get Basic Job Info-------------------------------------*

JobHandle = DSAttachJob(hJob,DSJ.ERRFATAL) 
JobName = DSGetJobInfo(JobHandle,DSJ.JOBNAME) 
JobStarted = DSGetJobInfo(JobHandle,DSJ.JOBSTARTTIMESTAMP) 
JobEnded = DSGetJobInfo(JobHandle,DSJ.JOBLASTTIMESTAMP) 
JobElapsed = DSGetJobInfo(JobHandle,DSJ.JOBELAPSED)
JobStatus = DSGetJobInfo(JobHandle,DSJ.JOBSTATUS) 

ReportText = JobName:",":JobStarted:",":JobEnded:",":JobElapsed:",":JobStatus:Char(10)
*---------      Write Info To File in Append Mode------------------*

PathName = DirName:File

OpenSeq PathName To F.Var Then
Loop
ReadSeq Dummy From F.Var Else Exit ;* at end-of-file
Repeat
WriteSeqF ReportText To F.Var Else
Call DSLogFatal("Cannot write to ":PathName, "MyRoutine")
End
End Else
Call DSLogFatal("Cannot open file ":PathName, "MyRoutine")
End


*-------    Release Job   ----------------------------------------*
DET = DSDetachJob(JobHandle) 
Ans = 0
Job and FileVar are the arguments to this routine, FileVar consiste of directory path and filename, seperated by a semi colon. You will need to test this routine or customize it appropriately.
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Post by Nagin »

chulett wrote:What exactly is the problem you are waiting on a resolution for? With cryptic messages and obviously edited posts from other folks, I can't really tell at this point. :?
Craig,
We are trying to find how to get the job end date time as the following command triggering a warning message "DSGetJobInfo(DSJ.ME,DSJ.JOBLASTIMESTAMP)"
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

vsi wrote:Narsimha,
Thank you very much for your routine.

But i wonder why this is not possible to use

Code: Select all

DSGetJobInfo(DSJ.ME,DSJ.JOBLASTTIMESTAMP)
inside Derivation?

But i can use

Code: Select all

DSGetJobInfo(DSJ.ME,DSJ.JOBSTARTTIMESTAMP)
inside Derivation field,WithOUT any problem.

did someone tried using these in Derivation field?

Thanks
vsi
This was the issue I wanted to resolve, but got into another issue!
ray.wurlod wrote:Yes. Notify the documentation fault via your support provider. Use the tokens in JOBCONTROL.H.

1. My JOBCONTROL.H has DSJ.JOBLASTTIMESTAMP

2. In my DS Constants, going through the drop down list from the Expression Editor menu, I find DSJ.JOBLASTIMESTAMP but no DSJ.JOBLASTTIMESTAMP .

If I use DSJ.JOBLASTTIMESTAMP in the derivation it complains, it does not complain for DSJ.JOBLASTIMESTAMP .(But get the warning in the logs for undefined InfoType.

Craig, I wanted to know the correct usage, is it DSJ.JOBLASTTIMESTAMP or DSJ.JOBLASTIMESTAMP.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

as noted You cannot Use DSJ.LASTIMESTAMP, it is DSJ.LASTTIMESTAMP. And you do not use it from the transformer stage derivation within that job. When job executes the transformer, it hasnt yet completed, so how can you capture its end time within a run? You need to have a routine that attaches the job after the job has completed a run, gets all the info on the job and detaches it.

hth

ramesh
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Nagin wrote: We are trying to find how to get the job end date time as the following command triggering a warning message "DSGetJobInfo(DSJ.ME,DSJ.JOBLASTIMESTAMP)"
If you need the job end time, use either the routine ramesh has provided or mine on the previous page, as an after job routine, you should be fine!
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
Post Reply