Previous Topic: Location Mode OptionsNext Topic: Schema Definition Summary


Example of Schema Definition

Sample DDL statements that represent a VSAM KSDS with an alternate index in the CA IDMS/DB database are shown below. In this example, the DEPARTMENT record is stored via the alternate index set.

Primary Index

        ADD RECORD NAME IS DEPARTMENT
            LOCATION MODE IS VIA DEPARTMENT-NDX SET.

        ADD SET NAME IS DEPARTMENT-NDX      <---- Primary index
            ORDER IS SORTED
            MODE IS INDEX
            OWNER IS SYSTEM
            MEMBER IS DEPARTMENT
               ASCENDING KEY IS CONTROL-FIELD
                  DUPLICATES NOT ALLOWED.

Alternate Index

ADD SET NAME IS DEPARTMENT-NAME-NDX     <---- Alternate index
    ORDER IS SORTED
    MODE IS INDEX
    OWNER IS SYSTEM
    MEMBER IS DEPARTMENT
       ASCENDING KEY IS DEPARTMENT-NAME
          DUPLICATES LAST.