Previous Topic: SynonymsNext Topic: Date Option


Code Tables

Access mode: CA OLQ does not use code tables in the dictionary with records containing fields that are tightly coupled when the access switch is set to IDMS.

You can define a small field to hold a value, and then use a code table to translate that value to the appropriate string upon display of the report.

Example:

In a grocery store, each type of apple has a code for the type:

01       for the Macintosh
02       for the Granny Smith
03       for the Cortland
04       for the Golden Delicious
05       for the Red Delicious

In the record, you can use the code value to identify the item. When you want to print the report, however, you want to see the name of the item. Associate a code table with the record, and when you display the record, the code table translates the code into the appropriate string. A sample code table would look like:

01       MACINTOSH
02       GRAN.SMITH
03       CORTLAND
04       GOLD.DEL
05       RED.DEL

To associate a code table with a field, use the IDD statement:

REMOVE/REPLACE RECORD ELEMENT ...
INCLUDE CODE TABLE IS LIST/encode-value decode-value/NULL