skip to main content

Compiler and Runtime : Compiler

Compiler
Overview
The job of any compiler is to convert human-readable source code to an object that a computer can run. To accomplish this, isCOBOL performs two steps: the COBOL source code is translated to a Java source code, then the Java source code is converted to a Java class.
For a standard COBOL program compiled without particular options, a single class file is generated. The name of this class file is always upper-case and matches the source file name. There are situations in which more than one class file is generated.
If the -d compiler option is used, a class file called program$Debug$Infos is generated in addition to the program class file.
If the source code contains OCCURS statements or object invocation in the SCREEN SECTION, a class file for each occurrence and each object invocation are generated in addition to the program class file. These classes are named using a progressive number (program$1, program$2, ..., etc.). If the OCCURS statement appears in the LINKAGE SECTION, a class of each occurrence is always generated. If the OCCURS statement appears in the WORKING-STORAGE SECTION, a class for each occurrence is generated only if the index is variable.
If the Screen Section contains control properties associated with referenced variables, for example: VALUE W-VALUE (offs:len) and offs or len are data-items (not constant values), then an additional class for each one of these cases is generated. The classes are named using a progressive number (program$1, program$2, ..., etc). If the referenced variable appears in the LINKAGE SECTION, a class of each occurence is always generated. If the referenced variable appears in the WORKING-STORAGE SECTION, a class for each occurrence is generated only if offs or len are variables.
The command to execute the compiler is:
iscc Options SourceCode
Note: On Windows this command should be launched from inside the isCOBOL Shell. Otherwise you need to set the ISCOBOL and ISCOBOL_JDK_ROOT environment variables before using iscc.
Compiling multiple source files at once
The isCOBOL compiler supports the * wildcard in the SourceCode parameter.
For example, the following compilations:
can be done all at once with the command:
Exit status
The Compiler returns 0 if the compilation is OK and a number greater than 0 if it fails due to severe errors. When you compile multiple source files at once, if any of these files produce severe errors, then the return code will be greater than zero.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left