PeopleSoft Unix Process Scheduler running DataStage jobs.
Posted: Fri Oct 08, 2004 9:02 am
For those interested, I put together a Unix version of the PeopleSoft delivered Windows Bat file to run ETLs using the Process Scheduler. I'm curious is anyone else has something like this, and if so please send me a copy or post it here in the forum. I'm not the best scripter in the world so I'm sure others have a better way of doing this.
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
dscmd.sh Note: PeopleSoft delivered instructions have dscmd.bat, make sure to change your process type command line to be dscmd.sh instead of CMD /c dscmd.bat I apologize for the code snipet below, it's hard to work in this small window and show that some commands are all one line. Just make sure that anywhere there is a then or else statement, the code following it is all on one line.
Andy
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