How do I count the total number of Jobs is a project?

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

dearkriss
Premium Member
Premium Member
Posts: 8
Joined: Mon Aug 22, 2005 12:42 pm

How do I count the total number of Jobs is a project?

Post by dearkriss »

I know there is a command for this in datastage administrator command window. But i just can not remember what it is. any idea?
The Right One at Right Place at Right Time
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

COUNT DS_JOBS will be very close, but would include a couple of control records. COUNT DS_JOBS WITH JOBNO LIKE "1N0N" will be more accurate, or COUNT DS_JOBS WITH NAME LIKE "1A0X"

If you prefer SQL, SELECT COUNT(*) FROM DS_JOBS WHERE NAME NOT LIKE '\\%';
Last edited by ray.wurlod on Wed Oct 25, 2006 9:08 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

you can also do it in the command prompt using the dsjob command

Code: Select all

dsjob -ljobs <Project Name> | wc -l
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The original question stipulated "in DataStage Administrator"

:idea: To execute a UNIX command from Administrator use the SH command. For example

Code: Select all

SH -c "dsjob -ljobs <Project Name> | wc -l"
:idea: To execute a DOS command from Administrator use the DOS command. For example:

Code: Select all

DOS /C "dsjob -ljobs <Project Name>"
Of course, if you're running 7.5x2 on Windows, you can use UNIX commands.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dearkriss
Premium Member
Premium Member
Posts: 8
Joined: Mon Aug 22, 2005 12:42 pm

Post by dearkriss »

Thank you Ray and DSguru2B. COUNT DS_JOBS in admin client gave me the approximate count and dsjob -ljobs <Project Name> | wc -l at command line gave the exact count. :D
The Right One at Right Place at Right Time
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

Where in the Administrator client would you execute?:

COUNT DS_JOBS and
SELECT COUNT(*) FROM DS_JOBS WHERE NAME NOT LIKE '\\%';

I have access to the Administrator command prompt and I can execute:
SH -c "dsjob -ljobs <Project Name> | wc -l"

and it works but I would like to know where you would execute the first 2 commands.

Thanks.
dearkriss
Premium Member
Premium Member
Posts: 8
Joined: Mon Aug 22, 2005 12:42 pm

Post by dearkriss »

You can execute the said commands in DS Admin client's projects tab...command window.
The Right One at Right Place at Right Time
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

No dearkriss. In DS Administrator's client's Projects tab, I click on Command button. In this window, I can execute:

SH -c "dsjob -ljobs <Project Name> | wc -l"

and it works fine. I want to know where I can execute:
COUNT DS_JOBS and
SELECT COUNT(*) FROM DS_JOBS WHERE NAME NOT LIKE '\\%';

They don't work in the Command window.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Ofcourse they do. How exactly are you typing it in ?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Lotus26
Premium Member
Premium Member
Posts: 48
Joined: Tue Jul 13, 2004 2:09 pm

Post by Lotus26 »

Hi,

When i tried to get the Job count for my Project! I am getting the following Error Message!

The Command issued is as follows:
SH -c "dsjob -ljobs <CMK> | wc -l"

The Error i am getting is:

SH: syntax error at line1: '|' unexpected

I tried in another way:
Command Issued: SH -c "dsjob -ljobs KMC | wc -l"
Message: SH:dsjob: not found 0

But i have some jobs in the project! My User id have Developer Access! So is it problem with User Id or any thing else.

I appreciate your help! Thanks for your time!
DSguru2B wrote:Ofcourse they do. How exactly are you typing it in ?
Regards
Lotus26
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Lotus26 wrote:...I tried in another way:
Command Issued: SH -c "dsjob -ljobs KMC | wc -l"
Message: SH:dsjob: not found 0
...
You need to make sure that the dsjob executable is in your path. You can change the call to "$DSHOME/bin/dsjob -ljobs KMC | wc -l"
dearkriss
Premium Member
Premium Member
Posts: 8
Joined: Mon Aug 22, 2005 12:42 pm

Post by dearkriss »

to run "dsjob" from command line you have to change directory to $DSHOME/bin
The Right One at Right Place at Right Time
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

And for that to work your DSHOME environment variable has to have been set.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Another crude way of finding the number of jobs in a project
In the Director go to

Code: Select all

View - > Uncheck "Show Categories"
All the job entries are displayed
Beware if you have thousands of jobs, it might take a pretty long time to give you results.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

... but the count will be given in the status bar. 8)
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