cobol compiler options

Upload: voidan

Post on 09-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 Cobol Compiler Options

    1/25

    COBOL COMPILATION

    The VS COBOL II compiler prepares a VS COBOL II source program for execution

    by producing a machine-language object module. This object module containsthe actual machine language which implements or carries out the instructionsspecified in the COBOL source program. (The object module produced by thecompiler must be processed by the linkage editor before the program is actuallyready for execution.)

    A single invocation of the compiler can compile an individual COBOL sourceprogram or a sequence of two or more separate source programs. The objectprograms which result from compiling more than one source program at a timemay be link-edited into a single load module or into two or more separate loadmodules.

    The VS COBOL II compiler provides several additional services while compiling aprogram. These include:

    producing a source listing tayloring the content of the source listing (i.e., to include a sorted cross-

    reference of data-names, a map of the DATA DIVISION, a listing ofthe machine-language instructions that were generated, etc.).

    setting literal delimiters selecting a reserved word list

    processing COPY, BASIS, and REPLACE statements

    offering options to control object code generation, object code execution,and the compilers use of virtual storage

    producing debugging information at run time

    providing user-exits

    ADV:

    This is a COBOL compiler option.

    Format: ADV NOADVAbbreviations: NoneIBM-default: ADV

    ADV, which conforms to the ANSI standard, requests that the compiler add1 byte to the record length to account for the printer control characterwhen WRITE with the ADVANCING option is used.

    NOADV implies that the record length has already been adjusted to accountfor the printer control character.

    QUOTE/APOST:

    This is a COBOL compiler option.

    Format: QUOTE APOSTAbbreviations: QIBM-default: QUOTE

  • 8/8/2019 Cobol Compiler Options

    2/25

    QUOTE, which conforms to the ANSI standard, specifies that the doublequotation mark () is to be the delimiter character for non-numeric literals.

    APOST specifies that the single quote mark or apostrophe () is to be thedelimiter character for non-numeric literals.

    AWO:This is a COBOL compiler option.

    Format: AWO NOAWOAbbreviations: NOAWOIBM-default: None

    AWO specifies that, for any file in the program which is physicalsequential with blocked V-mode records, the APPLY WRITE-ONLY clause bein effect (even if this clause is not specified in the program).

    BUFSIZE:

    This is a COBOL compiler option.

    Format: BUFSIZE(nnnn)(nnnK)

    where nnnn is a decimal number no less than 256nnnK is a decimal number in 1K (1024) increments

    Abbreviations: BUFIBM-default: 4096

    BUFSIZE specifies the amount of main storage to be allocated to eachcompiler work file buffer.

    Generally, a large buffer size will improve compiler performance;however, BUFSIZE cannot exceed the track capacity for the device being usednor can it exceed the maximum allowed by data management services.

    If the SIZE option is specified along with BUFSIZE, the amount of storage

    allocated to buffers is included in the amount of storage available forcompilation as specified by the SIZE option.

    CMPR2:

    This is a COBOL compiler option.

    Format: CMPR2 NOCMPR2Abbreviations: NoneIBM-default: NOCMPR2

    CMPR2 requests that generated object code be compatible with codegenerated by VS COBOL II Release 2.

    NOCMPR2 requests that generated object code conform to the ANSI 85standard (i.e., as implemented by VS COBOL II Release 3, which, in someinstances, is incompatible with Release 2).

    CMPR2 (which forces on the FLAGMIG option) can be used to assist in themigration of programs written under Release 2 to the 85 standard (i.e., to theRelease 3 level).

    See Release 2 Compatibility And Migration in the VS COBOL II Release 3APPLICATION PROGRAMMING GUIDE for more information (including a list

  • 8/8/2019 Cobol Compiler Options

    3/25

    of elements that are CMPR2 sensitive and a description of their behaviorunder CMPR2 and NOCMPR2).

    COMPILE:

    This is a COBOL compiler option.

    Format: COMPILE NOCOMPILE NOCOMPILE(W)(E)(S)

    Abbreviations: C NOC IBM-default:NOCOMPILE(S)

    COMPILE forces a full compilation even when serious errors are detected. Alldiagnostics and object code will be generated (even though the object codeshould not be executed if serious errors are detected).

    NOCOMPILE requests a syntax check only. Diagnostic messages (but no objectcode) are produced. When NOCOMPILE is specified, the following optionshave no effect (even though listed among the options in effect) because noobject code is generated:

    DECK FDUMP LISTOBJECT OFFSET OPTIMIZESSRANGE TEST

    NOCOMPILE(W), NOCOMPILE(E), and NOCOMPILE(S) -for level W(warning), level E (error), and level S (severe error)diagnostics, respectively- request a conditional fullcompilation (i.e., diagnostics and object code), with object code generation(but not diagnostics) to stop when an error of the level specified (or higher)is encountered.

    *** Compiler Options ***

    There are 4 ways in which options may be passed to the compiler, listed belowin order of precedence:

    Installation defaults that are fixed for your installation

    PROCESS (or CBL) statements in the source code

    JCL parameter

    Installation defaults that are not fixed

    Fixed installation defaults may not be overridden. Installation defaults thatare not fixed may be overridden by either PROCESS/CBL statements and/or byJCL parameters. If conflicting or mutually exclusive options are specified onboth PROCESS/CBL statements and via a JCL parm, then the PROCESS/CBLstatement takes precedence.

    For a list of the default options in effect for your installation, run a compilewithout specifying any options and look at the list of compiler options in effectproduced as part of the normal compiler printout. (For a list of the fixeddefaults, see your manager or technical support staff.)

    Note: The default value shown in the individual option descriptions

    is the IBM-supplied default shipped with the product (which may have beenchanged by your installation).

  • 8/8/2019 Cobol Compiler Options

    4/25

    PROCESS statements must appear before the IDENTIFICATION DIVISIONheader and are formatted as shown below:

    PROCESS option1,option2,....

    IDENTIFICATION DIVISION.

    CBL may be used as a synonym for PROCESS. PROCESS can start in columns1 through 66 (or 8 through 66 if a sequence field is placed in columns 1 through6). CBL can start in 1 through 70 (or 8 through 70 if a sequence field is used).One or more blanks must separate PROCESS/CBL from the first option; optionsmust not contain embedded blanks and must be separated be a comma or ablank. Options may not be continued; however, multiple PROCESS/CBLstatements may be used.

    PROCESS/CBL statements may be inhibited by your installation. In this case,PROCESS/CBL statements in the source code will be flagged with a COBOL errormessage.

    If conflicting versions of the same option (i.e., DECK and NODECK, NAME andNONAME, etc.) are specified at the same level of precedence (say, for example,

    via a JCL parameter), then the last one specified takes precedence. For example,specifying:

    PARM=(DECK,NAME,NODECK)

    would result in NODECK being used as the active option.

    The table below shows how mutually exclusive options (i.e., LIST and OFFSET,RENT and NORES, etc.). are handled when specified at the same level ofprecedence.

    OPTION OPTION OPTIONSPECIFIED IGNORED FORCED ON*---------------- --------------- -----------------

    TEST FDUMP NOFDUMP

    NOOBJECT OBJECTNORES RESOPTIMIZE NOOPTIMIZE

    RENT NORES RES

    DYNAM NORES RES

    OFFSET LIST NOLIST

    CMPR2 FLAGSTD NOFLAGSTD

    FLAGSAA NOFLAGSAADBCS NODBCS

    NOCMPR2 FLAGMIG NOFLAGMIG

    WORD FLAGSTD NOFLAGSTD

    FLAGSTD FLAGSAA NOFLAGSAAFLAGMIG NOFLAGMIGDBCS NODBCS

    FLAGSAA FLAGMIG NOFLAGMIG

  • 8/8/2019 Cobol Compiler Options

    5/25

  • 8/8/2019 Cobol Compiler Options

    6/25

    Select spacing within source listing............. SPACE

    Send diagnostics to SYSTERM dd statement......... TERMINAL

    Produce verb cross-reference..................... VBREF

    Produce sorted cross-reference................... XREF

    Provide debugging information at run time:

    Produce formatted dump for abends................ FDUMP Setup for batch/interactive debugging............ TEST

    Set literal delimiters:

    Set apostrophe as non-numeric delimiter.......... APOST

    Set quote mark as non-numeric delimiter.......... QUOTE

    Recognize shift codes for DBCS................... DBCS

    Control object code output:

    Set diagnostic severity to stop compilation...... COMPILE

    Produce object code as 80-column card images..... DECK

    Generate link-edit NAME for each object module... NAME Output object code to SYSLIN dd statement........ OBJECT

    Optimize object code:

    Specify APPLY WRITE-ONLY clause.................. AWO Allow sort product to perform I/O................ FASTSRT

    Request optimized object code.................... OPTIMIZE

    Control object code generation and execution:

    Provide byte for printer control character....... ADV

    Generate Release 2 compatible code............... CMPR2

    Restrict dynamic storage to 16-meg line.......... DATA

    Specify dynamic CALL............................. DYNAM Set DISPLAY output ddname........................ OUTDD

    Specify invalid sign processing.................. NUMPROC

    Request reentrant object code.................... RENT

    Request Library Management Feature............... RESIDENT

    Check subscripts/indexes/ref. mod. expressions... SSRANGE Set binary field truncation...................... TRUNC

    Remove sign from DISPLAY fields for comparisons.. ZWB

    Control compilers use of virtual storage:

    Set buffer size.................................. BUFSIZE

    Set amount of storage available for compilation.. SIZE

    Miscellaneous:

    Select reserved word list........................ WORD Process COPY, BASIS, and REPLACE statements...... LIB

    Provide User-exits............................... EXIT

    Some compiler options are specified with sub-parameters. These sub-

  • 8/8/2019 Cobol Compiler Options

    7/25

    parameters are specified in parentheses (with multiple sub-parameters, when applicable, generally separated by a comma)immediately following the option to which they apply (with no intervening orembedded blanks). As examples:

    DATA(24) SIZE(MAX) FLAG(W,E)

    DATA:

    This is a COBOL compiler option.

    Format: DATA(24)(31)

    Abbreviations: None IBM-default: DATA(31)For a program compiled with the RENT option which is to be executedunder XA, the DATA option specifies whether dynamic storage (for dataareas such as WORKING STORAGE, file buffers, etc.) is to be acquiredfrom below the 16-meg line or from unrestricted storage.

    DATA(24) specifies that dynamic storage areas are to beallocated from storage below the 16-meg line.

    DATA(31) specifies that dynamic storage areas are to beallocated from unrestricted storage (i.e., either above or below the 16-megline).

    DATA(24) should be used for programs running under XA in 31-bit addressingmode that are passing data parameters to programs in 24-bit addressingmode. Otherwise, the called program may not be able to address the databeing passed.

    DBCS:

    This is a COBOL compiler option.

    Format: DBCS NODBCSAbbreviations: NoneIBM-default: NODBCS

    DBCS instructs the compiler to recognize X0E and X0F as shift codes forthe double byte portion of a non-numeric literal. (The double byteportion is syntax checked; the literal remains in the alphanumericcategory.)

    If either CMPR2 or FLAGSTD is specified, DBCS is ignored.

    NODBCS conforms to the ANSI standard.

    DECK:

    This is a COBOL compiler option.

    Format: DECK NODECKAbbreviations: D NODIBM-default: NODECK

    DECK requests that object code be produced in the form of 80- column cardimages and output to the SYSPUNCH dd statement.

  • 8/8/2019 Cobol Compiler Options

    8/25

    DUMP:

    This is a COBOL compiler option.

    Format: DUMP NODUMP

    Abbreviations: DU NODUIBM-default: NODUMP

    DUMP requests that a dump be produced whenever the compilerabnormally terminates. This option is normally used by IBM personnel inorder to diagnose bugs in the compiler itself. When DUMP is specified, aSYSABEND, SYSUDUMP, or SYSMDUMP dd statement should be included inthe compile JCL.

    NODUMP provides a limited set of diagnostic information when the compilerabnormally terminates. This includes a description of the error, the compilerexecution phase at the time of the abend, the line number of the COBOLstatement being processed when the error occured, and the contents of thegeneral purpose registers.

    DYNAM:

    This is a COBOL compiler option.

    Format: DYNAM NODYNAMAbbreviations: DYN NODYNIBM-default: NODYNAM

    DYNAM specifies that separately compiled programs invoked through theCAll literal statement (i.e., a CALL statement where the program to be calledis specifed in the form of a literal) are to be loaded dynamically at run time.

    NODYNAM implies that programs invoked through the CALL literal statementwill be statically linked into the run-unit prior to execution.

    EXIT:

    This is a COBOL compiler option.

    Format: EXIT(xparm) NOEXITAbbreviations: EX NOEXIBM-default: NOEXIT

    EXIT, depending upon the sub-parameters specified, instructs the compiler to:

    accept source input from a user-supplied exit module (rather than

    from the file defined with the SYSIN dd statement) accept copy input from a user-supplied exit module (rather than from the

    file defined with the SYSLIB dd statement)

    pass printer output to a user-supplied exit module (rather than to the filedefined with the SYSPRINT dd statement)

    The xparm sub-parameters (separated by a comma) must be specifiedby choosing one option from each of the 3 pairs of options shown below:

    INEXIT(instring,inmod) or NOINEXIT

    LIBEXIT(libstring,libmod) or NOLIBEXIT

  • 8/8/2019 Cobol Compiler Options

    9/25

    PRTEXIT(prtstring,prtmod) or NOPRTEXIT

    where inmod, libmod, and prtmod are, respectively, thenames of the user-supplied load modulesto be used inplace of SYSIN, SYSLIB, and SYSPRINT

    and instring, libstring, and prtmod are optionalcharacter strings of up to 64 characters (enclosed inapostrophes) that are to be passsed to the

    corresponding user-supplied load module

    INEXIT, LIBEXIT, and PRTEXIT may be abbreviated as INEX, LIBEX, and PRTX,respectively.

    EXIT may only be specified via a JCL parm or as an installation default (i.e.,it may not be specified in a PROCESS/CBL statement).

    FASTSRT:

    This is a COBOL compiler option.

    Format: FASTSRT NOFASTSRTAbbreviations: FSRT NOFSRTIBM-default: NOFASTSRT

    FASTSRT specifies that, during an internal sort operation, IBM DFSORT (oran equivalent sort product) is to perform the I/O operations on sort input andoutput files (i.e., SORT USING and GIVING). This option may improveinternal sort performance.

    NOFASTSRT, which is the ANSI standard, specifies that COBOL is to performthe I/O operations on these files.

    FDUMP:

    This is a COBOL compiler option.Format: FDUMP NOFDUMPAbbreviations: FDU NOFDUIBM-default: NOFDUMP

    FDUMP requests that a formatted dump be produced at run time whenexecution ends in an abnormal termination.

    When FDUMP is specified:

    the run time execution JCL should include a SYSDBOUT dd statement forFDUMP output

    if NUMBER is also specified, the sequence fields in columns 1 through 6must be numeric

    the size of the object module is increased (because statementnumber and data description tables are included as part of the objectcode)

    No formatted dump will be produced if the NOSTAE run time option is used orif any other program in the run-unit was compiled with TEST.

    FLAG:

    This is a COBOL compiler option.

  • 8/8/2019 Cobol Compiler Options

    10/25

    Format: FLAG(a) NOFLAG

    (a,b) where a and b are specified as I, W, E,S, or U Abbreviations: F NOF IBM-default: FLAG(I)

    FLAG(a) directs the compiler to produce diagnostic messages for errors of

    severity level a or above at the end of the source listing.FLAG(a,b) directs the compiler to produce diagnostic messages for errors ofseverity level a or above at the end of the source listing and to also placediagnostic messages for errors of severity level b and above directly in thesource lising (i.e., directly after the statement in error). FLAG(a,b) hasno meaning unless the SOURCE option is also specified.

    NOFLAG directs the compiler to suppress error flagging.

    The levels of severity for diagnostic messages are shown below:

    I Informational (Return Code=0)W Warning (Return Code=4)E Error (Return Code=8)

    S Severe (Return Code=12)U Unrecoverable (Return Code=16)

    FLAGMIG:

    This is a COBOL compiler option.

    Format: FLAGMIG NOFLAGMIGAbbreviations: NoneIBM-default: NOFLAGMIG

    FLAGMIG requests that the compiler identify language elements that may beimplemented differently in Release 2 than in Release 3 (which conforms to the

    85 ANSI standard).

    NOFLAGMIG conforms to the ANSI standard.

    FLAGMIG is intended to be used, in conjunction with CMPR2 (which forces onFLAGMIG), to aid in the migration of programs written under VS COBOL IIRelease 2 to the Release 3 level (i.e., to the 85 standard). See CMPR2 formore information.

    FLAGSAA:

    This is a COBOL compiler option.

    Format: FLAGSAA NOFLAGSAAAbbreviations: None

    IBM-default: NOFLAGSAAFLAGSAA requests that the compiler identify (by flagging with a warningmessage) language elements that are not Systems ApplicationArchitecture (SAA) compatible. This will identify program elements thatmay restrict program portability across IBM systems.

    NOFLAGSAA conforms to the ANSI standard.

    The NOCMPR2 compiler option must be in effect in order to use FLAGSAAand the FLAGSTD option can not be used. If FLAGSTD and FLAGSAA areboth specified along with NOCMPR2, FLAGSAA is ignored.

  • 8/8/2019 Cobol Compiler Options

    11/25

    FLAGSTD:

    This is a COBOL compiler option.

    Format: FLAGSTD(s) NOFLAGSTD(smm)(smm,o)

    (s,o) where s is specified as M, I, or H in order to set thelevel or subset of Standard COBOL that is to beconsidered as conforming

    mm is specified (as a single character or acombination of any two) as D, N, or S to setthe optional modules to be included in thesubset

    o is specified as O to indicate that obsoletelanguage elements are to be flagged

    Abbreviations: NoneIBM-default: NOFLAGSTD

    FLAGSTD is designed to provide information (via flagging) about the type of

    COBOL elements included in the source program. Based on the way inwhich the subparameters are coded, this can include flagging for non-conforming, non-standard, and/or obsolete language elements.

    NOCMPR2 and the standard set of reserved words must be in effect in order touse FLAGSTD.

    The sub-parameters are further described below:

    For s: M specifies that language elements not from

    the minimum subset are to be flagged (i.e., as non-conforming standard)

    I specifies that language elements not from

    the minimum or intermediate subset are tobe flagged (i.e., as non-conformingstandard)

    H specifies that language elements offered as

    as IBM extension are to be flagged (i.e., as non-conforming non-standard)

    ------------

    For mm: D specifies that elements from Debug module level 1 are notflagged (i.e., as non- conforming standard)

    N specifies that elements from Segmentationmodule level 1 are not flagged (i.e., as non-conforming standard)

    S specifies that elements from Segmentation

    module level 2 are not flagged (i.e., as non-conforming standard)(Note: N is a subset of S.)

    For o: O specifies that obsolete language elements are to be flagged(i.e., as obsolete)

  • 8/8/2019 Cobol Compiler Options

    12/25

    Specified elements are flagged with an informational message that:

    Identifies the clause, statement, or header that contains the element aswell as the source program line number and column.

    Identifies the subset or optional module to which the element belongs.

    Identifies the element as non-conforming standard, non- conforming

    non-standard, or obsolete. (A language element that is both obsolete

    and non-conforming is flagged as obsolete only.)

    Flagging is suppressed whenever an error (diagnostic level E or higher) isdetected.

    *** JCL ***

    Sample JCL required to invoke the compiler appears below, followed by adescription of each dd statement required. This is followed by severalexamples (showing required JCL and selected options).

    Sample compiler JCL:

    //JS10 EXEC PGM=IGYCRCTL, Compiler Program Name

    // PARM=(options) Optional Parms //STEPLIB DD DSN=SYS1.COB2COMP,DISP=SHR PDS Containing Compiler //SYSLIB DD DSN=cpylib,DISP=SHR Copy Member Library //SYSPRINT DD SYSOUT=* Printed Output //SYSTERM DD SYSOUT=* Diagnostic Messages //SYSUT1 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT2 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT3 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT4 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT5 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT6 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT7 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSLIN DD DSN=&&OBJMOD,DISP=(MOD,PASS), Object Module Output

    // UNIT=SYSDA,SPACE=(subparms) //SYSIN DD * Source Program Inputsource program...

    /*

    Explanation of Compiler JCL:

    PARM: JCL parameter used to pass options to the compiler. (See

    descriptions below.)

    STEPLIB DD:

    Partitioned data set containing the executable form of the compiler. (Thismay be installation dependent.)

    SYSLIB DD:

    Partitioned data set containing copy members. Required if programs to becompiled contain any COPY or BASIS statements.

  • 8/8/2019 Cobol Compiler Options

    13/25

    SYSPRINT DD:

    Provides a definition of the data set that receives printed output from thecompiler. This includes the source listing, diagnostic messages, etc. Musthave RECFM=F or FB. BLKSIZE can be any permissable value for the outputdevice (up to 32760) that is a multiple of 133.

    SYSTERM DD:

    Provides definition of a second data set on which diagnostic messages are tobe output. Only required when the TERMINAL compiler option is specified.Must have RECFM=F or FB. BLKSIZE can be any permissable value for theoutput device (up to 32670) that is a multiple of 81.

    SYSUT1-SYSUT7:

    Provides definitions of various compiler work files. These files must be ondirect-access storage devices and must have RECFM=F or FB. BLKSIZE canbe any permissable value for the output device (up to 32760) that is a multipleof 80.

    SYSLIN DD:

    Provides a definition of the output data set that is used for the objectmodule. Must have RECFM=F or FB. BLKSIZE can be any permissable valuefor the output device (up to 32760) that is a multiple of 80.

    SYSIN DD:

    Provides a definition of the input data set that contains the source program(s) to be compiled. Must have RECFM=F or FB. BLKSIZE can be anypermissable value for the input device (up to 32670) that is a multiple of 80.

    Rather than specifying all of the required JCL shown above, you may prefer to

    invoke the VS COBOL II compiler by executing one of the IBM-suppliedcataloged procedures for this purpose (i.e., COB2UC, COB2UCL, COB2CLG, etc.)or some other cataloged procedure provided by your systems programming ortechnical support staff. (Check with your manager or technical support staff fordirection on which cataloged procedure to use.)

    Examples of the JCL required to invoke the compiler (and selected options) areshown and described below:

    //JS10 EXEC PGM=IGYCRCTL, Compiler Program Name // PARM=(LIST,MAP,XREF) Optional Parms //STEPLIB DD DSN=SYS1.COB2COMP,DISP=SHR PDS Containing Compiler //SYSLIB DD DSN=cpylib,DISP=SHR Copy Member Library //SYSPRINT DD SYSOUT=* Printed Output //SYSTERM DD SYSOUT=* Diagnostic Messages //SYSUT1 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT2 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT3 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT4 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT5 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT6 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSUT7 DD UNIT=SYSDA,SPACE=(subparms) Work File //SYSLIN DD DSN=&&OBJMOD,DISP=(MOD,PASS), Object Module Output

  • 8/8/2019 Cobol Compiler Options

    14/25

    // UNIT=SYSDA,SPACE=(subparms) //SYSIN DD * Source Program Inputsource program...

    /*

    The example above shows sample JCL required to execute the compiler with the

    following options:

    LIST: to request an assembler-language listing of the generatedobject code

    MAP: to request a DATA DIVISION mapXREF: to request a sorted cross-reference listing

    //JS10 EXEC PROC=COB2UC, IBM-supplied proc // PARM.COB=(OFFSET,OUTDD(DSPOUT)) Optional Parms //COB.SYSIN DD * Source Program Inputsource program...

    /*

    The example above shows sample JCL required to execute the compiler via theCOB2UC JCL procedure supplied by IBM. In this case, the following options arespecified:

    OFFSET: to request a condensed PROCEDURE DIVISION listingOUTDD: to request that execution time DISPLAY output use a

    ddname of DSPOUT

    LANGUAGE:

    This is a COBOL compiler option.

    Format: LANGUAGE(xxxxxx)Abbreviations: LANG(xx)

    IBM-default: LANGUAGE(ENGLISH)LANGUAGE specifies the language that will be used for compiler messages(i.e., for diagnostic messages, message summary headers, thecompilation summary, and various headers and notations resulting fromthe use of compiler options like MAP, XREF, etc.).

    The language sub-parameters that may be specified are shown below:

    Sub-parameter Abbreviation Description------------- ------------ ------------------------

    ENGLISH EN Mixed case ENGLISH

    JAPANESE JA,JP Japanese (using Japanesecharacter set)

    UENGLISH UE Upper-case English

    Note: To use Japanese, the Japanese National Language

    Feature must be installed.

  • 8/8/2019 Cobol Compiler Options

    15/25

    If the LANGUAGE option is changed using CBL or PROCESS statements,some initial text will be printed in the language that was in effect whencompiler execution began.

    LIB:

    This is a COBOL compiler option.Format: LIB NOLIBAbbreviations: NoneIBM-default: NOLIB

    LIB, which conforms to the ANSI standard, instructs the compiler that it is tohonor and process COPY, BASIS, and REPLACE statements.

    If COPY or BASIS statements are to be processed, the compile JCL mustinclude a dd statement for the library or libraries from which the compilercan extract the copied code (i.e., SYSLIB) as well as the SYSUT5 work file.

    LINECOUNT:

    This is a COBOL compiler option.Format: LINECOUNT(nn) Abbreviations: LCIBM-default: LINECOUNT(60)

    LINECOUNT specifies the number of lines to be printed on each page of thecompilation listing.

    The nn sub-parameter must be an integer between 10 and 255. This includes3 lines which are used for titles. If LINECOUNT is specified as LINECOUNT(50), 47 lines of source code are printed on each page of the output listing.

    LINECOUNT may also be specified as LINECOUNT(0) in order to suppresspagination (i.e., no page ejects are generated within the compilation listing).

    LIST:

    This is a COBOL compiler option.

    Format: LIST NOLISTAbbreviations: NoneIBM-default: NOLIST

    LIST requests that the compiler produce a listing of the generatedmachine language object code (which is produced by printing out thecorresponding assembler-language source code).

    LIST also provides information in the output listing about:

    Global tables Literal pools

    WORKING-STORAGE

    If compiled with the NORENT option, the WORKING-STORAGEinformation includes the size of WORKING-STORAGE and itslocation within the object code.

    LIST and OFFSET are mutually exclusive; if both are used, LIST is ignored.

  • 8/8/2019 Cobol Compiler Options

    16/25

    The assembler-language source listing can be limited (i.e., turned on oroff as required) through the use of *CONTROL LIST and *CONTROL NOLISTstatements placed in the PROCEDURE DIVISION.

    MAP:

    This is a COBOL compiler option.Format: MAP NOMAPAbbreviations: NoneIBM-default: NOMAP

    MAP requests that the compiler produce a listing of the items defined in theDATA DIVISION (i.e., a DATA DIVISION map).

    Other MAP output includes:

    Global tables

    Literal pools

    Nested program structure (and attributes)

    If compiled with the NORENT option, MAP information includes the size ofWORKING-STORAGE and its location within the object code.

    MAP output can be limited (i.e., turned on or off as required) through theuse of *CONTROL MAP and *CONTROL NOMAP statements placed in the DATADIVISION.

    NAME:

    This is a COBOL compiler option.

    Format: NAME NAME(ALIAS) NONAME(NOALIAS)

    Abbreviations: NoneIBM-default: NONAME

    NAME and NAME(NOALIAS) request that a link-edit NAME card be generatedfor each object module. NAME(ALIAS) requests that, in addition to a NAMEcard, a link-edit ALIAS card be generated for each ENTRY statement containedin the source program.

    NUMBER:

    This is a COBOL compiler option.

    Format: NUMBER NONUMBERAbbreviations: NUM NONUMIBM-default: NONUMBER

    NUMBER instructs the compiler to honor the line numbers embedded in

    columns 1 through 6 of each source statement. The compiler will checkthese columns to ensure that they contain numeric data and will sequencecheck them according to numeric collating sequence (as opposed toSEQUENCE, which checks them according to EBCDIC collating sequence).When a line number is found to be out of sequence, a number one greaterthan the number in the previous line will be assigned and sequencechecking then continues with the newly assigned line number. These linenumbers will also be referenced in error messages and in MAP, LIST, andXREF listings.

  • 8/8/2019 Cobol Compiler Options

    17/25

    If NUMBER is specified and COPY statements are used, the line numbers inthe source program should be coordinated with those in each referenced COPYmember.

    NONUMBER, which conforms to the ANSI standard, specifies that linenumbers appearing in columns 1 through 6 (if any) are to be ignored. In thiscase, the compiler generates a line number for each line in the source program

    and uses these generated line numbers as references in error messages andin MAP, LIST, and XREF listings.

    NUMPROC:

    This is a COBOL compiler option.

    Format: NUMPROC(PFD)(NOPFD)(MIG)

    Abbreviations: None IBM-default: NUMPROC(NOPFD)

    NUMPROC(NOPFD), which conforms to the ANSI standard, specifies that the

    generated code is to perform invalid sign processing during run time. This willresult in increased run time and a larger object module.

    NUMPROC(PFD) is a performance option which specifies that invalid signprocessing is not to be done. It should be used only if the data to beprocessed agrees exactly with the following IBM system standards:

    DATA FORMAT STANDARD SIGN FORMAT----------------- ------------------------------------------

    External decimal, High-order 4 bits of the sign byte containunsigned XF

    External decimal, High-order 4 bits of the sign byte contain

    signed overpunch XC if the number is positive or 0; XDif the number is negative

    External decimal, Separate sign byte contains character +separate sign if the number is positive or 0; - if thenumber is negative

    Internal decimal, Low-order 4 bits of the low-order byteunsigned contain XF

    Internal decimal, Low-order 4 bits of the low-order bytesigned contain XC if the number is positive or

    0; XD is the number is negative

    NUMPROC(MIG), which conforms to the ANSI standard, is designed to aid inmigrating from OS/VS COBOL to VS COBOL II. It results in the following signprocessing:

    preferred signs are created only for the receiving field in a MOVE statementor an arithmetic operation

    no explicit sign correction is done during input operations

    some implicit sign correction may be done during data formatconversion operations

  • 8/8/2019 Cobol Compiler Options

    18/25

    numeric comparisons are performed as a decimal (rather than a logical)comparison operation

    OBJECT:

    This is a COBOL compiler option.

    Format: OBJECT NOOBJECTAbbreviations: OBJ NOOBJIBM-default: OBJECT

    OBJECT requests that the generated object code be routed to the SYSLIN ddstatement.

    NOOBJECT and TEST are mutually exclusive; NOOBJECT is ignored if TEST isspecified.

    OFFSET:

    This is a COBOL compiler option.

    Format: OFFSET NOOFFSETAbbreviations: OFF NOOFFIBM-default: NOOFFSET

    OFFSET requests that the compiler produce a condensed PROCEDUREDIVISION listing. This condensed listing will contain line numbers,statement references, and the location (i.e., offset within the object code) ofthe first instruction generated for each statement. Other OFFSET outputincludes:

    Global tables

    Literal pools

    If compiled with the NORENT option, OFFSET information includes the size ofWORKING-STORAGE and its location within the object code.

    OFFSET and LIST are mutually exclusive; if both are used, LIST is ignored.

    OPTIMIZE:

    This is a COBOL compiler option.

    Format: OPTIMIZE NOOPTIMIZEAbbreviations: OPT NOOPTIBM-default: NOOPTIMIZE

    OPTIMIZE specifies that the object code be generated for maximum efficiency.This should result in reduced run time and may also reduce the size of theobject module. However, use of OPTIMIZE increases compile time.

    OPTIMIZE is turned off whenever a severe error is detected.

    OPTIMIZE and TEST are mutually exclusive; if TEST is specified, OPTIMIZE isignored. Given these facts (and the additional compile time consumed bythe OPTIMIZE option), it might be best to use NOOPTIMIZE while in initialprogram development or debugging mode.

    Use of OPTIMIZE along with NUMPROC(PFD), AWO, and FASTSRT (whenapplicable) may result in significant run time savings.

  • 8/8/2019 Cobol Compiler Options

    19/25

    OUTDD:

    This is a COBOL compiler option.

    Format: OUTDD(ddname) Abbreviations: OUTIBM-default: OUTDD(SYSOUT)

    OUTDD may be used to specify a ddname other than SYSOUT for run time

    output produced by the DISPLAY verb.

    RENT:

    This is a COBOL compiler option.

    Format: RENT NORENTAbbreviations: NoneIBM-default: NORENT

    RENT specifies that the generated object code is to be reentrant.

    NORENT specifies that the program be generated as a nonreentrant objectmodule. (This option should not be used for CICS programs.)

    Reentrant object code can be executed only in run units where all programshave been generated with the RESIDENT option. (RENT automatically forces onRESIDENT).

    RENT must be specified if the program will be executed under XA in virtualstorage addresses above the 16-meg line. In this case, the DATA option canbe used to control whether dynamic data areas are allocated in unrestrictedstorage or from below the 16-meg line.

    RENT automatically forces on RESIDENT and is not valid with NORESIDENT.DYNAM automatically forces on RESIDENT and is not valid with NORESIDENT.

    Outlined below are the 5 valid combinations of DYNAM, RESIDENT, and RENT:

    NORENT/NORES/NODYNAMNonreentrant code, COBOL library subroutines are statically called, CALLliteral is a static call.

    NORENT/RES/NODYNAM

    Nonreentrant code, COBOL library subroutines are dynamically called,CALL literal is a static call.

    NORENT/RES/DYNAM

    Nonreentrant code, COBOL library subroutines and applicationsubprograms are all dynamically called.

    RENT/RES/NODYNAM

    Reentrant code, COBOL library subroutines are dynamically called, CALLliteral is a static call.

    RENT/RES/DYNAM

    Nonreentrant code, COBOL library subroutines and applicationsubprograms are all dynamically called.

  • 8/8/2019 Cobol Compiler Options

    20/25

    RESIDENT:

    This is a COBOL compiler option.

    Format: RESIDENT NORESIDENTAbbreviations: RES NORESIBM-default: NORESIDENT

    RESIDENT, which conforms to the ANSI standard, specifies that the COBOLLibrary Management Feature be invoked. This causes most COBOL librarysubroutines to be loaded dynamically at run time rather than being staticallylink-edited into the run unit. (This allows for application programs toautomatically pick up any fixes applied to the library subroutines withouthaving to be link-edited again.) This option requires that the VS COBOL IIsubroutine library be included in the JOBLIB/STEPLIB concatenation atrun time.

    NORESIDENT, if used when compiling each COBOL program in the run unit,specifies that the load module contain all required VS COBOL II librarysubroutines needed for execution. In this case, the VS COBOL II subroutinelibrary need not be included in the JOBLIB/STEPLIB concatenation.

    The RESIDENT option is automatically in effect when the DYNAM option isspecified or when the source program uses CALL identifier (i.e., a CALLstatement where the program to be called is specified in the form of anidentifier rather a literal).

    Use of the VS COBOL II Library in conjunction with an OS/VS COBOLprogram compiled with the RESIDENT option may result in significantperformance degradation at run time.

    For more information on the interaction of RESIDENT and other compileroptions, see the RENT option.

    SEQUENCE:

    This is a COBOL compiler option.Format: SEQUECNE NOSEQUENCEAbbreviations: SEQ NOSEQIBM-default: SEQUENCE

    SEQUENCE instructs the compiler to ensure that the source program linesare in ascending EBCDIC collating sequence based on the information coded incolumns 1 through 6. (Source program lines containing spaces in columns 1through 6 are not checked.)

    If NUMBER is also specified, the sequence checking is based on the numeric(rather than the EBCDIC) collating sequence.

    If SEQUENCE is specified and COPY statements are used, the source

    program line numbers should be coordinated with the line numbers in eachreferenced COPY member.

    NOSEQUENCE, which conforms to the ANSI standard, suppresses thissequence checking.

    SIZE:

    This is a COBOL compiler option.

    Format: SIZE(nnnn)

  • 8/8/2019 Cobol Compiler Options

    21/25

    (nnnK)(MAX)

    where nnnn is a decimal number no less than 655360nnnK is a decimal number in 1K (1024) increments

    with a minimum value of 640KMAX requests the largest block of storage

    available in the user region Abbreviations: SZIBM-default: SIZE(MAX)

    SIZE specifies the amount of main storage to be made available for thecompile process.

    In an XA environment, SIZE(MAX) will cause the compiler to use all thestorage in the user region above the 16-meg line. (Storage below the 16-meg line will be used for compiler modules that must be loaded below the lineand for work file buffers.)

    SIZE(MAX) should not be used if there is a need for the compiler to leave aspecific amount of unused storage in the user region.

    SOURCE:This is a COBOL compiler option.

    Format: SOURCE NOSOURCEAbbreviations: S NOSIBM-default: SOURCE

    SOURCE requests that the compiler produce a listing of the input sourceprogram (including statements brought in by COPY or PROCESSstatements).

    SOURCE must be specified in order to get embedded diagnostics.

    SOURCE output can be limited (i.e., turned on or off as required)through the use of *CONTROL SOURCE and *CONTROL NOSOURCE

    statements placed in the source program.

    SPACE:

    This is a COBOL compiler option.

    Format: SPACE(1)

    (2)(3)Abbreviations: None IBM-default: SPACE(1)

    SPACE, which is meaningful only when SOURCE is specified, sets the (single,double, or triple) spacing to be used between the printed lines in the sourcecode listing.

    SSRANGE:

    This is a COBOL compiler option.

    Format: SSRANGE NOSSRANGEAbbreviations: SSR NOSSRIBM-default: NOSSRANGE

    SSRANGE specifies that the generated code is to check to ensure that:

  • 8/8/2019 Cobol Compiler Options

    22/25

    the effective address generated for an index or subscript does notreference an area outside the region of the associated table

    the current effective length for a variable-length item (i.e., OCCURSDEPENDING ON) is no greater than its maximum defined length

    for reference modification expressions:

    the reference modification starting position is no less than 1 and no

    greater than the current length of the subject item the reference modification length value (if specified) is no less

    than 1 the reference modification starting position and length value (if

    specified) do not reference an area that extends beyond the endof the subject item

    If an out of range condition is detected, an error message will be writtento write-to-programmer route code 11 (i.e., usually the SYSPRINT ddstatement) and the program will be terminated. When running underCICS, these messages are written to a temporary storage queue.

    The SSRANGE option can result in some performance degradation.

    The NOSSRANGE run time option can be specified at run time in order toinhibit the range checking code generated by specifying SSRANGE as as acompile time option. In this way, the dormant range checking code can beactivated at run time (i.e., to assist in resolving any unexpected errors)without having to recompile.

    TERMINAL:

    This is a COBOL compiler option.

    Format: TERMINAL NOTERMINALAbbreviations: TERM NOTERMIBM-default: NOTERMINAL

    TERMINAL requests that a copy of each diagnostic message be sent to theSYSTERM data set.

    NOTERMINAL suppresses this duplicate output.

    TEST:

    This is a COBOL compiler option.

    Format: TEST NOTESTAbbreviations: TES NOTESIBM-default: NOTERMINAL

    TEST requests that the compiler produce object code that can be executedwith VS COBOL II batch or interactive debug.

    The following options are forced on when TEST is specified:

    NOFDUMP, NOOPTIMIZE, OBJECT, and RES.

    If NUMBER is also specified, the sequence fields in columns 1 through 6 mustbe numeric.

    If both the WITH DEBUGGING MODE clause and the USE FOR DEBUGGINGstatement are specified, then TEST is deactivated. (TEST will appear in the

  • 8/8/2019 Cobol Compiler Options

    23/25

    options list; however, a diagnostic message will be issued to indicate that,because of the conflict, TEST is not in effect.)

    Using TEST can result in significant performance degradation at run time.

    TRUNC:

    This is a COBOL compiler option.

    Format: TRUNC(STD)(OPT)(BIN)

    Abbreviations: None IBM-default: TRUNC(STD)

    TRUNC(STD), which conforms to the ANSI standard, specifies that, for USAGEBINARY receiving fields, the final result of an arithemetic expression orMOVE statement is truncated to the number of digits in the PICTURE clause ofthe BINARY receiving field.

    TRUNC(OPT), which is provided as an IBM extension, is a performanceoption which causes the compiler to assume that data being moved to a

    USAGE BINARY receiving field conforms to the associated PICTURE clause.For this reason, the data will be truncated in what appears to the compiler tobe the most optimal way at the time the code is being generated. Thismeans that the truncation may be based on the number of digits in thePICTURE clause or it might be based on the actual physical size of the binaryfield in storage (i.e., as a halfword, fullword, or doubleword). If the databeing moved has a value with a larger precision than that defined in thePICTURE clause, an unpredictable truncation of high order digits mayoccur.

    Since the type of truncation generated for TRUNC(OPT) is unpredictable,TRUNC(OPT) should be used only if the data being moved to binary items isguaranteed not to have a value with a larger precision than that defined by

    the PICTURE clause for those binary items.

    TRUNC(BIN), which is provided as an IBM extension, specifies that all binaryitems (no matter how many digits are shown in their PICTURE clause) are tobe treated as a halfword, fullword, or doubleword. (The number of digits inthe PICTURE clause is used only to determine the minimal binary field -i.e.,halfword, fullword, doubleword- requried to store the item.) This means,once the physical size of the field is determined, that it is treated as ahalfword, fullword, or doubleword both when processed as a sending fieldand when processed as a receiving field. In this case then, the only way tolose significant digits is to move a larger binary field to a smaller binaryfield (i.e., fullword to halfword, etc.).

    TRUNC(BIN) should be used when there is a possibility of having more than9 digits in a fullword or more than 4 digits in a halfword. (Specifying aPICTURE clause for a binary item with more than 4 digits forces it into afullword. However, a halfword can contain some numbers of up to 5 decimaldigits and a fullword can contain some numbers of up to 10 decimal digits.)TRUNC(BIN) should also be used when interfacing with other languages orproducts that have S/370 format binary data (i.e., PL/1, FORTRAN, S/370assembler, CICS, DB2, etc.).

    For the MOVE statement shown below:

  • 8/8/2019 Cobol Compiler Options

    24/25

    MOVE 32700 TO BINFIELD1.

    where BINFIELD1 is defined as:

    BINFIELD1 PIC 9(4) COMP.

    The result of compiling with the various binary truncation options is shown

    below:Decimal Hex------- ----

    Sending Value 32700 7FBC

    Received Value TRUNC(STD) 2700 0A8C

    Received Value TRUNC(BIN) 32700 7FBC

    Received Value TRUNC(OPT)* 32700 7FBCor or2700 0A8C

    *Depends upon how the compiler generates the truncation logic in thisparticular case.

    VBREF:

    This is a COBOL compiler option.

    Format: VBREF NOVBREFAbbreviations: NoneIBM-default: NOVBREF

    VBREF requests that the compiler produce a cross-reference showing allverb types used in the source program and the line numbers of the lines inwhich they appear. A summary showing how many times each verb is used

    is also produced.

    WORD:

    This is a COBOL compiler option.

    Format: WORD(wwww) NOWORDAbbreviations: WD NOWDIBM-default: NOWORD

    WORD instructs the compiler to use an alternative reserved word table for thecurrent compilation.

    The wwww sub-parameter specifies the (up to 4) characters that are to beappended to IGYC to form the name of the reserved word table to be used.

    These 4 characters may not include the dollar sign ($) nor any of thecharacter strings listed below:

    ASM1 ASM2 DIAG DMAP DOPT FGEN INIT LIBO LIBRLSTR LVL0 LVL1 LVL2 LVL3 LVL8 OPTM OSCN PGENRCTL RDPR RDSC RWT SAW SCAN SIMD XREF

    NOWORD, which conforms to the ANSI standard, is a fixed default (i.e.,cannot be changed by an application programmer via a JCL parm orPROCESS/CBL statement).

  • 8/8/2019 Cobol Compiler Options

    25/25

    XREF:

    This is a COBOL compiler option.

    Format: XREF NOXREFAbbreviations: X NOXIBM-default: NOXREF

    XREF requests that the compiler produce a sorted cross-reference showingEBCDIC data-names and EBCDIC procedure names (in alphanumericorder) and the line numbers of the source lines in which they are referenced.It also includes a listing of DBCS data-names and DBCS procedure namesin the same order as they appear in the source program (unless theDBCSXREF installation option is selected) as well as a section listing all theprogram names that are referenced in the source program and the linenumber in which they are defined (with external program names identifiedas such).

    In the data-name portion of the XREF listing, line numbers preceded bythe letter M indicate the data item is modified by a statement on that line.Elementary names within a group item referenced in a MOVECORRESPONDING statement will also be included in the XREF listing.

    If both XREF and SOURCE are specified, cross-referenceinformation will also be embedded in the source listing itself(i.e., at the right hand end of the line to which it applies).This information includes line number references as well as anindication that a name is undefined (UND), duplicately defined(DUP), implicitly defined (IMP), or, if a program name,externally defined (EXT).

    XREF and NOSOURCE produce only the sorted cross-reference listing.

    ZWB:

    This is a COBOL compiler option.

    Format: ZWB NOZWBAbbreviations: NoneIBM-default: ZWB

    ZWB, which conforms to the ANSI standard, specifies that the compilergenerate code to remove the sign from a signed external decimal field whencomparing such a field to an alphanumeric field.

    For the two fields defined below (with their hex values shown to the right):

    Hex Value

    ---------FIELDA PIC S9(3) VALUE +123. F1F2C3FIELDB PIC X(3) VALUE 123. F1F2F3

    Compiling with ZWB would result in the two fields above being consideredequal in value when compared; NOZWB would result in an unequalcomparison.