Collation Descriptor Exits 01 - 08

#### Search Results

Search

# Collation Descriptor Exits 01 - 08

The collation descriptor exits 1 through 8 (CDX01 through CDX08) are used for encoding and decoding values for the corresponding collation descriptors.

A collation descriptor may be defined for a field with alphanumeric or wide format. Its values are stored in the index, not in the record itself. The number of the collation descriptor exit used to derive the values is associated with the collation descriptor.

A sample collation descriptor exit CDXE2A is provided in the Adabas source data set. It converts EBCDIC to ASCII for the encoding function and the reverse (ASCII to EBCDIC) for the decoding function.

The Collation Exit implements three function entry points which are called on the following events:

#### INITIALIZE function

- nucleus session start

- utility initialization when collation exits have been defined (ADARUN parameters)

#### ENCODE function

- update/insert/delete of the parent's value (Nucleus)

- Search specifying the collation descriptor with the search value (Nucleus)

- compression of a record (ADACMP)

#### DECODE function

Read Index (L9) by Collation DE, only if the exit supports the DECODE function (Nucleus)

This document covers the following topics:

- Collation Descriptor Exit Interface

## Collation Descriptor Exit Interface

The collation descriptor exit interface is defined in the CDXPARM DSECT in the Adabas source data set. The interface has three functions:

- initialization

- encoding

- decoding (optional)

### Initialization Parameters

R1 points to a list of addresses that point to five storage areas of the caller. The collation descriptor exit must set the five areas as follows:

CDXSPC | default space character; a maximum of 4 bytes
CDXSPCL | fullword containing the size of the space character
CDXENC | address of encoding function
CDXDEC | address of decoding function If the returned address is zero, decoding is not supported. The collation descriptor cannot then be used for L9 processing.
CDXVER | address of zero-byte delimited version string

### Encoding/Decoding Parameters

R1 points to a list of five fullword-sized parameters:

CDXIA | address of the input string
CDXIL | length of the input string
CDXOA | address of the output string
CDXOL | size of the output area
CDXARL | address of the length of the returned output string

The collation descriptor exit stores

- the output string in the area at the address specified by CDXOA; and

- the input string length in the fullword at the address specified by CDXARL.