How to obtain the starttimestamp of the parent-sequencer
Moderators: chulett, rschirm, roy
How to obtain the starttimestamp of the parent-sequencer
Hello,
I have several DS-server-jobs grouped into several sequence-jobs. These sequence-jobs are also combined into other sequence-jobs. This hierarchy is 4 levels.
I want to obtain the start-timestamp of the 'highest' sequence-job in the DS-jobs on the lowest level.
Can someone tell me how to do this?
Thanks in advance.
Johannes Drost
I have several DS-server-jobs grouped into several sequence-jobs. These sequence-jobs are also combined into other sequence-jobs. This hierarchy is 4 levels.
I want to obtain the start-timestamp of the 'highest' sequence-job in the DS-jobs on the lowest level.
Can someone tell me how to do this?
Thanks in advance.
Johannes Drost
Kind regards,
Johannes Drost
Johannes Drost
-
- Participant
- Posts: 107
- Joined: Wed Sep 29, 2004 10:15 am
Assign JobHandle = DSJ.ME and then write a loop that uses a call to DSGetJobInfo(JobHandle,DSJ.JOBCONTROLLER) to get the parent job, then open up that job and issue the call again until you have found the ultimate parent process and then use another call to DSGetJobInfo to retrieve the start time.
Even with error handling it is just a couple of lines of code when finished and quite fast. I've had to do this before, so I know it works.
Even with error handling it is just a couple of lines of code when finished and quite fast. I've had to do this before, so I know it works.
What do you mean by '..., then open up that job and issue the call again.'? DSGetJobInfo(jobhandle, DSJ.JOBCONTROLLER) returns a string of the parent-job. How do I vovert this string into a jobhandle?
Below the code I wrote based on your remarks:
JobHandle = CurrentJob
Loop
ParentJob = DSGetJobInfo(JobHandle,DSJ.JOBCONTROLLER)
If ParentJob <> DSJE.BADHANDLE Then
JobHandle = ParentJob
Else
Exit
End
Repeat
Is this code correct?
Thanks in advance for your response.
Johannes Drost
Below the code I wrote based on your remarks:
JobHandle = CurrentJob
Loop
ParentJob = DSGetJobInfo(JobHandle,DSJ.JOBCONTROLLER)
If ParentJob <> DSJE.BADHANDLE Then
JobHandle = ParentJob
Else
Exit
End
Repeat
Is this code correct?
Thanks in advance for your response.
Johannes Drost
Kind regards,
Johannes Drost
Johannes Drost
I also tried the code below, but this code also did not work (the previous code did not work either):
JobHandle = CurrentJob
Loop
ParentJob = DSGetJobInfo(JobHandle,DSJ.JOBCONTROLLER)
If ParentJob <> @NULL Then
ParentJobHandle = DSAttachJob(Parentjob,DSJ.ERRFATAL)
JobHandle = ParentJobHandle
DET = DSDetachJob(ParentJobHandle)
End
Else
Exit
End
Repeat
Could you send me the an example of the code you used?
Thanks in advance.
Johannes Drost
JobHandle = CurrentJob
Loop
ParentJob = DSGetJobInfo(JobHandle,DSJ.JOBCONTROLLER)
If ParentJob <> @NULL Then
ParentJobHandle = DSAttachJob(Parentjob,DSJ.ERRFATAL)
JobHandle = ParentJobHandle
DET = DSDetachJob(ParentJobHandle)
End
Else
Exit
End
Repeat
Could you send me the an example of the code you used?
Thanks in advance.
Johannes Drost
Kind regards,
Johannes Drost
Johannes Drost
I used JobHandle = DSJ.ME and you changed that, so that part won't work.
After you get a job name you need to issue a call to DSAttachJob() to open up a new handle and then use that handle for the next call to DSGetJobInfo(). Any more code would only be visible to you if you were a premium member, so I didn't include it.
After you get a job name you need to issue a call to DSAttachJob() to open up a new handle and then use that handle for the next call to DSGetJobInfo(). Any more code would only be visible to you if you were a premium member, so I didn't include it.
-
- Participant
- Posts: 13
- Joined: Fri Aug 11, 2006 11:57 am
- Location: Toulouse, France
Wrong output from DSGetJobInfo("MyJob", DSJ.JOBCON
Thanks for your response(s).
I have build a function 'getUltimateParent' based on your response(s), but when I test it it doesn't seem to work correct. To debug the function I write the jobname(s) which are returned by DSGetJobInfo to a text-file.
I have made a testcase of a job of 3 levels:
Job_Level1 (highest level)
Job_Level2 (is called by Job_Level1)
Job_Level3 (is called by Job_Level2)
In Job_Level3 I call getUltimateParent.
The call to DSGetJobInfo only returns the name of the parent-job directly in control of the current job ('Job_Level2'), not the total structure of parent-jobs ('Job_Level1.Job_Level2') as is described in the help-text:'DSJ.JOBCONTROLLER String - name of the job controlling the job referenced by the job handle. Note that this may be several job names separated by periods if the job is controlled by a job which is itself controlled, etc.'.
Is this a bug, or do interpret the helptext wrong?
I have build a function 'getUltimateParent' based on your response(s), but when I test it it doesn't seem to work correct. To debug the function I write the jobname(s) which are returned by DSGetJobInfo to a text-file.
I have made a testcase of a job of 3 levels:
Job_Level1 (highest level)
Job_Level2 (is called by Job_Level1)
Job_Level3 (is called by Job_Level2)
In Job_Level3 I call getUltimateParent.
The call to DSGetJobInfo only returns the name of the parent-job directly in control of the current job ('Job_Level2'), not the total structure of parent-jobs ('Job_Level1.Job_Level2') as is described in the help-text:'DSJ.JOBCONTROLLER String - name of the job controlling the job referenced by the job handle. Note that this may be several job names separated by periods if the job is controlled by a job which is itself controlled, etc.'.
Is this a bug, or do interpret the helptext wrong?
Kind regards,
Johannes Drost
Johannes Drost
How can I then retrieve the jobHandle of the next parent level? What is wrong in my code?
My code:
JobHandle = DSJ.ME
Loop
ParentJob = DSGetJobInfo(JobHandle,DSJ.JOBCONTROLLER)
If ParentJob <> @NULL Then
ParentJobHandle = DSAttachJob(ParentJob,DSJ.ERRFATAL)
JobHandle = ParentJobHandle
End
Else
Exit
End
Repeat
My code:
JobHandle = DSJ.ME
Loop
ParentJob = DSGetJobInfo(JobHandle,DSJ.JOBCONTROLLER)
If ParentJob <> @NULL Then
ParentJobHandle = DSAttachJob(ParentJob,DSJ.ERRFATAL)
JobHandle = ParentJobHandle
End
Else
Exit
End
Repeat
Kind regards,
Johannes Drost
Johannes Drost
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Probably the overwriting of the job handle. Definitely the illegal comparison with @NULL (you must use the IsNull() function to test for null). Failure to detach jobs when done with them probably doesn't help either.
A possiblity would be re-cast this routine so that it could call itself recursively. What does DSGetJobInfo(hJob, DSJ.JOBCONTROLLER) return if the job is not run under control? I suspect it's "" rather than @NULL.
A possiblity would be re-cast this routine so that it could call itself recursively. What does DSGetJobInfo(hJob, DSJ.JOBCONTROLLER) return if the job is not run under control? I suspect it's "" rather than @NULL.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: