Вы находитесь на странице: 1из 5

Reading Session and Workflow Parameter Files Simultaneously

2011 Informatica Corporation

Abstract
The PowerCenter Integration Service uses the workflow parameter file instead of the session parameter file when you run the workflow. This article describes how to instruct the PowerCenter Integration Service to read the session parameter files and workflow parameter files at the same time.

Supported Versions
PowerCenter 8.5 - 9.1.0

Table of Contents
Overview .......................................................................................................................................... 2 Use Case ......................................................................................................................................... 3 Problem Description ..................................................................................................................... 3 Possible Workarounds ................................................................................................................. 3 Solution ........................................................................................................................................ 4 Example ........................................................................................................................................... 4

Overview
A parameter file is a list of parameters and variables and their associated values. These values define properties for a service, service process, workflow, worklet, or session. When you run a session or workflow that uses a parameter file, the PowerCenter Integration Service reads the parameter file at the start of the session or workflow. The PowerCenter Integration Service then expands the parameters and variables defined in the file. Parameter files provide the flexibility to change the parameter and variable values each time you run a session or a workflow. When you start a workflow or session, use a parameter file to pass the parameter and variable values to the PowerCenter Integration Service. You can specify the parameter file name and directory in the workflow or session properties or in the pmcmd command. The parameter file used with the pmcmd command overrides the parameter file in the workflow or session properties. The PowerCenter Integration Service uses the parameter file in the workflow properties for the workflow and all sessions in the workflow if the parameter file name is not in the pmcmd command. If you do not enter a parameter file name in the pmcmd command or the workflow properties, the PowerCenter Integration Service uses the parameter file in the session properties. Figure 1: Decreasing Parameter Files Overriding Precedence pmcmd Workflow Session

The following sections describe how to override the predefined precedence for the parameter files in PowerCenter.

Use Case
You are importing source data from a flat file using an FTP connection in a mapping. Define the FTP connection object in the Workflow Manager using the following properties: Host Name Default Remote Directory User Name Password

When you refer to the connection object in the session, specify the Remote File Name property, which is the overriding property. If you do not specify the overriding property, the following message appears in the session log:
Value must be provided for (Remote Filename) which belongs to (Connection)

The use case complies with the following ETL Center of Excellence (ETL COE) standards: 1. You must parameterize the connection objects. 2. If you parameterize the FTP connection reference in the session, parameterize the Remote File Name property. 3. It is important to mention FTPConnection as the keyword in the parameter name. For example, in the use case the user parameterizes the FTPConnection as FTPConnection_XXX. Similarly, the parameter name for Remote File Name property is Param_FTPConnection_XXX_Remote_Filename. Here, the FTPConnection_XXX is the parameter name for the FTP connection. Use the keywords such as Param and Remote_Filename so that the PowerCenter Integration Service uses the property.

Problem Description
The ETL COE framework maintains session level parameter files. The parameters table, parameters_table, dynamically generates the session level parameter files through a defined process. The parameters table contains the list of all parameters and variables referred in all the mappings and sessions for a specified workflow and are populated by the developer. The precision of the column, parameter_name, with datatype Varchar2, in the table is 35. The parameter name value for the remote file name, Param_FTPConnection_XXX_Remote_Filename, exceeds the column length even after making the FTPConnection_XXX part as short as possible. As the parameter name and value is not populated in the parameters_table, the entry does not appear in the dynamically generated session parameter file.

Possible Workarounds
There are two options as follows: Compromise the ETL COE standards and hard-code the connection object reference in the session. The workaround conflicts with ETL COE standards and thereby not an ideal practice. Increase the length of the column, parameter_name, in the table, parameters_table. This is a tedious and risky process as the table, parameters_table, has dependencies across multiple projects.

The solution requires initializing the parameter which cannot be present in the parameters_table and thereby not appearing as part of the dynamically generated session parameter files. The PowerCenter Integration Service must read the Param_FTPConnection_XXX_Remote_Filename in addition to the other parameters present in the dynamically generated session parameter files at the same time.

Solution
Set the parameter file to true at the workflow level. 1. Click Workflow > Edit. 2. Set the Parameter file name in the workflow properties. 3. In the workflow parameter file, set the $PMMergeSessParamFile property to True for all of the session sections. 4. Register the parameter name and value which was not able to get accommodated in the table, parameters_table, in the workflow parameter file. The PowerCenter Integration Service reads the parameter from the workflow parameter file and the rest from the session parameter file generated dynamically. When you define a workflow parameter file and a session parameter file for a session within the workflow, the PowerCenter Integration Service uses the workflow parameter file over the session parameter file. Effective in PowerCenter 8.5.x, you can instruct the PowerCenter Integration Service to read both the workflow and session parameter files with the $PMMergeSessParamFile property. The workflow parameter file appears as follows:
[z_snoorbasha.WF:wf_ftp_file_download] [s_ftp_file_download] $PMMergeSessParamFile=TRUE $Param_FTPConnection_XXX_Remote_Filename=FTP_FileName.txt

This is a must. This parameter name was not able to fit in 'parameters_table'.

Example

You have four sessions in the workflow. Register a parameter name and value to be read from the workflow parameter file for one session, add the sections for the remaining three sessions, and initialize $PMMergeSessParamFile to True. Else, the PowerCenter Integration Service searches for the session sections of the remaining three sessions in the workflow parameter file. If the PowerCenter Integration Service cannot find the corresponding session section, it fails the session. So even though the session parameter files for the remaining three sessions exist, it is ignored. For example, in the workflow coded above, there were three more sessions which load data into staging, audit, and data mart tables after the FTP file downloads. The workflow parameter file must contain at least the property name, $PMMergeSessParamFile set to TRUE for these sessions for the PowerCenter Integration Service to read the session parameter files generated dynamically.
[z_snoorbasha.WF:wf_ftp_file_download] [s_ftp_file_download] $PMMergeSessParamFile=TRUE $Param_FTPConnection_XXX_Remote_Filename=FTP_FileName.txt [s_load_stg_table] $PMMergeSessParamFile=TRUE [s_load_audit_table] Set $PMMergeSessParamFile $PMMergeSessParamFile=TRUE to TRUE for the remaining [s_load_datamart_table] sessions in the workflow. $PMMergeSessParamFile=TRUE

Tip: You can define the same parameter or variable in both the session and workflow parameter files after setting the property $PMMergeSessParamFile to true. In this case, the PowerCenter Integration Service sets the parameter and variable values according to the following rules: When a parameter or variable is defined in the same section of the workflow and session parameter files, the PowerCenter Integration Service uses the value in the workflow parameter file. When a parameter or variable is defined in both the session section of the session parameter file and the workflow section of the workflow parameter file, the PowerCenter Integration Service uses the value in the session parameter file.

Author
Noor Basha Shaik Informatica Certified PowerCenter Consultant and Data Quality Specialist

Acknowledgements
The author would like to thank the H2L team for their encouragement and support given during the course of writing this article.

Вам также может понравиться