Cobol Compiler Options SSRANGE, APOST, RENT, OFFSET, LIST
COBOL programs which are coded are called Source module that are not executable. Source code goes thru a process called Compilation that produces object module or Load Module which is an executable code format. These Load modules are stored in a Load Library and are made available to RUN JCL using STEPLIB/JOBLIB during the execution of the JOB.
IGYCRCTL is the IBM provided COBOL Compiler Utility. This will create the Object module which is the input to Link editor-IEWL and it Link edits this object module and creates a Load Module.
Different compiler options can be provided to IGYCRCTL using the PARM. Below are the list of important COBOL Compiler options
SSRANGE and NOSSRANGE
SSRANGE – As name implies, its functionality is to check the boundaries. This Compiler Option if used generates an extra code to validate the boundaries of the Subscripts, Indexes, Reference Modifications and makes sure that these are not being addressed outside the size defined. It also takes care of Occurs Depending On values by restricting them not going beyond its limit.
While executing the program this compiler option checks the boundary conditions and throws an abend.
NOSSRANGE is the default one.
Ex: If a Program is trying to access 6th element of a Array which is defined with 5 occurrences only. With SSRANGE compiler option, program abends. With NOSSRANGE, program does not abend but it may fetch garbage.
RENT and NORENT
These Compiler options tells whether a Program compiled is of RENTrant or Not. RENT makes the program as Re-entrant where as NORENT makes the program as non re-entrant programs.
Re-entrant programs are the ones that does not modify itself when it is reentered after an interruption by the OS. It is possible because it maintains a separate copy of working storage for each Task. Must use RENT for programs that run under CICS or UNIX. In contrary to a Re-entrant programs, in Pseudo conventional program, a task gets ended without waiting for the user input and after the input is received, it gets started (reentered) from that point only.
Default–>LIST = No
LIST=Yes produces the listing of source code in Assembler language. In case of abends, this listing is very useful in finding the abend location.
Default –> NOOFFSET
OFFSET produces the list of relative addresses of Object code which contains Line Number, Location in HEX and Verb.
LINE # HEXLOC VERB LINE # HEXLOC VERB LINE # HEXLOC VERB
000580 00284A DISPLAY 000581 002855 PERFORM 000633 00285A OPEN
000780 002868 DISPLAY 000881 00286E PERFORM 000933 002898 CLOSE
LIST and OFFSET are mutually Exclusive.
It directs the compiler on which source code line numbers to be used in error conditions. Whether to use line numbers from the generated LISTing or from the Source code.
NUM=No –> Uses line number from the compiler generated listing.
=Yes –> Uses line numbers from the source code. If there are any copy members in the source code, make sure its line numbers differs from source code line numbers.
Default –> SIZE(MAX)
It indicates the amount of storage required for compilation.
Syntax: SIZE(MAX) OR SIZE(nnnnn) or SIZE(nnnK)
MAX–> allocates MAX possible main storage for the compile process
If the compilation is in 31-bit then it allocates all the storage above 16MB line in Used region.
nnnnn–> is a decimal number which should be greater than or equal to 851968.
nnnK –> is also a decimal representation but in increments of 1-KB. Minimum value is 832K
Default –> NOTEST
It enables the debugging facility. With TEST compiler options the programs can be debugged also it has few sub options which enables the JUMPTO and GOTO debugger options.
Default –> QUOTE
This compiler options indicates whether to use Double Quotation marks(“) or Single Quotation Marks(‘) as a delimiter for non numeric literals.
Quote–> Directs to use Double quotes as the delimiter
APOST–> Directs to use Single quotes as the delimiter
This is to indicate what language to be used for the Output Compiler listing messages.
EN–> Mixed case US English
UE–> Upper case US English
Used for COBOL-DB2 programs so that the DB2 co processor gets enabled.
SQL=YES –> use YES if there are any SQL statements in the program.