CDO$HELP.HLB  —  CDO Commands, DEFINE  RMS_DATABASE
    Format

    DEFINE  RMS_DATABASE  rms-database-name

     [DESCRIPTION IS /*text*/] [AUDIT IS /*text*/]  .

     RECORD record-name  .

     FILE_DEFINITION [file-definition-property] ... .

     [AREAS . {AREA numeric-literal [area-property] ... } ... . END AREAS .]

     [KEYS . {KEY numeric-literal [key-property] ... } ... . END KEYS .]

    END [ [rms-database-name] RMS_DATABASE ] .

1  –  Parameters

1.1  –  rms-database-name

    Specifies the logical RMS database element you are creating.

1.2  –  text

    Adds information. Within the DESCRIPTION clause, this is
    information documenting the database definition; within the AUDIT
    clause, it is a history list entry. Valid delimiters are /* */ or
    double quotation marks (" ").

    You can use Japanese to document comments in the DESCRIPTION or
    AUDIT clause for a field. To do this, use the SET CHARACTER_SET
    command, and set the character_set of the session to DEC_KANJI.

1.3  –  record-name

    Specifies an existing record element.

1.4  –  file-definition-property

    Defines the file and record services for a logical RMS database
    definition. See File_Area_Key_Properties for the file definition
    properties CDO provides.

1.5  –  area-property

    Defines the area properties for a logical RMS database element.
    See File_Area_Key_Properties for the area properties CDO
    provides.

1.6  –  numeric-literal

    Defines the number of characters or bytes in the field. See
    Expressions for more information on numeric literals.

1.7  –  key-property

    Defines the key properties for a logical RMS database element.
    See File_Area_Key_Properties for the key properties CDO provides.

2  –  Description

    The DEFINE RMS_DATABASE command creates a logical RMS database
    element in a CDO repository.

    A logical RMS database consists of only one record and file
    definition. However, one logical RMS database definition can
    be owned by many physical RMS databases, where each physical RMS
    database owns a different CDD$FILE element. To create a physical
    RMS database on a disk with the characteristics specified by the
    DEFINE RMS_DATABASE command, issue the DEFINE DATABASE command.

    To create a valid logical RMS database element, you must specify
    at least one record element and a file definition property with a
    SEQUENTIAL file organization option.

3  –  Examples

    1.CDO>  DEFINE FIELD LAST_NAME DATATYPE TEXT 30.
      CDO>  DEFINE FIELD FIRST_NAME DATATYPE TEXT 20.
      CDO>  DEFINE FIELD EMP_ID DATATYPE UNSIGNED LONGWORD.
      CDO>  DEFINE RECORD EMPLOYEE_REC.
      cont>   LAST_NAME.
      cont>   FIRST_NAME.
      cont>   EMP_ID.
      cont> END.

      This example has three steps. It shows you how a corporation
      can create a logical RMS database definition that can be used
      by all of its divisions to maintain employee information in a
      physical RMS database.

      The data administrator creates the EMPLOYEE_STORAGE RMS
      database element in the central corporate repository, using
      the DEFINE RMS_DATABASE command.

    2.CDO>  DEFINE RMS_DATABASE EMPLOYEE_STORAGE.
      cont>   RECORD EMPLOYEE_REC.
      cont>   FILE_DEFINITION
      cont>     ALLOCATION 200
      cont>     FILE_PROCESSING_OPTIONS CONTIGUOUS
      cont>     ORGANIZATION INDEXED.
      cont>   AREAS.
      cont>     AREA 0
      cont>       ALLOCATE 10
      cont>       BUCKET_SIZE 5
      cont>       EXTENSION 7.
      cont>     AREA 1
      cont>       ALLOCATE 15
      cont>       BUCKET_SIZE 3
      cont>       EXTENSION 11.
      cont>     AREA 2
      cont>       ALLOCATE 20
      cont>       BUCKET_SIZE 7.
      cont>   END.
      cont>   KEYS.
      cont>     KEY 0
      cont>       DUPLICATES
      cont>       SEGMENT LAST_NAME IN EMPLOYEE_REC.
      cont>     KEY 1
      cont>       CHANGES
      cont>       SEGMENT EMP_ID IN EMPLOYEE_REC.
      cont>   END.
      cont> END.
      CDO>  DEFINE DATABASE DISG_FILE USING EMPLOYEE_STORAGE
      cont>   ON DISK1:[DISG]EMP.DAT.
      CDO>  DEFINE DATABASE SSG_FILE USING EMPLOYEE_STORAGE
      cont>   ON DISK2:[SSG]EMP.DAT.
      CDO>  DEFINE DATABASE DBS_FILE USING EMPLOYEE_STORAGE
      cont>   ON DISK3:[DBS]EMP.DAT.

      Each division creates its own employee information database on
      disk using the DEFINE DATABASE command and the same logical RMS
      database element, EMPLOYEE_STORAGE, from the central corporate
      repository.
Close Help