Avoid Instances--SH -c "dsjob -ljobs <Project> |
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
Avoid Instances--SH -c "dsjob -ljobs <Project> |
Hi,
I need to find the total number of jobs in a project, I can use the
SH -c "dsjob -ljobs <Project> | wc -l"
But the issue is it also counts the instance of a job and bump the number way up, is there a way I can count Just the jobs and not instances?
Thanks,
I need to find the total number of jobs in a project, I can use the
SH -c "dsjob -ljobs <Project> | wc -l"
But the issue is it also counts the instance of a job and bump the number way up, is there a way I can count Just the jobs and not instances?
Thanks,
Thanks,
Vinay
Vinay
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
Hmm - My dsjob -ljobs just returns job names. Invocations are returned by dsjob -linvocations. Assuming your "dsjob -ljobs" is returning a list of JOBNAME.INVOCATIONID lines (!?), you can de-duplicate and count lines like this:
J.
Code: Select all
SH -c "dsjob -ljobs <project> | cut -d'.' -f1 | uniq | wc -l"
J.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
Can you show us what you get from "dsjob -ljobs Project1"?
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
Thank God - I thought this thread was about to reveal some mysterious new "dsjob" behaviour I'd never encountered.
J.
J.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
I felt the same. Thats why immediately tried the command to double check at my end and results came negative.jhmckeever wrote:Thank God - I thought this thread was about to reveal some mysterious new "dsjob" behaviour I'd never encountered.
J.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.