COBOL compiler options

You can direct and control your compilation by using compiler options or by using compiler-directing statements (compiler directives).

Compiler options affect the aspects of your program that are listed in the table below. The linked-to information for each option provides the syntax for specifying the option and describes the option, its parameters, and its interaction with other parameters.

Table 1. Compiler options
Aspect of your program Compiler option Default Option abbreviations
Source language APOST/QUOTE QUOTE APOST | Q
ARITH ARITH(COMPAT) AR(C | E)
CICS NOCICS None
CODEPAGE CODEPAGE(1140) CP(ccsid)
CURRENCY NOCURRENCY CURR | NOCURR
DBCS DBCS None
NSYMBOL NSYMBOL(NATIONAL) NS(DBCS | NAT)
NUMBER NONUMBER NUM | NONUM
QUALIFY QUALIFY(COMPAT) QUA(C | E)
SEQUENCE SEQUENCE SEQ | NOSEQ
SQL NOSQL None
SQLCCSID SQLCCSID SQLC | NOSQLC
SQLIMS NOSQLIMS None
SUPPRESS SUPPRESS SUPP
WORD NOWORD WD | NOWD
XMLPARSE XMLPARSE(XMLSS) XP(X) | XP(C)
Date processing INTDATE INTDATE(ANSI) None
Start of changeMaps and listingsEnd of change Start of changeCONDCOMPEnd of change Start of changeCONDCOMP(NOSKIPSRC)End of change Start of changeCC(SKIPS | NOSKIPS)End of change
LANGUAGE LANGUAGE(ENGLISH) LANG(EN | UE | JA | JP)
LINECOUNT LINECOUNT(60) LC
LIST NOLIST None
MAP NOMAP None
OFFSET NOOFFSET OFF | NOOFF
SOURCE SOURCE S | NOS
SPACE SPACE(1) None
TERMINAL NOTERMINAL TERM | NOTERM
VBREF NOVBREF None
XREF XREF(FULL) X | NOX
Object deck generation COMPILE NOCOMPILE(S) C | NOC
COPYRIGHT NOCOPYRIGHT CPYR | NOCPYR
DECK NODECK D | NOD
NAME NONAME, or NAME(NOALIAS) if only NAME is specified None
OBJECT OBJECT OBJ | NOOBJ
PGMNAME PGMNAME(COMPAT) PGMN(CO | LU | LM)
SERVICE NOSERVICE SERV | NOSERV
Object code control ADV ADV None
AFP AFP(NOVOLATILE) None
ARCH Start of changeARCH(10)End of change None
AWO NOAWO None
BLOCK0 NOBLOCK0 None
DEFINE NODEFINE DEF | NODEF
DISPSIGN DISPSIGN(COMPAT) DS(S | C)
DLL NODLL None
EXPORTALL NOEXPORTALL EXP | NOEXP
FASTSRT NOFASTSRT FSRT | NOFSRT
HGPR HGPR(PRESERVE) None
INITIAL NOINITIAL None
INLINE INLINE INL | NOINL
INVDATA NOINVDATA NOINV | INVD(FNC | NOFNC,CS | NOCS)
Start of changeJAVAIOPEnd of change Start of changeNOJAVAIOPEnd of change Start of changeJIOP | NOJIOPEnd of change
LP LP(32) None
MAXPCF MAXPCF(100000) None
NUMCHECK NONUMCHECK NC | NONC
NUMPROC NUMPROC(NOPFD) None
OPTIMIZE OPTIMIZE(0) OPT(n)
OUTDD OUTDD(SYSOUT) OUT
PARMCHECK NOPARMCHECK PC | NOPC
TRUNC TRUNC(STD) None
Start of changeTUNEEnd of change Start of changeTUNE(10) if ARCH is not specified. The default TUNE level must match the ARCH level if ARCH is specified.End of change Start of changeNoneEnd of change
VLR VLR(STD) VLR(C | S)
ZONECHECK NOZONECHECK NOZC | ZC(MSG) | ZC(ABD)
ZONEDATA ZONEDATA(PFD) ZD(PFD) | ZD(MIG) | ZD(NOPFD)
ZWB ZWB None
Virtual storage usage BUFSIZE 4096 BUF
DATA DATA(31) None
DYNAM NODYNAM DYN | NODYN
RENT RENT None
RMODE AUTO None
STGOPT NOSTGOPT SO | NOSO
Debugging and diagnostics DIAGTRUNC NODIAGTRUNC DTR | NODTR
DUMP NODUMP DU | NODU
FLAG FLAG(I,I) F | NOF
FLAGSTD NOFLAGSTD None
INITCHECK NOINITCHECK IC | NOIC
RULES NORULES RULES(ENDP,EVENP,LXPRF,SLCKB,OOM) | RULES(NOENDP,NOEVENP,NOLXPRF,NOSLCKB,NOOOM,NOUNRA | NOUNRS)
SSRANGE NOSSRANGE SSR(ZLEN | NOZLEN,MSG | ABD) | NOSSR
TEST NOTEST None
Other ADATA NOADATA None
COPYLOC NOCOPYLOC CPLC
EXIT NOEXIT NOEX | EX(INX | NOINX, LIBX | NOLIBX, PRTX | NOPRTX, ADX | NOADX, MSGX | NOMSGX)
MDECK NOMDECK NOMD | MD | MD(C | NOC)
OPTFILE None None
SMARTBIN SMARTBIN when LP(32) is in effect.
SMARTBIN is not supported when LP(64) is in effect.
None
THREAD NOTHREAD None
VSAMOPENFS VSAMOPENFS(COMPAT) VS(C | S)

Installation defaults: The default compiler options that were set up when your compiler was installed are in effect for your program unless you override those options. (In some installations, certain compiler options are fixed so that you cannot override them. If you have problems with the default options, contact your system administrator.) To determine which are the default options, run a test compilation without specifying any compiler options. The output listing lists the default options in effect at your site.

Nonoverridable options: In some installations, certain compiler options are fixed so that you cannot override them. If you have problems with those options, contact your system administrator.

Option specification: Compiler options and suboptions are not case sensitive.

Performance considerations: The AFP, ARCH, ARITH, AWO, BLOCK0, DYNAM, FASTSRT, HGPR, MAXPCF, NUMCHECK, NUMPROC, OPTIMIZE, PARMCHECK, RENT, SQLCCSID, SSRANGE, STGOPT, TEST, THREAD, TRUNC, Start of changeTUNEEnd of change, ZONECHECK, and INVDATA compiler options can affect runtime performance.