Setting Compiler Options - COBOL Levels

 
 

Use this pane area to set the various COBOL compiler options.

Degree of Compilation Selection
Press mouse button 1 to see the various options associated with the Degree of compilation field. To specify the degree of compilation for your source program, select one of the following option buttons:

Use default Uses the installation default setting. See your system administrator to determine the value of the default setting. Note that you cannot override the default value if it is fixed.
NOCOMPILE Performs a syntax check and produces diagnostics only. Since no object code is produced, these compiler options have no effect:
  • LIST
  • OBJECT
  • SSRANGE
  • TEST

Choosing this option is the same as entering the -qNOCOMPILE option on the command line.

COMPILE Generates both object code and diagnostics. Do not try to run the object code generated if the compilation resulted in serious errors; the results could be unpredictable or an abnormal termination could occur. Choosing this option is the same as entering the -qCOMPILE option on the command line.

Delimiter Character Selection
To select a delimiter character when using COBOL, press mouse button 1 on the Delimiter character field, and then select one of the following option buttons:

Use default Uses the installation default setting. See your system administrator to determine the value of the default setting. Note that you cannot override the default setting if it is fixed.
QUOTE Uses the quotation mark (") as the delimiter character for literals. Choosing this option is the same as entering the -qQUOTE option on the command line.
APOST Uses the apostrophe (') as the delimiter character for literals. Choosing this option is the same as entering the -qAPOST option on the command line.

COPY, BASIS, and REPLACE Statement Processing
To process COPY, BASIS, or REPLACE statements, click mouse button 1 on the Process COPY, BASIS, and REPLACE field, then select one of the following option buttons:

Use default Uses the installation default setting. See your system administrator to determine the value of the default setting. Note that you cannot override the default setting if it is fixed.
NOLIB Indicates that your program does not contain COPY, BASIS, or REPLACE statements. Choosing this option is the same as entering the -qNOLIB option on the command line.
LIB Indicates that your program contains COPY, BASIS, or REPLACE statements. If your program contains COPY and BASIS statements, you need to define the library or libraries from which the compiler can take the copied code:
  • If the library name is specified with a user-defined word (not a literal), you must set the corresponding environment variable to point to the desired directory path for the copy file.
  • If the library name is specified with a literal, the literal value is treated as the actual path name.
  • If the library name is omitted for a COPY statement, specify the path to be searched by using the -Ixxx option on the cob2 command.
  • If the library name is omitted for a COPY statement and you do not specify the path to search by using the -Ixxx option, the current directory is searched for the copy text.

Choosing this option is the same as entering the -qLIB option on the command line.

Listings
To generate listings of computer-generated code, click mouse button 1 on the List compiler generated code info field, then select one of the following option buttons:

Use default Uses the installation default setting. See your system administrator to determine the value of the default setting. Note that you cannot override the default setting if it is fixed.
NOLIST Indicates that no listing is generated. Choosing this option is the same as entering the -qNOLIST option on the command line.
LIST Produces a compiler listing that expands the assembler-language in your source code. You will also get this information in your output listing:
  • Global tables
  • Literal pools
  • Information about working-storage
  • Size of the program's working-storage

If you want to limit the assembler listing output, use CONTROL LIST or NOLIST statements in your PROCEDURE DIVISION. Your source statements following a CONTROL NOLIST statement are not included in the listing until a CONTROL LIST statement switches the output back to normal LIST format. Choosing this option is the same as entering the -qLIST option on the command line.

To generate a listing of your source program, click mouse button 1 on the Produce source listing field, then select one of the following option buttons:

Use default Uses the installation default setting. See your system administrator to determine the value of the default setting. Note that you cannot override the default setting if it is fixed.
NOSOURCE Suppresses the source code from the compiler output listing. Choosing this option is the same as entering the -qNOSOURCE option on the command line.
SOURCE Generates a listing of your source program. The listing will include any statements embedded by PROCESS or COPY statements.

If you want to limit the SOURCE output, use CONTROL SOURCE or NOSOURCE statements in your PROCEDURE DIVISION. Source statements following a CONTROL NOSOURCE statement are not included in the listing, unless a CONTROL SOURCE statement switches the output back to normal SOURCE format. Choosing this option is the same as entering the -qSOURCE option on the command line.

To produce a cross reference listing, click mouse button 1 on the Produce cross reference listing field, then select one of the following option buttons:

Use default Uses the installation default setting. See your system administrator to determine the value of the default setting. Note that you cannot override the default setting if it is fixed.
NOXREF Suppresses a cross-reference listing. Choosing this option is the same as entering the -qNOXREF option on the command line.
XREF Produces a sorted cross-reference listing. Data-names and procedure names are ordered based on the collating sequence of the locale setting in effect.

Also included is a section listing all the program names that are referenced in your program, and the line number where they are defined. External program names are identified as such.

If you also produce a source listing, cross-reference information is printed on the same line as the original source in the listing. Choosing this option is the same as entering the -qXREF option on the command line.

Subscript and Index Range Checking
To check if subscripts or indexes are in range, click mouse button 1 on the Generate subscript range check code field, then select one of the following option buttons:

Use default Uses the installation default setting. See your system administrator to determine the value of the default setting. Note that you cannot override the default setting if it is fixed.
NOSSRANGE Prevents subscript and index range checking. Choosing this option is the same as entering the -qNOSSRANGE option on the command line.
SSRANGE Initiates subscript and index range checking. To enable range checking, you must also specify the CHECK=ON option at run-time.

Each subscript or index is not checked for validity; the effective address is checked to ensure that it does not cause a reference outside the region of the table. Variable-length items will also be checked to ensure that the reference is within their maximum defined length.

Reference modification expressions will be checked to ensure that:

  • The reference modification starting position is greater than or equal to 1.
  • The reference modification starting position is not greater than the current length of the subject data item.
  • The reference modification length value (if specified) is greater than or equal to 1.
  • The reference modification starting position and length value (if specified) do not reference an area beyond the end of the subject data item.

If an out-of-range condition is detected, an error message will be displayed and the program will be terminated. Choosing this option is the same as entering the -qSSRANGE option on the command line.

Debugging Options
To debug source code, click mouse button 1 on the Prepare object code for debugging field, then select one of the following option buttons:

Use default Uses the installation default setting. See your system administrator to determine the value of the default setting. Note that you cannot override the default setting if it is fixed.
NOTEST Generates object code without debugging information. Programs compiled with NOTEST execute with the debugger, but there is limited debugging support. Choosing this option is the same as entering the -qNOTEST option on the command line.
TEST Causes the compiler to produce object code that contains symbol and statement information to enable the debugger to perform symbolic source-level debugging. Choosing this option is the same as entering the -qTEST option on the command line.

Note: The /etc/cob2.cfg configuration file defines the default values used by the compiler to compile and link COBOL programs.



Setting Compiler Options - COBOL
Setting Compiler Options - COBOL Compilers
Setting Compiler Options - COBOL Include Directories