The DIALECT Directive: Meta-Directive Cascades, Left-to-Right Overrides, and the AMODE Exception
In Rocket Enterprise Developer 12.0 for Linux/UNIX, the DIALECT compiler directive acts as a meta-directive, automatically cascading dozens of subordinate options for target environments like IBM Enterprise COBOL (DIALECT"ENTCOBOL"). Because DIALECT sets options such as ALIGN, CHARSET, and PERFORM-TYPE, placing specific directives to the left of DIALECT results in them being silently overwritten. Crucially, DIALECT does not configure mainframe pointer behavior: developers must explicitly specify AMODE (24 or 31), and can tailor keyword conflicts using REMOVE and ADDRSV. [1] [2] [3]
Read the full briefing
Scope and Architectural Overview
This article covers language dialect emulation, directive cascades, and compiler override behavior in Rocket Enterprise Developer / Enterprise Server 12.0 for Linux/UNIX.
When modernizing COBOL applications from IBM mainframe z/OS, RM/COBOL, or ACUCOBOL-GT environments, reconciling syntax, reserved keywords, storage alignments, and execution rules is a complex task. Rather than requiring developers to research and manually specify dozens of disparate compiler directives, Rocket COBOL provides the DIALECT directive.
DIALECT functions as a high-level composite meta-directive that automatically applies a coordinated profile of subordinate directives to replicate the behavior of a specific target compiler.
What DIALECT Does: The Meta-Directive Cascade
The syntax for setting a dialect is:
DIALECT"dialect"The default setting is DIALECT"ROCKET" (formerly DIALECT"MF"). Other supported values include ENTCOBOL, MVS, OS390, OSVS, VSC2, BS2000, ACU, RM, and ISO2002.
When a dialect is declared, the compiler sets a vast array of subordinate directives. For example, declaring DIALECT"ENTCOBOL" activates compatibility with IBM Enterprise COBOL for z/OS. As detailed in the ENTCOBOL DIALECT setting reference, this single declaration cascades over 60 individual directives, including:
- Character Set & Collation: Sets
CHARSET"EBCDIC",DBCS"3",DBCSSOSI"14""15", andDBSPACE. - Data Representation & Storage: Enforces
ALIGN"4 OPT",DEFAULTBYTE"00",IBMCOMP,RECMODE"ENTCOBOL", andBYTEMODEMOVE. - Arithmetic & Truncation: Enforces
ARITHMETIC"ENTCOBOL",CHECKDIV"ENTCOBOL",FP-ROUNDING"ENTCOBOL",REMAINDER"2", andZEROLENGTHFALSE. - Program & Copybook Folding: Enforces
FOLDCALLNAME"UPPER",FOLDCOPYNAME"UPPER",TRUNCCALLNAME"8", andTRUNCCOPY"8". - I/O & Linkage Behavior: Enforces
ASSIGN"EXTERNAL",COPYEXT"CPY,CBL",COPYLBR,INDD"SYSIN 80 R",OUTDD"SYSOUT 121 R",PERFORM-TYPE"ENTCOBOL", andSTICKY-LINKAGE"1". - Reserved Words: Activates ENTCOBOL reserved keyword recognition.
The Evaluation Order and Left-to-Right Override Trap
A frequent source of build confusion in migrated environments is directive overriding. Because DIALECT sets so many underlying directives, its position on the command line or within configuration files is critical.
On the cob command line, directives are processed strictly from left to right. If an individual directive precedes DIALECT, the dialect's internal profile will overwrite it:
# INCORRECT: ALIGN"2 OPT" is overwritten by DIALECT"ANS85", resulting in ALIGN"8 OPT"
cob -C 'ALIGN"2 OPT" DIALECT"ANS85"' myprog.cbl
# CORRECT: Placing ALIGN after DIALECT successfully applies the custom override
cob -C 'DIALECT"ANS85" ALIGN"2 OPT"' myprog.cblFurthermore, DIALECT must be specified on an initial $SET statement before any division headers or code statements. Once set, a dialect cannot be changed or unset later in the program source.
The AMODE Exception and Reserved Word Management
Understanding what DIALECT does not do is just as important as knowing what it sets:
1. Pointer Addressing: The AMODE Exception
Rocket documentation explicitly highlights a critical operational boundary: > Under your COBOL development system, the DIALECT directive does not set the AMODE directive. To provide compatibility with mainframe style pointers, you will need to set AMODE to the appropriate storage format.
Setting DIALECT"ENTCOBOL" aligns arithmetic and EBCDIC character sets, but it leaves pointer representations at the operating system default. If legacy mainframe applications manipulate address bits (such as storing status flags in the high-order byte of a 24-bit pointer or testing the high bit of a 31-bit pointer), developers must explicitly configure AMODE"24" or AMODE"31" in addition to DIALECT.
2. Resolving Reserved Keyword Collisions
Enabling a dialect activates all words reserved by that vendor's compiler. If legacy code uses a keyword (such as XML, JSON, or TITLE) as a user-defined data name or paragraph label, compilation fails. Developers can resolve these conflicts without renaming source variables:
- Use
REMOVE"keyword"to remove an identifier from the reserved word list. - Use ADDRSV (
ADDRSV"keyword") to add specific reserved words regardless of what dialect is active.
Documentation Takeaway
In Rocket Enterprise Developer 12.0 for Linux/UNIX, the DIALECT directive simplifies migration by cascading dozens of environment-specific directives (such as EBCDIC collation, byte alignment, and arithmetic semantics in DIALECT"ENTCOBOL"): developers must place custom directive overrides to the right of DIALECT to prevent them from being overwritten, manage keyword collisions with REMOVE and ADDRSV, and explicitly specify AMODE because pointer addressing is not configured by DIALECT.