Important COBOL compiler options
Important 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.
Thank you for this article, I was looking for this.
I want to create a COBOL program who use an ISPF service (show a panel). Ok in REXX is very easy. But I found some problems trying with COBOL when I want to run the program, error 20. My friend Gagan say you cannot run directly, you need to launch from a REXX. But I don’t want to agree !
My question is there are an option in the compiler or in the linker who gives the object with the ISPF interaction directly? I come from an AS400, and there the COBOL compiler and linker are far more flexible than the Z.
Could you give a solution or at least an explanation?
Thanks a million!
Thank you for this nice introduction to some compiler parameters.
I want to create a COBOL program who use an ISPF service to show a panel. I REXX is very easy. I want to run the COBOL program without calling it by a REXX script or so. I’m looking for an option or options in the compiler or/and in the linker to run this COBOL program.
Would be possible to have an example of this kind of program?
Thank you in advance!