Job Status in Server transformer
Moderators: chulett, rschirm, roy
Job Status in Server transformer
I was using the following code in the column derrivation of my server transformer to get the job status,
DSGetJobInfo(JobName, DSJobStatus)
but it was not reuturing any value.
Please help me in achieving it.
I've list of jobs avaialable in the project in a spreasheet as like below,
Job1
Job2
Job3
Job4
I was asked to get the output as like below,
Output:
Job1 Finished
Job2 Finished with warnings
Job3 Aborted
Job4 Not compiled
DSGetJobInfo(JobName, DSJobStatus)
but it was not reuturing any value.
Please help me in achieving it.
I've list of jobs avaialable in the project in a spreasheet as like below,
Job1
Job2
Job3
Job4
I was asked to get the output as like below,
Output:
Job1 Finished
Job2 Finished with warnings
Job3 Aborted
Job4 Not compiled
Recheck the syntax. It requires a job handle, not a name, so you'll need to put it in a routine and add a call to DSAttachJob(), then call it with the appropriate InfoType:
I've left out any error handling and all possible case values but it's plenty to get you going.
Code: Select all
jHandle = DSAttachJob(JobName)
jStatus = DSGetJobInfo(jHandle, DSJ.JOBSTATUS
ErrCode = DSDetachJob(jHandle)
Begin Case
Case jStatus = 1
Ans = JobName : " Finished"
Case jStatus = 2
Ans = JobNAme : " Finished with warnings"
Case jStatus = 3
Ans = JobName : " Aborted"
End Case
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi,
I cereated the below routine with the name 'GetJobStatus'
I also placed a constraint in the transfomer to omit the job name that was calling the above routine...
It is generating the expected results.
Thanks...
I cereated the below routine with the name 'GetJobStatus'
Called in my job through tranformer as follows$include DSINCLUDE JOBCONTROL.H
JobName=Arg1
JobHandle = DSAttachJob (JobName, DSJ.ERRFATAL)
controllerList=DSGetJobInfo(JobHandle,DSJ.JOBSTATUS)
ErrCode=DSDetachJob(JobHandle);
Begin Case
Case controllerList = 1
Ans = "Finished"
Case controllerList = 2
Ans = "Finished with warnings"
Case controllerList = 3
Ans = "Aborted"
End Case
GetJobStatus(JobName)
I also placed a constraint in the transfomer to omit the job name that was calling the above routine...
It is generating the expected results.
Thanks...
-
- Participant
- Posts: 42
- Joined: Wed Dec 26, 2007 1:58 am
- Location: India
What is the staus code for the jobs having status Not Compiled, Reset, Running & your code doesn't include that?DSMaestro wrote:Hi,
I cereated the below routine with the name 'GetJobStatus'
Called in my job through tranformer as follows$include DSINCLUDE JOBCONTROL.H
JobName=Arg1
JobHandle = DSAttachJob (JobName, DSJ.ERRFATAL)
controllerList=DSGetJobInfo(JobHandle,DSJ.JOBSTATUS)
ErrCode=DSDetachJob(JobHandle);
Begin Case
Case controllerList = 1
Ans = "Finished"
Case controllerList = 2
Ans = "Finished with warnings"
Case controllerList = 3
Ans = "Aborted"
End Case
GetJobStatus(JobName)
I also placed a constraint in the transfomer to omit the job name that was calling the above routine...
It is generating the expected results.
Thanks...
Regards
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: