Page 1 of 1

Calling DataStage job using PERL in unix server

Posted: Mon Jan 16, 2006 11:27 pm
by Veni
Hi

Is any one help me how to call DataStage job using PERL in unix server.

Will appreciate if any one can provide the code for calling datastage job.

Thanks in advance

Posted: Mon Jan 16, 2006 11:30 pm
by ray.wurlod
There is a command line interface called dsjob that you invoke from your Perl script.

Read about dsjob by searching the forum, or by reading either the Server Job Developer's Guide or the Parallel Job Developer's Guide. It's also mentioned in the DataStage Operator's Guide.

Posted: Tue Jan 17, 2006 12:29 am
by jzparad
You invoke an external command using backticks as

Code: Select all

`dsjob -server ....`
But I'm curious to know why you want to run dsjob using perl.

Posted: Tue Jan 17, 2006 2:51 am
by Veni
I will call the unix script using the PERL job and internally unix script will call the DataStage job.

can i call this command inside my unix script or do i need to inclide any library for that (`dsjob -server ....` )

Posted: Tue Jan 17, 2006 3:46 am
by jzparad
I will call the unix script using the PERL job and internally unix script will call the DataStage job.
Now I'm totally confused. If you're calling DataStage from a unix script then all you have to do is call it like any other unix command.

i.e
dsjob -server ...

You then call the unix script from within Perl using the backtick syntax. As for whether you need any special libraries, the answer is no.

But I'm still trying to understand what advantage you hope to gain by running everything under Perl. Do you use Perl as some sort of intelligent controller for all you jobs?

Posted: Wed Jan 25, 2006 5:20 am
by Veni
Where do i need to place my Unix shell script .Is it under Project folder ?

Actually i am getting folowing while using -

${DSBINDIR}/dsjob -run -mode NORMAL
-param '$prmfilepath'='/data/dw/af2/rawdata/Strategyware060112.txt' -warn $WARN_LIMIT -jobstatus $PROJ $JOB

Error is - StrategyWareLoad.sh[30]: /dsjob: not found

Please help me in understanding why i am getting this error.

Thanks in advance

Posted: Wed Jan 25, 2006 7:03 am
by chulett
It says it couldn't find "/dsjob". To me that would imply that your DSBINDIR variable wasn't set.

Place your shell script anywhere you like - and then provide a full path to it.