USERFUNCTION

Declares a user-written function to EngageOne™ Enrichment. It is usually placed in the START section of the rule file. Once defined, the user-written function is called like any other EngageOne™ Enrichment rule function.

Syntax

USERFUNCTION name module [language type maxin maxout buffers]

Parameter Description Default
name Up to 20 characters that specify a unique name for the function. None
module One of the following:
  • For mainframe systems, up to 8 characters that specify the actual subroutine name link-edited into its own load module of the same name.
  • For UNIX or Linux, any number of characters that specify the actual subroutine name linked as a shared object where the entry point name is the same as the file name. The file must be in the library path.
  • For Windows, the value consists of two parts: DLL:function where DLL is the name of the DLL you created and function is the name of the function within the DLL. If you specify only one name, it is used for both the DLL and function values.
None
[language] One of the following that specifies the language type used in the function’s subroutine:
C IBM C/370 or SAS/C for mainframe systems, or UNIX C for UNIX systems. Use C for Windows no matter which language you used to create the DLL.
ASM IBM Assembler (mainframe only)
COB IBM VS COBOL II (mainframe only) C
[type] The user-written function interface type, one of the following: NORMAL
N[ORMAL] One call per entry in the rule file, no initialization or termination calls. (The call type in the Input Call area is N for all calls.
E[XTENDED] Three types of call:

I—Initialization (once after initial program load)

N—Normal call (one call per entry in the rule file)

T—Termination (once before final remove).

[maxin] The maximum size of the input data that will be passed to the function. The Input Call Area will be this size plus 40 bytes. 256
[maxout] The maximum size of the result returned from the function. The Output Call Area will be this size plus 40 bytes. 256
[buffers] One of the following that specifies the type of memory to pass to the function for the Input and Output Call Areas:
  • A Pass memory above the 16MB line to the function.
  • B Pass memory below the 16MB line to the function.
This parameter is only available on mainframe systems.
A

Calling a User-Written Function

The syntax for calling a user-written function in an EngageOne™ Enrichment rule file is:

%%Ans = Name(%%IN_VAR)

Parameter Description
%%Ans A variable whose value is the result of the call to the user-written function.
Name The user-written function name. This must be identical to the name value in the USERFUNCTION command used to define the function to EngageOne™ Enrichment.
%%IN_VAR The variable or constant string to store into InData in the Input Call Area (that is, the data the user-written function will use as input).

For more information, see the EngageOne™ Enrichment Developer Guide.