The following example defines the record PHONE_REC:
DTR> DEFINE RECORD PHONE_REC USING
DFN> 01 PHONE.
DFN> 02 NAME PIC X(20).
DFN> 02 NUMBER PIC 9(7) EDIT_STRING IS XXX-XXXX.
DFN> 02 LOCATION PIC X(9).
DFN> 02 DEPARTMENT PIC XX.
DFN> ;
[Record is 38 bytes long.]
DTR>
The following example defines the record FAMILY:
DTR> DEFINE RECORD FAMILY USING
DFN> 01 FAMILY.
DFN> 03 PARENTS.
DFN> 06 FATHER PIC X(10).
DFN> 06 MOTHER PIC X(10).
DFN> 03 NUMBER_KIDS PIC 99 EDIT_STRING IS Z9.
DFN> 03 KIDS OCCURS 0 TO 10 TIMES DEPENDING ON NUMBER_KIDS.
DFN> 06 EACH_KID.
DFN> 09 KID_NAME PIC X(10) QUERY_NAME IS KID.
DFN> 09 AGE PIC 99 EDIT_STRING IS Z9.
DFN> ;
[Record is 142 bytes long.]
DTR>
The following example defines the record ACCOUNT_BALANCE_REC
using the OPTIMIZE qualifier. Note that the USING clause is
optional.
DTR> DEFINE RECORD ACCOUNT_BALANCE_REC USING OPTIMIZE
.
.
.
DFN> ;
DTR>
The following example defines the record YACHT_REC in the CDO
format dictionary using fields from a CDO dictionary. Note that
you can mix fields from an existing CDO dictionary and fields
private to DEC DATATRIEVE in the same record definition. Field
BEAM uses CDD$DEFAULT.BEAM as a path. Fields LOA and PRICE are
defined only for this record.
DTR> DEFINE RECORD YACHT_REC USING
DFN> 01 BOAT.
DFN> 03 FROM GROUP SYS$COMMON:[CDDPLUS]DTR32.TYPE.
DFN> 03 SPECIFICATIONS.
DFN> 06 LOA PIC 99.
DFN> 06 FROM FIELD BEAM.
DFN> 06 PRICE PIC 999999.
DFN> ;
DTR>