3: Creating the Demonstration System Files

3.9 Modifying a Data File by Adding a Field

One of the most common modifications to an RMSfile is to add a new data field. The following exercise illustrates the methods for modifying RMSfiles. In it we add a field to the subscriber file (i.e., sub) to store each subscriber’s telephone number along with their name and address.

The name assigned to this field is telephone. It must be defined as a string field since it contains a hyphen as well as numbers, and since phone numbers in a format such as nnn-nnnn have seven characters, eight characters must be allocated for this field. The extra character reserves space for the terminator character.

1. From the Data Files Menu, select choice D2 - Modify File Definition.

Enter sub as the file name and press STORE <F5>.

2. The screen should display the File Definition form.

3. Press the SWITCH key <F7>. This appends the Field Description form to the File Definition form.

4. Press the ADD key <F6> and add the telephone field.

5. To store the new description, press the STORE key <F5>.

6. To examine the primary key information, press the SWITCH key <F7>.

To examine the secondary key information, press the SWITCH key <F7> again.

With the Secondary Key Field Names form displayed, press the NEXT key <F3>. If there were multiple secondary key indexes, the system would display the next one found. (Note: Up to 127 secondary indexes may be defined.) At this point the message No more secondaries is displayed.

7. Now that all the changes have been made to the RMSfile, write the modified file by pressing the EXIT key <F8>.

A message is displayed:

There is a short pause while this file conversion takes place.

At the conclusion of the file conversion process, the Data Files Menu is displayed.

This concludes the steps to modify the RMSfile sub by adding the field telephone.