I am currently using Datastage 7.5.1.A, our database is DB2 UDB v 8.1.2 and our server is UNIX. Currently I have a script in Unix that is called in a datastage execute command stage with three parameters. The truncate works but what I would like to do is pass another parameter so that I might be able to return the status of a job that has errored, in datastage, from that particular script.I have not worked with unix and datastage together much so I was hoping that someone could help. below is the script for the truncate.
#!/bin/ksh
###knm 5/26/06 this truncates a table
USAGE="Usage : loadreset <DBNAME SCHEMANAME.TABLENAME> "
/opt/Ascential/DataStage/DSEngine/dsenv
if [ $# -eq 3 ] # if no arguments specified
then
DBXNM=$1
DBIDX=$2
DBPWX=$3
else
echo $USAGE
exit 0
fi
XSEC1=$SECONDS
#db2 connect to $DBXNM
db2 connect to $DBXNM user $DBIDX using $DBPWX
#db2 "load from export file"
#empty CCC PLD tables
db2 "load client from /dev/null of del replace into PLD.CCC_COL_EST_FACT without prompting"
db2 "load client from /dev/null of del replace into PLD.CCC_COL_EST_FLDR without prompting"
db2 "load client from /dev/null of del replace into PLD.CCC_REINSP_FACT without prompting"
db2 "load client from /dev/null of del replace into PLD.CCC_REINSP_FLDR without prompting"
db2 "load client from /dev/null of del replace into PLD.CCC_TOT_LOSS_FACT without prompting"
db2 "load client from /dev/null of del replace into PLD.CCC_TOT_LOSS_FLDR without prompting"
db2 terminate
XSEC2=$SECONDS
let XSEC3=$XSEC2-$XSEC1
echo "Total load time:"$XSEC3 " Seconds."
Thanks
#!/bin/ksh
###knm 5/26/06 this truncates a table
USAGE="Usage : loadreset <DBNAME SCHEMANAME.TABLENAME> "
/opt/Ascential/DataStage/DSEngine/dsenv
if [ $# -eq 3 ] # if no arguments specified
then
DBXNM=$1
DBIDX=$2
DBPWX=$3
else
echo $USAGE
exit 0
fi
XSEC1=$SECONDS
#db2 connect to $DBXNM
db2 connect to $DBXNM user $DBIDX using $DBPWX
#db2 "load from export file"
#empty CCC PLD tables
db2 "load client from /dev/null of del replace into PLD.CCC_COL_EST_FACT without prompting"
db2 "load client from /dev/null of del replace into PLD.CCC_COL_EST_FLDR without prompting"
db2 "load client from /dev/null of del replace into PLD.CCC_REINSP_FACT without prompting"
db2 "load client from /dev/null of del replace into PLD.CCC_REINSP_FLDR without prompting"
db2 "load client from /dev/null of del replace into PLD.CCC_TOT_LOSS_FACT without prompting"
db2 "load client from /dev/null of del replace into PLD.CCC_TOT_LOSS_FLDR without prompting"
db2 terminate
XSEC2=$SECONDS
let XSEC3=$XSEC2-$XSEC1
echo "Total load time:"$XSEC3 " Seconds."
Thanks