Defining Record Types

Record types are subsets of a complete file definition, which are useful when the FD describes a data file that contains different types of records. Use record types to only include the data items pertaining to a particular type of record, filtering out the other items.

This type of scenario within a COBOL program would often be solved within the Procedure Division code, using IF statements to query the purpose of the data item to determine how it should be processed.

In Relativity, you must use conditional variables and 88-level conditions to query the values of data items, and then associate the relevant value with a record type. The association is made using the record type filter, which allows you to evaluate a data item 'true' or 'false' based on one or more values.

Define a record type by selecting the relevant data items to include (which are ultimately your table's column names), and apply a filter based on an 88-level condition. The record type then enables you to create a table definition that uses only the data items that you are interested in.

Record types are optional, and only filter out information for as long as the record type is applied to a table definition; no data items are permanently removed from the FD.

Indications that your FD may contain different record types, and could benefit from record types, are the presence of multiple 01 entries, or one or more REDEFINES clauses.