3: Creating the Demonstration System Files

3.6 Creating the Magazine File

From the Toolkit Menu select choice 1 - Data Files Menu.

1. Select choice D1 - Create File Definition.

The Create Data File Definition parameter screen allows you to enter the name and description of the RMSfile you are about to create. The entry field for the name of the RMSfile is blank. This field requires the name of the RMSfile. The entry field for the description of the RMSfile is defaulted to

If desired, the default contents of the description field may be overwritten by simply entering a new description.

Now, with the cursor in the entry field for the name of the RMSfile, enter the name of the RMSfile, i.e., mag.

Press the STORE key <F5>.

2. Press the ADD key <F6> so that data may be entered. Notice that the word ADD appears in the lower left-hand corner of the screen, and that the cursor is positioned in the field labeled File Access Method. As noted in the previous section, we will simply ‘enter’ the default values for the fields in this form.

Press RETURN. The word indexed is displayed in the field automatically.

Press RETURN again, and the word btree appears in the field labeled Primary Key Ordering.

Press RETURN again, and the word none appears in the field labeled Duplicate Key Handling.

Store this information by pressing the STORE key <F5>.

3. The Field Description form is then displayed.

The word ADD appears in the lower left-hand corner of the screen, since the system is still in ADD mode.

Enter the information for the first field is as follows:

In our data entry we will make use of the default feature. After you enter the name of the field (i.e., magazine), press RETURN. The cursor then moves to the field labeled Data Type. Press RETURN. The default value string is entered in the field. Enter 16 in the Field Length field and press RETURN. Press RETURN again, and the contents of the field labeled Number of Elements defaults to 1. Type the Description field entry.

Store the description by pressing the STORE key <F5>.

4. A new Field Description form is displayed.

Following the procedure above, enter the information for the title field.

Store this description using the STORE key <F5>. Again, a new Field Description form is displayed.

5. Add the next field, year_rate.

You should note that the Field Length field has different default values associated with each Data Type entry, although for char(acter) and string type fields you may rarely, if ever, use them. (You should further note that the Field Length of some Data Type entries is the length of the internal representation rather than the number of characters, and thus may differ from the values shown in C/Base Tutorial Manual since they are dependent upon your system configuration.)

Enter and store the description.

6. Add the next field, subscribers, and store the description.

7. All fields for the RMSfile mag have now been entered. Press the SWITCH key <F7> to display the first of the Key Definitions forms.

Enter magazine in the first field of the Primary Key Field Names form. Press the STORE key <F5>.

The system now appends the Secondary Key Field Names form.

You can now enter the names of fields to be secondary keys. Since we may want to have quick access to the records in this file based upon the magazine’s title as well as the magazine’s code (which is the primary key), we will enter the title field as a secondary key in the RMSfile mag.

Store the information by pressing the STORE key <F5>.

8. The final step for creating a RMSfile is to save the definition. This is done by pressing the EXIT key <F8>.

The system displays progress messages while it is creating the RMSfile:

After you press RETURN the Data Files Menu is redisplayed.

9. To test some of the features of the Data Files Menu, select choice L1 - List Logical Data File(s). This function lists the names of all RMSfiles that are in the current database.

Each listing choice in toolkit presents you with a parameter form to specify the destination of the listing. You can send the listing to the screen or printer.

Notice that there are two entry fields. The first holds the answer to the question Output to Printer? and has a default value of no, which automatically appears in the field. If you wish to see the listing on your screen, simply accept the parameter screen as it is by pressing the STORE key <F5>. If you wish to print the listing, enter yes in the entry field next to the prompt Output to Printer?. If you desire more than one copy of the listing you may specify how may copies you want. Enter the number of copies in the second entry field next to the prompt Number of Copies?.

For now, press the STORE key <F5>.

Toolkit will display the RMSfiles in the current database. Now there is a single file name mag as below:

(If you entered your own description, it may appear differently.) As other files are added, their names and descriptions also appear on the list. When you are through looking at the list, press RETURN and the Data Files Menu is redisplayed.

10. To list the dictionary for a RMSfile, select choice L2 - List the data dictionary for a Data File and press RETURN. Toolkit responds with a parameter form.

Press the STORE key <F5>.

Press RETURN to redisplay the Data Files Menu.

This completes the creation of RMSfile mag.

Note:

Delete the record for cwpuzz (as outlined in the preceding exercise) so that the next time this Tutorial is used the contents of the data files will reflect the illustrations.