Previous Topic: Dataview Field DefinitionNext Topic: Runtime Considerations for VSAM Dataviews


Dataview Key Definition

The dataview key definition specifies the primary and alternate keys (indexes) that can access records through this dataview. You must complete the key definition for KSDS files. You cannot define keys for RRDS and ESDS files. (CA Ideal does not support alternate indexes for ESDS or RRDS files.)

Note: If the file contains variable‑occurrence or variable‑segment records, the keys must all be in the fixed‑length portion of the record.

Enter the KEY command to display the Dataview Key Definition fill‑in shown below.

=> => => 1‑IDDVSKYL05E ‑ Please enter primary key field name ------------------------------------- ----------------------------------------- IDEAL: vsam dvw keys DVW EMPMASTER (001) TEST SYS: DOC FILL‑IN Primary Key Field Name ________________________________ Alternate Keys Command Path Name Field Name Unique Upgrade Set ‑‑‑‑‑‑ ‑‑‑‑‑‑‑‑ ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑ ====== ======== ============= TOP ============== = = ...... ...... ...... ...... ...... ====== ======== ============ BOTTOM ============ = =

The fields on the Dataview Key Definition fill‑in are:

Primary Key Field Name

Enter the name of the field that is the complete primary key. The key must be in the fixed portion of a variable‑occurrence or variable‑segment record. If the key is composed of several fields, a group field must be defined for the key. The key field can be a redefined field, but it cannot be a field that is part of a repeating group field (referenced with a subscript) nor can it be a condition name.

An entry is required for this field.

Alternate Keys

Definition of alternate keys is optional. It is not necessary to include all or any of the alternate indexes defined for the VSAM file in your dataview definition. To define an alternate key, use the following fields:

Command

Enter CA Ideal line commands in this area, as needed. For a description of the CA Ideal line commands, see the Command Reference Guide.

Path Name

Enter the ddname or DLBL file name of the JCL statement that corresponds to the path established with IDCAMS for the alternate index. The Path Name can be up to eight characters long in a z/OS environment or up to seven characters long in a VSE environment. The path name must be unique in the path and file names specified for the dataview.

Field Name

Enter the field name that identifies the full alternate key. The key must be in the fixed portion of a variable‑occurrence or variable‑segment record. If the key is composed of several fields, a group field must be defined for the key. The key field can be a redefined field, but it cannot be a field that is part of a repeating group field (referenced with a subscript) or a condition name.

An alternate key can overlap the primary key or another alternate key fully or partially. However, the field name must be unique for each key. This means that you must redefine the field to provide a unique name for each key.

Unique

Enter one of the following:

  • Y-Key is a unique key. This is the default.
  • N-Key is a non‑unique key.

If the value in this field does not correspond to the actual attribute of the alternate index as it is defined with IDCAMS for the given path, unpredictable results occur.

The execution of a FOR EACH statement based on a non‑unique key cannot resume after any of the following events takes place in the FOR construct:

  • Panel TRANSMIT
  • CHECKPOINT
  • BACKOUT
  • Debugger breakpoint
  • Update of the current data set, even if the update was made through a different dataview
Upgrade Set

Enter one of the following:

Y-This key is part of the upgrade set defined for the VSAM cluster with IDCAMS. If this is specified, a DD or DLBL statement must be present for this path and, in CICS, an FCT entry must also be present for the specified Path Name.

N-This key is not part of the upgrade set. This is the default.

If the dataview is updateable (Update Intent = Y on the Parameter Definition fill‑in), all paths that are defined as part of the upgrade set are validated at runtime, regardless of which one accesses the data set.

Note: This attribute must match the VSAM catalog definition for the path.

In the following example, both a primary key and one alternate key were defined.

=> => => ------------------------------------------------------------------------- IDEAL: vsam dvw keys DVW EMPMASTER (001) TEST SYS: DOC FILL‑IN Primary Key Field Name NAME Alternate Keys Command Path Name Field Name Unique Upgrade Set ‑‑‑‑‑‑ ‑‑‑‑‑‑‑‑ ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑ ====== ======== ============= TOP ============== = = 000100 EMPID EMP‑ID Y Y ====== ======== ============ BOTTOM ============ = =

Note: VSAM implementation in CA Ideal requires that the master file and all alternate indexes included in the Upgrade Set be defined with SHAREOPTIONS (2,3) or higher.