getUserControlRecordList method

The getUserControlRecordList method is called for all record types except the item addendum records. These record types include type 01, 10, 20, 25, 31, 40 41, 61, 64, 68, 70, 75, 85, 90, 99, open batch (ICL), close batch (ICL), and store transaction. Use this exit point to add your own user documents to the transmission file before it is transferred to the host. This method has the following parameters:
Table 1. getUserControlRecordList method parameters
Parameter Definition
recordType A string containing the record type of the current record being processed
records A vector containing the records. When the recordType is "25" (check detail record), "31" (return record), or "61" (credit record), the vector contains the item record and all its associated addendum records. For all other record types, the vector should contain one and only one record that is the current record being processed.

The records are stored in the vector as an object of type ICLRecord. The business date, business day category, entry number, sort type, and bank number being used to process the current extraction are available to the user exit by calling the getCycleDate(), getCycleId(), getEntryNum(), getSortType(), and getBankNum() methods, respectively.

If the user exit wants to insert any records at the current location, it should return a list of byte arrays, each of which is a control record to insert, containing the bytes to be put in the file. The host expects this file to be EBCDIC data, thus the data returned by the user should be encoded appropriately. Before returning, the method should call the setInsertLocation() method, passing one of the values described as follows:
Table 2. Values for setInsertLocation() method
Values Definition
INS_BEFORE Insert the user record before the current record and do not assign it a unique ISN.
INS_BEFORE_WITH_ISN Insert the user record before the current record and assign it a unique ISN.
INS_AFTER Insert the user record after the current record and do not assign it a unique ISN.
INS_AFTER_WITH_ISN Insert the user record after the current record and assign it a unique ISN.

This insert location and ISN choice applies to all records in the returned list. The returned list may be any Java™ collection implementing the interface java.util.List, such as Vector or ArrayList. Each element in the list must be a byte array. When inserting user records for a current record that has multiple versions, the user record is inserted before the first version or after the current record.

As a migration aid, the class UserControlRecord provides a default implementation of getUserControlRecordList that calls the old getUserControlRecord method and returns a single element list (or null). The older user exits do not require immediate modification. They can still return a single byte array, which the default getUserControlRecordList puts into a list. User exits now override this default method to insert multiple records.

The SampleUserControlRecord class in the samples directory is an example of a user control record user exit. It inserts some records with simple EBCDIC strings, depending on the record type. You can invoke this by adding the following to the parameters in your extraction profile:
<parameter name="userControlRecClass">
   com.ibm.icpcs.transactionserver.samples.cpcs.SampleUserControlRecord
</parameter>