Assigning data elements to segments

After you determine how data elements are related in a hierarchy, associate each of the data elements with a segment.

To do this, construct a list of all the keys and their associated data elements. If a key and its associated data element appear in several local views, only record the association once.

List the data elements next to their keys, as shown in the following table. The key and its associated data elements become the segment content.

Table 1. Keys and associated data elements
Data aggregate Key Data elements
COURSE CRSCODE CRSNAME, LENGTH, PRICE
CUSTOMER/LOCATION CUST, LOCTN  
CLASS EDCNTR, DATE  
STUDENT STUSEQ# STUNAME, ABSENCE, STATUS, GRADE
INSTRUCTOR INSTR  

If a data element is associated with different keys in different local views, then you must decide which segment will contain the data element. The other thing you can do is to store duplicate data. To avoid doing this, store the data element with the key that is highest in the hierarchy. For example, if the keys ALPHA and BETA were both associated with the data element XYZ (one in local view 1 and one in local view 2), and ALPHA were higher in the hierarchy, store XYZ with ALPHA to avoid having to repeat it.