Compatibility Options

ACUCOBOL-GT has several options that aid in converting programs written for other COBOL environments. By default, ACUCOBOL-GT runs in the VAX COBOL compatibility mode. See Compatibility Modes for more information.

-Ca       This option causes simple ACCEPT and DISPLAY statements to be treated in accordance with ANSI semantics. Specifying this option is the same as specifying FROM CONSOLE for all simple ACCEPT statements and UPON CONSOLE for all simple DISPLAY statements. You can control this behavior for individual ACCEPT or DISPLAY statements by specifying an explicit FROM/UPON phrase.See ANSI ACCEPT and DISPLAY Verbs for more information.

Prior to Version 2.1, -Ca was a synonym for the compile-time option -Va. If you have an obsolete reference to -Ca in any of your compile scripts, or in your CBLFLAGS environment setting, make sure that you change this to -Va.

-Cb This option causes all sequential files that are not explicitly specified as LINE or BINARY sequential to be treated as BINARY sequential. Normally the file type is determined by a long sequence of rules. Files specified as print files are treated as LINE sequential even when this option is selected.

This option allows you to specify a default source name extension that is used for both the main source file and its COPY files. When it is specified, any source or COPY file name that does not explicitly specify an extension has the default extension appended to it. When the option is specified in RM/COBOL compatibility mode, the default extension is .CBL. Otherwise, the default is .COB.

You may specify an alternate default by naming it after an = sign in the -Ce option. For example, the option -Ce=CPY would cause the default extension to be .CPY.

ACUCOBOL-GT automatically adjusts the extension for upper or lower case to match the case of the name it is being appended to, then searches for the COPY file. If this first search fails, ACUCOBOL-GT matches the case of the extension specified in the -Ce compiler option to perform a second search for the COPY file.

-Cf This option forces all indexed, relative, and binary sequential files to be given fixed-length records. Normally the record type is determined by a sequence of rules. This flag is supplied to enhance compatibility with pre-85 compilers and earlier versions of ACUCOBOL-GT.
-Cg Turns off the conditional compiling features. In version 8.1.0 (ECN 3607) conditional compilation was added to ACUCOBOL-GT. Conditional compiling statements begin with the $ sign. In prior versions, lines of code that began with the $ sign were treated as comments. Unfortunately, some COBOL programs use a type of conditional compilation, which now fail to compile. Turning off conditional compiling should rectify these situations. See Conditional Compilation Options for information on conditional compiling.
-Ci This option causes the compiler to be compatible with ICOBOL for certain COBOL constructs. References in this manual to VAX COBOL compatibility also apply to ICOBOL compatibility mode unless otherwise stated.

This option causes the compiler to generate key numbers for indexed file alternate keys in a different order. Key numbers are used internally by the compiler and runtime to identify a key. Normally, you don't need to know the key number for a particular key, or care about the order in which they are generated. By default, the compiler sorts the alternate keys in record order before assigning key numbers. This ensures that the keys are given the same number regardless of the ordering in the file's SELECT. Specifying -Ck causes the compiler to assign key numbers in the SELECT order.

For most applications, the order in which key numbers are assigned is irrelevant. This option provides compatibility with some other COBOL compilers. This could be helpful when you are sharing data files between ACUCOBOL-GT-based programs and programs compiled with these other systems.


This option causes the compiler to be compatible with IBM/COBOL for the ASSIGN phrase of a SELECT statement. The syntax for the IBM/COBOL ASSIGN phrase is:

ASSIGN TO <filename-1> [<filename-2>
				<filename-3> ...]

where <filename-1>, <filename-2>, and <filename-3> are file identifiers.

Compiling with the -Cm option allows the IBM/COBOL ASSIGN phrase to ignore <filename-2> and <filename-3>. If <filename-1> contains any "-" characters, only the characters following the last "-" will constitute the file name assignment for the particular SELECT command. For example:


results in a file called TEST1.

All of the existing ACUCOBOL-GT SELECT phrases and options can be used with the IBM/COBOL ASSIGN phrase.

-Cp This option sets the compiler to its HP COBOL compatibility mode. In this mode, it accepts features of HP COBOL that are not otherwise accepted.
-Cr This option sets the compiler to its RM COBOL compatibility mode. In this mode, it accepts features of RM COBOL that are not otherwise accepted.
-Cv This option sets the compiler to its IBM DOS/VS compatibility mode. In this mode, it accepts features of IBM DOS/VS COBOL that are not otherwise accepted.

Since there are slight differences between IBM COBOL versions, -Cv also takes the following optional arguments:

-Cv=OSVS specifies OSVS compatibility.

-Cv=VSC2 specifies VSC2 compatibility.

-Cv by itself defaults to OSVS mode. The two modes are very similar, except that in VSC2 compatibility mode, the following words are not reserved:

Note that CURRENT-DATE is a valid function in any compatibility mode.

-C3 This option causes ACUCOBOL-GT to abide by the rules used by Version 1.3. Later versions changed the way ACUCOBOL-GT treats a few special cases. If you use this flag, ACUCOBOL-GT will treat these cases in the same way it did under Version 1.3. This is useful if you are compiling programs written for Version 1.3 and you do not want to modify the programs. See Appendix C. Changes Affecting Previous Versions for details of which features are affected by this option.

Specifying this option does not prohibit the use of later features, but merely ensures that the changed features behave in the original fashion. Compare with the -Z3 option below.

-C4 Similar to -C3, this option causes the compiler to generate code according to the rules used by Version 1.4.
-C5 This option causes the compiler to maintain source compatibility with the Version 1.5 compiler.
-C20 This option causes the compiler to maintain source compatibility with the Version 2.0 compiler. Chart verbs are allowed.
-Cnn This option causes the compiler to maintain source compatibility with the Version nn compiler.

nn is the version number of product; for example, -C21 for version 2.1, -C60 for version 6.0, and so on. From version 10.0 onwards, 3 digits are used to represent the version number; for example -C100 for version 10.0, -C101 for version 10.1, and so on.