Page 1 of 1
to get job names of a category through unix command
Posted: Mon Mar 08, 2010 12:51 am
by ksudhir466
Hi,
i am in need of unix command which can give us all job names and annotation in the job of a category.
say i have three job in the folder /test/prjct1
j1ext
j2tfm
j3load
if i pass argument to unix command as /test/prjct1 , i should get job names and annotation given in that job.
Thx
Sudhir
Posted: Mon Mar 08, 2010 1:49 am
by ray.wurlod
Do you mind if your UNIX command invokes a database query? Because you are going to need a database query to determine the category contents.
Posted: Mon Mar 08, 2010 2:21 am
by ksudhir466
Hi Ray,
thx for reply, please suggest the approach , it should be k if it invokes database query.
Posted: Mon Mar 08, 2010 3:06 am
by ray.wurlod
Usually categories are delimited by backslash, so you might need either to specify the argument with backslashes or, within your script, translate forward slashes to backslashes. For example
Code: Select all
category=$1
catpath=`echo $category | tr \/ \\`
The command has to be executed while attached to a project directory. Therefore you need to provide the name of a project or, preferably, the pathname of the project directory as an additional command line argument.
If the DSEngine bin directory is not in your PATH then you will need the full pathname of the dssh executable. The query is probably the easiest part.
Code: Select all
export DSHOME=`cat /.dshome`
${DSHOME}/bin/dssh "SELECT NAME FMT '60L' FROM DS_JOBS WHERE CATEGORY = '$catpath';"
Error and argument checking has been omitted for clarity.
Posted: Mon Mar 08, 2010 11:46 am
by dsedi
a batch file with the below can help to get just the Job name in the category...
but i am sure the experts gave you the way to get the annotation given in that job
Code: Select all
@echo off
SETLOCAL
SET Host=
SET /p Host=Type host and press Enter:
SET User=
SET /p User=Type User and press Enter:
SET PW=
SET /p PW=Type Password and press Enter:
SET project=
SET /p project=Type Project Name and press Enter:
SET folder=
SET /p folder=Type folder path and press Enter:
SET DsSearch=C:\Progra~1\Ascential\DataStage7.5.2\dssearch.exe
SET JobList=JobList.txt
%DsSearch% -server %Host% -user %User% -password %PW% -ljobs -matches -sub -c %folder% %project% >> %JobList%
ENDLOCAL
Posted: Tue Nov 25, 2014 11:38 am
by joycerecacho
The command bellow doesnt work.
%DsSearch% -server %Host% -user %User% -password %PW% -ljobs -matches -sub -c %folder% %project% >> %JobList%
If a cut the part: "-matches -sub -c %folder%" it works fine.
It says:
"Valid primary command options are: -ljobs
Status code = -9999 DSJE_DSSEARCH_ERROR"
Any idea?
Tks!