Input Call Area

The Input Call area is a memory block used to pass the %%IN_VAR data from Enrichment to the user-written function. (For more information about %%IN_VAR, refer to Calling User-Written Functions.) The size of this memory block is set with the maxin parameter of the USERFUNCTION declaration. (For more information about USERFUNCTION, refer to Declaring User-Written Functions.)

The layout of the Input Call area is described in the following table:

Table 1. Layout of Input Call Area
Name Type Size Offset Description
InSig CHAR 4 0 Input signature, set to "PDRI" by Enrichment
CallType CHAR 1 4 Call Type. This will be one of the following:
  • I Initialization Call
  • N Normal Call
  • T Termination Call
CallFrom CHAR 1 5 Section of the rule file from which it is called:
  • S START
  • D DOCUMENT
  • E PRESORTED
  • P PAGE
  • F FINISH
future CHAR 2 6 Reserved
RC INT 4 8 Current Return Code (from the previous function)
RV INT 4 12 Current Return Value (from the previous function)
future CHAR 20 16 Reserved
InSize INT 4 36 Size of the input data (less than or equal to maxin; if less than maxin, Enrichment pads InData with blanks)
InData CHAR n 40 Input data. The user-written function can define multiple fields within this data for ease of processing. The rule file can then prepare one long string with multiple values using concatenation or the RPUT function.

Hints

  • Enrichment sets the Input Call Area and the user-written function should not modify it.
  • The Input signature should be created by the user function to ensure that the proper block of memory has been passed to it.
  • For extended user-written functions, the initialization and termination calls (call types I and T) do not set InSize or InData and do not use OutSize or OutData. If the user-written function returns anything other than a 0 in the Output Call Area RC or RV, Enrichment assumes the initialization/termination failed. If the RC is between 1 and 7, Enrichment issues a warning. Otherwise, Enrichment issues a severe error.
  • For extended user-written functions, the init and term calls only occur once: init when the program is loaded (before any rules) and term at the end of processing.