Can we get only job status???
Moderators: chulett, rschirm, roy
Can we get only job status???
Hi,
I like to write a batch job which contains all other jobs from my project directory to get only their job status whether they are successful or not.
I don't want to run those jobs from there.I just want to get their status only.
Can I do that???
Could u pls give me some idea???
Thanks,
I like to write a batch job which contains all other jobs from my project directory to get only their job status whether they are successful or not.
I don't want to run those jobs from there.I just want to get their status only.
Can I do that???
Could u pls give me some idea???
Thanks,
You would need to use
which will give you the status of the job.
where JobHandle is the Handle for the job returned by
Use erroMode as DSJ.ERRNONE. You can get the name of the jobs from
Code: Select all
Result = DSGetJobInfo (JobHandle, DSJ.JOBSTATUS)
where JobHandle is the Handle for the job returned by
Code: Select all
JobHandle = DSAttachJob (JobName, ErrorMode)
Code: Select all
Call DSExecute("NAME FMT '60R' FROM DS_JOBS WHERE NAME NOT LIKE '%\%';",cmd,output,sysretcode)
Success consists of getting up just one more time than you fall.
Ice,
Kim Duke has posted this. You can search the posts of Kim, something it would have
It is part of his ETL_Stats code. Search for it
Kim Duke has posted this. You can search the posts of Kim, something it would have
Code: Select all
begin case
case JStat = 0
JobStatus = 'Running'
CanRunFlag = 0
CanResetFlag = 0
CanStopFlag = 1
case JStat = 1
JobStatus = 'Finished'
case JStat = 2 ; * Finished with warnings
JobStatus = 'Finished'
case JStat = 3
ContinueFlag = @false
JobStatus = 'Aborted'
CanRunFlag = 0
case JStat = 11
JobStatus = 'Finished'
case JStat = 12 ; * Validated with warnings
JobStatus = 'Finished'
case JStat = 13
* ContinueFlag = @false
JobStatus = 'Finished'
case JStat = 21
JobStatus = 'Finished'
case JStat = 96
ContinueFlag = @false
JobStatus = 'Aborted'
CanRunFlag = 0
case JStat = 97
* ContinueFlag = @false
JobStatus = 'Stopped'
CanRunFlag = 0
case JStat = 98
JobStatus = 'Finished'
case JStat = 99
JobStatus = 'Finished'
case @true
ContinueFlag = @false
JobStatus = 'Not Compiled'
CanRunFlag = 0
CanResetFlag = 0
end case
end
Rgds
Anand
Anand
Hi loveojha2,
Thanks for your suggestion.But still i need some suggestion.
You give the example to get the jobs name.
So there are more than one jobs I will get if I use this.Right?So do I have to use the loop function to get the job status???
Thank u so much,
ICE
Thanks for your suggestion.But still i need some suggestion.
You give the example to get the jobs name.
So there are more than one jobs I will get if I use this.Right?So do I have to use the loop function to get the job status???
Thank u so much,
ICE
loveojha2 wrote:You would need to use
which will give you the status of the job.Code: Select all
Result = DSGetJobInfo (JobHandle, DSJ.JOBSTATUS)
where JobHandle is the Handle for the job returned by
Use erroMode as DSJ.ERRNONE. You can get the name of the jobs fromCode: Select all
JobHandle = DSAttachJob (JobName, ErrorMode)
Code: Select all
Call DSExecute("NAME FMT '60R' FROM DS_JOBS WHERE NAME NOT LIKE '%\%';",cmd,output,sysretcode)
Yes
and don't forget to detach the job, once you have read the status with
![Smile :)](./images/smilies/icon_smile.gif)
and don't forget to detach the job, once you have read the status with
Code: Select all
ErrCode = DSDetachJob(JobHandle)
ICE wrote:Hi loveojha2,
Thanks for your suggestion.But still i need some suggestion.
You give the example to get the jobs name.
So there are more than one jobs I will get if I use this.Right?So do I have to use the loop function to get the job status???
Thank u so much,
ICE
loveojha2 wrote:You would need to use
which will give you the status of the job.Code: Select all
Result = DSGetJobInfo (JobHandle, DSJ.JOBSTATUS)
where JobHandle is the Handle for the job returned by
Use erroMode as DSJ.ERRNONE. You can get the name of the jobs fromCode: Select all
JobHandle = DSAttachJob (JobName, ErrorMode)
Code: Select all
Call DSExecute("NAME FMT '60R' FROM DS_JOBS WHERE NAME NOT LIKE '%\%';",cmd,output,sysretcode)
Success consists of getting up just one more time than you fall.
Dear loveojha2,
May I know how to get the job name one by one???
Now your exp will give the series of jobs name.Right?So how to get one by one.I mean how to assign to a variable???I cannot assign to one variable when I run this DSExecute.
Or can I use the jobname as the alias of NAME from that query statement.I think it's a query statement.Right?
Sorry for my inconvinience.
I am very poor knowledge in this.
Thank u so much 4 ur help.
May I know how to get the job name one by one???
Now your exp will give the series of jobs name.Right?So how to get one by one.I mean how to assign to a variable???I cannot assign to one variable when I run this DSExecute.
Or can I use the jobname as the alias of NAME from that query statement.I think it's a query statement.Right?
Sorry for my inconvinience.
I am very poor knowledge in this.
Thank u so much 4 ur help.
loveojha2 wrote:Yes![]()
and don't forget to detach the job, once you have read the status with
Code: Select all
ErrCode = DSDetachJob(JobHandle)
ICE wrote:Hi loveojha2,
Thanks for your suggestion.But still i need some suggestion.
You give the example to get the jobs name.
So there are more than one jobs I will get if I use this.Right?So do I have to use the loop function to get the job status???
Thank u so much,
ICE
loveojha2 wrote:You would need to use
which will give you the status of the job.Code: Select all
Result = DSGetJobInfo (JobHandle, DSJ.JOBSTATUS)
where JobHandle is the Handle for the job returned by
Use erroMode as DSJ.ERRNONE. You can get the name of the jobs fromCode: Select all
JobHandle = DSAttachJob (JobName, ErrorMode)
Code: Select all
Call DSExecute("NAME FMT '60R' FROM DS_JOBS WHERE NAME NOT LIKE '%\%';",cmd,output,sysretcode)
FromICE wrote:Dear loveojha2,
May I know how to get the job name one by one???
Now your exp will give the series of jobs name.Right?So how to get one by one.I mean how to assign to a variable???I cannot assign to one variable when I run this DSExecute.
Or can I use the jobname as the alias of NAME from that query statement.I think it's a query statement.Right?
Sorry for my inconvinience.
I am very poor knowledge in this.
Call DSExecute("NAME FMT '60R' FROM DS_JOBS WHERE NAME NOT LIKE '%\%';",cmd,output,sysretcode)
output will contain the list of the jobnames separated by @FM (it will also contain CHAR(10)s). Use Field function to select individual jobnames from this string.
Success consists of getting up just one more time than you fall.
hmmm... that last post needs to be corrected!
The command to execute had 2 errors, it should read:
Your output variable "output" will contain a multivalued list of the jobs located. You can then do something like:
The command to execute had 2 errors, it should read:
Code: Select all
Call DSExecute("UV","SELECT NAME FMT '60R' FROM DS_JOBS WHERE NAME NOT LIKE '%\%';",output,sysretcode)
Code: Select all
JobsFound = DCOUNT(output,@FM)
FOR I = 1 TO JobsFound
JobNameToCheck = output<I>
** do your processing here **
NEXT I
Thank you so much.
But I still have some more questions.
Can I output to the txt file in batch job?
How to make it???
Can I call a routine from batch job???
How to call ???
Thanks in Advance,
But I still have some more questions.
Can I output to the txt file in batch job?
How to make it???
Can I call a routine from batch job???
How to call ???
Thanks in Advance,
ArndW wrote:hmmm... that last post needs to be corrected!
The command to execute had 2 errors, it should read:
Your output variable "output" will contain a multivalued list of the jobs located. You can then do something like:Code: Select all
Call DSExecute("UV","SELECT NAME FMT '60R' FROM DS_JOBS WHERE NAME NOT LIKE '%\%';",output,sysretcode)
Code: Select all
JobsFound = DCOUNT(output,@FM) FOR I = 1 TO JobsFound JobNameToCheck = output<I> ** do your processing here ** NEXT I
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I think we're becoming confused. By "batch job" do you mean the task of getting each job's job status?
Can I output to the txt file in batch job? Yes
How to make it??? OpenSeq, WriteSeq, CloseSeq
Can I call a routine from batch job??? Yes
How to call ??? What kind of routine?
Why not just create a regular server job that processes DS_JOBS using a Hashed File stage or UniVerse stage (you need only the NAME column; declare it as VarChar(254)) to get the job names, call a routine via a Transformer stage to get the job status, and direct the output to a Sequential File stage?
Can I output to the txt file in batch job? Yes
How to make it??? OpenSeq, WriteSeq, CloseSeq
Can I call a routine from batch job??? Yes
How to call ??? What kind of routine?
Why not just create a regular server job that processes DS_JOBS using a Hashed File stage or UniVerse stage (you need only the NAME column; declare it as VarChar(254)) to get the job names, call a routine via a Transformer stage to get the job status, and direct the output to a Sequential File stage?
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.
I don't know whether they will work for DS 4.x, as they have only been used in anger against DS 6.x & DS 7.x, but one option for you may be to try either this thread or this one.
Both threads provide DS jobs that allow different dumps of DS Director job log. The first thread (you can ignore the spreadsheet bit if you want - the DS job creates a flat file that you can always manipulate) provides a summary of each job that has been run, with one of the columns created being the job status. The second thread provides a complete dump of the Director log content and you could always pick apart the job and steal this bits you want if the first thread isn't of any use.
<aside>Craig, is that an improvement on the "Try here" message?
</aside>
David
Both threads provide DS jobs that allow different dumps of DS Director job log. The first thread (you can ignore the spreadsheet bit if you want - the DS job creates a flat file that you can always manipulate) provides a summary of each job that has been run, with one of the columns created being the job status. The second thread provides a complete dump of the Director log content and you could always pick apart the job and steal this bits you want if the first thread isn't of any use.
<aside>Craig, is that an improvement on the "Try here" message?
![Wink :wink:](./images/smilies/icon_wink.gif)
David
Great.Thank u so much ,Ray.
Really thanks to u.
Yeah,I wanna check all of my jobs status whether successfully done or not.
Now I created regular server job according to your suggestion.It works.Thank u so much.
ICE
Really thanks to u.
Yeah,I wanna check all of my jobs status whether successfully done or not.
Now I created regular server job according to your suggestion.It works.Thank u so much.
ICE
ray.wurlod wrote:I think we're becoming confused. By "batch job" do you mean the task of getting each job's job status?
Can I output to the txt file in batch job? Yes
How to make it??? OpenSeq, WriteSeq, CloseSeq
Can I call a routine from batch job??? Yes
How to call ??? What kind of routine?
Why not just create a regular server job that processes DS_JOBS using a Hashed File stage or UniVerse stage (you need only the NAME column; declare it as VarChar(254)) to get the job names, call a routine via a Transformer stage to get the job status, and direct the output to a Sequential File stage?
Dear Ray,
Now I got the jobs name but the DSJ.JOBSTATUS are always -1 even though they are not the same status.
May I know what is that???
May I know how to know the staus as -1 is what,1 is what.Like that way.Where can I find those information???I don't see any clarification in DS Dev help files.
Thank u so much.
Now I got the jobs name but the DSJ.JOBSTATUS are always -1 even though they are not the same status.
May I know what is that???
May I know how to know the staus as -1 is what,1 is what.Like that way.Where can I find those information???I don't see any clarification in DS Dev help files.
Thank u so much.
ray.wurlod wrote:I think we're becoming confused. By "batch job" do you mean the task of getting each job's job status?
Can I output to the txt file in batch job? Yes
How to make it??? OpenSeq, WriteSeq, CloseSeq
Can I call a routine from batch job??? Yes
How to call ??? What kind of routine?
Why not just create a regular server job that processes DS_JOBS using a Hashed File stage or UniVerse stage (you need only the NAME column; declare it as VarChar(254)) to get the job names, call a routine via a Transformer stage to get the job status, and direct the output to a Sequential File stage?
Hi ICE,
For me job status is -1 when I create a new job and its yet to be compiled.
But not very sure on this.
For me job status is -1 when I create a new job and its yet to be compiled.
But not very sure on this.
ICE wrote:Dear Ray,
Now I got the jobs name but the DSJ.JOBSTATUS are always -1 even though they are not the same status.
May I know what is that???
May I know how to know the staus as -1 is what,1 is what.Like that way.Where can I find those information???I don't see any clarification in DS Dev help files.
Thank u so much.
ray.wurlod wrote:I think we're becoming confused. By "batch job" do you mean the task of getting each job's job status?
Can I output to the txt file in batch job? Yes
How to make it??? OpenSeq, WriteSeq, CloseSeq
Can I call a routine from batch job??? Yes
How to call ??? What kind of routine?
Why not just create a regular server job that processes DS_JOBS using a Hashed File stage or UniVerse stage (you need only the NAME column; declare it as VarChar(254)) to get the job names, call a routine via a Transformer stage to get the job status, and direct the output to a Sequential File stage?
Success consists of getting up just one more time than you fall.
Hi loveojha2,
Thanks for ur sharing.......
My jobs are with different kinds of status.But I got all of the status as -1.
So,I wanna to know what this.At least it should be different status .Right?
Thanks,
ICE
Thanks for ur sharing.......
My jobs are with different kinds of status.But I got all of the status as -1.
So,I wanna to know what this.At least it should be different status .Right?
Thanks,
ICE
loveojha2 wrote:Hi ICE,
For me job status is -1 when I create a new job and its yet to be compiled.
But not very sure on this.
ICE wrote:Dear Ray,
Now I got the jobs name but the DSJ.JOBSTATUS are always -1 even though they are not the same status.
May I know what is that???
May I know how to know the staus as -1 is what,1 is what.Like that way.Where can I find those information???I don't see any clarification in DS Dev help files.
Thank u so much.
ray.wurlod wrote:I think we're becoming confused. By "batch job" do you mean the task of getting each job's job status?
Can I output to the txt file in batch job? Yes
How to make it??? OpenSeq, WriteSeq, CloseSeq
Can I call a routine from batch job??? Yes
How to call ??? What kind of routine?
Why not just create a regular server job that processes DS_JOBS using a Hashed File stage or UniVerse stage (you need only the NAME column; declare it as VarChar(254)) to get the job names, call a routine via a Transformer stage to get the job status, and direct the output to a Sequential File stage?