Field properties define the characteristics of the data you store in field and record elements. You can remove a field or record property by adding the NO keyword to the property name. For example, NOARRAY removes the ARRAY property. Not all languages or language processors support all CDO properties. Those properties that are not supported are ignored. The valid CDO field properties appear below.
1 – ARRAY
Format [ ROW_MAJOR ] [ COLUMN_MAJOR ] ARRAY { [ n1: ] n2 } ... [ ]
1.1 – Parameters
1.1.1 – n1
Specifies the lower bound of the subscript. Replace n1 with a signed integer or a value expression that translates to a signed integer. The default value is 1.
1.1.2 – n2
Specifies the upper bound of the subscript. Replace n2 with a signed integer or a value expression that translates to a signed integer. This value is greater than or equal to n1.
1.2 – Description
The ARRAY property defines a single- or multidimensional array in a field or record element. In multidimensional arrays, ROW_MAJOR declares the rightmost subscript to be the fastest varying. COLUMN_MAJOR declares the leftmost subscript to be the fastest varying. If you do not specify either ROW_MAJOR or COLUMN_MAJOR, the default is ROW_MAJOR.
1.3 – Examples
1.CDO> DEFINE FIELD SUPPLIER cont> ARRAY 0:19 1:4 cont> DATATYPE IS TEXT cont> SIZE IS 30 CHARACTERS. In this example, the DEFINE RECORD command includes an ARRAY property that declares 20 instances of the SUPPLIER field element (from 0 to 19). Each instance is four 30-character strings. 2.CDO> DEFINE RECORD SUPPLIER_REC cont> ROW_MAJOR ARRAY 1:20. cont> END RECORD. In this example, the DEFINE RECORD command includes an ARRAY property that creates the SUPPLIER_REC record element as an array. 3.CDO> CHANGE RECORD SUPPLIER_REC. cont> NOARRAY. cont> END RECORD. In this example, the CHANGE RECORD command includes a NOARRAY property that removes the ARRAY property from the SUPPLIER_REC record element.
2 – BASED_ON
Format BASED ON field-name
2.1 – Parameters
2.1.1 – field-name
Specifies the field name on whose properties you are basing a new field element.
2.2 – Description
The BASED ON field property bases the properties of a new field element on one that already exists. You must have privilege to read a field element to be able to base other elements upon it. You can use BASED ON field properties to define several fields related to a base field and to each other. You can use the BASED ON field property to give individual names to field elements that share the same properties. This allows you to uniquely refer to these field elements in record elements. If you want the new field to have additional properties not found in the base field, you can specify the additional properties in the DEFINE FIELD or CHANGE FIELD command.
2.3 – Examples
1.CDO> DEFINE FIELD SUPERVISOR_BADGE_NUMBER cont> BASED ON BADGE_NUMBER cont> VALID IF SUPERVISOR_BADGE_NUMBER > 500. In this example, the DEFINE FIELD command bases SUPERVISOR_ BADGE_NUMBER on the BADGE_NUMBER field element. The VALID IF property is an additional property that is unique to SUPERVISOR_BADGE_NUMBER. 2.CDO> DEFINE FIELD MANAGER_BADGE_NUMBER cont> BASED ON SUPERVISOR_BADGE_NUMBER cont> VALID IF MANAGER_BADGE_NUMBER > 1000. In this example, the DEFINE FIELD command bases a second field element on the element created in the previous example. The VALID IF property explicitly defined for the new element overrides the property included in the previous element. 3.CDO> DEFINE FIELD SUPERVISOR_SSN cont> BASED ON SSN. In this example, the DEFINE FIELD command creates a new element from a standard element (SSN). When you use the BASED ON property to give different names to field elements that share the same properties, you base the new elements on a field element that does not change frequently. 4.CDO> DEFINE FIELD MANAGER_SSN cont> BASED ON SSN cont> QUERY_HEADER IS "MANAGER SSN". CDO> CHANGE FIELD MANAGER_SSN cont> NOBASED ON. In this example, the NOBASED ON keyword removes the BASED ON property, but does not remove the QUERY_HEADER property, from the MANAGER_SSN field element. Because all other MANAGER_SSN properties were based on SSN, you must define new properties for MANAGER_SSN, unless the QUERY_HEADER property is adequate.
3 – COLLATING_SEQUENCE
Format COLLATING_SEQUENCE IS text-string
3.1 – Parameters
3.1.1 – text-string
Specifies a sequence name that was previously defined in RDO or SQL.
3.2 – Description
The COLLATING_SEQUENCE field property refers to a collating sequence that you have defined in RDO or SQL. The DEFINE FIELD and CHANGE FIELD commands accept the COLLATING_SEQUENCE syntax. The CHANGE FIELD command accepts a NOCOLLATING_SEQUENCE keyword that deletes the collating sequence; the SHOW FIELD and EXTRACT FIELD commands process the attributes.
3.3 – Examples
CDO> COLLATING_SEQUENCE IS "French" In this example, the COLLATING_SEQUENCE field property sets the collating sequence to French.
4 – COMPUTED_BY
Format { value-expr } { IF cond-expr THEN value-expr [ ELSE value-expr ] } COMPUTED BY { NULLIF ( value-expr, value-expr ) } { } { COALESCE ( value-expr [ , value-expr ] ... ) }
4.1 – Parameters
4.1.1 – value-expr
Specifies an expression a product can use to calculate a field's value. See Expressions for more information on value expressions.
4.1.2 – cond-expr
Specifies an expression that represents the relationship between two value expressions. See Expressions for more information on conditional expressions.
4.2 – Description
The COMPUTED BY field property evaluates an expression, allowing a product that uses CDO to determine the value of a field at runtime. The expression must be a valid CDO expression. CDO checks the expression for correct syntax and field references. The product must be able to interpret the CDO expression. When you specify a conditional expression in the COMPUTED BY field property, you can define a field that is equivalent to a COBOL level 88 condition. The computed by expression must be in one of the following forms: o if [name EQ literal1] THEN 1 ELSE 0 o if [(name GE literal1 AND name LE literal2) OR (name GE literal3 AND name LE literal4)]... THEN 1 ELSE 0 Use NULL IF to substitute NULL when two value expressions are equal. Use COALESCE to return the first non-NULL value from a series of value expressions. There is a limited subset of valid COMPUTED BY fields that are acceptable in COBOL syntax for inclusion through the COPY FROM DICTIONARY clause. They have the following format: COMPUTED BY IF expression THEN 1 ELSE 0 Where expression is: { } { { number } } { fld-name = { } } { { string } } { } OR ... { { number } { number } } { fld-name GE { } AND fld-name LE { } } { { string } { string } } { } For example, the following COMPUTED BY fields are defined: DEFINE FIELD Y_TRUE COMPUTED BY IF (Y = "TRUE") THEN 1 ELSE 0. DEFINE FIELD Z_NULL COMPUTED BY IF (Z = 0) THEN 1 ELSE 0. DEFINE FIELD W_ALPHABETIC COMPUTED BY IF ((W GE "A") AND (W LE "Z")) OR ((W GE "a") AND (W LE "z")) THEN 1 ELSE 0. DEFINE FIELD X_3_DIGITS COMPUTED BY IF (X GE 100) AND (X LE 999) THEN 1 ELSE 0. They are translated as the following COBOL level 88 conditions: 02 Y ... 88 Y_TRUE VALUE IS "TRUE". 02 Z ... 88 Z_NULL VALUE IS 0. 02 W ... 88 W_ALPHABETIC VALUES ARE "A" THRU "Z", "a" THRU "z". 02 X ... 88 X_3_DIGITS VALUES ARE 100 THRU 999. RESTRICTION The COMPUTED BY field property can reference only one field. The fld-name parameter must be the same field name in all instances. When included in COBOL, the COMPUTED BY field will be translated as a level 88 condition associated with the field that was referenced.
4.3 – Examples
1.CDO> DEFINE FIELD SUBTOTAL_PRICE cont> COMPUTED BY UNIT_PRICE * QUANTITY. In this example, the DEFINE FIELD command includes the COMPUTED BY property to calculate a value for the SUBTOTAL_PRICE field element. The value is computed by multiplying UNIT_PRICE by QUANTITY. 2.CDO> DEFINE FIELD TOTAL_PRICE cont> COMPUTED BY UNIT_PRICE (3) * 10. In this example, the DEFINE FIELD command includes a COMPUTED BY property to calculate a value for the TOTAL_PRICE field element. The value is calculated by multiplying the value in the third instance of the UNIT_PRICE field element by 10. 3.CDO> CHANGE FIELD TOTAL_PRICE cont> NOCOMPUTED BY. In this example, the CHANGE FIELD command includes the NOCOMPUTED BY keywords to remove the COMPUTED BY property from the TOTAL_PRICE field element. 4.CDO> DEFINE FIELD C cont> DATATYPE SIGNED WORD. CDO> DEFINE FIELD C_ONE cont> COMPUTED BY IF C EQ 1 THEN 1 ELSE 0. CDO> DEFINE FIELD C_FIVE_TEN cont> NAME FOR COBOL IS C_5_10 cont> COMPUTED BY IF C GE 5 AND C LE 10 THEN 1 ELSE 0. CDO> DEFINE FIELD C_OTHER cont> COMPUTED BY cont> IF (C GE 2 AND C LE 4) cont> OR (C GE 11 AND C LE 20) cont> THEN 1 ELSE 0. CDO> DEFINE RECORD COB88. cont> C. cont> C_ONE. cont> C_FIVE_TEN. cont> C_OTHER. cont> END RECORD. In this example, the DEFINE FIELD commands include COMPUTED BY properties that contain conditional and value expressions. These expressions are related to the value of the C field element, as follows: o The C_ONE field element takes the value of one (if C evaluates to one) or zero. o The C_FIVE_TEN field element takes the value of one (if C evaluates to a value between five and ten) or zero. o The C_OTHER field element takes the value of one (if C evaluates to a value between two and four or if C evaluates to a value between eleven and twenty) or zero. 5.01 COB88. 03 C USAGE IS COMP PIC 9(4). 88 C_ONE VALUE 1. 88 C_FIVE_TEN VALUES ARE 5 THRU 10. 88 C_OTHER VALUES ARE 2 THRU 4 11 THRU 20. This example shows COBOL syntax for the record containing level 88 definitions.
5 – CURRENCY_SIGN
Format CURRENCY_SIGN IS quoted-string
5.1 – Parameters
5.1.1 – quoted-string
Specifies the character that displays as a currency sign.
5.2 – Description
The CURRENCY_SIGN field property indicates how a product using CDO displays the currency sign of a field element. Only DIGITAL DECforms supports the CURRENCY_SIGN field property. You can specify only one CURRENCY_SIGN property for a field element.
5.3 – Examples
1.CDO> DEFINE FIELD PRICE cont> DATATYPE IS LONGWORD cont> EDIT_STRING IS 999999 cont> CURRENCY_SIGN IS "¥". In this example, the DEFINE FIELD command creates the PRICE field element with the yen symbol as the currency sign. 2.CDO> CHANGE FIELD PRICE cont> NOCURRENCY_SIGN. In this example, the NOCURRENCY_SIGN keyword removes the CURRENCY_SIGN property from the PRICE field element.
6 – DATATYPE Field Property
Format { } { ALPHABETIC SIZE IS numeric-literal case CHARACTERS } { } { [ ALIGNED | UNALIGNED ] BIT SIZE IS numeric-literal } { } { date-time-dtypes } { } { decimal-string-dtypes } { } { fixed-point-dtypes } { } { floating-point-dtypes } { } { POINTER [ TO name [ IN name ] ... ] } { } { REAL } { } { SEGMENTED STRING [SEGMENT_LENGTH IS numeric-literal BYTES] } { [SEGMENT_TYPE IS string-type ] } { } { TEXT CHARACTER_SET character-set-name SIZE IS } { numeric-literal case CHARACTERS } { } { UNSPECIFIED SIZE IS numeric-literal BYTE } { } { VARYING STRING CHARACTER_SET character-set-name } { SIZE IS numeric-literal case CHARACTERS } { }
6.1 – Parameters
6.1.1 – numeric-literal
Specifies the number of characters or bytes in the field being defined. See Expressions for more information on numeric literals.
6.1.2 – case
{ } { CASE_INSENSITIVE } { LOWERCASE } { UPPERCASE } { } Specifies whether the characters in a string data type are uppercase, lowercase, or mixed case. The default is CASE_ INSENSITIVE.
6.1.3 – date-time-dtypes
Specifies a date-time data type for a field. See DATATYPE_Date_Time help topic for more information.
6.1.4 – decimal-string-dtypes
Specifies a decimal string data type for a field. See DATATYPE_Decimal_String help topic for more information.
6.1.5 – fixed-point-dtypes
Specifies a fixed point data type for a field. See DATATYPE_Fixed_Point help topic for more information.
6.1.6 – floating-point-dtypes
Specifies a floating point data type for a field. See DATATYPE_Floating_Point help topic for more information.
6.1.7 – name
Specifies the structure used to provide a path to an element.
6.1.8 – string-type
Specifies a numeric or character string literal that contains the name of the segment type. See Expressions for more information on literals.
6.1.9 – character-set-name
Valid Character Set Name Values for Character Set Attributes shows the valid character-set-names. Table 2-1 Valid Character Set Name Values for Character Set Attributes CHARACTER_ SET character- Attribute set-name Description MCS DEC_MCS A set of international alphanumeric characters Kanji+ASCII DEC_KANJI Japanese characters as defined by the JIS X0208:1990 standard, Narrow Katakana characters as defined by the JIS X0201:1976 standard, and ASCII characters Kanji KANJI Japanese characters as defined by the JIS X0208:1990 standard and user- defined characters Katakana KATAKANA Narrow Katakana characters as defined JIS X0201:1976 standard Oracle CDD/Repository does not have a default character set attribute; Oracle CDD/Repository stores the character set attribute that you specify. The default character set that is used for a field in Oracle CDD/Repository, and how an unspecified character set is handled by other products, depends on each product. See the documentation for the product in which you intend to use the character set attribute.
6.2 – Description
The DATATYPE field property defines the type and size of a field. Some valid CDO data types are not supported by all languages or language processors. Consult the documentation for your product. The case you specify for characters with the ALPHABETIC, TEXT, and VARYING STRING data types must be valid for your product. The following list provides information on valid data types: o ALPHABETIC specifies that the field is a sequence of 8-bit ASCII bytes. You cannot use non-alphabetic characters with this data type. o BIT specifies that the field is a bit string. The optional UNALIGNED keyword specifies that the string is not aligned. The optional ALIGNED keyword specifies that the string is aligned on a byte boundary. If no alignment keyword is specified, the default is ALIGNED. o POINTER specifies that the field contains the address of another field or record element. PL/I, for example, uses POINTER fields to access based variables and buffers allocated by the system. Although PL/I does not associate POINTER fields with a specified record structure, other languages do; the optional TO name lets you connect a POINTER to a structure. The optional IN name lets you connect a POINTER to a structure in a structure. o REAL specifies that the field is a 32-bit floating point number with precision to approximately seven decimal digits. VAX BASIC uses REAL as an optional alternative to the floating-point data type. o SEGMENTED STRING specifies that the field will contain a pointer to a sequential file with a segmented internal structure. The maximum size of a string segment is 64K bytes. In a segmented string, you can store large amounts of text, long strings of binary input from a data collecting device, or graphic data. Oracle Rdb databases support this data type. Its SEGMENT_LENGTH component corresponds to RDB$LENGTH and its SEGMENT_TYPE component corresponds to RDB$VALUE. A numeric- literal must follow a SEGMENT_TYPE. The following table lists the valid values for SEGMENT_TYPE. Table 2-2 Values for SEGMENT_TYPE Value Meaning 0 The contents of the segmented string are unspecified. 1 The segmented string contains text. 2 The segmented string contains Binary Language Representation statements. Greater than Reserved for use by Oracle. 2 Less than 0 Reserved for use by customers. See the Oracle Rdb7 SQL Reference Manual for more information about segmented strings. o TEXT specifies that the field is a sequence of 8-bit ASCII bytes. When you define the TEXT data type field property, CDO accepts two units of size for the field: - CHARACTERS - OCTETS To specify a character-based field size, use the CHARACTERS unit. To specify octet-based field size, use the OCTETS unit. For a field with a single octet character set attribute, such as DEC_MCS, KATAKANA and so on, one character corresponds to one octet. On the other hand, for fields with multiple-octet character set attributes, such as Kanji, the field size is changed depending on the unit. The default is CHARACTERS. When you specify a field size using CHARACTERS, CDO translates the correct length of octets and stores the field size in octets. When OCTETS is specified, CDO ensures that the valid field size in CHARACTERS is translated. Number of Octets Used for One Character in Each Character Set shows the number of octets used for one character in each character set. Table 2-3 Number of Octets Used for One Character in Each Character Set M+Number of Character Octets Used for Number of Octets Translated in Set One Character CDO MCS 1 octet 1 octet Katakana 1 octet 1 octet Kanji 2 octets 2 octets Kanji+ASCII 1 octet for 2 octets ASCII; 2 octets for Kanji If CDO cannot translate a valid field size in characters, an error occurs. For example, when you try to define a field with the Kanji character set attribute, and you specify a size of odd octets, CDO returns an error because it cannot identify a valid field size in characters. o UNSPECIFIED declares that the field is a sequence of 8-bit unsigned bytes. o VARYING STRING specifies that the field is a PL/I or PASCAL varying string.
6.3 – Examples
1.CDO> DEFINE FIELD BEST_SELLER cont> DATATYPE IS TEXT 40. In this example, the DEFINE FIELD command creates the BEST_ SELLER field element with data type TEXT. The numeric literal limits BEST_SELLER to 40 characters. 2.CDO> CHANGE FIELD BEST_SELLER cont> NODATATYPE. In this example, the CHANGE FIELD command includes a NODATATYPE keyword that removes the DATATYPE field property from the BEST_ SELLER field element. 3.CDO> DEFINE FIELD CUSTOMER cont> DATATYPE IS TEXT CHARACTER_SET IS KANJI cont> SIZE IS 20 CHARACTERS. In this example, a new field is defined and the character-set- name of KANJI is specified. 4.CDO> DEFINE FIELD FULL_NAME cont> DATATYPE TEXT CHARACTER_SET IS KANJI cont> SIZE IS 20 CHARACTERS. In this example, KANJI is specified as the character set attribute, and CHARACTERS is specified as the unit of size for the FULL_NAME field. In this case, FULL_NAME will be defined with a size of 40 octets. 5.CDO> DEFINE FIELD FULL_NAME cont> DATATYPE TEXT CHARACTER_SET IS KANJI cont> SIZE IS 20 OCTETS. In this example, KANJI is the character set attribute, and OCTETS is the size of the FULL_NAME field. In this case, FULL_ NAME will be defined with a size of 20 octets. 6.CDO> DEFINE FIELD FULL_NAME cont> DATATYPE TEXT CHARACTER_SET IS KANJI cont> SIZE IS 20. In this example, CHARACTERS is used as a default unit of size. KANJI is specified as the character-set-name of the field. In this case, FULL_NAME will be defined with a size of 40 octets.
7 – DATATYPE Date Time
Format { } { [VMS ] } { DATE [ANSI ] } { } { TIME [ SCALE scale-value ] } { } { TIMESTAMP [ SCALE scale-value ] } { } { INTERVAL YEAR [ SIZE IS numeric-literal ] [ TO MONTH ] } { } { INTERVAL MONTH [ SIZE IS numeric-literal ] } { } { INTERVAL DAY [ SIZE IS numeric-literal ] } { [TO HOUR ] } { [TO MINUTE ] } { [TO SECOND [ SCALE scale-value ] ] } { } { INTERVAL HOUR [ SIZE IS numeric-literal ] } { [TO MINUTE ] } { [TO SECOND [ SCALE scale-value ] ] } { } { INTERVAL MINUTE [ SIZE IS numeric-literal ] } { [ TO SECOND ] [ SCALE scale-value ] } { } { INTERVAL SECOND [ SIZE IS numeric-literal ] } { [ SCALE scale-value ] } { }
7.1 – Parameters
7.1.1 – scale-value
The default value for SCALE is -2 with the exception of the TIME keyword which has a default value of 0.
7.1.2 – numeric-literal
Specifies the number of digits allowed in the field. This number is greater than 0 and less than 32.
7.2 – Description
The default value for SIZE is 2 and the valid range is between 2 and 9. See the Oracle Rdb7 SQL Reference Manual for more information on different date-time data types.
7.3 – Examples
CDO> DEFINE FIELD SAMPLE_FLD DATATYPE DATE ANSI. CDO> DEFINE FIELD SAMPLE_FLD DATATYPE TIME SCALE -2. CDO> DEFINE FIELD SAMPLE_FLD DATATYPE INTERVAL YEAR. CDO> DEFINE FIELD SAMPLE_FLD DATATYPE INTERVAL YEAR TO MONTH. CDO> DEFINE FIELD SAMPLE_FLD DATATYPE INTERVAL DAY cont> SIZE 3 TO SECOND SCALE -2. CDO> DEFINE FIELD SAMPLE_FLD DATATYPE INTERVAL HOUR cont> SIZE 7 TO SECOND SCALE -2. CDO> DEFINE FIELD SAMPLE_FLD cont> DATATYPE INTERVAL MINUTE TO SECOND SCALE -2. CDO> DEFINE FIELD SAMPLE_FLD cont> DATATYPE INTERVAL SECOND SIZE 4 SCALE -2. This example shows the definition of fields with date-time data types.
8 – DATATYPE Decimal String
Format { {SEPARATE NUMERIC } } {LEFT {OVERPUNCHED NUMERIC } } { { } } { } { {SEPARATE NUMERIC } } {RIGHT { } } SIZE IS numeric-literal DIGITS [SCALE n] { {OVERPUNCHED NUMERIC } } { } {PACKED DECIMAL } {ZONED NUMERIC } {UNSIGNED NUMERIC }
8.1 – Parameters
8.1.1 – numeric-literal
Specifies the number of digits allowed in the field. This number is greater than 0 and less than 32.
8.1.2 – n
Specifies an implied exponent. The n value indicates the number of places the decimal point shifts when evaluating the field. This number is a signed integer in the range -128 to 127.
8.2 – Description
Decimal string data types represent fixed scale quantities. They are efficient in applications that generate numerous reports and listings. There are two classes of decimal string data types. Those in which each decimal digit occupies one 8-bit byte are called NUMERIC data types. In the more compact form called PACKED DECIMAL, two decimal digits occupy each byte. The following list explains the characteristics of each decimal string data type: o UNSIGNED NUMERIC specifies an unsigned numeric ASCII string. You must include the keyword UNSIGNED. o LEFT SEPARATE NUMERIC specifies a signed numeric ASCII string. The leftmost byte contains the sign. o LEFT OVERPUNCHED NUMERIC specifies a signed numeric ASCII string. The sign and the leftmost digit occupy the same byte. o RIGHT SEPARATE NUMERIC specifies a signed numeric ASCII string. The rightmost byte contains the sign. o RIGHT OVERPUNCHED NUMERIC specifies a signed numeric ASCII string. The sign and the rightmost digit occupy the same byte. o ZONED NUMERIC specifies the VAX ZONED NUMERIC type. This signed numeric ASCII string is similar to the RIGHT OVERPUNCHED NUMERIC, but the sign codes differ. o PACKED DECIMAL specifies a signed numeric ASCII string. Two digits occupy each byte, and the low half of the last byte is reserved for the sign.
8.3 – Examples
CDO> DEFINE FIELD ACCOUNT_BALANCE cont> DATATYPE IS PACKED DECIMAL. In this example, the DEFINE FIELD command creates the ACCOUNT_ BALANCE field element with a PACKED DECIMAL data type.
9 – DATATYPE Fixed Point
Format {BYTE } [SIGNED ] {WORD } [UNSIGNED] {LONGWORD} SIZE IS numerical-literal DIGITS [SCALE n] {QUADWORD} {OCTAWORD}
9.1 – Parameters
9.1.1 – numeric-literal
Specifies the number of digits allowed in the field. This number is greater than 0 and less than 32. The default is UNSIGNED.
9.1.2 – n
Specifies an implied exponent. The n value indicates the number of places the decimal point shifts when evaluating the field. This number is a signed integer in the range -128 to 127.
9.2 – Description
Fixed-point data types represent scaled quantities in a binary format. They can be signed or unsigned. Fixed-point numbers of the data type SIGNED are stored in two's complement form. For a complete description, see the CDO Reference Manual.
9.3 – Examples
CDO> DEFINE FIELD NEW_MEMBERS cont> DATATYPE IS UNSIGNED LONGWORD 3. In this example, the DEFINE FIELD command creates the NEW_ MEMBERS field element with the UNSIGNED LONGWORD data type.
10 – DATATYPE Floating Point
Format { D_FLOATING } { F_FLOATING } { G_FLOATING } [ COMPLEX ] [ SCALE n ] { } { H_FLOATING }
10.1 – Parameters
10.1.1 – n
Specifies an implied exponent. The n value indicates the number of places the decimal point shifts when evaluating the field. This number is a signed integer in the range -128 to 127.
10.2 – Description
Floating-point data types represent approximations to quantities in a scientific notation consisting of a signed exponent and a mantissa. For a complete description, see the CDO Reference Manual. Complex numbers specify ordered pairs of floating-point data types, representing the real and imaginary components of a number. See the CDO Reference Manual for a table of Complex Numbers.
10.3 – Examples
CDO> DEFINE FIELD STANDARD_DEVIATION cont> DATATYPE IS H_FLOATING. In this example, the DEFINE FIELD command creates the STANDARD_ DEVIATION field element with the H_FLOATING data type.
11 – DECIMAL_POINT
Format DECIMAL_POINT IS quoted-string
11.1 – Parameters
11.1.1 – quoted-string
Specifies the character displayed as a decimal point.
11.2 – Description
The DECIMAL_POINT field property indicates how to display the decimal point of a field element. Only DIGITAL DECforms supports the DECIMAL_POINT field property. You can specify only one DECIMAL_POINT property for a field element.
11.3 – Examples
1.CDO> DEFINE FIELD PRICE cont> DATATYPE IS LONGWORD cont> EDIT_STRING IS 999999 cont> CURRENCY_SIGN IS "£" cont> DECIMAL_POINT IS ",". In this example, the DEFINE FIELD command creates the PRICE field element that displays a comma for the decimal point. 2.CDO> CHANGE FIELD PRICE cont> NODECIMAL_POINT. In this example, the NODECIMAL_POINT keyword removes the DECIMAL_POINT property from the PRICE field element.
12 – DEFAULT_VALUE_FOR_SQL
Format [NO]DEFAULT_VALUE FOR SQL IS value-expr
12.1 – Parameters
12.1.1 – value-expr
Specifies an expression a product can use to calculate a field's value. See Expressions for more information on value expressions.
12.2 – Description
The DEFINE FIELD, CHANGE FIELD, and EDIT FIELD commands accept the DEFAULT_VALUE FOR SQL syntax. The CHANGE FIELD command accepts the NODEFAULT_VALUE FOR SQL keyword that deletes the default value for SQL. The SHOW FIELD and EXTRACT FIELD commands process the attributes.
12.3 – Examples
1.CDO> DEFINE FIELD AMOUNT cont> DATATYPE TEXT 5 cont> DEFAULT_VALUE FOR SQL IS "-----". This example shows the definition of the AMOUNT field with a default value for SQL of dashes.
13 – DISPLAY_SCALE
Format DISPLAY_SCALE IS n
13.1 – Parameters
13.1.1 – n
Specifies a signed integer indicating the number of places to shift the decimal point. A negative integer moves the decimal point to the left. A positive integer moves the decimal point to the right.
13.2 – Description
The DISPLAY_SCALE field property indicates how to shift the decimal point when displaying the value of a field element. Only DIGITAL DECforms supports the DISPLAY_SCALE field property. You can specify only one DISPLAY_SCALE property for a field element.
13.3 – Examples
1.CDO> DEFINE FIELD AMOUNT cont> DATATYPE IS LONGWORD cont> EDIT_STRING IS 9999.99 cont> INPUT_EDIT_STRING IS 9999.99 cont> DISPLAY_SCALE -2. In this example, the DEFINE FIELD command creates the AMOUNT field element with a decimal point shifted two places to the left. 2.CDO> CHANGE FIELD AMOUNT cont> NODISPLAY_SCALE. In this example, the NODISPLAY_SCALE keyword removes the DISPLAY_SCALE property from the AMOUNT field element.
14 – EDIT_STRING
Format [ COBOL ] [ DTR ] [ PLI ] EDIT_STRING IS edit-string [ ] [ RPG ]
14.1 – Parameters
14.1.1 – edit-string
Specifies an edit string. See CDO_Edit_Strings for detailed information on edit strings.
14.2 – Description
The EDIT_STRING field property indicates how to display the value of a field element. You can specify a CDO generic edit string or a language-specific edit string for the following languages: o COBOL o DATATRIEVE o PL/I o RPG When you specify a language-specific edit string for a field element that already contains a generic edit string, the language-specific edit string overrides the existing generic edit string. You should create a language-specific edit string when: o One or more characters in the generic edit string cannot be translated into valid edit string characters for a language that uses the generic edit string. Translation of CDO Edit Strings for Languages and Products shows how CDO translates characters in a generic edit string for COBOL, DIGITAL DATATRIEVE, PL/I, and RPG. o A language that uses the generic edit string does not support the data type of the field element that contains the generic edit string. If your programs fail to compile due to edit string or data type errors, the language may not support the generic edit string. If this is the case, you should create language-specific edit strings to exclude this language from accessing the generic edit string.
14.3 – Examples
1.CDO> DEFINE FIELD TRANS_DATE cont> DATATYPE IS DATE cont> EDIT_STRING IS NN"/"DD"/"YY. In this example, the DEFINE FIELD command creates the TRANS_ DATE field element, which displays as a series of three, two- digit numbers in a month/day/year format. 2.CDO> CHANGE FIELD TRANS_DATE cont> NOEDIT_STRING. CDO> CHANGE FIELD COBOL_TRANS_DATE cont> NOCOBOL EDIT_STRING. In this example, the NOEDIT_STRING keywords remove the generic EDIT_STRING property from the TRANS_DATE field element. The NOCOBOL EDIT_STRING keywords remove the COBOL-specific EDIT_ STRING property.
15 – FILLER
Format FILLER
15.1 – Description
The FILLER field property creates an unnamed field element. Unnamed field elements are similar to FILLER fields in COBOL. You can use them to format print records or to reserve space in a record for future additions. When you specify the FILLER property, CDO creates the field element without a processing name.
15.2 – Examples
CDO> DEFINE FIELD BLANKS cont> DATATYPE IS TEXT 30 FILLER. In this example, the DEFINE FIELD command includes a FILLER property that suppresses the BLANKS processing name.
16 – GENERIC
Format { quoted-string } GENERIC type-name IS { n } { }
16.1 – Parameters
16.1.1 – type-name
Specifies the user-defined type of the property you are adding.
16.1.2 – quoted-string
Specifies the value (a string enclosed in quotation marks) for this property.
16.1.3 – n
Specifies the value (numerical) for this property.
16.2 – Description
The GENERIC field property creates a generic field property. You specify generic field properties only if you have made changes to the field type (CDD$DATA_ELEMENT) supplied by Oracle CDD/Repository, and the changes require generic field properties. You can specify the NOGENERIC keyword to remove a generic field property only if the changes you have made to CDD$DATA_ELEMENT indicate that this property is optional.
16.3 – Examples
CDO> CHANGE FIELD TEST_FIELD cont> NOGENERIC MY_ATTRIBUTE. In this example, the NOGENERIC keyword in the CHANGE FIELD command removes the MY_ATTRIBUTE generic field property from the TEST_FIELD field element.
17 – HELP_TEXT
Format HELP_TEXT IS quoted-string
17.1 – Parameters
17.1.1 – quoted-string
Specifies the text you want the product to display when this field element is active and an operator presses the Help key.
17.2 – Description
The HELP_TEXT field property tells a product to display user- supplied help text for the current element. Only DIGITAL DECforms supports the HELP_TEXT field property. You can define only one HELP_TEXT property for a field element. When you enter a quoted string that extends beyond one line, let the string wrap to the next line. Do not enclose each line of the quoted string with quotation marks. Do not press the Return key until you have closed the quoted string.
17.3 – Examples
1.CDO> DEFINE FIELD EMPLOYEE_STATUS cont> DATATYPE IS TEXT SIZE IS 5 cont> HELP_TEXT IS " Enter: C for currently employed, cont> R for retired, D for dismissed, cont> or MLOA for medical leave of absence. ". In this example, the DEFINE FIELD command includes a HELP_TEXT property that defines help text for the EMPLOYEE_STATUS field element. NOTE When you enter a quoted string that extends beyond one line, let the string wrap to the next line. Do not enclose each line of the quoted string with quotation marks. Do not press the Return key until you close the quoted string. 2. CDO> CHANGE FIELD EMPLOYEE_STATUS cont> NOHELP_TEXT. In this example, the NOHELP_TEXT keyword removes the HELP_TEXT property from the EMPLOYEE_STATUS field element.
18 – INITIAL_VALUE
Format INITIAL_VALUE IS value-expr
18.1 – Parameters
18.1.1 – value-expr
Specifies an expression a product can use to calculate a field's value. See Expressions for more information on value expressions.
18.2 – Description
The INITIAL_VALUE field property declares a field's value when the product first allocates the field. The expression you specify must be a valid expression for the product evaluating it. The value of the expression must fit into the space allocated for the field. You can specify a complex number for the INITIAL_VALUE property of a field if the field's data type is F_FLOATING COMPLEX, D_ FLOATING COMPLEX, G_FLOATING COMPLEX, or H_FLOATING COMPLEX. You can specify a fixed-point number for the INITIAL_VALUE property of any field whose data type is not DATE, TEXT, UNSPECIFIED, or VARYING STRING. You can specify a floating-point number for the INITIAL_ VALUE property of a field whose data type is not DATE, TEXT, UNSPECIFIED, or VARYING STRING. You can use Japanese in an INITIAL_VALUE field property and to document comments (DESCRIPTION and AUDIT clauses) for a field. To do this set the character set of a session to DEC_KANJI; otherwise, the information may not display correctly. See the SET CHARACTER_SET command to set the character_set of a session.
18.3 – Examples
1.CDO> DEFINE FIELD AMOUNT cont> DATATYPE IS UNSIGNED NUMERIC cont> SIZE IS 8 DIGITS cont> INITIAL_VALUE IS 0. In this example, the DEFINE FIELD command assigns 0 as the initial value to the AMOUNT field element. 2.CDO> CHANGE FIELD AMOUNT cont> NOINITIAL_VALUE. In this example, the NOINITIAL_VALUE keyword removes the INITIAL_VALUE property from the AMOUNT field element.
19 – INPUT_VALUE
Format { OPTIONAL } INPUT_VALUE IS { REQUIRED } { }
19.1 – Description
The INPUT_VALUE field property indicates if a field requires input data (REQUIRED) or can be empty (OPTIONAL). Only DIGITAL DECforms supports the INPUT_VALUE field property.
19.2 – Examples
1.CDO> DEFINE FIELD PRICE cont> DATATYPE IS LONGWORD cont> INPUT_VALUE IS REQUIRED. In this example, the DEFINE FIELD command includes an INPUT_ VALUE property that requires at least one input character for the PRICE field element. 2.CDO> CHANGE FIELD PRICE cont> NOINPUT_VALUE. In this example, the NOINPUT_VALUE keyword removes the INPUT_ VALUE property from the PRICE field element.
20 – JUSTIFIED
Format { CENTER } { DECIMAL } JUSTIFIED { LEFT } { } { RIGHT }
20.1 – Description
The JUSTIFIED field property indicates how to fill the storage space allocated to a field element. o JUSTIFIED CENTER centers a TEXT field. o JUSTIFIED DECIMAL right-justifies the whole part of a number to the left of a decimal point and left-justifies the fractional part of the number to the right of a decimal point. DIGITAL DECforms provides interactive decimal justification that appears as a user types numeric data. o JUSTIFIED LEFT truncates or fills a TEXT field against the left margin. This is the default value. o JUSTIFIED RIGHT truncates or fills a TEXT field against the right margin. Only DIGITAL DECforms supports JUSTIFIED DECIMAL. All other products ignore it. JUSTIFIED DECIMAL requires a decimal string or floating-point data type. Only COBOL and DIGITAL DECforms support the JUSTIFIED RIGHT option. Other language processors ignore it. COBOL displays as much of the right portion of a JUSTIFIED RIGHT string as possible. If this adjustment leaves storage space to the left of the string, COBOL fills this space with blanks. Use the JUSTIFIED field property only with fields that have the following data types: o TEXT o UNSPECIFIED o Decimal string o Fixed-point o Floating-point
20.2 – Examples
1.CDO> DEFINE FIELD STREET cont> DATATYPE IS TEXT 15 cont> NAME FOR COBOL IS C_STREET cont> JUSTIFIED RIGHT. In this example, the DEFINE FIELD command allocates space for 15 right-justified text characters in the STREET field element. 2.thsonian Avenue 15 Maple Street ---6 Oak Street In this continuation of the previous example, COBOL displays the strings "137 Smithsonian Avenue," "15 Maple Street", and "6 Oak Street" in the STREET field element. The deltas represent blanks that COBOL enters to fill the 15 characters allocated for the STREET field element. In this example, 15 characters appear on a line; however, the individual line lengths vary due to the different character sizes. 3.CDO> CHANGE FIELD STREET cont> NOJUSTIFIED. In this example, the NOJUSTIFIED keyword removes the JUSTIFIED RIGHT property from the STREET field element.
21 – MISSING_VALUE
Format MISSING_VALUE IS value-expr
21.1 – Parameters
21.1.1 – value-expr
Specifies an expression a product can use to calculate a field's value. See Expressions for more information on value expressions.
21.2 – Description
The MISSING_VALUE field property specifies a value to use if a field has not been assigned a meaningful value. See the DIGITAL DATATRIEVE or Oracle Rdb documentation for more information on how those products interpret the MISSING_VALUE field property. The expression you specify must be a valid expression for the product evaluating it. Products using CDO ignore field elements that contain the MISSING_VALUE field property when performing statistical operations.
21.3 – Examples
1.CDO> DEFINE FIELD PRICE cont> DATATYPE IS SIGNED LONGWORD cont> MISSING_VALUE IS 0. In this example, the DEFINE FIELD command includes a MISSING_ VALUE field property that can assign a value of 0 to a null or missing value. 2.CDO> CHANGE FIELD PRICE cont> NOMISSING_VALUE. In this example, the NOMISSING_VALUE keyword removes the MISSING_VALUE property from the PRICE field element.
22 – NAME
Format { BASIC } { COBOL } NAME FOR { PLI } IS name { } { RPG }
22.1 – Parameters
22.1.1 – name
Specifies a language-specific name for a field or record element.
22.2 – Description
The NAME property declares a language-specific name for a field or record element. This name must be a valid name for the specified language or language processor. CDO does not check the validity of the name that you specify. Once you have assigned a language-specific name to an element, the specific language no longer recognizes the element's original name. You can assign only one language-specific name per language to an element. CAUTION Be careful when you use the NAME field property because it allows you to assign completely different names to the same field or record element. Choose a language-specific name that is similar to the element's directory or processing name to avoid confusion.
22.3 – Examples
CDO> DEFINE FIELD ORDER_NUMBER cont> DATATYPE IS UNSIGNED NUMERIC cont> SIZE IS 10 DIGITS cont> NAME FOR COBOL IS ORDER-NUMBER. In this example, the NAME property assigns a language-specific processing name to the ORDER_NUMBER field used by COBOL.
23 – OCCURS
Format OCCURS n TIMES [ INDEXED BY index-name [ , index-name ] ... ]
23.1 – Parameters
23.1.1 – n
Specifies the number of occurrences of the array. This number is greater than zero.
23.1.2 – index-name
Specifies the field element that functions as an index.
23.2 – Description
The OCCURS field property declares one or more fixed-length, one-dimensional arrays. The n value represents the upper bound of the array; the lower bound is always 1. Use the ARRAY field property to specify a lower bound other than 1.
23.3 – Examples
1.CDO> DEFINE FIELD MULTIPLE cont> OCCURS 3 TIMES cont> DATATYPE IS SIGNED LONGWORD. In this example, the OCCURS field property in the DEFINE FIELD command creates the MULTIPLE field element, which occurs 3 times. 2.CDO> CHANGE FIELD MULTIPLE cont> NOOCCURS. In this example, the NOOCCURS keyword removes the OCCURS property from the MULTIPLE field element.
24 – QUERY_HEADER
Format QUERY_HEADER IS quoted-string ,...
24.1 – Parameters
24.1.1 – quoted-string
Specifies the label you are using as a column heading.
24.2 – Description
The QUERY_HEADER field property creates a column heading for use in printouts and reports. The quoted string must be a valid column heading for the product that uses it. CDO accepts a text string of any length as a query header.
24.3 – Examples
1.CDO> DEFINE FIELD TOTAL_PRICE cont> DATATYPE IS UNSIGNED LONGWORD cont> COMPUTED BY UNIT_PRICE * QUANTITY cont> QUERY_HEADER IS "TOTAL PRICE". In this example, the QUERY_HEADER field property in the DEFINE FIELD command creates the TOTAL PRICE column heading for the TOTAL_PRICE field element. 2.CDO> CHANGE FIELD TOTAL_PRICE cont> QUERY_HEADER IS "TOTAL". In this example, the CHANGE FIELD command changes the column heading in the TOTAL_PRICE field to TOTAL. 3.CDO> CHANGE FIELD TOTAL_PRICE cont> NOQUERY_HEADER. In this example, the NOQUERY_HEADER keyword removes the QUERY_ HEADER property from the TOTAL_PRICE field element.
25 – QUERY_NAME
Format { quoted-string } QUERY_NAME IS { query-name } { }
25.1 – Parameters
25.1.1 – quoted-string
Specifies a string that is enclosed by quotation marks. DIGITAL DATATRIEVE only uses the string itself (not the quotation marks that enclose it) as the query name.
25.1.2 – query-name
Specifies a string that is not enclosed by quotation marks.
25.2 – Description
The QUERY_NAME field property provides an alternate name for a field element. Only DIGITAL DATATRIEVE supports this property. CDO accepts query names of up to 256 characters in length. Except for the quotation mark ("), comma (,), apostrophe ('), and embedded blanks, any characters in the Digital Multinational Character Set are valid in query names. Make sure the query name you specify is valid for the product that uses it. CDO does not check whether the string you specified for the query name is valid. When you assign a query name to a field element, products that support the QUERY_NAME field property can refer to the field element either by its query name or its processing name.
25.3 – Examples
CDO> DEFINE FIELD TOTAL_PRICE cont> DATATYPE IS UNSIGNED LONGWORD cont> COMPUTED BY UNIT_PRICE * QUANTITY cont> QUERY_NAME IS "TP". In this example, the QUERY_NAME field property in the DEFINE FIELD command specifies the TP alternate name for the TOTAL_ PRICE field element.
26 – VALID_IF
Format VALID IF cond-expr
26.1 – Parameters
26.1.1 – cond-expr
Specifies an expression that forms the validation condition. See Expressions for more information on value expressions.
26.2 – Description
The VALID IF field property checks values assigned to a field to ensure that they are in the acceptable range for the field. The expression you specify must be a valid expression for the product evaluating it.
26.3 – Examples
1.CDO> DEFINE FIELD AMOUNT_OWED cont> DATATYPE IS UNSIGNED WORD cont> VALID IF AMOUNT_OWED > 0. In this example, the VALID IF field property in the DEFINE FIELD command specifies a range of valid values for the AMOUNT_ OWED field element. 2.CDO> CHANGE FIELD AMOUNT_OWED cont> NOVALID IF. In this example, the NOVALID IF keywords remove the VALID IF property from the AMOUNT_OWED field element.