Compiler Options

SSRANGE. The SSRANGE (or SSR) option specifies that you want subscript values checked at run time to see if they are in range. The compiler will add code to your program to check subscript values each time they are used. If a subscript goes over (or under) it’s maximum range then this will be detected at run time and the program will abend.

This option is normally used to ensure that you don’t try and address storage that doesn’t belong to the program (usually resulting in a S0C4 abend).

Using the SSRANGE option does have performance implications however, as additional code is added (by the compiler) to check for subscript errors. If the length of run time is important then you might want to set SSRANGE checking off by specifying NOSSRANGE (or NOSSR) .

FDUMP: The FDUMP compiler option specifies that you want a Formatted Dump to be produced if the program abends. The formatted dump will contain variable names as specified in the Cobol program and their values at the time of the abend. This can be a useful debugging aid if you don’t have an abend/dump tool like Abend-Aid available.

FASTSRT: The FASTSRT compiler option can be used when your program does a Sort or Merge. Using FASTSRT can improve the efficiency of the Sort/Merge. Note that this option will have no effect if used with a CICS Cobol program.

LIST: The LIST option will produce a listing of the Assembler statements generated by your program statements. The Cobol compiler will take your program and convert it into equivalent Assembler statements which it can run. The LIST option will show you what assembler statements each of your Cobol statements has been converted into. Using the LIST compiler option can be a useful debugging aid. Note that the LIST option is mutually exclusive with OFFSET.

OFFSET: The OFFSET option produces a condensed listing of Procedure Division statements, The condensed listing will show line numbers, and the offset of the first generated Assembler statement. In addition a listing of Global Tables and Literal Pools are produced. This information can aid in debugging your program. Note OFFSET is mutually exclusive with LIST.

TRUNC: The TRUNC option specifies how COMP (Binary) fields are handled by the program during MOVEs and arithmetic. They specify how the binary numbers are truncated.

If you are using SQL (DB2) in your program then you should always specify TRUNC(BIN) otherwise you may have problems with numeric values being truncated incorrectly.

TRUNC(STD) will perform truncation of binary values that conform to the American National Standard, while TRUNC(OPT) is a performance option which optimizes the object code.