CHAPTER 6:  Adjusting The Schema Definition

PURPOSE:  This chapter covers the Mode menu for Schema Definitions (SDs) in more detail.  In Chapter 3, only the Add and Save functions were discussed in the creation of an SD.  While data in a Data Set (DS) can be manipulated through the Update menu (Chapter 4), the SD which defines the DS can be changed through the Mode menu.

Using The Mode Menu

If an SD needs to be changed, select DEFINE from the Master menu and press <RETURN>.  Next, select SCHEMA from the Define menu and press <RETURN>.  Express will prompt for an SD name.  To get a list of available SDs (Figure 43), type in a slash, then press <RETURN>.

Figure 43  SD List

For the example, select MYLIST and press <RETURN>.  Express warns, when a DS is attached to an existing DS (Figure 44).

Figure 44  Express Message

Express uses the ACCENT R utility, SDMOD to convert the attached DSs and re-save the DIs and PMs that relate to the DSs.  You have the option of continuing or not.  The default is YES.  Press <RETURN> to continue.  The Mode menu (Figure 45) is displayed next.

Figure 45  Mode Menu

The Mode menu has eight options: 

ADD

create a new SD

CHANGE

update an existing SD

INSERT

add new elements to an existing SD

DELETE

remove elements from an existing SD

LIST

show the contents of the current SD

SAVE

retain SD changes

HELP

display help information

RETURN

90 back to the Define menu

Modifying Fields

Select CHANGE from the Mode menu and press <RETURN>.  Express displays an edit window and a field listing (Figure 46).

Figure 46  Edit Window, Field List

You can use the up or down arrow keys to scroll through a long list of fields for large SDs.  For the example, enter 1 for the NAME field and press <RETURN>.  The Describe Schema window appears (Figure 47).

Figure 47  Describe Schema Window

Tab down to Field Length and replace 20 with 25.  Press <RETURN> and Express will ask if the field is to be an array.  The default is NO.  Press <RETURN> to go back to the edit menu.  Press <RETURN> again to retreat to the Mode Menu.

Adding Fields

Select INSERT and press <RETURN>.  The edit window and field list appear again.  The number entered is where the inserted field will be placed.  The existing field with the entered number (and succeeding fields) will be pushed down the list.

For the example, enter 2 and press <RETURN>.  The Define Schema window is blank. Enter ADDRESS for field name.  The Data Type window (Figure 48) is displayed when the cursor reaches the data type field. Select Character Data for field type and press <RETURN>.  Enter 20 for the field length.  Accept the default (NO) for the array prompt by pressing <RETURN>.  Press <RETURN> once more to back up to the Mode menu.

Figure 48  Data Types Window

Removing Fields

Select DELETE and press <RETURN>.  Express displays the same edit window and field list. For the example, enter 5 and press <RETURN> to delete the Date field.  Press <RETURN> again to exit the edit window. 

Viewing The Contents

Select LIST to see a display of the SD contents (Figure 49). 

Figure 49  SD Listing

Press <RETURN> to go back  to the Mode menu.  Select SAVE to keep the changes.  Express will prompt you for a save if you try to leave the Mode menu without saving your changes.  The prompt default is YES.  SD SDMOD is created by Express as a copy of the original SD.  Express then returns to the Define menu.

Select RETURN and press <RETURN> to get back to the Master menu.