Professional Documents
Culture Documents
Creating Parameter File Dynamic PDF
Creating Parameter File Dynamic PDF
Applies to:
Informatica PowerCenter
Summary
This article provides an example to dynamically create parameter files for workflows, worklets or sessions.
Author Bio
Author(s): Matthias Urech Company: interface-development.com Created on: January 5, 2009 Matthias Urech, founder and project leader of interface - development.com, has a proven track record of applying data integration solutions for several companies across the industry. He played a key role to implement projects in the area of data integration, data migration, data consolidation and data warehousing. Matthias contributed several articles about data integration best practices for Informatica Technology Network, resulting in nomination as member of developer wall of fame and receiving an award as contributor of the year in 2008.
Table of Contents
Introduction .........................................................................................................................................................2 Solution Overview...............................................................................................................................................2 Solution Details ...................................................................................................................................................2
Source .........................................................................................................................................................................3 Expression ...................................................................................................................................................................4 Normalizer....................................................................................................................................................................4 Filter.............................................................................................................................................................................5 Target ..........................................................................................................................................................................5 Output ..........................................................................................................................................................................6
http://technet.informatica.com 1
Introduction
Ive roughly outlined the possibility to create dynamic parameter files in one of my articles about the Normalizer (see What is the Normalizer good for anyway?). This article provides now a more detailed solution. Before we dive into detail, let me first give you a short summary about parameter file types. You can use two parameters file types with Informatica PowerCenter: Static Parameter Files are created once and are changed manually from time to time (i.e. once a month). Basically, you are using a tool (i.e. Parameter File Wizard) or text editor to modify the parameters and variables. Dynamic Parameter Files are changing permanently, so you cant or dont want to change them continuously (i.e. date values). This example describes how you can generate a dynamic parameter file that provides date values for file names.
Solution Overview
The provided solution allows you to generate the following information: Workflow Variables Worklet Variables Source and Target File Names Mapping Parameters and Variables Mapplet Parameters and Variables The solution reads the required values from a tab delimited file and generates date stamps (if needed) in any supported date format. Moreover, empty input values will be ignored and will not be visible in the parameter file. The example is provided AS IS and can be modified to fit your personal needs. Therefore, consider it as a basic example that gives you the opportunity to learn how you can generate dynamic parameter files.
Solution Details
In this section we will have a closer look at: Source Expression Normalizer Filter Target Figure 1 illustrates the interface.
http://technet.informatica.com 2
http://technet.informatica.com 3
Expression Expression transformation EXP_BUSINESS_RULES holds the logic for creating the required format of the parameter file: Information Heading Format Worflow Variable Expression '[' || FOLDER || '.WF:' || WORKFLOW || IIF(ISNULL(WORKLET_SESSION), '', '.WT:' || WORKLET_SESSION) || '.ST:' || SESSION || ']' WORKFLOW_VARIABLE_NAME || '=' || IIF(ISNULL(WORKFLOW_TIME_FORMAT), '', TO_CHAR(SYSDATE, WORKFLOW_TIME_FORMAT)) || WORKFLOW_VARIABLE_VALUE WORKLET_VARIABLE_NAME || = || IIF(ISNULL(WORKLET_TIME_FORMAT), '', TO_CHAR(SYSDATE, WORKLET_TIME_FORMAT)) || WORKLET_VARIABLE_VALUE '$InputFile1=' || SOURCE_DIR || SOURCE_NAME || IIF(ISNULL(SOURCE_TIME_FORMAT), '', TO_CHAR(SYSDATE, SOURCE_TIME_FORMAT)) || SOURCE_TYPE) '$OutputFile1=' || TARGET_DIR || TARGET_NAME || IIF(ISNULL(TARGET_TIME_FORMAT), '', TO_CHAR(SYSDATE, TARGET_TIME_FORMAT)) || TARGET_TYPE) PARAMETER_NAME || '=' || PARAMETER_VALUE MAPPLET_NAME || '.' || MAPPLET_PARAMETER_NAME || '=' || MAPPLET_PARAMETER_VALUE
Normalizer The following settings are used in Normalizer transformation NRM_NORMALIZE_DATA to transpose the data:
http://technet.informatica.com 4
Filter Filter transformation FIL_EMPTY_VALUES ensures that empty source entries will not be written to the target file. The Filter transformation has the following properties:
http://technet.informatica.com 5
Output Create a workflow and a session. The following output will be produced by running the workflow:
http://technet.informatica.com 6
http://technet.informatica.com 7