DSGetJobInfo
Moderators: chulett, rschirm, roy
DSGetJobInfo
Hi,
Requirement: To get Sequence name(output) corresponding to Job name(input) through below routine.
$include DSINCLUDE JOBCONTROL.H
JobName=Arg1
JobHandle = DSAttachJob ("JobName", DSJ.DSJ.ERRFATAL)
controllerList=DSGetJobInfo(JobHandle, DSJ.STAGENAME)
ErrCode=DSDetachJob(JobHandle)
Ans=controllerList
But everytime i am executing it by passing a job name, it returning 0/-1 etc.... not the sequence name.
Please suggest me where i am wrong.
Thanks
Subrat
Requirement: To get Sequence name(output) corresponding to Job name(input) through below routine.
$include DSINCLUDE JOBCONTROL.H
JobName=Arg1
JobHandle = DSAttachJob ("JobName", DSJ.DSJ.ERRFATAL)
controllerList=DSGetJobInfo(JobHandle, DSJ.STAGENAME)
ErrCode=DSDetachJob(JobHandle)
Ans=controllerList
But everytime i am executing it by passing a job name, it returning 0/-1 etc.... not the sequence name.
Please suggest me where i am wrong.
Thanks
Subrat
Try
Code: Select all
controllerlist=DSGetJobInfo(JobHandle,DSJ.JOBCONTROLLER)
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
Thanks for the replay.
I used the " controllerList=DSGetJobInfo(JobHandle,DSJ.DSJobController)" as well but getting the same output (-1/0 etcc...)
Seeking ur suggestion
I used the " controllerList=DSGetJobInfo(JobHandle,DSJ.DSJobController)" as well but getting the same output (-1/0 etcc...)
Seeking ur suggestion
keshav0307 wrote:STAGENAME will not retun the sequence name.
if you can get the newest event id for and then this command
./dsjob -logdetail <Project name> <job Name> <newest event id -4> <newest event id>|grep DSJobController
this will return the sequence of the job
-
- Participant
- Posts: 334
- Joined: Fri Dec 01, 2006 5:17 am
- Location: Texas
Hi Keshav,keshav0307 wrote:STAGENAME will not retun the sequence name.
if you can get the newest event id for and then this command
dsjob -logdetail <Project name> <job Name> <newest event id -4> <newest event id>|grep DSJobController
this will return the sequence of the job
One simple question.."grep DSJobController" will give all the jobs used in the a particular sequence..
![Confused :?](./images/smilies/icon_confused.gif)
![Smile :)](./images/smilies/icon_smile.gif)
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)
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)
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Thanks Ray. Now it is working....
I have one more question.. I have some 1000 DS Jobs.
I hav created a simple job where it will take these 1000 jobs in sequential file and in Transformaer of the job i have used the above routine to get the corresponding sequence which will be come in my output sequential file.
But when i am running this job i am getting the below error.
SEQTEST..Transformer_4 (fatal error from DSAttachJob): Job control fatal error (-12)
(DSOpenJob) Cannot open job DLY_Load_ABC_ABC040_Cust_OAT. - not a runnable job
This may be happening bcos some of the jobs are not compiled.. But anyhow i want my job should run and give me my desired output(sequence name)...
Please suggest..
Thanks
Subrat
I have one more question.. I have some 1000 DS Jobs.
I hav created a simple job where it will take these 1000 jobs in sequential file and in Transformaer of the job i have used the above routine to get the corresponding sequence which will be come in my output sequential file.
But when i am running this job i am getting the below error.
SEQTEST..Transformer_4 (fatal error from DSAttachJob): Job control fatal error (-12)
(DSOpenJob) Cannot open job DLY_Load_ABC_ABC040_Cust_OAT. - not a runnable job
This may be happening bcos some of the jobs are not compiled.. But anyhow i want my job should run and give me my desired output(sequence name)...
Please suggest..
Thanks
Subrat
ray.wurlod wrote:JobName should not be quoted in DSAttachJob - this means that you are trying to attach a job that is actually called "JobName". ...
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: