Previous Topic: Relational KeysNext Topic: Displaying Entity Occurrences


Attribute/Entity Relationships

Attributes are characteristics that can be assigned to entities.

Classes are categories of attributes.

For example, the attributes COBOL, Assembler, and PL/I are assignable to programs and are grouped into a class called LANGUAGE.

Note: For more information on the rules for defining attributes and classes, see the ATTRIBUTE and CLASS sections.

A Class Must Exist in the Dictionary

A class must exist in the dictionary in order for attributes within that class to be related to entity occurrences. Each class definition contains qualifiers that determine how attributes within the class are added to the dictionary and govern how many attributes can be related to each entity occurrence. These qualifiers are described in the following table.

Qualifiers for Attributes

To do this

Use these qualifiers

Specify how attributes are added to the dictionary

Manual

Attributes within classes assigned the manual qualifier must be defined in the dictionary explicitly with ADD ATTRIBUTE statements before being associated with an entity occurrence. Typically, the manual qualifier applies to classes having a limited number of attributes that can be easily predefined. For example, the class SEX has only two attributes, MALE and FEMALE. These attributes must exist in the dictionary before they can be related to occurrences of the USER entity.

 

Automatic

Attributes within classes assigned the automatic qualifier are added to the dictionary automatically. The automatic qualifier applies to classes having an unlimited number of attributes that would be difficult to predefine. For example, the class BIRTH DATE has unlimited attributes. These attributes are added to the dictionary automatically when they are related to occurrences of the USER entity.

Specify how many attributes can be related to each entity occurrence

Singular

Only one attribute can be related to each entity occurrence. For example, if attributes within the class LANGUAGE are to be related to programs, LANGUAGE should be assigned the singular qualifier because only one language (for example, COBOL) is valid for a single program.

 

Plural

An unlimited number of attributes can be related to each entity occurrence. For example, if attributes within the class LANGUAGE are to be related to users, LANGUAGE should be assigned the plural qualifier because a user could be proficient in several languages.

Standard Classes - LANGUAGE and MODE

The Integrated Data Dictionary automatically creates two standard classes; these classes and their qualifiers are as follows:

The IDD installation procedure assigns attributes to the LANGUAGE class (for example, OLQ, CULPRIT, COBOL).

Class/Attribute Clause

The repeatable class/attribute clause, valid in all entity-type statements, is used to establish attribute/entity relationships.

Syntax: Class/attribute Clause

    ┌───────────────────────────────────────────────────────────────┐
►►──▼─┬─ LANGUAGE ───┬─ is attribute-name ──┬─────────────────────┬─┴─────────►◄
      ├─ MODE ───────┤                      └─ TEXt is user-text ─┘
      └─ class-name ─┘

Parameters

LANGUAGE/MODE/class-name is

Specifies the class in which the named attribute participates. Specify LANGUAGE or MODE to relate an attribute within the predefined class LANGUAGE or MODE to the requested entity occurrence. Specify class-name to relate an attribute within a user-defined class to the requested entity occurrence. The name must be 1 through 20 characters in length, must reference a class that has been defined in the dictionary with an ADD CLASS statement, and must be coded on one input line. Class-name cannot be abbreviated.

Note: The specification of LANGUAGE or MODE affects the processing of other CA IDMS data-management components and should be used with care.

attribute-name

Specifies the attribute to be related to the named entity. The named attribute must exist in the dictionary if the named class is assigned the manual qualifier. If attribute-name includes embedded blanks or delimiters, it must be enclosed in site-standard quote characters. The specified attribute name must be unique within the named class but need not be unique within the dictionary.

TEXt is user-text

Associates 1 through 40 characters of documentation text with this attribute/entity relationship. If the text includes embedded blanks or delimiters, it must be enclosed in site-standard quote characters.

Examples

Assuming that class DATE-OF-HIRE has been defined with the automatic qualifier, the following statement adds user JCD and attribute 2/25/87 to the dictionary and relates this attribute to both user JCD and class DATE-OF-HIRE.

add user jcd
     date-of-hire is 2/25/87.

Using the predefined class LANGUAGE, the following statement associates the predefined attribute COBOL with the program BILLING.

modify program billing
     language is cobol.