Passing arguments to bin/dssh

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Passing arguments to bin/dssh

Post 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
Aim high
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
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