Page 1 of 1

Calling DataStage job from Unix script

Posted: Wed Jan 25, 2006 5:53 am
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

Posted: Wed Jan 25, 2006 6:09 am
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"

Posted: Wed Jan 25, 2006 6:43 am
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

Posted: Wed Jan 25, 2006 7:05 am
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

Posted: Wed Jan 25, 2006 7:10 am
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

Posted: Wed Jan 25, 2006 7:47 am
by gbusson
hi,

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

.dsenv sets this variable correctly.

Posted: Wed Jan 25, 2006 4:20 pm
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 

Example : Source dsenv , so that dsjob works

Posted: Mon Jul 31, 2006 5:04 am
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

Posted: Mon Jul 31, 2006 5:13 am
by kumar_s
Hi Ramesh,
Are you trying to say something :wink: