Identify Jobs that comples with warning

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
dsuser_cai
Premium Member
Premium Member
Posts: 151
Joined: Fri Feb 13, 2009 4:19 pm

Identify Jobs that comples with warning

Post by dsuser_cai »

Hi

We have nearly 200 to 250 jobs (server jobs and parallel jobs) that run everyday, ymy question is, is there any way we can create a job that will identify the jobs (job names) that completed with status Finished / Finished with warning / Aborted and load them in a table or send a report as email. Also if the jobs have some warning then it should give the warning message. For example the output should be having a columns like Job_Name, Status (OK/Warning/Aborted) and Description (this should include the warning and error messages).
Thanks
Karthick
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You were doing fine up until that last little bit. Getting the first part is easy and a simple script can get a list of the job names in a project then iterate through them to check and record the status of each. All that using 'dsjob'. Write the results out to a flat file and then either load it to a table or email it. Or both.

Adding in log messages complicates things but doesn't make it impossible. For a job found to not be in an "OK" status, you could do further dsjob checks of the specific contents of their logs and pull out warnings and/or errors if you like.

All of the functions you can use for this are documented in either of the two Developer's Guide pdfs in the Command Line Interface chapter.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

And you can also do it with a job, which was your original question, but you will need to write a couple of routines to gather information as each job is processed through your new job (which must be smart enough not to process itself, lest you introduce infinite recursion).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

True... not sure why I went down the script path, but either is valid and would use the same techniques with the caveat Ray mentioned for the job approach.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First off, it's not SQL though it looks like it is, so there's no Oracle or Toad or sqlplus for this. You need to run it in the "Universe" repository and that means either manually using the Command window of the Administrator (or from a TCL prompt) or in a job by using the UV stage set to "localuv".

Also note that your query gets you the job number which you don't need for this and only works for one job at a time. For your task, use a more basic query to get a list of all job names in the current project:

Code: Select all

SELECT NAME FROM DS_JOBS
Off the top of my head, you'll get more than just jobs, meaning control records will be included as well. You can either filter them out in the query directly or constrain them out in a downstream transformer. I don't recall exactly what they will look like, "\\" something or other, but they will be obvious when you run the query.

Then with the name you can establish a handle by attaching to each job, then use that handle to pull the information that you need. Don't forget two very important things: 1) You current job will also get selected in the list, do not attempt to attach to it. And 2) always detach each handle when you are through with it. Me, I would put all this in a routine - pass in the job name and pass back whatever you need, delimited if there are multiple values and parse the results - rather than trying to work directly inside a derivation.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you compile with Multi Job Compile tool you can get a report at the end of which jobs compiled OK, which compiled with warnings, and which failed to compile.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dsuser_cai
Premium Member
Premium Member
Posts: 151
Joined: Fri Feb 13, 2009 4:19 pm

Post by dsuser_cai »

Thank you so much, i will go through the pdf guides.
Thanks
Karthick
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well... that "comples" in the subject is a typo and should say "complete" not "compile", but I would wager you knew that. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
dsuser_cai
Premium Member
Premium Member
Posts: 151
Joined: Fri Feb 13, 2009 4:19 pm

Post by dsuser_cai »

chulett wrote:Well... that "comples" in the subject is a typo and should say "complete" not "compile", but I would wager you knew that. :wink:
Im Sorry about that. Next time I will make sure this dosent happen.
Thanks
Karthick
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

"compiles" is a closer match than "completes" (has QualityStage probabilistic matching hat on).

For "completes" the easy solution is in Director; disable display of categories in the View menu then sort by Status and/or filter on Status. Print report (perhaps to file) from the Project menu.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply