Assignment Task In Informatica Workflow

Srini is correct

 

You can use the variables:

$PMTargetName@numAffectedRows

$PMTargetName@numAppliedRows

$PMTargetName@numRejectedRows

 

Then Edit your session and on the component tab for the task: Post Session on Success Variable Assignment. Assign those variables. These should be on the RIGHT side. On the LEFT side you can name the variable whatever you like for example:$$Update_Count.

 

 

It should look like:

 

PARENT WORFLOW/WORKLET VARIABLES     OPERATOR     MAPPING VARIABLES/PARAMETERS

$$UPDATE_COUNT                                             =                    $PM<TargetName>@numAppliedRows

 

Then EDIT the workflow and on the VARIABLE tab..create a variable 

$$UPDATE_COUNT     with DATATYPE as Integer.

 

Now you will be able to see the USER DEFINED variable in a LINK condition.

Scenario

We want to create a target flat file name with the current system date.

Solution 1

  1. The first method is renaming the target file name in the post session command as bellow:

Example:

The following command will rename the file in the format filename_MMDDYYYY.out in Windows:

move $PMTargetFileDir\filename $PMTargetFileDir\filename_%date:~4,2%%date:~7,2%%date:~10%.out

  1. The second method is to use a command output type as follows:
  • In the Workflow Manager, edit the session task and go to the Mappings tab.
  • Select the flat file target.
  • Set the Output type as Command under Properties .
  • In the Command option, enter the shell command.

Example:

The following command will create the file in the format filename__dateYYYYMMDD.out   on UNIX:

cat  – > /$PMTargetFileDir/filename_’date ‘ +%Y%m%d’.out

Using this option, the Integration Service will send the output data of the session to the command, and the command will generate a file with a dynamic file name that contains the target data.

 

Solution 2

To append a timestamp to the name of a flat file target using a PowerCenter workflow variable:

1. Create a workflow variable with datatype NSTRING.

2. Create an assignment task before the session and enter the following expression in the assignment task:

3. Edit the session and enter the following file name:

Output filename=FF_Example$$timestamp.out

FF_Example.txt is the target flat file name as defined in the target definition.

 

Related posts:

0 thoughts on “Assignment Task In Informatica Workflow

Leave a Reply

Your email address will not be published. Required fields are marked *