Format { DUPLICATES } { CHANGES } { NULL_KEY } { } { NULL_VALUE null-value } { DATA_AREA area-number } { DATA_FILL numeric-literal } { } { DATA_KEY_COMPRESSION } { DATA_RECORD_COMPRESSION } { INDEX_AREA area-number } { } { INDEX_COMPRESSION } { INDEX_FILL numeric-literal } { LEVEL1_INDEX_AREA area-number } { } { NODATA_KEY_COMPRESSION } { NODATA_RECORD_COMPRESSION } { NOINDEX_COMPRESSION } { } { PROLOG numeric-literal } { SEGMENT within-name-clause } { SORTED BY ASCENDING } { } { SORTED BY DESCENDING }
1 – Parameters
1.1 – null-value
Specifies a null key value for an alternate index. This value is either an integer or a single character within quotation marks.
1.2 – area-number
Specifies a positive integer that corresponds to the number of a previously defined area.
1.3 – numeric-literal
Specifies a positive integer. See the OpenVMS documentation on RMS for the valid values for a particular keyword. For a mapping of CDO keywords to the corresponding RMS symbolic field offset, see RMS_Keyword_Mapping_Tables.
1.4 – within-name-clause
field-name { IN record-name } ... Specifies the field or record names that are part of a segmented key. A segmented key allows you to define a key that accesses noncontiguous fields in a record. The record name is the same name that defines the data structure of the RMS database in the DEFINE RMS_DATABASE command.
2 – Description
Key properties define the characteristics of a key in an indexed file. You define keys in numerical order, starting with 0. By default, Key 0 always has a value of DATA_AREA 0. A segmented key allows you to define a key that accesses non- contiguous fields in a record. You can specify from 2 to 8 segments for each segmented key in an indexed file. For example: o A field in a record o A field in a record that is in a record o A field in a structure in a record You must specify a segment for each key you define. A segmented key can contain up to 8 segments. The field element or elements specified by the keyword SEGMENT determine the data type of the key. A key with only 1 segment can point to a field that has any of the following RMS data types: DSC$K_DTYPE_B DSC$K_DTYPE_BU DSC$K_DTYPE_W DSC$K_DTYPE_WU DSC$K_DTYPE_L DSC$K_DTYPE_LU DSC$K_DTYPE_Q DSC$K_DTYPE_QU DSC$K_DTYPE_P DSC$K_DTYPE_T See the OpenVMS documentation on RMS for more information on valid RMS data types. Each segment of a key can contain up to 255 characters. The sum of all characters for all key segments must not exceed 255 characters. When defining a segment, you cannot use a field that is in the variant portion of a record. If you specify NULL_VALUE without specifying NULL_KEY, CDO automatically specifies NULL_KEY. If you specify NULL_KEY without specifying NULL_VALUE, the default value for NULL_VALUE is 0. When you display a RMS database element with a NULL_VALUE property, the null value appears as a decimal value. For a description and valid values for a particular keyword, see the OpenVMS documentation on RMS. For a mapping of CDO keywords to symbolics, see RMS_Keyword_ Mapping_Tables.
3 – Examples
CDO> DEFINE RMS_DATABASE EMPLOYEE_ INFO DESCRIPTION IS "INFORMATION ON" cont> "CURRENT EMPLOYEE". cont> RECORD EMPLOYEE_REC. . . . cont> KEYS. cont> KEY 0 cont> DATA_AREA 0 cont> INDEX_AREA 0 cont> SEGMENT EMP_ID IN EMPLOYEE_REC. cont> KEY 1 cont> DUPLICATES cont> DATA_AREA 1 cont> INDEX_AREA 2 cont> SEGMENT LAST_NAME IN EMPLOYEE_REC. cont> END KEYS. cont> END EMPLOYEE_INFO RMS_DATABASE. CDO> This example shows the syntax for defining the DATA_AREA, INDEX_AREA, SEGMENT, and DUPLICATES key properties in the EMPLOYEE_INFO RMS database element.