Using the EXIT function

The EXIT function is available when entering mapping rules for fields using the Map Designer on your PC.

Use this function to exit to a user-written program to get data for mapping to a field. See the Functions and Expressions documentation. However, there are special considerations when using this function in conjunction with the z/OS CICS Execution Option.

A user exit is invoked by calling the EXIT function in a mapping rule using the Map Designer. The EXIT function expects three arguments, as seen in the following example:

EXIT ("non_null_value", "load_module_name", "parameters")

When using the CICS Execution Option:

  • The first argument contains a value that is not a null string (a single space is sufficient).
  • The second argument contains the name of the exit program (the load module name).
  • The third argument is a text item containing parameter information for the exit program. This parameter text item may be up to 64K bytes in length, and the EXIT function returns a resulting text item, which also may be up to 64K bytes in length. Execution of this mapping rule causes the text item returned by the program exit-name to be placed in the field to which you are mapping data.

Exit programs must be defined as z/OS CICS programs. Any static data areas declared within an exit program, such as COBOL working storage, do not persist across multiple calls to the exit. Four arguments are passed to the user exit program in the COMMAREA:

  • The address of a full word that contains the length of the parameter text item.
  • The address of a space-padded buffer of up to 64K bytes that contains the parameter text item.
  • The address of a full word that contains the length of the resulting text item.
  • The address of a buffer of up to 64K bytes into which the resulting text item will be placed.

For an example of source code for a COBOL user exit program, see DTXSCXIT in the DTX.SDTXSAMP PDS included in the HCL Integration Platform installation.