# Program: etl_unix_shell_script.sh # Author: Kevin Gillenwater # Date: 7/24/2003 # Purpose: Sample UNIX shell script to load environment variables # needed to run PowerMart jobs, pass username and password variables # and start the job using the pmcmd command line. # # $1 = Project Id Parameter (ie. ud, hr, dss, siq, etc.) # # Example usage: etl_unix_shell_script.sh dss # # NOTE: Enter the Project ID parameter that is designated in the # directory structure for your team # (ie. dss would be used for the DWDAS team as the # directory is /usr/local/autopca/dss/) #----------------------------------------------------------------- # Call the script to set up the Informatica Environment Variables: #----------------------------------------------------------------- . /usr/local/bin/set_pm_var.sh #----------------------------------------------------------------- # Read ETL configuration parameters from a separate file: #----------------------------------------------------------------- ETL_CONFIG_FILE=$JOBBASE/$1/remote_accts/test_etl.config ETL_USER=`grep ETL_USER $ETL_CONFIG_FILE | awk -F: '{print $2}'` ETL_PWD=`grep ETL_PWD $ETL_CONFIG_FILE | awk -F: '{print $2}'` #----------------------------------------------------------------- # Start the job #----------------------------------------------------------------- $PM_HOME/pmcmd startworkflow -u $ETL_USER -p $ETL_PWD -s $MACHINE:4001 -f DWDAS_LOAD_dssqa -wait s_m_CENTER_INSTITUTE #----------------------------------------------------------------- # Trap the return code #----------------------------------------------------------------- rc=$? if [[ $rc -ne 0 ]] then exit $rc fi