Clearing the Director screen

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Clearing the Director screen

Post by gpbarsky »

[:)][:)][:)][:)][:)]

Hola, mis amigos...

When I run the jobs of my application, every one has an invocation id, and several copies of the same job my be running at the same time.

At last, the Director screen will have a long list of executed jobs (some finished fine and other aborted), and I need to clear this screen.

By example, I would like to have a job running and monitoring this screen. If the column status of a job is "Finished", then I would like this job to be deleted from the system.

Otherwise, if the column status of a job is "Aborted", I would like to send a note to some user telling what happens.

The last thing, is that jobs are run without waiting to finish, so I cannot monitor from within a job what happens with the execution of the job. I mean, I don't have the "job handler" to ask information about it.

How can I do to accomplish this task ?

Any help, will be very appreciated.

Chau amigos mios. Que tengan un buen dia...

[:)][:)][:)][:)][:)]


Guillermo P. Barsky
Buenos Aires - Argentina
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Recompilation of a base job removes all instantiated clones of that job.

I have a utility DataStage batch job that recompiles jobs. You could modify that job to periodically query your jobs and recompile them. If you want the .dsx, let me know.



Kenneth Bland
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

Kenneth:

Thank you for your response. But in the director screen I could have:

JOB STATUS ......
A.1 Finished
A.2 Finished
A.3 Finished
A.4 Finished
A.5 Finished
A.6 Finished
A.7 Aborted
A.8 Finished
A.9 Aborted
A.10 Finished
A.11 Finished

In this case, jobs A.7 and A.9 should not be cleared for further analysis.

So, the tool that I need should have the capability of retrieve the information of each job, and analyze the status of each.

Am I clear ?

Thanks again [;)]

Guillermo P. Barsky
Buenos Aires - Argentina
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Guillermo

I posted a compile routine http://www.tools4datastage.com/forum/to ... C_ID=84630 and in http://www.tools4datastage.com/forum/to ... C_ID=84566 how to get job status. You need to combine these two routines.

Kim.

Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

DSGetJobInfo is an API that does exactly this. Unfortunately, recompilation of the base job removes all clones. So, what you're asking is to selectively remove clone jobs. Can't be done with native API's.

Sorry, but why not cleanup all once analysis is done? Only clean up jobs if all clones are clean. This is ALL do-able.

Kenneth Bland
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

quote:Originally posted by gpbarsky
[br]By example, I would like to have a job running and monitoring this screen. If the column status of a job is "Finished", then I would like this job to be deleted from the system.

Otherwise, if the column status of a job is "Aborted", I would like to send a note to some user telling what happens.


I do not recommend this method of auditing. It is far easier to use an external file/table to keep track of things. If the job aborted, send to another job to record the abort via the Job Sequencer. Within this job recording the abort, output according to the parameters being passed in.

For our project, we have one centralized set of tables designated to be viewed by our Production team to observe results of any particular programs (including abort status, errors, warnings, and so on forth).

If you must find the aborted jobs via Director -- Ascential will be releasing DataStage 7.0 with color-coded jobs (and log status), making things a bit more easier for you to spot things. Perhaps this would be much closer to what you're looking for. You also could sort the list by status.

-T.J.


* * *

... now if this can make breakfast, my life is complete.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Colour coding of jobs is possible in DS 6.0 in Designer. You can set the colours for links to show you whether they're waiting, running, finished, aborted and a couple of other possibilities.
Tools > Options > Graphical Performance Monitor to set colours.
Diagram > Show Performance Statistics to show performance statistics.
Nothing happens until you run the job.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

[:)][:)][:)][:)][:)]

Hi my friends.

I think that really, the best solution that I'm searching is to access the DataStage tables, and retrieve the status of each job. Based on this, I will decide which job will be deleted or which will not.

But I don't know the structure of these tables, and I don't know how to access these tables.

Does anybody has a manual, or a document explain these two topics ? Where can I get them ? Or may be the job to access the tables.

I really appreciate all the answers that you posted.

[:)][:)][:)][:)][:)]


Guillermo P. Barsky
Buenos Aires - Argentina
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Guillermo

The code to get all the statuses of a job is http://www.tools4datastage.com/forum/to ... C_ID=84566. It was posted above. Follow this link.

Kim.

Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

[:)][:)][:)][:)][:)]

Hi friends.

I want to insist in the fact that what I really need is to DELETE the executed jobs, and ended Ok. I want to see no line for these jobs.

If in the Director screen you have something like this:

Jobname Status
A.1 Finished
A.2 Finished
A.3 Aborted
A.4 Aborted
A.5 Finished (see log)

I just want to see jobs A.3 and A.4. I know that I can filter entries in the Director screen, but I really want to DELETE from the entire system jobs A.1, A.2, and A.5.

Am I clear ?

Thanks again.
[:)][:)][:)][:)][:)]

Guillermo P. Barsky
Buenos Aires - Argentina
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Guillermo

Here is some real old code. Should be close. With main job record is stored in DS_JOBS. The key is the job name. Field 5 is the job number. There are several files that end in job number associated with the job. You have to delete the job and associated files.

USE AT YOUR OWN RISK.



* -------------------------------------------------------------------
get(arg.)ds.job.name else
print usage
stop
end
* -------------------------------------------------------------------
open 'DS_JOBS' to DS.JOBS else
print 'No DS_JOBS file'
stop
end
* -------------------------------------------------------------------
read main.job.rec from DS.JOBS, ds.job.name else
print 'No DataStage job named: ':ds.job.name
stop
end
* -------------------------------------------------------------------
job.files='DS_TEMP'
job.files='RT_BP'
job.files='RT_CONFIG'
job.files='RT_LOG'
job.files='RT_STATUS'
no.of.job.files=dcount(job.files, @FM)
* -------------------------------------------------------------------
job.num=job.rec
for XXX=first.file to no.of.job.files
filename=job.files< XXX >:job.num
ecmd='DELETE.FILE DATA ':filename
print ecmd
execute ecmd
delete VOC, filename
cnt+=1
if job.files< XXX >='RT_BP' then
filename=job.files< XXX >:job.num:'.O'
ecmd='DELETE.FILE DATA ':filename
print ecmd
execute ecmd
delete VOC, filename
cnt+=1
end
next i



Kim.

Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
spracht
Participant
Posts: 105
Joined: Tue Apr 15, 2003 11:30 pm
Location: Germany

Post by spracht »

Kim

always interesting to read this kind of, as it appears to me, old-fashioned code; this one seems to tell me how an entire job can be deleted from a project. But the real question is how to delete an invocation.

Stephan
Post Reply