calculate Job EndDateTime and Job ElapsedTime.
Moderators: chulett, rschirm, roy
My JOBCONTROL.H has DSJ.JOBLASTTIMESTAMPray.wurlod wrote:Yes. Notify the documentation fault via your support provider. Use the tokens in JOBCONTROL.H.
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
![Sad :(](./images/smilies/icon_sad.gif)
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.
I am still waiting on sombody who has encountered similar problems. This is not yet resolvedNagin wrote: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.narasimha wrote:Can you please go for a new post for this, it is not related to the discussion in this thread.
![Crying or Very sad :cry:](./images/smilies/icon_cry.gif)
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.
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
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.
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
Craig,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.
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)"
This was the issue I wanted to resolve, but got into another issue!vsi wrote:Narsimha,
Thank you very much for your routine.
But i wonder why this is not possible to useinside Derivation?Code: Select all
DSGetJobInfo(DSJ.ME,DSJ.JOBLASTTIMESTAMP)
But i can useinside Derivation field,WithOUT any problem.Code: Select all
DSGetJobInfo(DSJ.ME,DSJ.JOBSTARTTIMESTAMP)
did someone tried using these in Derivation field?
Thanks
vsi
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.
Finding answers is simple, all you need to do is come up with the correct questions.
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
hth
ramesh
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!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)"
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.