The DEFINE RECORD statement begins each record definition in the source file.
1 – Syntax Rules
o You must terminate the DEFINE statement and the END statement with periods. o The path name can be a full or a relative path specification. The last given name in the path name is the name you assign to the new record definition. You can specify an absolute version number with the path name. o The given name of the new record definition is a string of up to 31 characters from the set A-Z, 0-9, _, and $. The first character must be a letter from A-Z, and the last character must not be _ or $. You can use 8-bit alphabetic characters in path names. o Use the optional DESCRIPTION clause to include text in the CDD to document the record definition. You must use the keyword DESCRIPTION and the text delimiters /* and */ to insert one or more lines of text describing the record into the DEFINE statement. o The field description statement defines the whole record. You can use an elementary, STRUCTURE, COPY, VARIANTS, or VARIANTS_OF field description statement, but you can use only one field description statement to define a record. STRUCTURE, COPY, and VARIANT field description statements are themselves subdivided and defined by subordinate field description statements. o If you specify a path name in the END clause, it must match the path name in the corresponding DEFINE clause. o If you specify a given name in the END clause, it must be the given name of the new data definition and match the final given name in the path specification of the corresponding DEFINE clause.
2 – Usage Notes
o If the path name contains dictionary directories that do not exist, the CDD automatically creates them. o It is not recommended that you include passwords in the DEFINE statement path name, because passwords included in the source can be displayed with the DMU LIST/ITEM=SOURCE command. Instead, use the /PATH qualifier with the compile command if passwords are required in the path name. o The only way to assign a password to a record definition is to use the DMU SET PROTECTION or DMU SET PROTECTION/EDIT command after you compile the source file. You cannot assign a password to a record definition by including it in the DEFINE statement.
3 – Example
The following record description defines the dictionary object SALARY_RECORD in the sample CDD hierarchy. The field description statement for the record is SALARY STRUCTURE. DEFINE RECORD CDD$TOP.PERSONNEL.SERVICE.SALARY_RECORD. SALARY STRUCTURE. EMPLOYEE_ID DATATYPE IS UNSIGNED NUMERIC SIZE IS 9 DIGITS. PAY STRUCTURE. JOB_CLASS DATATYPE IS UNSIGNED NUMERIC SIZE IS 3 DIGITS. INCR_LEVEL DATATYPE IS UNSIGNED NUMERIC SIZE IS 1 DIGIT. WEEKLY_SALARY DATATYPE IS UNSIGNED NUMERIC SIZE IS 6 DIGITS 2 FRACTIONS. END PAY STRUCTURE. END SALARY STRUCTURE. END SALARY_RECORD RECORD.