Download IBM Optim: Optim Common Elements Manual

Transcript
Chapter 6. Column Map Procedures
A Table Map used in a process may reference one or more Column Maps used to derive the appropriate
values for destination columns. The Table Map identifies and matches two sets of tables for processing,
and a Column Map provides a way to control processing, column by column. With a Column Map, you
can match or exclude columns from processing or, using native functions, derive values for one or more
destination columns.
(For details on defining Column Maps, see Chapter 5, “Column Maps,” on page 121.)
For data transformations in a Convert, Insert, Load, or Restore Process that are beyond the scope of
native Column Map functions, you can specify an exit routine or, for processes that run in a Windows
environment, a Column Map Procedure for a source column. (Exit routines, which are programs that
conform to the C programming language, are discussed in Appendix B, “Exit Routines for Column
Maps,” on page 473.) If the process is delegated to an Optim Server on a Windows machine, the Column
Map Procedure is also executed on the Server.
Note: You cannot run a Column Map Procedure in a UNIX or Linux environment.
The function of a Column Map Procedure is generally the same as that of an exit routine. An exit routine
must exist in a DLL external to Optim, and must conform to calling conventions used in the C
programming language. A Column Map Procedure, however, is stored in the Optim Directory and is
written in Optim Basic, which is distributed with Optim.
An exit routine may execute more efficiently than a Column Map Procedure but is written externally, and
must be externally compiled and linked. A Column Map Procedure, on the other hand, is written within
Optim and can be embedded in a Column Map. An external compile and link, and complicated calling
conventions, are not required.
One function of a Column Map Procedure is to generate values that could not otherwise be defined for
the destination column. This function is useful for handling special processing and data manipulation
according to sitedefined rules. During processing, Optim runs the Column Map Procedure, which is a
program that derives values for the corresponding destination column. Column Map Procedures are not
limited to data transformation, however. You can also use a Column Map Procedure to reject rows on the
basis of custom processing, to create a report tailored to the needs of your site, or to implement
conditional data transformations.
Procedure in a Column Map
To reference a named procedure in a Column Map, use the following syntax for the appropriate source
column:
PROC identifier.name [ ( [''parm1'' [,''parmn''] ] ) ]
To reference a local procedure in a Column Map, use the following syntax for the appropriate source
column:
PROC LOCAL [ ( [''parm1'' [,''parmn''] ] ) ]
As many as eight optional string or numeric constants, separated by commas, are passed to the
procedure when it is called. String constants must be enclosed in single quotes.
© Copyright IBM Corp. 1994, 2010
175