Using User Modules For Accessing Multiple Dictionaries

Culprit programs have the ability to call user defined modules that are written in a non-culprit language. These modules can have different subschemas and access a different database than the calling culprit program or access a database when reading a flatfile. The basic process is to pass arguments to the user module, have that module either perform a calculation, edit, etc. or access data based on the passed arguments and send the results back to the culprit program.

All user modules must be stored in APPLPROD using the basic format of CULLUSnn. They should then be compiled into the appropriate loadlib depending on which dictionary they are accessing. Examples of compile for a specific database are in librarian. Review the Culprit manual for user modul names used by C.A. and review APPLPROD (request CULLUS** on LB) for user module names used internally.

CULLUS70 is an example of a COBOL user module that accesses the IAI database. It is called from a culprit program (PERSONS) that accesses the UNM database (see CALL US70). The JCL to run the culprit is stored in the PERSONS dataset.

Things to pay attention to:

  1. The JCL contains a Steplib override that must include all the datasets that contain the actual data of the database you will be accessing with the user module. The culprit proc contains only those datasets for the data being accessed by the culprit program.
  2. You must include a 1 byte buffer when defining the linkage section in your COBOL program but this is not included in the argument list.
  3. The nn of CULLUSnn must match nn of CALL USnn.

We haven't done any benchmarking of the time involved in linking to a COBOL program within a culprit. If anyone writes a user module that must be called repeatedly for each record, it would be interesting to see how much additional time is involved if any.


table of contents prev page next page