Page 1 of 1

Passing arguments to bin/dssh

Posted: Thu Sep 11, 2008 5:08 pm
by nkln@you
Hi,

I want to pass a parameter from Unix command prompt to Datastage UV prompt.

eg: SELECT * FROM DS_JOBS WHERE NAME=<PARAMETER>

The value of the parameter has to be passed from Unix Prompt to UV prompt (i.e after executing the steps

1 cd `cat /.dshome`
2 . ./dshome
3 bin/dssh
4.Execute a command which uses a parameter passed from command prompt.

Is there any way to achieve this

Posted: Thu Sep 11, 2008 5:49 pm
by ray.wurlod
You almost had it! The technique is called inline prompting. In its simplest form it is the prompt text surrounded by double angle brackets:

Code: Select all

SELECT * FROM DS_JOBS WHERE NAME=<<Job name>> ;
The parameter value can be supplied in response to the prompt from a "here script" within your script.

Code: Select all

cd `cat /.dshome`

. ./dsenv

cd $1    # project directory pathname

bin/dssh "SELECT * FROM DS_JOBS WHERE NAME=<<Job name>>;" << XYZ
$2       # job name
XYZ
If you are going to use this more than once (for example in a loop) it would be wise to include an "always prompt" control.

Code: Select all

SELECT * FROM DS_JOBS WHERE NAME=<<A,Job name>> ;
Finally there are two errors in your example. The script that you need to execute is dsenv, not dshome. There is no DS_JOBS table in the dshome account; you need to cd to a project directory.