You are here: LANSA for i User Guide > 3. Files > 3.10 The File Definition Menu > 3.10.1 Select Fields When Working from File Definition Menu

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:

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.

 

 DC@P800501           Select Field from Data Dictionary                

                                                                       

                                                                       

 Either Choose field required from list below,                         

 Or     Enter a new full or partial search name : DEM                 

                                                                       

 Sel Field       Description                       R/V  Type  Len  Dec 

  _  DEMAD1      Address line 1                          A     25      

  _  DEMAD2      Address line 2                          A     25      

  _  DEMAD3      Address line 3                          A     25      

  _  DEMCAT      Product category                        A     10      

                                                                       

                                                                       

                                                                       

 Fnn=Help  Fnn=Exit  Fnn=Cancel  Fnn=Messages                          

                                                                       

 

 

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.

 

 DC@P800501           Select Field from Data Dictionary    

 

Type option, press enter         4=Delete from current list

Act Seq   Field          Description                    Typ  Len  Dec

     10   DEMAD3         Address Line 3                  A    25

 

 

 

Full/Partial name of fields to be displayed from Data Dict ____________

Type option, press enter  1 to 99999=Select to add to current list

 Sel Field       Description                     R/V   Type  Len  Dec  

  _  DEMAD1      Address line 1                          A     25      

  _  DEMAD2      Address line 2                          A     25      

  _  DEMAD3      Address line 3                          A     25      

  _  DEMCAT      Product category                        A     10      

 

 

 Fnn=Help  Fnn=Cancel  Fnn=Messages     

 

 

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.

Type

Description

1

A partial name which is matched by only one full name,

2

A partial name which is a valid name, and has several matches,

3

A partial name which has several matches.

 

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.

Type

Single select

Multiple select Single partial name.

Multiple select. Multiple partial names

1

Selection list not displayed matching name returned

Selection list not displayed matching name returned

Matching name added to working list selection list displayed

2

Selection list displayed. See note below.

Selection list displayed, valid name added to working list.

Selection list displayed, valid name added to working list.

3

Selection list displayed

Selection list displayed

Selection list displayed.

 

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.