Sample Column Map Procedures

A Column Map Procedure is a custom program written in Optim™ Basic that is referenced to perform special processing or data manipulation that is otherwise beyond the scope of a Column Map.

The function of a Column Map Procedure is generally the same as that of an exit routine. Exit routines, however, are written outside Optim and must be externally compiled and linked. Column Map Procedures are written within Optim.

The \Samples\CMProc subdirectory includes sample files written in Optim Basic that can be used to create a set of Column Map procedures. The file names are:

CMEXIT.BAS
Sample Optim Basic Column Map procedure modeled after the Standard Exit routine. Refer to Sample standard exit.
TBLINFO.BAS
Sample Optim Basic Column Map procedure that demonstrates how to access and retrieve data about the process, product or database table. This sample procedure moves source data to the destination without changing it, and can be used with most column data types.
DEFAULT.BAS
Sample Optim Basic Column Map procedure used to populate the Column Map Procedure Editor when installed in the BIN subdirectory.

Create a Column Map Procedure from file provided

This task describes how to create a Column Map Procedure from a provided file.

To create a Column Map Procedure from one of the files provided:

  1. In the main window, select Column Map Proc from the Definitions menu to open the Column Map Proc Editor and last edited Column Map Proc.
  2. Select New from the File menu in the Column Map Proc Editor.
  3. Select Import from the File menu in the Column Map Proc Editor to open the Supply an Import File Name dialog.
  4. Type (or click the Browse button and select) the path to the Samples subdirectory containing the sample files, and the file name: (e.g., C:\Program Files\IBM Optim\RT\ Samples\CMProc\CMEXIT.BAS)
  5. Select Save As from the File menu in the Column Map Proc Editor. In the Save a Column Map Proc dialog, type a name in the Patternbox and click Save.
  6. Edit the Column Map Proc, as needed.
  7. Compile.

Sample Standard Procedure

A Standard procedure is called to derive the value for a destination column in a Column Map. This sample Column Map procedure is created from the CMExit.bas file provided.

This procedure performs two operations on the sample database table OPTIM_CUSTOMERS, as follows:

  • Discards rows that have a value of zero (0) in the YTD_SALES column, and processes all other rows.
  • Assigns a value of ‘SE012' to the SALESMAN_ID column for customers in Florida (rows with FL in the STATE column).

To use this sample in a Column Map, you must specify PROC CMEXIT.BAS in the source column for the destination column SALESMAN_ID.

Sample Table Information Procedure

The sample table information Column Map procedure is created from the TBLINFO.BAS file. This sample is provided to demonstrate the Optim Basic Column Map procedures that you can use to retrieve data about a process, product or database table.

This procedure moves unchanged source data to the destination, and demonstrates how to output the following:

  • Name of Optim Temp Directory
  • Name of Optim Data Directory
  • Name of Optim Script
  • Company Name
  • Optim Release Number
  • Optim Build Number
  • Optim Error Codes
  • Instance
  • Thread ID
  • Thread Handle
  • Operating System
  • Operating System Release
  • Operating System Build
  • Operating System Service Pack
  • Server User ID
  • Computer Name


Feedback