Skip to content

The File>New Wizards

Key Concepts

The New COBOL Project wizard creates a sub-folder under the Workspace Folder with the name of the project.

The New Folder wizard adds sub-folders under the Project Folder. These folders can be used to organize other project elements such as copy files, list files, object files, and data files.

The New COBOL Program wizard opens a blank COBOL program in the COBOL-IT Code Editor, and saves it in the selected folder.

File>New>COBOL Project

Select File>New>COBOL Project… to open the COBOL Project Wizard. Create a new project in the Workspace.

New Project Wizard

Enter a project name. In this example, we create a project called project1.

In this case, entering project1 as a Project name causes a subfolder called project1 to be created under the Workspace Folder.

Here we are creating a new project in the workspace. Eclipse artifacts, such as the .project file, will be created in this project directory. Click Finish.

Project>New>Folder

Now that we have created a COBOL Project Folder, we can create subfolders for the various components in our project, such as copy files, list files, object files, and data files. To do this, we will use the New Folder Wizard.

Select project1 in the Navigator Window. Right-click on the project, and select New>Folder to enter the New Folder Wizard. In the New Folder Wizard, enter a folder name for e.g copy, and press the Finish button. Finish closes the New Folder Wizard.

Repeat multiple times to create the subfolder lst for list files, the subfolder object for object files, and the subfolder data for data files.

New Folder Wizard

We now have a base project directory, and 4 subfolders, in which to do our Getting Started development exercises.

New Folder Advanced Functions

New Folder Advanced Functions allow you to add folders to your Project which are not located as subfolders of the Project Folder on the disk.

It is common that in a corporate work environment, copyfiles will be stored in a folder that all users share. This folder can be referenced by the -I copypath compiler flag without adding the folder to the project, so it is not strictly a requirement that it be part of the project.

However, the Copyfile Folder does have to be in the Project in order for the the Project to execute certain functions like, Open Declaration, for example. Or, if your copy file contains Procedure Division code, then the Copyfile Folder has to be in the Project in order for the Debugger to step through the Procedure Division code statements.

So, if your copyfiles are not in a subdirectory located underneath the Project, how do you get them into the Project? That is done at the point where you create a New Folder. In File>New>Folder, (the New Folder dialog Screen), click on the <<Advanced button.

Advanced Folder Functions

This expands the New Folder dialog screen to include 3 radio buttons, which are:

  • Use default location
  • Folder is not located in the File System (Virtual Folder)
  • Link to alternate location (Linked Folder)

When you are using the default location setting, and you create a folder, it is created as a subdirectory of the Project. You can then create folders under this folder, and so forth.

The Virtual Folder selection allows you to add a folder on a remote machine to your project. When using the Virtual Folder, you should also select the Remote System on which the virtual folder resides from the Choose File System dropdown box.

The Linked Folder allows you to link to an existing folder on your system that is not located under your Project Folder. For this case, you name the folder in the Folder Name entry field, but link this folder name to another location, which you browse and select. When you do this, you will find that this folder is added to your Project, and the Developer Studio and Debugger will execute functions like Open Declaration, and Step Into code located in a copyfile with no problems.

Project>New>COBOL program

We can now create a new COBOL program in the base project directory. We will create our sample program, hello.cbl, in the project directory.

In the Navigator Window, select the project by clicking on it. This selection will ensure that the Wizard will store the Project Folder as the default location for the new COBOL program.

Select File>New>COBOL Program to open the New COBOL Program Wizard. Enter the name of your new COBOL program, and press the Finish button to close the New COBOL Program Wizard.

COBOL Program

The Code Editor

You will see that you now have an empty COBOL program called hello.cbl in your Developer Studio Code Editor. The Outline Window becomes populated as you create hello.cbl.

Code Editor

Enter the code for hello.cbl.

Code EDitor

The Outline Window auto-updates as you type your COBOL program.

The Divisions (Procedure Division, Environment Division, etc… ) in your program are marked with a blue D, the Sections (Working-Storage, etc… ) are marked with a Green S.

The Outline Window provides a useful navigation tool. Click on a title, and navigate directly to that line of source in the COBOL program.

Save your COBOL program**

You can save your COBOL program by clicking on the Save button on the Developer Studio toolbar.

Additionally, the Window>Preferences>General>Workspace dialog screen contains interfaces for setting:

  • Save Automatically before build
  • Workspace save interval (in minutes)

Workspace save interval ensures that your work will be automatically saved at specified intervals. Save automatically before build ensures that even if you forget to save your work before starting a Build, the Developer Studio will automatically save the code changes before beginning the build.

Project>Properties>COBOL Properties (Compiler flags & Scripts)

Compiler flags and scripts can be set at the Workspace level in the Window>Preferences>COBOL>Compiler dialog screens.

Compiler flags and scripts can be set at the Project level in the Project>Properties>COBOL Properties dialog screens.

COBOL-IT Compiler flags are grouped by classifications that can be seen in the panel on the left.

COBOL Properties

Select the Enable source settings checkbox to enable compiler flag and script settings.

When you have selected the Enable source settings checkbox, it will be enabled at the top of all of the compiler flag screens. The compiler flag screens are listed in the Navigator Window.

Accept/Display

Affect the behavior of the ACCEPT and DISPLAY statements.

Accept/Display

Setting Behavior
-faccept-with-auto Causes the WITH AUTO clause to be assumed by default on a field-level ACCEPT statement.
-faccept-with-update Causes field-level ACCEPT statements to assume the WITH UPDATE clause.
-fraw-pic9-display (Internal use only)
DISPLAY PIC 9 (X) (no sign, no decimal) as it is in memory.

CALL Parameters

Affect the behavior of the CALL statement.

CALL Parameters

Parameter Behavior
-fcall-comp5-as-comp On little-endian platform (intel Linux, Windows) when a call USING clause contains a literal , causes the literal to be copied as a COMPUTATIONAL value, rather than as a COMP-5 value.
-fnull-param Causes an extra NULL pointers to be passed as the last argument on CALL statements.
-fstatic-call Causes static C function calls to be generated for the CALL statement.
-fvalue-size-is-auto Causes the SIZE IS clause in a CALL USING BY VALUE statement to be set to AUTO.
-fraw-by-value Causes PIC X to not be converted to numeric COMP-5 in a CALL USING BY VALUE statement. This is the default.
-fno-raw-by-value Causes PIC X to be converted to numeric COMP-5 in a CALL USING BY VALUE statement.

Cmd Flags

Allows for the setting of additional user flags. Enter additional compiler flags in the entry field and they will be added to your compile string.

Cmd Flags

Customize Setup

Allows for the scheduling of scripts to be run before/after clean and build operations.

Customize Setup

Browse and select scripts which are automatically executed in certain conditions:

Script Condition
Pre-build script Prior to a project build
Post-build script After the completion of a project build
Pre-clean script Prior to the execution of the clean operation
Post-clean script After the completion of the clean operation
Compiler command cobc %f %f = Module file name (no path)
Compiler execution directory %p %p = Module absolute path
Pre-run script Prior to launch of a run of the application
Post-run script After the completion of the run of the application
Pre-debug script Prior to launch of the application in the debugger
Post-debug script After the completion of the run of the application in the debugger
Remote SSH Port 8484
Remote SSH port range 50

Data Handling>Data Operations

Affects the behavior of data operations.

Data Operations

Operation Behavior
-falign-8 Aligns 01-level and 77-level data on 8 byte boundaries.
-fnumeric-compare Causes the comparison of a numeric field with a PIC X field to interpret the value of the PIC X field using its numeric value.
-fodo-slide Causes data items that appear after a variable-length table (with OCCURS DEPENDING clause) to always immediately follow the table, whatever the current size of the table. The internal addresses of these data items change as the table's size changes.
-fround-fp Affects behaviors when COMP-1 or COMP-2 are “moved” into non-COMP-1 or COMP-2 target fields when the target field has fewer decimal places than the source field. Causes the value to be rounded to the number of decimal of the target field.
-funstring-use-move When an UNSTRING INTO operation is described as PIC 9, causes the operation UNSTRING operation to be performed using a MOVE operation instead of raw copy operation. Rules defined by the move-picx-to-pic9 compiler configuration flag are used for conversion.
-fglobal-typedef Causes TYPEDEFs to be GLOBAL for all nested programs.
-fno-global-typedef Causes TYPEDEFs to be local to the current program.
-fsign-ascii Causes numeric DISPLAY items that include signs to be interpreted according to the ASCII sign convention. (default on ASCII machines)
-fsign-ebcdic Causes numeric DISPLAY items that include signs to be interpreted according to the EBCDIC sign convention. (default on EBCDIC machines)
-fsign-leading Makes SIGN IS LEADING the default.
-fsign-separate Makes SIGN IS SEPARATE the default.
-frecmode-v Causes all unspecified RECORDING MODE clauses to be interpreted as RECORDING MODE V.
-frecmode-f Causes all unspecified RECORDING MODE clauses to be interpreted as RECORDING MODE F.
-frecord-depending-iso For ISO-compatibility, causes files declared with a RECORD DEPENDING ON <FIELD> clause, without any FROM or TO value, to assume a FROM and TO value of the maximum record size.
-finitialize-fd Causes records declared in the File Section to be initialized when program is loaded in memory.

Data Handling>Linkage Section

Affects the handling of data in the Linkage Section.

Linkage Section

Setting Behavior
-falloc-unused-linkage Causes the compiler to allocate static memory for level 01 fields in the Linkage Section that are not used in either a USING clause or an ENTRY clause.
-fprotect-linkage Generates code at the entry point of a program containing a USING xxx clause.
-fsafe-linkage Generates code at the entry point of a program containing a USING xxx clause. This allows for the omission of parameters. Doing this will avoid a SIGVEC being returned by the debugger when all linkage parameters are not provided.

DevOps Tools>Checkpoint/Restore

Allows for use of the Checkpoint/Restore functionality.

Checkpoint/Restore

Setting Behavior
-fcheckpoint Enables setting of checkpoints. Program state is saved at checkpoints, and can be reloaded.

DevOps Tools>Code Coverage

Allows for use of the Checkpoint/Restore functionality.

Code Coverage

Setting Behavior
Open Coverage View automatically Causes the Coverage View to open automatically when compiling with -code-cover
-code-cover -debugdb=debugdb.dbd Causes code coverage information to be stored in the debugdb.dbd file. For more information on Code Coverage see Getting Started using the Developer Studio - The Utilities.

DevOps Tools>Data Displayer

Allows for the configuration of Data Displayer functionality

Data Displayer

Setting Behavior
Load data partially For use with table-mode display. Sets a page size which is the number of records that will be written to the table. In large files, tables can be browsed by page, with the table re-loading by page, rather than loading all of the records at once.
Use settings from a XDD file Data Displayer reads information from the XDD file.
Use variable-size record format Data Displayer evaluates variable-size relative file headers.
Use MF Sequential Escape format Corresponds to compiler configuration file setting lin-seq-mf: yes. Supports line sequential files that preface bytes with values less than 0x20 with 0x00.
-fgen-xdd Causes the compiler to parse FDs in the program and generate .xdd files.

DevOps Tools>Debugging Tools

Enables a range of debugging functionalities.

Debugging Tools

Tool Behavior
-debug Enables all run-time error checking.
-ftrap-unhandled-exception Enhances information dump when program aborts and ON EXCEPTION/ON OVERFLOW language is not present in the COBOL program.
-g Produce debugging information in the output.
-fdebugdb When used with –g, store alls debugging information into a file name <modulename>.dbd..
-fsource-location Generates source location code, enabling information to be dumped on source location when the runtime aborts. Enabled by the –g compiler flag, and by the –debug compiler flag.
-fstack-check Enables stack checking debug function. Enabled by the –g compiler flag, and by the –debug compiler flag.
-G Produces debugging information in the output, allowing C-level debugging. Use with -fnostrip.
-fdebug-exec Enables the debugging of code generated by a pre-processor when using the -preprocess compiler flag.
-fdebugging-line Enables support for debugging lines. ( Source lines that contain 'D' in indicator column)
-fmem-info Enables Dump of Working-Storage when runtime aborts. Use with the -g or -debug compiler flag.
-fnostrip Causes objects and object and executable files to NOT be stripped. Stripping an object or an executable is the action of removing system level debugging information.
-ftraceall Generates trace output at runtime, listing SECTION/PARAGRAPH/STATEMENTS names as they are executed.
-ftrace Generates trace output at runtime, listing SECTION/PARAGRAPH/STATEMENTS names as they are executed.
-fsimple-trace Generates trace output at runtime for executed SECTION/PARAGRAPHs.
-fsplit-debug-mark DEBUG marks respect max 72 characters (default).
Debugger socket connection timeout in seconds Debugger socket connection timeout, set to 10 seconds by default.

DevOps Tools>Profiler

Allows configuration of the Profiler function.

Profiler

Setting Behavior
Open Profile View automatically Causes the Profiler View to open automatically when compiling with -fprofiling.
-fprofiling Causes profiler information to be stored in a .xls file. For more information on Profiling, see Getting Started using the Developer Studio- The Utilities.
Enable interval profiling Allows interval profiling, which is displayed in the runtime tab of the profiling View.
Refresh interval (seconds) For the runtime tab of the profiling View, affects how often the memory/cpu usage graphs are refreshed.

Dialects>Compiler Configuration

Allows selection of compiler configuration file.

Compiler Configuration

Setting Behavior
-conf=<file> Causes a user-defined compiler configuration file to be referenced as the default configuration file.
-std=<dialect> Causes one of the dialect-oriented compiler configuration files to be used instead of the default compiler configuration file.

Dialects>IBM Compatibility

Provides refined compatibility with IBM COBOL.

IBM Compatibility

Setting Behavior
-fcics Generates CICS-compliant code.
-fcompute-ibm Causes arithmetic expressions (like a+B*c) in COMPUTE statements, and comparisons to use IBM COBOL defined rules for determining the number of decimals used in intermediate results.
-fdisplay-ibm Causes the output of the DISPLAY Statement for numeric fields to be more compatible with IBM mainframe.
-febcdic-charset Causes the COBOL-IT Compiler and Runtime to store and manage data in the EBCDIC encoding format. Source code is stored in ASCII format.
-fibm-listing-macro Enables IBM listing extensions (TITLE, SKIP1/2/3, EJECT ...) (default).
-fibm-mainframe Causes the compiler and runtime to operate in an IBM Mainframe compatible mode.
-fibm-sync Applies SYNC attribute to group item if first elementary field is described with the SYNC attribute. (default).
-fmainframe-vb Causes WRITEs and READs of Variable Blocked files to assume formats compatible with the Mainframe Z/OS COBOL Format.
-fregion0 Causes the module to always switch to region 0 even if called from another region.

Dialects>Micro Focus Compatibility

Provides refined compatibility with Micro Focus COBOL.

Micro Focus Compatability

Setting Behavior
-ffunctions-all Allows use of intrinsic functions without the FUNCTION keyword.
-fmfcomment Treats lines with '*' or '/' in column 1 as comments.
-fmf-compat-parser Increases compatibility of syntax parser with the Micro Focus syntax parser (default).
-fmf-ctrl-escaped-parser Syntax parser is MF compatible with control character escaped by 0 (default).
-fmf-file-optional Causes files declared as OPTIONAL and OPEN in EXTEND to return file-status code “05” if the file is created and file-status code “00” if the file exists.
-fmf-hostnumcompare The -fmf-hostnumcompare compiler flag affects comparisons of USAGE DISPLAY numeric data items when one of the numeric data items in the comparison contain non-numeric data.
-fmf-relativefile The –fmf-relativefile compiler flag causes the runtime to assume the Micro Focus format for relative files for both READ and WRITE operations.
-fnotrunc Causes truncation of binary fields to NOT be made according to the PICTURE clause while performing intermediate computations.
-fdiv-check Causes divide-by-0 operations to generate an exception.

Dialects>Other COBOL Compatibilities

Provides refined compatibility with other COBOL compilers.

Other COBOL Compatability

Setting Behavior
-fas400-like Causes the LIKE clause to act compatibly with the AS400 implementation. A field declared with the LIKE clause is described as a PIC X (other field’s byte size).
-fcarealia-sign Use CA Realia sign coding for Usage Display.
-fgcos-mode Causes the compiler to more closely emulate GCOS operations.

Environment>Copy Files

Affects the handling of COPY files. In our sample, we use a Copy Folder outside the Project Folder.

Copy Files

Setting Behavior
-ext <extension> Adds <extension> to list of default copy file extensions. For example, to direct the compiler to search for copy files with .fd and .sl extensions, use the compiler flags -ext fd -ext sl.
-I <directory> Allows location of copy files in <directory>.
-fcopy-mark Adds mark for begin/end of COPY In listing and preprocessed file.
-fcurdir-include Causes COPY files to first be searched for in the current directory, before locations described with the -I <Path>, or with environment variables.
-fno-curdir-include Causes COPY files to not be searched for in the current directory, before locations described with the -I <Path>, or with environment variables.
-ffold-copy-lower Folds COPY file names to lower case.
-ffold-copy-upper Folds COPY file names to upper case.
-fkeep-copy-statement In listing and preprocessed file, keep COPY statements.

Environment>Encoding

Allows UTF-8 and UTF-16-LE encoding.

Encoding

Setting Behavior
-futf16-le Causes fields declared as PIC N to be stored as UTF16-LE (Little Endian). Note that by default, fields declared as PIC N are stored as UTF16-BE (Big Endian).
-fut-8 Instructs the compiler that the source file, and literals are UTF-8 encoded. The -futf-8 compiler flag can be used with, or without the -codepage compiler flag.

Environment>Source Files

Affects how source is interpreted.

Source Files

Setting Behavior
-free Instructs the compiler that source code is in the free, or terminal source format.
-fixed Instructs the compiler that source code is in the fixed source format. The –fixed compiler flag is assumed, by default.
-codepage <cpid> Defines the encoding of PIC X in memory. If –source-codepage is specified, the compiler converts from the codepage-id used in the –source-codepage compiler flag to the codepage-id used in the –codepage compiler flag.
-source-codepage <cpid> Defines the code page to be used when editing the source and the code page used for string literals in the COBOL source code.
-flisting-sources Informs the compiler that source is the result of program listing option (-t <file>).
-fcontinuation-line Allows a hyphen in column 7, with no following text, to be recognized as not being a continuation line.

File Handling>External Files

Affects the handling of External files.

External Files

Setting Behavior
-ffile-auto-external The –ffile-auto-external compiler flag affects the way that the compiler treats variables describing file-names for files described as EXTERNAL (Default).
-fno-file-auto-external Disables -ffile-auto-external. When disabling this functionality, if you have separate programs sharing the same EXTERNAL file that also have file-var fields, then changes made between the programs will not automatically be shared.

File Handling>File names

Affects the interpretation of file names.

File Names

Setting Behavior
-fno-realpath Causes file names to NOT be extended to a fully qualified path.

File Handling>Line Sequential

Affects the handling of line sequential files.

Line Sequential

Setting Behavior
-fls-expand-tab Causes the READ of a LINE SEQUENTIAL file to expand the TAB character to 8 spaces (default).
-fprinter-crlf Files declared with ASSIGN TO PRINTER file names are generated with compatibility for DOS printers. This will change the End Of Record to CR/LF (instead of LF).
-fsequential-line Causes all non-qualified SEQUENTIAL files to be declared as LINE SEQUENTIAL.

File Handling>Relative Files

Affects the handling of relative files.

Relative Files

Setting Behavior
-frelativefile-bigendian Causes the record header of relative files to be stored in BigEndian format.

File Handling>Select Behaviors

Sets default behaviors for SELECT statements.

Select Behaviors

Setting Behavior
-fautolock Sets default for SELECT to LOCK MODE IS AUTOMATIC.
-fexclusivelock Causes all files with no LOCK MODE clause in their SELECT statement to be declared implicitly as LOCK MODE is EXCLUSIVE unless a SHARING clause in the SELECT statementor in the OPEN statement indicates otherwise.
-fmanuallock Causes all files with no LOCK MODE clause in their SELECT statement to be declared implicitly as LOCK MODE is MANUAL unless a SHARING clause in the SELECT statement or in the OPEN statement indicates otherwise.
-fshare-all-default The -fshare-all-default compiler flag causes all files to be declared implicitly as SHARE WITH ALL.
-fshare-all-manulock Causes all files with a SHARE WITH ALL clause in their SELECT statement to be declared implicitly as LOCK MODE IS MANUAL.
-fshare-all-autolock Causes all files with a SHARE WITH ALL clause in their SELECT statement to be declared implicitly as LOCK MODE IS AUTOMATIC.
-use-extfh <NAME> Names an EXTFH File handler to be used, enabling the use of an external file system.
-ffcdreg Allows a user of an EXTFH-compliant data source to directly read and write the File Control Description (FCD) through which information passes to and from an EXTFH-compliant data source. Use with -use-extfh.

File Handling>Sort Files

Affects the behavior of the SORT statement.

Sort Files

Setting Behavior
-use-extsm <NAME> Names a runtime module to be used, enabling the use of an external sort handler.

File Handling>Third-party support

Enables the use of EXTFH-compliant file systems.

Third-party Support

Setting Behavior
-fdbd Activates the usage of Oracle Berkeley DB isam files.
-fvbisam Activates the usage of VBISAM isam files.
-fdisam Activates the usage of DISAM isam files.
-fctree Activates the usage of CTREE isam files.
-fctree-field-numbering Causes the CTREE XDD generator to generate a prefix F <field-number> before field names. Use with –fgen-xdd compiler flag.
-fctree-no-full-qualification Causes the CTREE XDD generator to not generate the fully qualified data names in the XDD description of the file. Use with –fgen-xdd compiler flag.

Informational

Returns information, does not compile source files.

Informational

Setting Behavior
--help Lists compiler flags.
--check-codepage <cpid> Checks if a given codepage is recognized by the ICU library.
--list-codepage Lists all supported codepages in the following format: Codepage: [list of synonyms for codepage].
--list-intrinsics Lists supported intrinsic functions.
--list-mnemonics Lists supported mnemonic names.
--list-reserved Lists all reserved words.
--version, -V Displays compiler version.

Link>C Code Generation

Affects the way COBOL is translated into C.

C Code Generation

Setting Behavior
-fC-cmd-line When used with –x, causes the program to receive command line parameters as though they were given in C.
-fC-data-init (Internal use only) Controls if the C data structure created by the compiler is initialized in the source (at compilation time) or at runtime. This should not be changed.
-fimplicit-init Initializes the COBOL runtime system at runtime start-up.
-fgcc Generates gcc-compliant C code. The –fgcc compiler flag is enabled when COB_CC=gcc. Default on Linux platforms.
-fgcc-bug When using a gcc compiler on very large source files, the gcc compiler could enter an infinite loop. This bug is avoided by using the –gcc-bug compiler flag.
-fgcc-goto Generates gcc-computed goto code. Enabled when using the –fgcc compiler flag, or when COB_CC=gcc.
-fmain Generates main() symbol when used with -x (default).
-fnomain Does not generate main() symbol when used with -x.
-finclude-main Causes main() symbol to be included in module object when compiled with –c.
-fmain-as-object Generates main() symbol as object not in library (unix only) (default).

Link>C Compiler/Linker

Allows passing options to the C Compiler or Linker.

C Compiler/Linker

Setting Behavior
-D <define> Passes <define> to the C Compiler.
-Wc CC_opt Passes CC_opt directly to the C Compiler, where CC_opt is a compiler flag, or string, that can be processed by the C compiler.
-Wl LD_opt Passes LD_opt directly to the Linker, where LD_opt is an option, or string that can be processed by the Linker.

Link>Full Build

Affects the building of compiled objects generated by the Compiler.

Full Build

Setting Behavior
-b Links multiple input files into a single dynamically loadable module.
-m Builds a dynamically loadable module. (Default).
-x Builds an executable program.
-fmodule-uppercase Causes the output file name to be created in upper-case, when used with the –m compiler flag.
-flink-only Causes the main() symbol to not be generated, when used with –x.
-l <lib> Causes the library <mylib> to be used by the linker.
-L <dir> Adds <directory> to the library search path.
-R <dir> Adds <directory> to runtime library search path (if supported).
-MF <file> Writes dependency list into <file>.
-MT <target> Names the target file used for the dependency list.
-fobj-cit Causes compiled object to be generated with a cit extension instead of .dll (Windows) or .so (unix/linux).
-fmf-gnt Causes compiled object to be generated with a gnt extension instead of .dll (Windows) or .so (unix/linux).
-fmf-int Causes compiled object to be generated with an int extension instead of .dll (Windows) or .so (unix/linux).

Link>Partial Build

Interrupts compilation prior to the creation of a compiled object.

Partial Build

Setting Behavior
-c Compile and assemble, but do not link.
-C Interrupts the compilation after converting COBOL to C.
-E Interrupts the compilation after the preprocessing of the COBOL code, without doing any translation to C, compilation, assembly, or linking.
-S Interrupts the compilation after after output of the assembly file. Translated C files are compiled by cc. The output is saved in a file with a .s extension.
-fvalidate-only Compile source, no output produced, EXEC are ignored
-fsyntax-only Performs syntax error checking only. Output is limited to results of syntax check.
-fexec-check Used with -fsyntax-only, checks the EXEC SQL/CICS/DLI syntax.

Optimize Options

Enables optimizations of a range of functions.

Optimize Options

Setting Behavior
-O Enables optimization. CHECK> -O, -Os and -O2 are passed to the C compiler as is and used for C-level optimization.
-f77-opt Optimizes the use of integers stored in USAGE DISPLAY or PACKED fields in level-77 data items.
-fall-external-link Causes the targets of the CALL statement to all be assumed to be external-links.
-fbin-opt Enables the use of CPU integers when manipulating USAGE COMP and USAGE COMP-5 data elements.
-fcall-opt Enables CALL statement optimization. Programs containing CANCEL statements should not be compiled with -fcall-opt.
-fdecimal-optimize Optimizes the conversion from DISPLAY/COMP-3 to binary values in COMPUTE statements.
-ffast-op Enables the runtime to use faster operations when manipulating data items declared as USAGE DISPLAY or USAGE COMP-3.
-findex-optimize Improves performance where indexes in tables are evaluated and USAGE DISPLAY fields are used as indexes.
-finitialize-opt Optimizes the implementation of the initial field initialization at runtime startup and the execution of the INITIALIZE statement by grouping field initializations wherever possible.
-freturn-opt Generates optimized PERFORM return code. The –freturn-opt compiler flag is ignored when using the –fgcc compiler flag.
-fcmp-opt Activates optimizations when comparing literals with variables (default).
-fno-cmp-opt Disables optimizations when comparing literals with variables.
-ffast-figurative-move Enables fast MOVE's of figurative constants (default).
-fno-fast-figurative-move Disables fast MOVE's of figurative constants.

Pre-processing Options

Affects pre-processing functionalities.

Pre-Processing Options

Setting Behavior
-fcopy-default-leading When using the ==xxx== notation in a COPY REPLACING statement, causes the LEADING phrase to be assumed by default.
-fcopy-exec-replace When a COPY REPLACING == xxx == statement is performed, causes text inside EXEC / END-EXEC blocks to be also replaced if applicable.
-fcopy-partial-replace When a pattern like COPY FIC1 REPLACING == WJXX- == BY == WJ03- == is processed : If this flag is on, the preprocessor uses a partial replacement as defined by MF and ANSI2002 standard. If it is off (the default) the IBM mainframe and ANSI85 standard is used.
-preprocess=<CMD> Causes <CMD> to be run after the COBOL pre-processing step. <CMD> is a script of batch file in which an external pre-processor is run.
-fexpand-exec-cpy The –fexpand-exec-copy compiler flag causes the compiler to expand COBOL COPY statements inside EXEC … END-EXEC blocks. This applies to both EXEC SQL and EXEC CICS blocks.
-fexpand-sql-include Used with -E, expands EXEC SQL INCLUDE <Filename> END-EXEC in the –E output.
-fkeep-org-src-line For use with the integrated pre-processor (-preprocess). Causes errors to be reported on the original source line.
-fmakesyn-patch-preprocess Causes the makesyn compiler flag to change the output of a pre-processed file.
-freplace-additive Allows for the use of the REPLACE ADD verb, which has the effect of nesting a REPLACE statement inside an existing REPLACE statement.
-frw-after-preprocess Causes SPCRW2 to be run after the -preprocess script.
-makesyn “key=value” Provides a way to make a reserved word a synonym for another reserved word. A common usage is to make COMP a synonym of COMP-5.>cobc –makesyn comp=comp-5 hello.cbl
-fauto-sprwr Causes SPCRW2 to run automatically when needed before any -pre-process script (default).
-fno-auto-sprwr Causes SPCRW2 to not run automatically when needed before any -pre-process script.

Project Options

Affects handling of the build process.

Project Options

Setting Behavior
Always rebuild makefile When selected, the makefile will be re-built for every build.
Cobol program extension to compile File extensions that the compiler will recognize as source files, and compile in a BUILD.
Cobol program to preprocess before compile File extensions that will be precompiled when using the –preprocess compiler flag.
Setup Script The COBOL-IT setup script.
Working directory Default is project directory.

Remote Source Control

Allows settings for CVS, SVN source code control. This funcitonality is only supported when using the Remote System Explorer.

Remote Source Control

Standard Options

Standard compiler options. In our examples, we have set -o to .\object and -t to .\lis.

Standard Options

Setting Behavior
-err <file> Causes errors and warnings to be written to <file> instead of stderr.
-o <file> | <dir> Causes a compiled object to be output into <file> or <directory>.
-t <file> | <dir> Causes a program listing to be output into <file> or <directory>.
-ftruncate-listing Causes output of the -t <file> compiler flag to be truncated at column 76.
-v Produces verbose output.
-save-temps=<directory> Causes all intermediate files to be preserved.
-fthread-safe Generates thread-safe executables.

Warnings

Configure how the compiler generates warnings.

Warnings

Setting Behavior
-w Disables all warnings.
-Wall Enables all warnings.
-Warchaic Warns if archaic features are used.
-Wbdb Warns about bdb license (default).
-Wcall-params Warns if non 01/77 items are used for CALL parameters (NOT set with -Wall).
-Wconstant Warns if inconsistent constant is used.
-Wimplicit-define Warns of implicitly defined data items.
-Winformation Warns information about 'not recommended' code.–Winformation is applied by default.
-Wlinkage Warns of dangling LINKAGE items (NOT set with -Wall).
-Wobsolete Warns if obsolete features are used.
-Wparentheses Warns of lack of parentheses around AND within OR.
-Wredefinition Warns if incompatible redefinition of data items are used.
-Wstrict-typing Warns of type mismatch strictly.
-Wsuggestion Warns suggestions about 'not recommended' code. –Wsuggestion is applied by default.
-Wterminator Warns of lack of scope terminator, such as END-XXX (NOT set with -Wall)
-Wtruncate Warns of possible field truncations. –Wtruncate is applied by default.
-Wunreachable Warns of unreachable statements.
Back to top