Define View Supplementary

Once you have specified the row layout information that defines your table View, you may wish to specify some of the table access controls that are described below. The screen required to define these controls is accessed using Option 2 – DEFINE VIEW SUPPLMT from the Define Table and View menu (Figure 4-1). Selecting Option 2 will bring up the Supplementary View Information screen (see Figure 138).

Figure 138. Supplementary View Information
Supplementary View Information

Note:
For ease of reading all the fields of the Supplementary View Information screen (Figure 138) are shown as one screen. However, in reality, the fields are spread over multiple screens; to view each screen use the scroll keys, <PF7> and <PF8>, to move back and forth between the screens.

Each field of the Supplementary View Information screen is described below.

Library Name

Enter the name of the library where the View is stored. You may alternatively enter any alias that is defined in TBOLLIBR, a number from 1-7 to select a relative library number, a DDNAME or full dataset name. To display a list of all authorized libraries, place the cursor in the library field and press <PF1>. To select a library from the displayed list, place the cursor beside the row and press <Enter> or use the S line command.

If you do not know in which library the View is stored, clear the name in this field and all authorized libraries will be searched.

There is a safety feature to prevent illogical changes from this screen. If Library Name and/or View Name has been changed, then tablesONLINE rejects the first attempt to store the modified trailer with the <PF2> key. Instead, it reads in the data for the new table so that it can be modified. It will not allow you to store supplementary information you have not read.

View Name

Enter the name of the View for which you wish to define supplementary information. To display a list of all authorized Views using the List Facility, place the cursor in the View Name field and press <PF1>. A list of all libraries containing a View with the specified name will be displayed. If you clear the View Name field, a list of all authorized Views will be displayed. To select a View from the displayed list, place the cursor beside the row and press <Enter> or use the S line command.

Definition Version

This field will display an entry indicating whether the selected View was created for Release 4.0 or a subsequent release of tablesONLINE. An entry will automatically appear in this field when this screen is displayed. A 5 in this field reflects all releases from 5.0 to the current release.

Write Password

A write password may be set for the View from the tablesONLINE Utilities menu. If a write password has been set for the View, then it must be specified in this field before you can edit the supplemental information for the selected View.

User Comments

This field allows you to insert a comment up to 16 characters long, into the View supplemental information. This comment field may be used to give a brief description of the table.

User ID

This field will display a user identification. The User ID is placed into this field automatically by tablesONLINE based on the Sign-on ID of the individual that created or last updated the tablesONLINE View.

Data Table Name

If the Data Table and the View share a common name, you do not need to complete this field. If a different View is used to access the Data Table and its name is not the same as the Data Table, then the Data Table name should be specified in this field to indicate that tablesONLINE should resolve the relationship accordingly. The List Facility can also be used here to find and select a Data Table name. Place the cursor in the field and press <PF1>.

Help Table Name

Enter the name of the XXXXHELP table you wish to use with the View being defined. The Help table name specifies a table containing help information specific to the Data Table or the View being defined. If this field is filled in, the named table is searched before the application’s Help table when help is requested during an edit using this View. The List Facility can also be used here to find and select a Help table name. Place the cursor in the field and press <PF1>.

Multiple User Update

Multiple User Update controls how multiple users can access table data. There are three options available:

  • (blank) – this is the default. Multiple user access to the Data Table is turned off
  • B – all users will be restricted to browse-only access to the Data Table.
  • M – this allows simultaneous editing of the Data Table by multiple users.

Option M requires the following additional settings:

When multiple users are editing a table, duplicate prime keys are not allowed as they cannot be referenced properly.

If this is a View for the Data Table, the Duplicate Keys Indicator field must be set to Option N (no duplicate prime keys in the Data Table).

If this is a View for an Alternate Index, the Data Table key(s) must be unique (see Enforcing Unique Data Table Keys with an Alternate Index) and the Duplicate Prime Keys field must be set to N. The Duplicate Keys Indicator field can then be set to either blank, Y or N Duplicate Keys Indicator. The definition of the Duplicate Keys Indicator field will apply only to the keys of the Alternate Index View, while setting Duplicate Prime Keys field to N will ensure that the prime keys of the Data Table are unique.

The multiple-user update feature can be defined for Data Table Views and/or Alternate Index Views. Users entering a multi-user updateable table are notified that multiple user access is in effect.

When entering the Edit-Table screen, an asterisk beside the row identifies the rows that are currently being edited by another user. To test whether a row is still in use attempt to edit it. If a row is being edited by another user, you will only be allowed to browse the row.

Duplicate Keys Indicator

This option indicates whether duplicate keys can be created within a table and whether or not the display screen will contain a prompt to allow users to enter duplicate keys in those cases where it may be allowed.

If this field is set to N, no two table rows can have the same value in their key fields. If duplicate keys is set to Y or left blank, the user has the choice of whether or not to allow duplicate keys in the table (see Table 152).

Table 152. Duplicate Key Indicator Values

Value

Display Option on Table ID Screen?

Initial Value of Option

Allow user to Alter?

Duplicate Keys Actually Permitted?

N

No

No

Not with this View

Y

Yes

Y

Yes

User’s choice

(blank)

Yes

N

Yes

User’s choice

Protect Keys Indicator

The Protect Keys Indicator specifies whether or not the keys in the table are protected. This option can be used to limit the editing process to fields that are not key fields. If Protect Keys is set to Y, the key fields in the table are protected and cannot be edited. As well, rows cannot be added to, or deleted from, the table.

Hash Reorganization Code

This code controls whether tablesONLINE reorganizes Hash true tables for editing. Codes of S (sequential) and D (descending) in this field cause the table to be reorganized as ascending sequential or descending sequential, respectively. This feature should only be used when you are certain that no other application will attempt to access the table during editing.

When using the Hash re-organization code you must also set the duplicate keys indicator in the View to N. This feature applies only to Hash true tables. Hash pointer tables are always accessed via an index that makes them appear to be in ascending sequential order.

Freeze Keys Count

The Freeze Keys Count specifies the number of fields that are to be locked. The specified number of fields will not scroll when the table is displayed. The value set here is used as a default. The user may change it once the application is running.

Duplicate Prime Keys

An N in this field indicates that unique Data Table keys should be enforced. This field is blank by default.

Note:
If multiple-user access is enabled and you are defining an Alternate Index View, the Duplicate Prime Keys field must be set to N.

Dynamic Suffix Location

The Dynamic Suffix Location is automatically inserted in to this protected field by tablesONLINE. This field will contain a non-zero value if a field in the table has been defined as a dynamic suffix field with an S, B, Q or A key field indicator. The value is the location of that field within the row.

Dynamic Suffix Length

The Dynamic Suffix Length is automatically inserted in to this protected field by tablesONLINE. This field will contain a non-zero value if a field in the table has been defined as a dynamic suffix field with an S, B, Q or A key field indicator. The value is the length of that field.

View Item Size / View Key Location / View Key Size

The View Item Size, View Key Location and View Key Size are all protected fields maintained by tablesONLINE. They show table parameters that have been calculated by tablesONLINE from the View information provided. When tablesONLINE is asked to open a table, it obtains the tableBASE definition of the table from the library and checks that the Row Size, Key Location and Key Size match those in the View. If they do not, an error message is generated and the open fails.

Primary Key Location / Primary Key Size

These are protected fields maintained by tablesONLINE. They show table parameters that have been calculated by tablesONLINE from the View information provided.When a table is opened using an Alternate Index and the Duplicate Prime Keys indicator is set to N, tablesONLINE obtains the tableBASE definition of the table from the library and checks that the Prime Key Location and Prime Key Size match those in the View.

Item Exit Name

This field allows you to specify the name of the item exit program that is to be called. Item exit programs may be used to access data outside tableBASE or to perform cross-field validation.

An item-level exit program will be called whenever the current row has been changed and the user hits <Enter> or takes any action that requires that the current row be either input, output and/or cross-field validated.

Note:
To activate the Item Exit program you must set the Item Exit Name and at least one of the following indicators: Item Exit Input Indicator, Item Exit X-Field Indicator and/or Item Exit Output Indicator.

Item/Table Exit Version

This option is for backward compatibility and allows you to indicate whether the exit program specified was compiled with a particular tableBASE release.

  • Enter 4 to indicate the exit program was compiled with copybooks provided with releases 4.0 to 4.2
  • Enter 5 to indicate the exit program was compiled with copybooks provided with release 5.0.x
  • Enter 6 to indicate the exit program was compiled with copybooks provided with releases 5.1 or later

Item Exit Input Indicator / Item Exit Output Indicator / Item Exit X-Field
Indicator

Item exit indicators may be set to apply to input, output, or cross-field validation: input applies to data movement from table to screen; output applies to movement from screen to table, and X-Field controls calls to the item exit program for cross-field data validation.

The set of permitted values for the item exit indicators are listed in Table 153:

Table 153. Item Exit Indicators

Value

When Exit Program Called

(blank)

Never

B

Before the action

A

After the action

Y

Both before and after the action

Note:
The cross-field validation indicator may only be set to Y or blank. If it is set to Y, then the exit program is invoked when the current row has been changed and the user presses <Enter> or takes any action that requires that the current row be output back to the table.

Row Exclude Indicator

The Row Exclude Indicator is used in conjunction with user exit programs that prevent certain rows from being displayed.

If you have an exit program whose purpose is to suppress rows from being displayed and you perform a block delete in the Edit-Table screen, you may be affecting rows you are not aware exist, since they are not displayed. In order to prevent the deletion of hidden rows, set the row exclude indicator to Y toexclude all hidden rows from the operation being performed.

Table Exit Name

This field allows you to specify the name of the table exit program that is to be called. Depending on the indicator that is selected, a table-level exit program will be called when one of three events occurs – a table is opened, stored and/or closed.

Note:
To activate the Table Exit program you must set the Table Exit Name and at least one of the following indicators: Table Exit Open Indicator, Table Exit Store Indicator and/or Table Exit Close Indicator.

Table Exit Open Indicator / Table Exit Store Indicator / Table Exit Close Indicator

Table exit indicators (see Table 154) may be set to apply to open, store or close. If the Table Exit Open Indicator is set, then the exit program specified above is invoked when the table is opened. If the Table Exit Store Indicator is set, then the exit program specified is invoked when the table is stored. If the Table Exit Close Indicator is set, then the exit program specified is invoked when the table is closed.

Table 154. Table Exit Indicators

Value

When Exit Program Called

(blank)

Never

B

Before the action

A

After the action

Y

Both before and after the action

For example, if the Table Exit Open Indicator is set to B, then tablesONLINE will run the exit program before attempting to open this table.