Sei sulla pagina 1di 14

INFORMATICA

MAPPING PARAMETRS & VARIABLES


&
WORKFLOW VARIABLES

Prepared by,
Jeeva R

Purpose

Mapping parameters and variables represent values in mappings


and mapplets.
To store information during the execution.
We use mapping variable to perform an incremental read of the
source, To assign sequence values, etc.,
e.g. $$SEQ_VAR
We use mapping parameters to substitute values that are defined.
e.g. $$STGDB
Workflow Variable is used to pass the value of mapping variable or
parameter from one session to the other.

Parameter vs. Variable


The value of aparameter is fixedduring the run of the mapping
Variables can changein value during run-time.
To create a parameter or variable, go to
Mapping -> Parameters and Variables within the Mapping Designer in the
Designer client.
The format is$$VariableName or $$ParameterName.
Select data type and Aggregation type for the mapping variable.
Select data type for mapping parameter.
Initial and Default Value:

We can define initial value while creating else IS considers default value.
The default values based on data type of variables,
Data ->Default Value
Numeric ->0
String ->Empty String
Date time ->1/1/1

Start Value

Value at Start of session


The IS looks for the start value in the following order:
1.Value in parameter file
2.Value saved in the repository
3.Initial value
4.Default value
Current Value:
Value of variable as session progresses (Will always be the start
value).
Final value is stored to repository under that variable at the end of
successful session.

Variable Data type and Aggregation Type:

Declared during mapping variable creation.


The IS uses the aggregate type of a Mapping variable to determine the
final current value of the mapping variable.
Aggregation types are:
1.Count:Integer and small integer data types are valid only.
2.Max:All transformation data types except binary data type are
valid.
3.Min:All transformation data types except binary data type are
valid.
Variable Functions:
determine how the Integration Service calculates the current value
of a mapping variable in a pipeline.
Three types,
1. SetMaxVariable---ignores update,delete and reject statement.
2. SetMinVariable---ignores update,delete and reject statement.
3. SetCountVariable---ignores update and reject statement.
4. SetVariable.

Examples:

SETMAXVARIABLE($$var_max,SAL)
SETMINVARIABLE($$var_min,SAL)
SETCOUNTVARIABLE($$var_count)
SETVARIABLE($$var,SAL)

Parameter File:

A parameter file is a list of parameters and associated values for a


workflow, worklet or session.
Parameter files provide flexibility to change these variables each time
we run a workflow or session.
Enter the parameter file name and directory in the workflow or session
properties.
A parameter file contains the following types of parameters and
variables:
Workflow variable
Worklet variable:References values and records information in a
worklet. We can use predefined worklet variables in a parent workflow,
but we cannot use workflow variables from the parent workflow in a
worklet.
Session parameter:Defines a value that can change from session to
session, such as a database connection or file name.
Mapping parameter and Mapping variable

In a Parameter file:
[Global]
[Service: service name]
[folder name.WF:workflow name]
[folder name.WF:workflow name.WT:worklet name]
[folder name.WF:workflow name.WT:worklet name.WT:worklet name...]
[folder name.WF:workflow name.ST:session name]
[folder name.session name]
[session name]
Note : In the parameter file, folder and session names are case sensitive.

e.g. of variables defined in Parameter file.


$$Bonus=1000
$$var_max=500
$$var_min=1200
$$var_count=0

Workflow Variables:

We can create and use variables in a workflow to refer values and


to record information.
The workflow variable value can change during workflow run.
Types:
Predefined workflow variables -used to evaluate workflow and
task conditions.
Represented with $ sign
e.g. $DBConnection_Source
User-defined workflow variables
Represented with $$ sign
Assignment tasks
Decision tasks
Links
Timer tasks

User Defined Workflow variables:

The user defined workflow variables are used to pass mapping


parameter/variable value from one particular session to other.
The workflow variables are of different data types,
Date/time
nString
Integer
Double
The workflow variable and mapping param/var should be of same data type.
The workflow variable can be declared persistent or non-persistent and
IsNULL as default value or a specific defined value while creating it.
Values will be stored in repository for persistent variables that can be used
for next run.
Can be viewed by Right click on wf name and view persistent values.

(Cont)

User Defined Workflow variables:

User Defined Workflow variables:

The user defined workflow variables can be assigned with


mapping parameter/variable value in edit tasks under
components tab in Post-session on success variable
assignment.
They can also be used to assign mapping parameter/variable
value for a session in edit tasks under components tab in Presession variable assignment.

System Parameters:

$$$ refers System Parameters like $$$SessStartTime


$$$SessStartTime returns the initial system date value onthe
machine
hosting
the
PowerCenter
Server
when
the
serverinitializes a session
$$$SessStartTime returns the sessionstart time as a string value.

Thank You

Potrebbero piacerti anche