Skip Ribbon Commands
Skip to main content
Navigate Up
Sign In

Quick Launch

Average Rating:

facebook Twitter
Email
Print Bookmark Alert me when this article is updated

Feedback

MAPPING TEMPLATES: Load using an External procedure
Content

Overview

Using PowerCenter to replace characters in a string with a single character, multiple characters, or no character by using an External Procedure transformation that calls the stringfunction.dll. (Please note that in PowerCenter there is the Replacechr and Replacestr function that does exactly what the stringfunction.dll does. The goal of this mapping template is simply to illustrate the ability to extend PowerCenter functionality with external programs such as stringfunction.dll).

 

External Procedure transformations operate in conjunction with procedures you create outside of the Designer interface to extend PowerCenter functionality. Although the standard transformations provide you with a wide range of options, there are occasions when you might want to extend the functionality provided with PowerCenter and PowerMart. For example, the range of standard transformations, such as Expression and Filter transformations, may not provide the exact functionality you need. If you are an experienced programmer, you may want to develop complex functions within a dynamic link library (DLL) or UNIX shared a library, instead of creating the necessary Expression transformations in a mapping.

There are many uses of the External Procedure transformation, depending on the client's need. If Informatica cannot provide the logic, and certain code can, Informatica can still support this by using the External Procedure transformation. This mapping template illustrates just one method of using a PowerCenter External Procedure transformation. The mapping replaces characters in a string with a single character, multiple characters, or no character by using an External Procedure transformation that calls the stringfunction.dll.

Implementation Guidelines

An external procedure exists separately from the Integration Service.  It consists of C, C++, or Visual Basic code written by a user to define a transformation. This code is compiled and linked into a DLL or shared library, which is loaded by the Integration Service at runtime. An external procedure is "bound" to an External Procedure transformation. It allows an external procedure to be referenced in a mapping. By adding an instance of an External Procedure transformation to a mapping, you call the external procedure bound to that transformation.

This mapping template uses the stringfunction.dll. To use the dll, place it in the ExtProc directory, under the Informatica server installation directory. Then the register the dll at the command prompt,

Example

D:\Program Files\Informatica\PowerCenter Server\EXTPROC>regsvr32 stringfunctions.dll.

A window prompt acknowledges that the dll is registered.

In Designer, under the Transformation Developer tab, import the external procedure called Replace_Single_Char.
On the Properties tab on this transformation, you must

  1. choose Type (in this case choose COM)
  2. Identify Module/Programmatic Identifier : (in this case: StringFunctions.ReplaceFunctions)
  3. Identify Procedure Name : (in this case Replace_Single_Char)
The Expression Transformation exp_SEARCH_AND_REPLACE_VALUES sets the search for values to be '@' and '2'.
If any of these values is found, it is replaced with the value '(at)'. In this mapping the string searched is in the column EMAIL.
If any value in the column EMAIL is equal to '@' or '2', then it is replaced by'(at)'.

So for example:
EMAIL RETURN VALUE
janedoe@somedomain.com janedoe(at)somedomain.com
jack2jill@somedomain.com jack(at)jill(at)somedomain.com

Pros

  • Extends PowerCenter functionality.

Cons

  • Must maintain external code.


More Information


Reference


Attachments


Applies To
Product: PowerCenter
Problem Type:
User Type: Administrator
Project Phase:
Product Version: PowerCenter
Database:
Operating System:
Other Software:

Last Modified Date: 8/12/2018 8:23 PM ID: 16317
People who viewed this also viewed

Feedback

Did this KB document help you?



What can we do to improve this information (2000 or fewer characters)