Parameters and variables in Informatica PowerCenter


A mapping can utilize parameters and variables to store information during the execution. Each parameter and variable is defined with a specific data type and their main purpose is to provide increased development flexibility. Parameters are different from variables in the fact that:

 The value of a parameter is fixed during the run of the mapping  Variables can change in value during run-time Both parameters and variables can be accessed from any component in the mapping which supports it. To create a parameter or variable, go to Mapping -> Parameters and Variables from within the Mapping Designer in the Designer client. The format is $$VariableName or $$ParameterName

Changing values of Variables
To change the value of a variable, one of the following functions can be used within an expression: SETMAXVARIABLE($$Variable, value) , SETMINVARIABLE($$Variable, value), SETVARIABLE($$Variable, value) , SETCOUNTVARIABLE($$Variable), where:

 SETVARIABLE sets the variable to a value that you specify (executes only if a row is marked as insert or update). At the end of a successful session, the Integration Service saves either the MAX or MIN of (start value) to the repository, depending on the aggregate type of the variable. Unless overridden, it uses the saved value as the start value of the variable for the next session run.  SETCOUNTVARIABLE - increments a counter variable. If the Row Type is Insert increment +1, if Row Type is Delete increment -1. A value = 0 is used for Update and Reject.  SETMAXVARIABLE - compare current value to value passed into the function. Returns the higher value and sets the current value to the higher value.  SETMINVARIABLE - compare current value to the value passed into the function. Returns the lower value and sets the current value to the lower value.
At the end of a successful session, the values of variables are saved to the repository. The SetVariable function writes the final value of a variable to the repository based on the Aggregation Type selected when the variable was defined.

Parameter files
Parameter file is an ASCII file which is used to set values of mapping paramteres and variables. Parameters can be set on workflow, worklet or session level. The physical location

ST:s_src_sa_sapbw] $$DBC_SAP=sapbw. Repository $$FailureEmail=helpdesk@etl-tools.WF:workflow name.WT:worklet name] [folder name.ST:session name] [folder name.WT:worklet name. Parameter file structure Parameters can be grouped into the following sections: • • • • • • • • [Global] [Service: service name] [folder name. Declared initial [DWH_PROJECT.of a parameter file is set in Workflow manager in Workflows -> Edit. however it can be set to a different value in a parameter file.] [folder name. Default value Initialization priority of Variables: Parameter file. Declared initial value. It can also be specified using the pmcmd command when starting a session $$DBC_ORA=oracle_sap_staging . Parameters and variables can be used in pre and post-SQL Sample parameter file: [Service:IntegrationSvc_01] $$SuccessEmail=dwhadmin@etl-tools.WT:worklet name..WF:wkf_daily_loading] $$platform=hpux $$DBC_ORA=oracle_dwh [DWH_PROJECT.WF:workflow name] [folder name.WF:wkf_daily_loading.WF:workflow name.WF:workflow name.session name] [session name] Examples / useful tips • • • • • • • • • • • • • • The value is initialized by the specification that defines it.. specified for the session task Initialization priority of Parameters: Parameter file. Default value Parameters and variables can only be utilized inside of the object that they are created in.

The named Integration Service and m .co m $PMFailureEmailUser=pcadmin@mail. Worklet or session to which the parameters or variables need to be defined. We can define the parameters in the file as shown below: Heading Example Scope [Global] $PMSuccessEmailUser=pcadmin@mail. workflows. Subscribe now Parameter file is a text file that contains parameters and variables which can be referenced in Sessions and Workflows. Integration Service processes. Parameter File Sections: The following table describes the parameter file headings that define each section in the parameter file and the scope of the parameters and variables that you define in each section. and sessions that this service runs. Each section is preceded by a heading that identifies the Integration Service. Characteristics: • The Integration Service interprets all characters between the beginning of the line and the first equals sign as the parameter name and all characters between the first equals sign and the end of the line as the parameter value. Multiple Session and Workflows can share the same parameter file by logically grouping the Parameter file as mentioned below.Informatica Parameter Files by Priya T on August 23. 2011 in Informatica Way Get the latest updates on Informatica Way directly in your inbox. Workflow. and sessions. worklets. [Service:service name] [Service:ETLI] $PMSuccessEmailUser=pcadmin@mail. worklets. Integration Service process. Parameters and variables need to be defined below the m All Integration m $PMFailureEmailUser=pcadmin@mail.

co m The named Integration Service process and workflows.ND:node1] $ m $PMFailureEmailUser=pcadmin@mail.ST:session name] [ m The named worklet and all sessions within the m The nested worklet and all sessions within the nested worklet.WT:wrk_sub_test.WF:w_test.WT:wrk_sub_test] $PMSuccessEmailUser=pcadmin@mail. and sessions that this service process runs. [folder name. worklets. [folder name.WT:worklet name] [SCN_D.WF:workflow name. [folder m $PMFailureEmailUser=pcadmin@mail. [folder name.WF:workflow name.WF:workflow name. .[Service:service name. WT:wrk_sub_test1] $PMSuccessEmailUser=pcadmin@mail.WF:w_test] $PMSuccessEmailUser=pcadmin@mail.ND:node name] [ m $PMFailureEmailUser=pcadmin@mail.WF:w_test.ST:s_test] $PMSuccessEmailUser=pcadmin@mail...] [SCN_D.WT:worklet m The named workflow and all sessions within the workflow.WF:workflow name] [SCN_D.WT:worklet m $ m $ The named session.

WF:wf_TCOMMIT1] $$platform=windows .co m $PMFailureEmailUser=pcadmin@mail. For example.WT:worklet m Or [s_test] $ m Or -or[ -or[folder name. ST:s_test] $PMSuccessEmailUser=pcadmin@mail. a parameter file contains the following identical headings:[HET_TGTS.-or[folder m Precedence: Create each heading only once in the parameter m $PMFailureEmailUser=pcadmin@mail. Integration service will always refer to the first one and ignore the rest. If there are multiple headers with the same name.session name] m $PMFailureEmailUser=pcadmin@mail.ST:session name] m or [SCN_D.WF:w_test.WF:workflow name.ST:s_test] [session name] $PMSuccessEmailUser=pcadmin@mail.WT:wrk_sub_test.

” In all other sessions in the workflow. *** Update the parameters below this line when you run this workflow on Integration Service Int_01. *** . . Comments: Comments can be defined on parameter files.[HET_TGTS.WF:wf_TGTS_ASC_ORDR. the value for session parameter $DBConnection_ora is “Ora3. Also. The following lines are examples of parameter file comments: ————————————— Created 10/11/06 by Smith.WF:wf_TCOMMIT1] $$platform=unix $DBConnection_ora=Ora2 In workflow wf_TCOMMIT1. the parameter or variable with the smallest scope takes precedence over parameters or variables with larger scope.WF:wf_TGTS_ASC_ORDR] $DBConnection_ora=Ora2[HET_TGTS. it is “Ora2”. For example. a parameter file contains the following sections:[HET_TGTS.ST:s_TGTS_ASC_ORDR] $DBConnection_ora=Ora3 In session s_TGTS_ASC_ORDR. If we define the same parameter or variable in multiple sections in the parameter file. the value for mapping parameter $$platform will be “windows” and not “unix”. The Integration Service ignores lines that are not valid headings and do not contain an equals sign character (=). session parameter $DBConnection_ora is not defined. This is a valid comment because this line contains no equals sign.

Sign up to vote on this title
UsefulNot useful