Calling DataStage job using PERL in unix server

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
Veni
Participant
Posts: 45
Joined: Fri Oct 21, 2005 2:51 am

Calling DataStage job using PERL in unix server

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

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jzparad
Charter Member
Charter Member
Posts: 151
Joined: Thu Apr 01, 2004 9:37 pm

Post 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.
Jim Paradies
Veni
Participant
Posts: 45
Joined: Fri Oct 21, 2005 2:51 am

Post 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 ....` )
rv
jzparad
Charter Member
Charter Member
Posts: 151
Joined: Thu Apr 01, 2004 9:37 pm

Post 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?
Jim Paradies
Veni
Participant
Posts: 45
Joined: Fri Oct 21, 2005 2:51 am

Post 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
rv
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
Post Reply