Data Definition Language (DDL) Reference Manual

Definition Attributes
Data Definition Language (DDL) Reference Manual529431-004
6-86
89 Enumeration
For C, the level-89 enumeration clauses for a field of type ENUM are translated to
literals included in a C enumeration type. If the type of a single-field definition is ENUM,
the DDL compiler generates a typedef enum. If the type of a field in a group definition
is ENUM, the DDL compiler generates an enum embedded in a typedef:
enum
{
value-name1 = enumeration-value1,
value-name2 = enumeration-value2,
...
};
typedef short def-name_def;
If the type of a field in a group definition is ENUM, the DDL compiler generates a
separate enumeration outside a typedef struct:
enum
{
value-name1 = enumeration-value1,
value-name2 = enumeration-value2,
...
};
typedef struct __group-name
{
char first-element;
short enumeration-element
} group-name_def;
Because the C compiler is case sensitive, the DDL compiler generates all lowercase
letters for C source code.
For COBOL, the level-89 enumeration clauses for a field of type ENUM are translated
to level-88 items. These items follow the source code for the ENUM field, a NATIVE-2
clause.
For FORTRAN, the level-89 enumeration clauses for a field of type ENUM are
translated to comments. These comments follow the source code for the ENUM field,
an INTEGER*2 type declaration.
For Pascal (on D-series systems), the level-89 enumeration clauses for a field of type
ENUM are translated to constants. These constants precede the type declaration for
the definition or record within the same section.
For pTAL or TAL, the level-89 enumeration clauses for a field of type ENUM are
translated to LITERALs. If the type of a single-field definition is ENUM, and you do not
specify NOTALALLOCATE, the DDL compiler generates LITERALs followed by an INT
for the definition; for example:
LITERAL ENUMERATION-NAME1 = ENUMERATION-VALUE1,
ENUMERATION-NAME2 = ENUMERATION-VALUE2,
... ;
INT DEF-NAME;
If the type of a field in a group definition is ENUM, the DDL compiler generates
LITERALs followed by a STRUCT template.