3.10.1 Select Fields When Working from File Definition Menu
Many of the processes that work from the file definition menu will request that field names be specified. For instance which fields are to be included in the file definition?, which fields form the key of the logical file?, etc.
When requested to specify a field name it can usually be done in these ways:
- In full. Enter the full name of the field required. If the field is found then it will be accepted with no further action.
- Partially. Enter as much as desired of the partial name of the field. A search is made for all fields which generically match the name specified and a list is displayed for subsequent selection.
- As a "?". In this case a list of all fields that are available is displayed from which the desired field can be selected.
Note: If literals and system variables are valid entries for the context only the "?" can be used to display the selection list.
The fields that are included in the list will vary with the context in which the fields are being used. For instance, if specifying the fields to be included in the file definition then list of fields will come from the LANSA data dictionary. However, if specifying the key fields of a logical view then the list will come from the fields in the file definition since a file key must be one of the real fields in the file. The list will contain both the real and virtual fields in the file when specifying access route key fields.
The selection display may allow a single or multiple selection of fields depending on the context. For instance when adding real or virtual fields to the file definition a multiple choice may be made, but only a single choice when selecting access route or batch control keys.
Single Field Selection
When only one field is to be selected the list of fields will fill the full screen.
|
Search Name
A new name may be entered to build a new generic list. It may be built from the data dictionary, the real fields in a file definition, or the real and virtual fields in a file definition, depending on which attribute of the file is being defined.
Sel
To add a field to the definition, type any non blank character in the 'Sel' column and press enter.
R/V
When the selection list is built from the fields in a file definition an 'R' for real or a 'V' for virtual will be displayed against each field in the 'R/V' column.
Multiple Field Selection
When a multiple selection is allowed the screen is split horizontally in two. The number of fields which can be selected at one time depends on the context in which the selection is made.
|
The top half of the screen contains the current work list to which selected fields are added.
Act
The action field allows fields to be deleted from the current list by entering option 4 and pressing the enter key.
Seq
The sequence number allows the order of the fields to be changed. The fields will be returned to the calling program ordered by the sequence number. In the case of fields being added to a physical file definition the new and existing fields are sorted by these sequence numbers. If several fields have the same sequence number they are sorted alphabetically.
The bottom half of the screen contains the selection list. It may be a full or generic list, and may be built from the data dictionary, the real fields in a file definition, or the real and virtual fields in a file definition depending on the calling program.
Search Name
A new name may be entered to rebuild the list. If a generic name is entered which is unique, its matching field is added to the current work list automatically. If a generic name is a valid name but has other generic matches, it is automatically added to the current work list and the generic selection list is also displayed.
Seq
The sequence number (1 to 99999) allows the selected fields to be ordered and added to the current work list. If several fields are given the same number they are ordered alphabetically.
R/V
When the selection list is built from fields in a file definition an "R" for real or "V" for virtual is displayed against each field.
Partial/Generic Names
Partial/Generic names may be classified in three different ways.
|
As an example of a type 2 partial name, 'DATE' could be a valid field name, but this may also be generic because field 'DATETIME' may exist.
All type 1 and 2 generic names are automatically added to the working list in a multiple selection list.
Each generic field type causes different actions by the selection program as shown below. The multiple field selection can be activated by a single entry or by several partial names of different types, and will act according to which type they are.
|
Note when a valid but generic name (type 2) is used in a single select condition, the select screen containing the generic list is displayed. If no selection is made the name is retained on the calling screen but the 'no selection made message' is displayed even although the name is valid. To exit F12 must be used as enter key will again display selection list. This is because the program cannot interpret the user's intention in entering the name as a generic or valid name as it is both.
Comments/Warnings
For response reasons, if the LANSA data dictionary for the current partition contains a large number of fields, it is preferable to use partial names rather than '?'s.