Previous Topic: Add TABLE SubstructuresNext Topic: Create DATABASE Structures


Define Keys and Elements to the Table

The KEY/ELEMENT ATTRIBUTES region of the panel contains one line to define a key or element. You can add more lines with the line commands to define additional keys and elements on this panel.

Define Keys

Type K/E

(Required) Specify whether this line is for a KEY or an ELEMENT definition.

Valid Entries:

E or K

Default Value:

(No default)

Name

(Required) Specify a name for the occurrence.

Valid Entries:

1- to 32-character name

Default Value:

(No default)

DB-NM

(Required) Type a name that is unique within the TABLE substructure. CA Datacom/DB uses this name to identify the key.

Note: If the Ty (KEY-TYPE) is P, this attribute is ignored.

For more information, see the DATACOM-NAME attribute-type for KEY occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

5 alphanumeric characters

Default Value:

(No default)

Id

(Optional) Specify a number to identify the key internally. If you do not enter a value for this attribute, CA Datacom Datadictionary assigns a number that is unique within the DATABASE structure when the SET function is executed.

Note: If the Ty (KEY-TYPE) is P, this attribute is ignored.

For more information, see the DATACOM-ID attribute-type for KEY occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

1—999

Default Value:

CA Datacom Datadictionary assigns an available number when the SET function is executed if you do not enter a value.

Mst

(Optional) Specify Y (yes) if this KEY occurrence is the table's Master Key. A table can have only one Master Key. If the MASTER-KEY attribute-value is Y, the DATACOM-ID for the key must be unique for all KEY occurrences for the same table.

Note: If the Ty (KEY-TYPE) is P, this attribute is ignored.

For more information about this attribute, see the CA Datacom/DB Database and System Administration Guide and the MASTER-KEY attribute-type for KEY occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

N or Y

Default Value:

N

Nat

(Optional) Specify Y (yes) if this KEY occurrence is the table's Native Key. A table can have only one Native Key. However, the same KEY occurrence can be both the Master and Native Key.

Note: If the Ty (KEY-TYPE) is P, this attribute is ignored.

For more information, see the NATIVE-KEY attribute-type for KEY occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

N or Y

Default Value:

N

Nil

(Optional) Specify Y (yes) if keys that are all blanks (X'40') or all binary zeros (X'00') are to be included in the CA Datacom/DB index. Specify N if these values are to be excluded from the index.

Note: If the Ty (KEY-TYPE) is P, this attribute is ignored.

For more information, see the INCLUDE-NIL-KEY attribute-type for KEY occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

Y or N

Default Value:

Y

Unq

(Optional) Specify Y (yes) if the value of the key must be unique within the table.

Note: If the Ty (KEY-TYPE) is P, this attribute is ignored.

For more information, see the UNIQUE attribute-type for KEY occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

N or Y

Default Value:

N

Ty

(Optional) Specify whether the key is an index or a partitioning key.

For more information, see the KEY-TYPE attribute-type for KEY occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Note: Occurrences with a KEY-TYPE value of P are not cataloged to the Directory (CXX) as indexes.

Valid Entries:

I or P

Default Value:

I

Pswd

(Optional) Specify a password to protect this occurrence from unauthorized updates. For more information, see the section about protecting definitions in the CA Datacom Datadictionary User Guide.

Valid Entries:

1 to 4 alphanumeric characters

Default Value:

(No default)

Lock

(Optional) Specify a lock level to restrict access to this occurrence. For more information, see the section about protecting definitions in the CA Datacom Datadictionary User Guide.

Valid Entries:

0, 1, or 2

Default Value:

0

Define Elements

Type K/E

(Required) Specify whether this line is for a KEY or an ELEMENT definition.

Valid Entries:

E or K

Default Value:

(No default)

Name

(Required) Specify a name for the occurrence.

Valid Entries:

1- to 32-character name

Default Value:

(No default)

DB-NM

(Required) Type a name that is unique within the TABLE substructure. CA Datacom/DB uses this name to identify the element.

For more information, see the DATACOM-NAME attribute-type for KEY occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

5 alphanumeric characters

Default Value:

(No default)

Pswd

(Optional) Specify a password to protect this occurrence from unauthorized updates. For more information, see the section about protecting definitions in the CA Datacom Datadictionary User Guide.

Valid Entries:

1 to 4 alphanumeric characters

Default Value:

(No default)

Lock

(Optional) Specify a lock level to restrict access to this occurrence. For more information, see the section on protecting definitions in the CA Datacom Datadictionary User Guide.

Valid Entries:

0, 1, or 2

Default Value:

0

After completing your entries, press PF9 (APPLY). If there are no errors, CA Datacom Datadictionary displays an indented structure containing the TABLE occurrences and any ELEMENT and KEY occurrences that you defined on the TABLE definition panel.

You can enter margin commands on the indented structure to place an occurrence and a function in the online work queue. For example, you enter the DEF margin command in the line number for the TABLE occurrence to define the FIELD occurrences for the TABLE substructure. For more information, see Define FIELD Occurrences to a TABLE.