Get Job Status from Command Line

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
badhri
Participant
Posts: 42
Joined: Tue Mar 19, 2002 8:15 pm

Get Job Status from Command Line

Post by badhri »

Greetings:

I am trying to get the status of the jobs from the Command line and help monitor the jobs without using DS Director.

For this i just loop through all the jobs and run dsjob to get the log details and spool into a text. Then parse this text to derive the required info. This whole process is very consuming (say 2sec/job).

Is there any Universe table/VOC Entry that i can use to derive this quick.

Thanks in Advance.

Regards,
Badhri ...
Badhrinath Krishnamoorthy
www.cognizant.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not from the UniVerse command line, unless you know the internal structure in the Repository where status is recorded (it's based on a concept of "resources" - active stages that run in separate processes are also "resources").

You can, however, use the dsjob command from the operating system command line. The -jobinfo option reports job status among other things.

Code: Select all

dsjob -user userid -password password -jobinfo projectname jobname
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
badhri
Participant
Posts: 42
Joined: Tue Mar 19, 2002 8:15 pm

Post by badhri »

Hi Ray,

Thanks for your input. I tried this dsjob and get the update. But everytime someone wants to know the status of the jobs i need to run this dsjob command for all the jobs which is very time consuming. Is there anyway i can erive the status of the all the jobs in one go?

Badhri ...
Badhrinath Krishnamoorthy
www.cognizant.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Nothing that's supplied.

You could write your own wrapper to dsjob. For example:

Code: Select all

#!/bin/sh
project=myproject   # name of your project
for jobname in `dsjob -ljobs $project`
do
   jstatus=`dsjob -jobinfo $project $jobname| grep "Job Status" | cut -d: -f2`
   echo $jobname: $jstatus
done
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