3: Creating the Demonstration System Files

3.7 Creating the Subscriber File

We will now create the subscriber file. The file is named sub and is created using the same way we created th RMSfile named mag.

1. The Data Files Menu should now be displayed. Confirm that before proceeding. From the Data Files Menu select choice D1-Create File Definition.

The Create Data File Definition parameter form appears asking for the name and description of the RMSfile.

Enter sub as the name of the RMSfile and press RETURN.

2. After the licensing information flashes on the screen, the File Definition screen is displayed. Press the ADD <F6> key and enter the default information into the File Definition form by pressing RETURN three times.

3. Enter the following information for the subscriber field and then press the STORE key <F5>:

4. Enter the following information for the name field:

Store the description with the STORE key <F5>.

5. Add the next field, address.

The address field illustrates the use of a multi-element field (i.e., an array). An array allows two or more identically described fields (in this example, address lines 1 & 2) to be identified by one name. (Note: Distinguishing one element from another is unnecessary when creating RMSfiles. It does become necessary, however, when creating data entry forms and reports, and is, therefore, covered in the chapters of this manual dealing with those topics.)

Store the description.

6. Add the next field, city, and store the information.

7. Add the state field.

8. After storing the previous description, add the zip field:

Store the information.

9. All field information for the RMSfile sub has now been entered. Press the SWITCH key <F7> to display the Primary Key Field Names form.

Enter subscriber as the primary key and press the STORE key <F5>.

The system now appends the Secondary Key Field Names form.

10. It could be important in our application to have rapid access to data in this RMSfile with the name or zip fields. Set up a secondary key for the name field.

Type name into the first field of the form and press the STORE key <F5>.

A second Secondary Key Field Names form is appended to the screen.

Type zip into the first field and press the STORE key <F5>.

Note that name and zip were not entered on the same Secondary Key Field Names form. If they had been, only one secondary index would have been created. The values of the name and zip fields concatenated (i.e., put together) would have been the key for this index. By entering name and zip separately, two secondary indexes are created.

11. The final step for creating a data file is to write the file. This is done by pressing the EXIT key <F8>.

The system responds with progress messages:

Press RETURN.

12. To check the file definition just created, select choice L1 - List Logical Data File(s) from the Data Files Menu.

Press RETURN.

13. Select choice L2 - List Data File Dictionary.

The appropriate parameter form appears.

Type the name sub in the entry field next to the question Name of Data File? and press the STORE key <F5> .

Press RETURN to redisplay the Data Files Menu.

This completes the creation of RMSfile sub.