Professional Documents
Culture Documents
UNIX Shell Script Standards For PowerCenter 713
UNIX Shell Script Standards For PowerCenter 713
3
Scripting Standards (for PowerCenter version 7.1.3):
Scripting standards include the use of a UNIX shell script, which the scheduling tool uses to start the
PowerCenter job, and a separate file which contains the username and password for the user called in the
script. The following is a template that should be used to create scripts for new scheduled jobs. Following
is the script and explanation. This script has been provided as an example and is named
etl_unix_shell_script.sh.
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
Program:
Author:
Date:
Purpose:
etl_unix_shell_script.sh
Kevin Gillenwater
7/24/2003
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/)
1. The beginning of each script should call and execute the script set_pm_var.sh to set up the
PowerCenter variables used in the session (. /usr/local/bin/set_pm_var.sh). The set_pm_var.sh, located on
each machine (Leisure for Production and Glance for Development), will provide ease of maintenance if
changes need to be made to PowerCenter variables, and will provide one source for the scripts on a
machine. The following is the code in the script. You will not need to do anything with this script, it is for
informational purposes only:
#
#
#
#
#
Program: set_pm_var.sh
Author: Kevin Gillenwater
Date: 7/3/2003
Purpose: UNIX script which sets the variables for running PowerMart 6.2
when called from a shell script (ie. script run by Autosys).
JOBBASE=/usr/local/autopca
JOBBASE=/usr/local/autopca
JOBBASE=$HOME
;;
;;
;;
esac
export JOBBASE
2. The second section of etl_unix_shell_script.sh sets up ETL parameters for username and password
usage by PowerCenter when running the workflow. The username and password are no longer stored as
part of the main shell script. In the script example, the filename test_etl_config contains the username and
password to be used when running the workflow. Following is the contents of test_etl_config:
ETL_USER:etlguy
ETL_PWD:ou812
This file (your password file) must be located in your team directory under the remote_accts folder (i.e.
/usr/local/autopca/dss/remote_accts/). The folder permissions on the Production machine will only permit
PCAs access to this folder. The permissions should be 6-4-0 (rw,r,-) on this file.
3. The third section of etl_unix_shell_script.sh contains the command to run the workflow in
PowerCenter. Please follow the script exactly. The only thing that will need to be changed in this section
is the folder name and the workflow within the folder that is being executed
(i.e. ... DWDAS_LOAD_dssqa wflw_m_CENTER_INSTITUTE).
4. The final section of etl_unix_shell_script.sh contains code to trap the return code of the script that
indicated success or failure..
*8/27/03 Added -wait parameter to the pmcmd command line to start the scheduled job.
*10/6/04 - Updated to generalize the scheduling tool used to run the shell scripts as UC4 has been chosen
to replace Autosys as the scheduling tool used to run PowerMart workflows.