Calling DataStage job from Unix script

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 from Unix script

Post by Veni »

Hi All

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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You are getting a UNIX error. The environment variable you are referencing with "${DSBINDIR}" is empty in your script so it is looking for the dsjob program in the root directory. It might be better to use either $DSHOME if you have it set or resort to using "`cat /.dshome`/bin"
Veni
Participant
Posts: 45
Joined: Fri Oct 21, 2005 2:51 am

Post by Veni »

HI

I tried this way , but this also giving error -

DSBINDIR='/opt/tools/datastage7/Ascential/DataStage/DSEngine/bin'

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

Error is -
ld.so.1: /opt/tools/datastage7/Ascential/DataStage/DSEngine/bin/dsjob: fatal: libvmdsapi.so: open failed: No such file or directory
StrategyWareLoad.sh[16]: 28238 Killed

Please suggest me
rv
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your environment isnt' setup properly for this script's session. Make sure it 'sources' the dsenv file before you run the dsjob command.

Code: Select all

cd $DSHOME
. ./dsenv
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

HI,

You need to execute your dsenv once.
It would be under your DSHOME.
Later try to execute 'dsjob' from you command prompt to get the list of option for dsjobs so that you can make sure your environment is ready.

-Kumar
gbusson
Participant
Posts: 98
Joined: Fri Oct 07, 2005 2:50 am
Location: France
Contact:

Post by gbusson »

hi,

actually the folder where Datastage is installed must be in the $PATH environment variable.

.dsenv sets this variable correctly.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

DSHOME=`cat /.dshome`
DSBINDIR=${DSHOME}/bin
export DSHOME DSBINDIR

. $DSHOME/dsenv

${DSBINDIR}/dsjob -run -mode NORMAL -param '$prmfilepath'='/data/dw/af2/rawdata/Strategyware060112.txt' -warn $WARN_LIMIT -jobstatus 
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Example : Source dsenv , so that dsjob works

Post by rameshrr3 »

todev132:/app/ascential/Ascential/DataStage/DSEngine> bash
todev132:/app/ascential/Ascential/DataStage/DSEngine . dsenv
todev132:/app/ascential/Ascential/DataStage/DSEngine bin/dsjob
Command Syntax:
dsjob [-file <file> <server> | [-server <servertodev132:/app/ascential/Ascential/DataStage/DSEngine> bash
todev132:/app/ascential/Ascential/DataStage/DSEngine . dsenv
todev132:/app/ascential/Ascential/DataStage/DSEngine bin/dsjob
Command Syntax:
dsjob [-file <file> <server> | [-server <server>][-user <user>][-password <password>]]
<primary command> [<arguments>]

Valid primary command options are:
-run
-stop
-lprojects
-ljobs
-linvocations
-lstages
-llinks
-projectinfo
-jobinfo
-stageinfo
-linkinfo
-lparams
-paraminfo
-log
-logsum
-logdetail
-lognewest
-report
-jobid
-import

Status code = -9999 DSJE_DSJOB_ERROR
>][-user <user>][-password <password>]]
<primary command> [<arguments>]

Running TCL from Unix
todev132:/app/ascential/Ascential/DataStage/DSEngine cd ../Projects/Test
todev132:/app/ascential/Ascential/DataStage/Projects/Test $DSHOME/bin/dssh
DataStage Command Language 7.5
Copyright (c) 1997 - 2004 Ascential Software Corporation. All Rights Reserved
Test logged on: Mon Jul 31 06:57:36 2006

>LIST.READU

Active Record Locks:
Device.... Inode.... Netnode Userno Lmode Pid Login Id Item-ID.............
22282243 1564166 0 52065 2 RU 13471 sophis SPtest2
22282243 1870981 0 40110 4 RU 25426 sophis GetDSSECID
22282243 4457887 0 59852 8 RL 5684 sophis RT_LOG446
22282243 4457887 0 54340 8 RL 11196 sophis RT_LOG446
22282243 4457887 0 41825 8 RL 23711 sophis RT_LOG400
22282243 4457887 0 57594 10 RL 7942 sophis RT_LOG409
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi Ramesh,
Are you trying to say something :wink:
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply