Tuesday, March 04, 2008

Informatica PowerCenter 7.x ETL UNIX Shell scripts

Informatica PowerCenter 7.x ETL UNIX Shell scriptsProgram: etl_unix_shell_script.sh

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:


Read ETL configuration parameters from a separate file:
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_
Trap the return code
if [[ $rc -ne 0 ]] then
exit $rc
Program: set_pm_var.sh

Purpose: UNIX script which sets the variables for running PowerMart 6.2
when called from a shell script (ie. script run by Autosys).

Set up the Informatica Variables
export MACHINE=`hostname`

export SHLIB_PATH=/usr/local/pmserver/informatica/pm/infoserver

export PM_HOME=/usr/local/pmserver/informatica/pm/infoserver
Set the environment variables needed for scheduling jobs.

The value of JOBBASE differs based on the account. For AUTOSYS

and AUTODBA, the variable should evaluate to /usr/local/autopca.

For all other accounts, it should evaluate to their $HOME variable.
case $HOME in
/home/autopca/autopca) JOBBASE=/usr/local/autopca ;;

/home/autopca/autodba) JOBBASE=/usr/local/autopca ;;


export JOBBASE

No comments: