You will need to create two .sh files and put them into the $PS_HOME/appserv/prcs/<Scheduler> folder with execute rights by your Unix Process ID. Make sure you lock down the dsparam.sh so users can't see the password for your dsadmin ID. Here is an example of what I have for both files.
dsparam.sh
Code: Select all
export DS_SERVER=<server hostname here>
export DS_USER=<dsadmin unix id here>
export DS_PASSWORD=<dsadmin unix id password here>
export DS_PROJECT=<project name for this scheduler here, example FDM84_88_PWSBX8>
export DS_HOME=<dshome here, example /opt/Ascential/DataStage/DSEngine>
Code: Select all
#!/usr/bin/sh
. ./dsparam.sh
case $2 in
[0]) VAR1="Batch::RunFolder"
VAR2=`echo $1|awk -F "-" '{print $2}'`
VAR3=`echo $1|awk -F "-" '{print $3}'`
if [ $VAR2 == "Destructive_OR_Incremental" ]
then $DS_HOME/bin/dsjob -server $DS_SERVER -user $DS_USER -password $DS_PASSWORD -run -param FolderName=$VAR2 -param LoadType=$VAR3 $DS_PROJECT $VAR1
if [ $? <> 0 ]
then exit 1
fi
else $DS_HOME/bin/dsjob -server $DS_SERVER -user $DS_USER -password $DS_PASSWORD -run -param FolderName=$VAR2 $DS_PROJECT $VAR1
if [ $? <> 0 ]
then exit 1
fi
fi;;
[1]) SVAR1=`echo $1|awk -F "-" '{print $1}'`
SVAR2=`echo $1|awk -F "-" '{print $2}'`
if [ $SVAR2 == "I" ]
then $DS_HOME/bin/dsjob -server $DS_SERVER -user $DS_USER -password $DS_PASSWORD -run -param '$
LoadType='$SVAR2 $DS_PROJECT $SVAR1
if [ $? <> 0 ]
then exit 1
fi
else $DS_HOME/bin/dsjob -server $DS_SERVER -user $DS_USER -password $DS_PASSWORD -run $DS_PROJECT $SVAR1
if [ $? <> 0 ]
then exit 1
fi
fi;;
*) ;;
esac
echo "Execution Complete"
exit 0