Display Jobs in a Category

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

talk2shaanc
Charter Member
Charter Member
Posts: 199
Joined: Tue Jan 18, 2005 2:50 am
Location: India

Display Jobs in a Category

Post by talk2shaanc »

Hello,

I want to list all Jobs within a given "Category" using CLI commands.
I tried using dssearch command; but its not working as expected:

Code: Select all

dssearch.exe -domain acc-gz3ve9aah8t:9080 -user Admin -password Pass1234? -server ACC-GZ3VE9AAH8T -ljobs -matches -sub -c \Jobs\Inder DSProject 
Result:

Code: Select all

Employee_ExtractJob1
Employee_ExtractJob2
Employee_Job
Employee_TrasformationJob

Status code = 4
Problem Statement:
1. The above statement is missing out few jobs which are also inside "\Jobs\Inder" category
2. The status code is also 4
Shantanu Choudhary
talk2shaanc
Charter Member
Charter Member
Posts: 199
Joined: Tue Jan 18, 2005 2:50 am
Location: India

Post by talk2shaanc »

I got answer to both the questions. Actually jobs which were missed out through above command were not compiled; I would rather say they were never compiled. Once these jobs were compiled I was able to see the results.

This again doesn't solve my primary objective :( ; at least I have an answer to my questions.

I can achieve the result by running UV command on the Sever side; but first I was exploring for options available on the Client side. Do let me know if anyone has a solution.

Thanks
Shantanu Choudhary
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

I am also looking for a similar requirement.

But I do not understand the initial command the shaanc is talking about either. :-(
Joel Satire
Pierre
Participant
Posts: 66
Joined: Thu May 24, 2007 7:16 am
Location: Paris

Post by Pierre »

Hello,

I wrote a batch file that does it :

!DirDSBin!dssh COMO ON !FicSortie!
!DirDSBin!dssh SELECT !CommandeDS!

move !FicSortie! %DirSauve%\!FicSortie!

set FicResultat=Repository_!Projet!.csv
for /F "skip=3" %%B in (%DirSauve%\!FicSortie!) do (
set LigneLue=%%B
if !LigneLue! neq "SQL+" (
if !LigneLue! neq "" (
if !LigneLue:~0,8!=="Job name" (
set ComposeLigne=!ComposeLigne!;!LigneLue:~9,80!
)
if !LigneLue:~0,8!=="Category" (
set ComposeLigne=!LigneLue:~9,80!
)
if !ComposeLigne! neq "" (
echo !ComposeLigne! >> %DirSauve%\!FicResultat!
set ComposeLigne=
)
)
)
)
...

where
- FicSortie is an intermedary file,
- CommandeDS is "NAME FMT'80L', CATEGORY FMT'80L' FROM DS_JOBS WHERE NAME NOT LIKE '\%%' [AND CATEGORY LIKE 'xxx%'] ORDER BY CATEGORY, NAME

And it works (!)...
Hope it can help you.

Pierre
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

..and, I am using DS 7.5 version..
Joel Satire
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

i am sorry.. but is this code in "francaise"?
Joel Satire
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So what? It still works. "Fiche" = file, "Ligne" = line.

The words of the script language (like "for", "set" and so on) are universal.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Pierre
Participant
Posts: 66
Joined: Thu May 24, 2007 7:16 am
Location: Paris

Post by Pierre »

Yes,

My variable names are "in french" because I am "in France".
I did not translate them, I'm sorry.
But you can find good dictionnaries to do that on the web.

Mais, bonjour de Paris.

Pierre.
Pierre
Participant
Posts: 66
Joined: Thu May 24, 2007 7:16 am
Location: Paris

Post by Pierre »

(I was joking)... next time, I'll try to be more explicit.

Pierre.
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

Pierre wrote:
I wrote a batch file that does it :

!DirDSBin!dssh COMO ON !FicSortie!
!DirDSBin!dssh SELECT !CommandeDS!

move !FicSortie! %DirSauve%\!FicSortie!

set FicResultat=Repository_!Projet!.csv
for /F "skip=3" %%B in (%DirSauve%\!FicSortie!) do (
set LigneLue=%%B
if !LigneLue! neq "SQL+" (
if !LigneLue! neq "" (
if !LigneLue:~0,8!=="Job name" (
set ComposeLigne=!ComposeLigne!;!LigneLue:~9,80!
)
if !LigneLue:~0,8!=="Category" (
set ComposeLigne=!LigneLue:~9,80!
)
if !ComposeLigne! neq "" (
echo !ComposeLigne! >> %DirSauve%\!FicResultat!
set ComposeLigne=
)
)
)
)
Sorry I am not really sure how to implement this batch file.. is it a windows batch file? I tried to search for 'batch file' and I get six pages of results...
Joel Satire
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes, a "batch file" would be a DOS script file, one with an extension of ".bat" that you would run from the command line of a Windows PC.
-craig

"You can never have too many knives" -- Logan Nine Fingers
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

So, all I would have to do is to copy and paste Pierre's codelet and create a batch file. Would I then get the list of jobs in a category?
Joel Satire
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try it.

Bonne chance!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

I am not able to see any reference to the project name in the codelet... any clues on that before I try, Ray? :wink:
Joel Satire
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It must be executed while attached to a project directory.
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