Page 1 of 2

Display Jobs in a Category

Posted: Thu Sep 11, 2008 3:06 am
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

Posted: Thu Sep 11, 2008 4:01 am
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

Posted: Thu Nov 06, 2008 4:33 am
by joesat
I am also looking for a similar requirement.

But I do not understand the initial command the shaanc is talking about either. :-(

Posted: Thu Nov 06, 2008 4:53 am
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

Posted: Thu Nov 06, 2008 4:53 am
by joesat
..and, I am using DS 7.5 version..

Posted: Thu Nov 06, 2008 7:06 am
by joesat
i am sorry.. but is this code in "francaise"?

Posted: Thu Nov 06, 2008 7:27 am
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.

Posted: Fri Nov 07, 2008 2:13 am
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.

Posted: Fri Nov 07, 2008 2:18 am
by Pierre
(I was joking)... next time, I'll try to be more explicit.

Pierre.

Posted: Thu Feb 05, 2009 12:23 am
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...

Posted: Thu Feb 05, 2009 12:27 am
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.

Posted: Thu Feb 05, 2009 1:11 am
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?

Posted: Thu Feb 05, 2009 1:15 am
by ray.wurlod
Try it.

Bonne chance!

Posted: Thu Feb 05, 2009 1:39 am
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:

Posted: Thu Feb 05, 2009 2:36 am
by ray.wurlod
It must be executed while attached to a project directory.