Compiler -f Flags
-f compiler flags describe a context in which the compiler should generate code in a prescribed way. As such, they are used to enable optimizations, to enforce behaviors compliant with other COBOLs, to create thread-safe code, and to enable the use of utilities such as the debugger, tracing, memory dumps, and profiling.
All flags are provided in the form : -fflag-name
To enable the flag, use: -fflag-name
To disable the flag, use: -fno-flag-name
The -f convention can also be applied to compiler configuration file entries, enabling compiler configuration file entries to be entered on the command line.
Consider the case of the align-8:[y/n]
compiler configuration flag as an example:
align-8:y
is expressed on the command line as follows:
cobc -falign-8 sample.cbl
align-8:n
is expressed on the command line as follows:
cobc -fno-align-8 sample.cbl
-f Flags that can be set on the command line are listed in the following table.
Flags | Description |
---|---|
-f77-opt | Optimizes the use of integers stored in USAGE DISPLAY or PACKED fields in level-77 data items. The 77-opt optimizations are enabled by use of the -O compiler flag. |
-faccept-with-auto | Causes the WITH AUTO clause to be assumed by default on a field-level ACCEPT statement. When not compiling with -faccept-with-auto , the WITH TAB clause is assumed by default on a field-level ACCEPT statement. |
-faccept-with-update | Causes field-level ACCEPT statements to be interpreted as containing the WITH UPDATE clause. Equivalent to compiler configuration file setting: accept-with-update: yes |
-falign-8 | Aligns 01-level and 77-level data on 8 byte boundaries. Default is 4- byte boundaries. On HP Itanium based system this flag is always enabled. |
-fall-external-call | Internal use only. Causes all CALL statements to be considered EXTERNAL . |
-fall-external-link | Causes the targets of the CALL statement to all be assumed to be external-links. This can improve performance at runtime by optimizing the resolution of the CALL statement. |
-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. If the -falloc-unused linkage compiler flag is not used, and level 01 fields in the Linkage Section are not used in either a USING clause or an ENTRY clause, these fields are initialized to NULL , and no memory is allocated for them. The usage of a field for which no static memory has been allocated will provoke a Memory Fault. For cases where static memory has not been allocated at compile time, it is possible to programmatically allocate static memory to an unused linkage field using the SET [ linkage field ] to ADDRESS OF [ data-pointer ] statement, and avoid the Memory Fault condition. |
-fas400-like | Causes the LIKE clause to act compatibly with the AS400 implementation of the LIKE clause. The -fas400-like compiler flag causes a field declared with the LIKE clause to be described as a PIC X (other field's byte size). Equivalent to compiler configuration file setting as400-like: yes |
-fauto-load-symb | Provides additional control, as regards static symbol definition, by causing the static.symb and user.symb files to be automatically loaded with the compiler configuration file. static.symb is provided with the compiler distribution, and should not be changed by the user. Static.symb includes symbols declared by Pro*Cob and Tuxedo. Note that it is overwritten when the compiler is updated. user.symb is user-definable and may be placed in the config directory of the COBOL-IT installation, or in the current directory. If user.symb is missing, no error is generated. Both static.symb and user.symb files may include static-link declarations. |
-fautolock | Sets default for SELECT to LOCK MODE IS AUTOMATIC |
-fauto-sprwr | Causes SPCRW2 to run automatically when needed before any -pre-process script (default). |
-fbdb | Activates the usage of Oracle Berkeley DB isam files |
-fbinary-byteorder-big-endian | Sets binary-byteorder to big-endian. Corresponds to compiler configuration flag: binary-byteorder: big-endian |
-fbinary-byte-order-native | Sets binary-byteorder to native. Corresponds to compiler configuration flag: binary-byteorder: native |
-fbin-opt | Enables the use of CPU integers when manipulating USAGE COMP and USAGE COMP-5 data elements. The -bin-opt optimizations are enabled by use of the -O compiler flag. |
-fbin-opt-strict | Causes -fbin-opt binary operation optimization to be strictly respected. Corresponds to configuration flag: bin-opt-strict:yes |
-fcall-comp5-as-comp | The -fcall-comp5-as-comp compiler flag affects the behavior of the CALL statement. On little-endian platform (intel Linux, Windows) when a call USING clause contains a literal, the -fcall-comp5-as-comp compiler flag causes the literal to be copied as a COMPUTATIONAL value, rather than as a COMP-5 value. In the statement: CALL "subprogram" USING 1234 the literal 1234 is passed as a COMP value when using -fcall-comp5-as-comp . Otherwise, the literal 1234 is passed as a COMP-5 value. Equivalent to: call-comp5-as-comp:yes in a config file |
-fcall-lowercase | Affects the handling of literals that are the target of a CALL statement. As an example, consider the literal "MyProg" in the statement: CALL "MyProg" . In this case, the -fcall-lowercase compiler flag causes all of the characters in the literal "MyProg" to be converted to lowercase. |
-fcall-opt | Enables CALL statement optimization. Programs containing CANCEL statements should not be compiled with -fcall-opt . |
-fcall-uppercase | Affects the handling of literals that are the target of a CALL statement. As an example, consider the literal "MyProg" in the statement: CALL "MyProg" . In this case, the -fcall-uppercase compiler flag causes all of the characters in the literal "MyProg" to be converted to uppercase. |
-fcarealia-sign | Use CA Realia sign coding for Usage Display. See CA Realia sign coding below |
-fC-cmd-line | When used with -x , causes the program to receive command line parameters as though they were given in C. In this case, command line parameters are read as they would be through a "C" interface. For example (int argc , char **argv) |
-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. |
-fcheckpoint | Enables setting of checkpoints. Program state is saved at checkpoints, and can be reloaded. For more details on the usage of the -fcheckpoint flag, see the Guidelines for use of Checkpoints section. |
-fcics | Generates CICS-compliant code. |
-fcmp-inline | Causes comparisons to be inlined in the C code instead of through calls to the runtime library when possible. |
-fcmp-opt | Activates optimizations when comparing literals with variables. The -fcmp-opt compiler flag is set by default. Use -fno-cmp-opt to disable the functionality. The -fcmp-opt compiler flag corresponds to the compiler configuration flag: cmp-opt :yes |
-fcobol-lines | When compiling with gcc, line directives corresponding to COBOL source code line numbers are added to the "C" source code. |
-fcompat-display-to-int | Provides compatibility with older versions of COBOL-IT Compiler Suite (prior to version 3.10.5) as regards display to int functionality. |
-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. -fno-compute-ibm causes the maximum number of decimals (machine-dependent, up to 37) to be used in intermediate results of arithmetic expressions in COMPUTE statements and comparisons. For details, please consult IBM documentation. |
-fcompute-ibm-trunc | When using -fcompute-ibm compiler flag, or when compute-ibm compiler configuration flag is set to yes, causes intermediate results to be truncated (default). Corresponds to compiler configuration flag: compute-ibm-trunc:yes |
-fcontinuation-line | Allows a hyphen in column 7, with no following text, to be recognized as not being a continuation line. When compiling with -fcontinuation-line , a hyphen in column 7, with no following text in quotes is not recognized as a continuation line. A hyphen in column 7, with following text, in quotes, is always recognized as a continuation line. For rules on the handling of continuation lines, see Line Continuations in the COBOL-IT COBOL Reference Manual. |
-fcopy-default-leading | The -fcopy-default-leading compiler flag affect the behavior of the COPY REPLACING statement. When using the -fcopy-default-leading compiler flag, and when using the ==xxx== notation in a COPY REPLACING statement, the LEADING phrase is assumed by default. The LEADING phrase indicates that only the LEADING characters identified will be replaced if they match text in the copy file. |
-fcopy-exec-replace | The -fcopy-exec-replace compiler flag affects the behavior of the COPY REPLACING statement. When using the -fcopy-exec-replace compiler flag, and when a COPY REPLACING == xxx == statement is performed, text inside EXEC / END-EXEC blocks are also replaced if applicable. |
-fcopy-mark | Adds mark for begin/end of COPY In listing and preprocessed file.The copy marks are: *++SCOPY .\copy/sample.CPY ( beginning of COPY file ) , [ COPY file is listed here ] , *-SCOPY .\copy/sample.CPY ( end of COPY file ) |
-fcopy-partial-replace | The -fcopy-partial-replace compiler flag increases the compatibility of the COPY REPLACING behavior with Micro Focus compiler behaviors. 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. The -fcopy-partial-replace compiler flag corresponds to the compiler configuration flag:copy-partial-replace :yes |
-fctree | Activates the usage of C-tree 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 | Affects the behavior of the -fgen-xdd compiler flag, causing it to not generate the fully qualified data names in the XDD description of the file. When using the -fctree-no-full-qualification compiler flag with the -fgen-xdd compiler flag, the field name generated is xxx_<Field_Name> Where: xxx is a unique number (position in the structure), <Field_Name> is the name of the data field, without any other prefix or suffix. Use with -fgen-xdd compiler flag. |
-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. The COPY search is performed for files with default extensions, and with extensions described with the -ext compiler compiler flag.This is a default behavior. The -fno-curdir-include compiler flag causes the search for a COPY file to not search for COPY file in the current directory, unless that directory is named by an -I compiler flag, or by a COB_COPY_DIR , or COBCPY environment variable. |
-fdebugdb | The -fdebugdb compiler flag, when used with -g, store alls debugging information into a file name <modulename>.dbd . The runtime checks for the <debugdb> file using the name given at compilation time. If not found, the runtime will then check for the filename in the COB_LIBRARY_PATH location. This is different from debugdb=<filename> where you have to specify a unique Debug db for the whole project. Equivalent to: debugdb:yes in the compiler configuration file. |
-fdebug-exec | Affects the tracing of EXEC statements when debugging code that has been compiled with the integrated pre-processor (-preprocess ). When using the Integrated Preprocessor Interface, the default behavior of the debugger is to -not- trace (display) the code generated by the external preprocessor. Only the original source EXEC statements are shown. The -fdebug-exec compiler flag enables the tracing (debugging) of the generated code. |
-fdebugging-line | Enables support for debugging lines. (Source lines that contain 'D' in indicator column). |
-fdebug-parser | Allows for the debugging of the parser. (maintainer use only) |
-fdecimal-optimize | Optimizes the conversion from DISPLAY /COMP-3 to binary values in COMPUTE statements. When several COMPUTE statement are in the same paragraph, the compiler minimizes the conversions from DISPLAY /COMP-3 to binary values for fields that are used (and not modified) in different statements in the same paragraph. Enabled by using either the -O or -O2 compiler flags. Equivalent decimal-optimize:yes in config file. |
-fdisam | Activates the usage of the DISAM indexed file engine. |
-fdisplay-dos | Causes DISPLAY statements to use CR /LF . Corresponds to configuration file setting:display-dos: yes |
-fdisplay-ibm | Affects the output of the DISPLAY Statement for numeric fields to be more compatible with IBM mainframe. |
-fdiv-check | Enables the checking of divide operations when binary optimizations are turned on with the use of the -fbin-opt , or -O compiler flags. The effect is to cause divide-by-0 operations to generate an exception. |
-femulate-vms | Causes spaces to be stripped from filenames and adds suffix '.DAT' if needed. Corresponds to compiler configuration file setting: emulate-vms: yes |
-fexclusivelock | Causes all files with no LOCK MODE clause in their SELECT statement to be declared Implicitly as LOCK MODE is EXCLUSIVE . For details on other -f compiler flags related to the treatment of LOCK MODE , see Guidelines for modifying default handling of the LOCK MODE. |
-fexec-check | Used with -fsyntax-only , checks the EXEC SQL /CICS /DLI syntax |
-fexpand-exec-copy | 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 . Equivalent to: expand-exec-copy:yes in config file. |
-fexpand-sql-include | Used with -E , expands EXEC SQL INCLUDE <File name> END-EXEC in the -E output. |
-ffast-figurative-move | Fast MOVE of figurative constant (default). |
-ffast-op | Enables the runtime to use faster operations when manipulating data items declared as USAGE DISPLAY or USAGE COMP-3 . |
-ffcdreg | The -ffcdreg compiler flag 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. When the -ffcdreg compiler flag is used the compiler will generate an error if -use-extfh is not used. As background, EXTFH makes use of a standardized File Control Description (FCD), through which information passes to and from the EXTFH-compliant data source. An FCD is created for each file that is mapped to an EXTFH-compliantdata source. It can be useful inside a program to directly read and write the FCD. The FCDREG compiler directive was developed for this purpose, and the COBOL-IT implementation of this functionality is the -ffcdreg compiler flag. When you compile with the -ffcdreg compiler flag, a register is created for each [filename] which is named FH--FCD of [filename] . Note that there are two hyphens in the name "FH--FCD" . By describing the FCD structure, and positioning the beginning of the structure at the address of FH-FCD of [filename] , individual elements within the structure can be read and written. The FCD structure is described in a copy file called XFHFCD.CPY , which is included in the $COBOLITDIR\copy directory in Windows, and the $COBOLITDIR/share/config directory on UNIX/Linux-based systems. See below for an example. |
-ffdclear | Causes the record to be INITIALIZE 'd after each WRITE . |
-ffile-auto-external | Default: On This functionality may be disabled using the compiler flag -fno-file-auto-external . However, when disabling this functionality, be aware, that 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. The -ffile-auto-external compiler flag affects the way that the compiler treats variables describing file-names for files described as EXTERNAL . When a file is declared as EXTERNAL , if the file-name is indicated as a variable name, in an ASSIGN DYNAMIC [file-var] clause, then file-var should be declared as EXTERNAL . Note that variables declared as EXTERNAL must be declared as level 01 or level 77. |
-ffold-copy-lower | Folds COPY file names to lower case. |
-ffold-copy-upper | Folds COPY file names to upper case. |
-ffp-opt | Causes COMP-2 operations to be inlined in C, and maximizes the use of the CPU Floating Point unit. |
-ffree-thread-safe-data | When used with -thread-safe , causes the data in a module to be freed after a CANCEL event that is not a FULL-CANCEL .Corresponds to config file setting:free-thread-safe-data: yes |
-ffunctions-all | Allows use of intrinsic functions without the FUNCTION keyword. |
-ffunctions-all-intrinsic | Some functions do not require FUNCTION keyword. |
-fgcc | Generates gcc-compliant C code. This flag is enabled when COB_CC=gcc . Default: off for all platforms except Linux. Default: on for 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. The -fgcc-goto compiler flag is enabled when using the -fgcc compiler flag, or when COB_CC=gcc |
-fgcc-O-bug | When using -O , some versions of gcc generate incorrect code. This bug is avoided by using the -gcc-O-bug compiler flag. |
-fgcos-mode | Causes the compiler to more closely emulate GCOS operations. |
-fgen-xdd | Generate c-TreeACE .xdd file |
-fglobal-typedef | Causes TYPEDEF s to be GLOBAL for all nested programs. If not set, TYPEDEF s are local to the current program. |
-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).To turn off this behavior, use the -fno-ibm-sync compiler flag. The -fno-ibm-sync compiler flag does not cause the SYNC attribute to be applied to a group item if the first elementary field in the group item is described with the SYNC attribute. |
-fimplicit-init | Initializes the COBOL runtime system at runtime start-up. |
-finclude-main | Causes main symbol to be included in module object when compiled with -c . Previously, the compiler generated a wrapper C module <module-name>_main.c with the main symbol that called the first module (.o or .cob ) given as a parameter at the -x command line. The C module was compiled into a .o and stored in a static .a library. Then this library was appended at link time. For new behavior see additional resources below |
-fincomplete-subscript | Affects the behavior of MOVE s to table items. Consider a data item declared as 01 TABLE OCCURS 10 PIC X . Causes the phrase MOVE SPACE TO TABLE to be equivalent to MOVE ALL SPACE TO TABLE . |
-findex-optimize | Improves performance where indexes in tables are evaluated and USAGE DISPLAY fields are used as indexes. In these cases, the index values are cached in a C integer field to improve performance. See Additional Resources for an example |
-finitialize-fd | Causes records declared in the FD section to be initialized when the program is initially loaded in memory. |
-finitialize-opt | Using the -finitialize-opt compiler flag optimizes the implementation of the initial field initialization at runtime startup and the execution of the INITIALIZE statement by grouping field initializations wherever possible. |
-fkeep-copy-statement | In listing and preprocessed file, keep COPY statements. |
-fkeep-org-src-line | For use with the integrated pre-processor ( -preprocess ). Causes errors to be reported on the original source line. |
-fkeep-unused | Causes memory to be allocated for the field tree of level-01 and level-77 data items that are declared which contain sub-fields and in which none of these sub-fields is used. The -fno-keep-unused compiler flag causes memory to not be allocated for the field tree of level-01 and level-77 data items that are declared which contain sub-fields and in which none of these sub-fields are used. |
-fline-seq-dos | Affects the writing of the record delimiter at the end of each record in a line sequential file. When compiling with -fline-seq-dos , the record delimiter is set to <CR><LF> . |
-flink-only | Causes the main ( ) symbol to not be generated, when used with -x . For use when the program entry point (main) is provided by an external object or library. |
-flisting-sources | Informs the compiler that source is the result of program listing option (-t <file> ). |
-floosy-comment | Causes the compiler to allow a * in column 8 to be used to mark a comment. |
-fls-expand-tab | Causes the READ of a LINE SEQUENTIAL file to expand the TAB character to 8 spaces (default). |
-fmain | Generates main () symbol when used with -x (default). |
-fmain-as-object | Generates main () symbol as object not in library (unix only) (default). |
-fmainframe-vb | The -fmainframe-vb compiler flag causes WRITE s and READ s of Variable Blocked files to assume formats compatible with the Mainframe Z/OSbCOBOL Format. |
-fmakesyn-patch-preprocess | Causes the makesyn compiler flag to change the output of a pre-processed file. |
-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. For details on other -f compiler flags related to the treatment of LOCK MODE , see Guidelines for modifying default handling of the LOCK MODE. |
-fmem-info | Enables Dump of Working-Storage when runtime aborts. The -fmem-info compiler flag functionality is enabled by the -g compiler flag, and by the -debug compiler flag. |
-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).Causes COBOL-IT to match certain Micro Focus behaviors. Including: Parsing of line continuation characters, Relaxed syntax check on RECORD CONTAINS phrase in the FD, and Allowing level-66 and level-88 data names to have the same name as a paragraph or section. |
-fmf-ctrl-escaped-parser | Syntax parser is MF compatible with control character escaped by 0 (default). |
-fmf-file-optional | Affects the file-status codes returned on files declared as OPTIONAL and OPEN in EXTEND . The -fmf-file-optional compiler flag 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. The -fmf-file-optional compiler flag improves consistency with Micro Focus behaviors. Alternatively, the runtime returns file-status code 00 in either case. The -fmf-file-optional compiler flag corresponds to setting mf-file-optional:yes in the compiler configuration file. |
-fmf-gnt | Causes shared objects generated by the compiler to be created with the .gnt extension. The generated object IS NOT compatible with the .gnt objects produced by Micro Focus. This option is only used to reduce change in existing compilation scripts by causing object code to be generated with the same extensions |
-fmf-hostnumcompare | Provides compatibility with Micro Focus in cases where the HOST-NUMCOMPARE directive is used. 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. When compiling with -fmf-hostnumcompare , the field containing numeric data is redefined as an alphanumeric item of the same length, and this redefined data item is compared with the non-numeric value of the other numeric data item. When not compiling with -fmf-hostnumcompare (the default), the contents of the field containing numeric data are moved to an intermediate alphanumeric data item that is the same size as the field containing nonnumeric data before the comparison is performed. The content of this intermediate alphanumeric item is then compared to the non-numeric value of the other numeric data item. |
-fmf-int | Causes shared objects generated by the compiler to be created with the .int extension. *The generated object IS NOT compatible with the .int objects produced by Micro Focus. This option is only used to reduce change in existing compilation scripts by causing object code to be generated with the same extensions*. |
-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. When using the -fmf-relativefile compiler flag, the end-of-record marker for relative files is consistent with the setting of the compiler configuration flag line-seq-dos . When line-seq-dos:yes , the end of record setting is CR/LF. When line-seq-dos:no , the end of record setting is LF |
-fmodule-name-entry | Generates source module as alternate entry (default). |
-fmodule-uppercase | Causes the output file name to be created in upper-case, when used with the -m compiler flag. |
-fmove-all-edited | Causes MOVE ALL "X" to an edited field to take care of the PICTURE . Corresponds to configuration file setting:move-all-edited: yes |
-fno-cbl-error-proc | Prevents the execution of CBL_ERROR_PROC .Corresponds to compiler configuration file setting:no-cbl-error-proc: yes |
-fno-realpath | Causes file names to NOT be extended to a fully qualified path. By default, when processing file names, the compiler retrieves the fully qualified path (from the root) and processes the compilation using that extended name. That full name is also stored as the source file name for debugging purposes. |
-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 |
-fnotrunc | Causes truncation of binary fields to NOT be made according to the PICTURE clause while performing intermediate computations. |
-fnull-param | Causes an extra NULL pointers to be passed as the last argument on CALL statements. Note that this option will be disabled by the -fstatic-call option for calls to COBOL programs within the same source module. |
-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. |
-fnumval-validate | The -fnumval compiler flag validates argument 1 of the NUMVAL function. |
-fobj-cit | The -fobj-cit compiler flag causes compiled object to be generated with a .cit extension instead of .dll (windows) or .so (unix/linux). The COBOL-IT runtime recognizes the .cit extension as an executable extension. In a runtime session in which some of the programs have been compiled with the -fobj-cit compiler flag, the runtime, when resolving the names of programs/sub-programs, will search first for programs/sub-programs with the .cit extension. Subsequently, the runtime will search for programs/sub-programs with the .so /.dll extension. In a runtime session in which no programs have been compiled with the -fobj-cit compiler flag, the runtime will search first for programs/sub-programs with the .so /.dll extension. |
-fodo-slide | Affects data items that appear after a variable-length table in the same record; that is, after an item with an OCCURS DEPENDING clause, but not subordinate to it. If the odo-slide compiler flag is set, these items always immediately follow the table, whatever the current size of the table. Note that the internal addresses of these data items change as the table's size changes. If the odo-slide compiler flag is not set, these items have fixed addresses, and begin after the end of the space allocated for the table at its maximum length. The mf.conf configuration file, which contains compiler configuration flags designed to match Micro Focus default behaviours, includes the setting odo-slide : no . |
-foptimize-move | Causes MOVE operations to be optimized by -fmem-info where the source and target fields have identical declarations. (Default is on). |
-foptimize-move-call | Causes MOVE operations to be optimized by pre-selecting the internal runtime library routines used for the MOVE when possible. |
-foptional-file | Causes all SELECT statements that do not specify OPTIONAL or NOT OPTIONAL to be considered OPTIONAL . If the compiler flag is not present or if -fno-optional-file is specified, NOT OPTIONAL is the default value. The implementation of -foptional-file is designed to be compatible with the OPTIONAL-FILE compiler directive supported by other COBOL compilers. |
-fperform-osvs | Enhances compatibility with OSVS COBOL PERFORM statements. The $SET perform type settings of COB370 , ENTCOBOL , OSVS and VSC2 are emulated with the -fperform-osvs compiler flag. The exit point of any currently executing perform is recognized if reached. See Additional Resources for an example. |
-fprepro_cut_line | When preparing a file for preprocessing, cuts line to 72 columns (default). Corresponds to config file setting:prepro_cut_line: yes |
-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). |
-fprofiling | Generates paragraph profiling code. The output produced by the profiler includes separate Counts for CPU and real elapsed times. For more details on using COBOL-IT's built-in Profiler, see the Guidelines for use of Profiler section. |
-fprotect-linkage | Generates code at the entry point of a program containing a USING xxx clause. This allows for the passing of parameters that are NULL pointers. In these cases, where NULL pointers are passed, the compiler creates a "fake" field of the same definition in WORKING-STORAGE , and substitutes it as a reference for the parameter. Doing this will avoid a SIGVEC error if NULL pointers passed through linkage are targets of a READ or WRITE statement. |
-fraw-by-value | CALL BY VALUE [PIC X Fld] does not convert [PIC X Fld] to numeric COMP-5 (default). |
-fraw-pic9-display | (Internal use only) DISPLAY PIC 9(X) (no sign, no decimal) as it is in memory. |
-fread-into-copy | Causes a READ INTO statement to COPY data rather than perform a MOVE . Corresponds to config file setting:read-into-copy: yes |
-fready-trace | The -fready-trace compiler flag enables paragraph tracing between READY TRACE and RESET TRACE procedural COBOL statements. In the interval between the READY TRACE and RESET TRACE statements, paragraph tracing output is written to the console in the format:PROGRAM-ID: [program-id]: [paragraph name] |
-frecmode-f | Causes all unspecified RECORDING MODE clauses to be interpreted as RECORDING MODE F . |
-frecmode-v | Causes all unspecified RECORDING MODE clauses to be interpreted as RECORDING MODE V. |
-frecord-depending-iso | Causes a RECORD DEPENDING ON <FIELD> clause to be handled in an ISO-compatible manner. More specifically, the -frecord-depending-iso compiler flag 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. The -frecord-depending-iso compiler flag corresponds to the record-depending-iso:yes compiler configuration flag. |
-fregion0 | Causes the program to always switch to region 0 when executing. The compiler flag -fregion0 lets you specify that the module will always execute in region 0 even if called from another region. When called from another region, the module will switch to region 0 on entry and switch back to the calling region at exit. |
-frelativefile-bigendian | Causes the record header of relative files to be stored in BigEndian format. |
-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. Nested REPLACE statements are executed before outer REPLACE statements in COBOL-IT's precompile phase. Note that a REPLACE stack can be cleared with the REPLACE OFF statement. |
-freturn-opt | Generates optimized PERFORM return code. The -freturn-opt compiler flag is ignored when using the -fgcc compiler flag. |
-fround-fp | Controls the way 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. If the -fround-fp compiler flag is used, the value is rounded to the number of decimal of the target field. Otherwise, the value is truncated. |
-frw-after-preprocess | Causes SPCRW2 to be run after the -preprocess script. By default SPCRW2 is run before the -preprocess script. |
-frw-mode-nopf | Is equivalent to setting MODE NOPF for a Report Section report. MODE NOPF causes the Report Writer to emulate an external print driver that does not generate printer control characters, like FF. When using the -frw-mode-nopf compiler flag, the report file is written as a standard LINE SEQUENTIAL file. |
-frw-mode-nopf-dos | Is equivalent to setting MODE NOPF for a Report Section report. MODE NOPF causes the Report Writer to emulate an external print driver that does not generate printer control characters, like FF. When using the -frw-mode-nopf-dos compiler flag, the report file is generated with fixed-length lines that are padded with SPACES and use the CR/LF record delimiter. |
-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 avoind a SIGVEC being returned by the debugger when all linkage parameters are not provided. |
-fsequential-line | Causes all non-qualified SEQUENTIAL files to be declared as LINE SEQUENTIAL . Files declared as RECORD SEQUENTIAL are not affected. |
-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 . For details on other -f compiler flags related to the treatment of LOCK MODE , see Guidelines for modifying default handling of the LOCK MODE. |
-fshare-all-default | The -fshare-all-default compiler flag causes all files to be declared implicitly as SHARE WITH ALL . -fshare-all-default may be used in conjunction with: -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 . -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-default should not be used in conjunction with: -fexclusivelock Causes all files with no LOCK MODE clause in their SELECT statement to be declared implicitly as LOCK MODE is EXCLUSIVE . -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.For details on other -f compiler flags related to the treatment of LOCK MODE , see Guidelines for modifying default handling of the LOCK MODE. |
-fshare-all-manulock | Causes all files with a SHARE WITH ALL clause in their SELECT statement to bedeclared implicitly as LOCK MODE IS MANUAL . For details on other -f compiler flags related to the treatment of LOCK MODE , see Guidelines for modifying default handling of the LOCK MODE. |
-fsign-ascii | Corresponds to the SIGN "ASCII" directive. Causes numeric DISPLAY items that include signs to be interpreted according to the ASCII sign convention. (default on ASCII machines). See Additional Resources |
-fsign-ebcdic | Corresponds to the SIGN "EBCDIC" directive. Causes numeric DISPLAY items that include signs to be interpreted according to the EBCDIC sign convention. (default on EBCDIC machines).See Additional Resources |
-fsign-leading | Makes SIGN IS LEADING the default. |
-fsign-separate | Makes SIGN IS SEPARATE the default. |
-fsimple-trace | Generates trace output at runtime for executed SECTION /PARAGRAPH s. |
-fsource-location | Generates source location code, enabling information to be dumped on source location when the runtime aborts. The -fsource-location compiler flag is enabled by the -g compiler flag, and by the -debug compiler flag. |
-fsplit-debug-mark | DEBUG marks respect max 72 characters (default). |
-fstack-check | Enables stack checking debug function. The stack checking debug function allows the user to trace back through the stack of calling programs to the currently running line of source in a program. The -fstack-check compiler flag is enabled by the -g compiler flag, and by the -debug compiler flag. |
-fstatic-call | Causes static C function calls to be generated for the CALL statement. This implies that all CALL 'ed programs are C function that are linked with the current program. When using the -fstatic-call compiler flag, no external dynamic resolution is performed at run-time. |
-fstrict-compare-low | Causes display of numeric variables containing low values not equal to zero or spaces when compared. Corresponds to compiler configuration setting:strict-compare-low: yes |
-fstrict-record-contains | Causes the RECORD CONTAINS clause to be strictly respected. (This is the default.) Note that this compiler flag contains underscores, instead of hyphens. When an FD contains a RECORD CONTAINS xx CHARACTERS clause, such as: RECORD CONTAINS 70 CHARACTERS , but the actual record size described has fewer characters than are named in the clause, COBOL-IT now sends the stated number of characters in the RECORD CONTAINS clause for both MIN-RECORD-SIZE and MAX-RECORD-SIZE . In the case above, when using VBISAM, which does not rely on EXTFH handling, COBOL-IT would detect the smaller actual record size, and pass it through as the MIN-RECORD-SIZE . This behavior increases compatibility with the EXTFH implementation of the c-Tree ISAM file system. If you encounter an EXTFH-compliant file system that requires that the non-EXTFH default behavior described above, then you may compile with the -fno-strict_record_contains compiler flag or set:strict-record-contains:no in the compiler configuration file. |
-fsyntax-only | Performs syntax error checking only. Output is limited to results of syntax check. |
-fthread-safe | Generate thread-safe executables. For more details, see Guidelines on operating in a thread-safe environment. When implementing the COBOL-IT Region Interface, required to provide region isolation. For more details, see Region Interface |
-ftrace | Generates trace output at runtime, listing the SECTION /PARAGRAPH names as they are executed. |
-ftrace-ts | Generates trace code with timestamp (Executed SECTION /PARAGRAPH ). |
-ftrace-upon-sysout | Causes trace output to be written upon SYSOUT . Default is to write trace output upon SYSERR . |
-ftraceall | Generates trace output at runtime, listing SECTION /PARAGRAPH /STATEMENTS names as they are executed. |
-ftrap-unhandled-exception | The -ftrap-unhandled-exception compiler flag is useful in cases where certain EC compiler configuration file flags are set to yes, yet ON EXCEPTION /ON SIZE ERROR /ON OVERFLOW language is not present in the COBOL program. In these cases, using the -ftrap-unhandled-exception compiler flag causes the information made available to the user to be enhanced when the program aborts. See Additional Resources below for example. |
-ftruncate-listing | Causes output of the -t <file> compiler flag to be truncated at column 76. |
-funstring-use-move | The -funstring-use-move compiler flag affects the behavior of the UNSTRING verb. When using the -funstring-use-move compiler flag, if the target of an UNSTRING INTO operation is described as PIC 9 , then the operation will be performed using a MOVE operation instead of raw copy operation. Then rules defined by the move-picx-to-pic9 compiler configuration flag are used for conversion. |
-futf-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. If the -futf-8 compiler flag is used and the -codepage compiler flag is not specified, then -codepage UTF-8 is assumed. |
>cobc -futf-8 <source-file> If, however, you wish to compile your source with another codepage (for example, the LATIN1 codepage), you should explicitly include that codepage declaration. >cobc -futf-8 -codepage latin1 <source-file> |
|
-futf16-le | Causes fields declared as PIC N to be stored as UTF16-LE (Little Endian).By default, fields declared as PIC N are stored as UTF16-BE (Big Endian). Big-Endian refers to a convention for the storage of integers in memory in which the most significant bytes are stored in the bytes with the lower addresses. The integer 256 is stored in Big- Endian format, see Additional Resources below: |
-fvalidate-dep-on | Causes the setting of DEPENDING ON to be set at runtime. Corresponds to compiler configuration file setting:validate-dep-on: yes |
-fvalidate-only | Compiles source, no output produced, EXEC are ignored. |
-fvalue-of-id-priority | Gives priority to the literal or data element named in the VALUE OF FILE-ID clause in the FD, causing the target of the VALUE OF FILE-ID clause in the FD to override the target of the ASSIGN clause for the file. |
-fvalue-size-is-auto | Causes the CALL ..USING BY VALUE :default SIZE IS clause to be set to AUTO (current default is SIZE IS 4 ). |
-fvbisam | Forces use of the VBISAM Extfh indexed file engine. This is the default setting in version 3.x and prior versions of COBOL-IT. However, in the future release of COBOL-IT version 4.x, VBISAM will be deprecated and D-ISAM will become the default. At that time, continued use of VBISAM files will require that the VBISAM Extfh indexed file engine be activated either by using the -vbisam compiler flag, or with the use of the COB_EXTFH=vbisamextfh runtime environment variable setting. |
-fvms-error-handler | Causes the default file error handler to always abort (emulation of VMS behavior).Corresponds to config file setting:vms-error-handler: yes |
-fxparse-event | The -fxparse-event compiler flag causes the XML PARSE statement to generate START-OF-DOCUMENT and END-OF-DOCUMENT XML-EVENTS . |
Additional resources
-fcarealia-sign table
Digit | Sign Digit Character for: | Positively-signed values | Negatively-signed values | -fsign-ascii | -fsign-ebcdic | -fcarealia-sign |
---|---|---|---|---|---|---|
0 | 0(30) | {(7B) | 0(30) | p(70) | }(7D) | 0(30) |
1 | 1(31) | A(41) | 1(31) | q(71) | J(4A) | !(21) |
2 | 2(32) | B(42) | 2(32) | r(72) | K(4B) | "(22) |
3 | 3(33) | C(43) | 3(33) | s(73) | L(4C) | #(23) |
4 | 4(34) | D(44) | 4(34) | t(74) | M(4D) | $(24) |
5 | 5(35) | E(45) | 5(35) | u(75) | N(4E) | %(25) |
6 | 6(36) | F(46) | 6(36) | v(76) | O(4F) | &(26) |
7 | 7(37) | G(47) | 7(37) | w(77) | P(50) | '(27) |
8 | 8(38) | H(48) | 8(38) | x(78) | Q(51) | ((28) |
9 | 9(39) | I(49) | 9(39) | y(79) | R(52) | )(29) |
Example of -ffcdreg:
- Include a reference to the FCD in your Linkage Section, as follows:
LINKAGE SECTION.
01 FCD.
COPY "XFHFCD.CPY".
- Sync the address of FCD with the address of FH-FCD OF FIL1.
PROCEDURE DIVISION.
. . .
SET ADDRESS OF FCD TO ADDRESS OF FH--FCD OF FIL1.
- After performing the
SET
statement above, the fields in `XFHFCD.CPY can be read and written.
Example for -ffile-auto-external:
If [file-var]
is not declared as EXTERNAL
, then the default behavior of the COBOL-IT Compiler is to implicitly declare an external variable name, and assign it a name derived from the FD named in the SELECT
clause.
Consider the statement:
SELECT myfile ASSIGN DYNAMIC file-var...
…
77 file-var pic x(8) value “customer”.
In this case, file-var
is not declared as EXTERNAL
, so COBOL-IT issues the following warning:
file-var
declared implicitly EXTERNAL AS 'FE_file_myfile_ASSIGN'
(-fno-file-auto-external
to disable).
Creating the implicit name based on the file name guarantees that the programmer will be able to give different names to [file-var]
in different programs, and that they will nonetheless share the same value.
If file-var
is declared explicitly as EXTERNAL
, then this condition does not apply.
Example of -finclude-main
new behavior
When compiling with the compiler flag combination -c -finclude-main
, the compiler inserts the main symbol into the object of the first COBOL module named on the command line. When compiling with the compiler flag -x
, and at least one COBOL module has been compiled, the -finclude-main
compiler flag is implied, and no static .a
library is produced. If no COBOL modules are compiled, the previous behavior is used.
Example:
>cobc -c -finclude-main myprog.cob mysub.cob
You may the link the program with:
>cobc -x -flink-only myprog.o mysub.oad
This will generate a myprog executable. No static .a
library is produced, and the main symbol of myprog.o
is used.
Example:
>cobc -x myprog.cob mysub.cob
This will generate a myprog executable. No static .a
library is produced.
Example of -findex-optimize:
Improves performance where indexes in tables are evaluated and USAGE DISPLAY
fields are used as indexes. In these cases, the index values are cached in a C integer field to improve performance.
As an example, consider the usage of the follow code:
…
01 IxdA PIC 999 USAGE DISPLAY.
01 IxdB PIC 999 USAGE DISPLAY.
…
MOVE FLD-ARRAY(IxdA, ixdB) TO …
MOVE FLD-ARRAY(IxdA, ixdB) TO …
IF (FLD-ARRAY(IxdA, ixdB) …
Use of the -findex-optimize
compiler flag will benefit the performance of these MOVE
and IF
statements by keeping the actual value of the index in a binary C cache, thus avoiding conversion from DISPLAY
(or COMP-3
) to a binary value each time the index is evaluated in a statement. The -findex-optimize
flag is enabled by use of the -O
or -O2
compiler flags.
Example for fperform-osvs
PERFORM
statements with the same exit point can be nested to a depth of two (one inner and one outer). If they are nested deeper, they do not return correctly. The end of a section is regarded as a separate point from the end of its last paragraph.
The example below is included to illustrate a possible consequence of using the -fperform-osvs
compiler flag, where an infinite loop results that would otherwise be avoided.
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST-PERFORM.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 SW PIC X VALUE '1'.
01 ABORT-PRG PIC X(3) VALUE 'NO'.
PROCEDURE DIVISION.
BEGIN.
DISPLAY "BEGIN".
PERFORM A THRU A-EX UNTIL ABORT-PRG = 'YES'.
DISPLAY"END".
STOP RUN.
C.
DISPLAY "I AM IN C".
A.
IF SW = '1'
PERFORM D THRU D-EX
ELSE
MOVE 'YES' TO ABORT-PRG.
A-EX.
EXIT.
B.
DISPLAY "I AM IN B".
MOVE '0' TO SW.
GOTO C.
D.
IF SW = '1'
GOTO B.
D-EX.
EXIT.
When not using the -fperform-osvs
compiler flag, , the source above produces the following result:
BEGIN
I AM IN B
I AM IN C
END
As an example, in a case where there is a compiler configuration flag setting of: EC-SIZE:yes
and where this phrase does not contain an ON SIZE ERROR
clause, the program would abort in cases where a SIZE ERROR
was triggered. In combination with -ftrap-unhandled-exception:yes
, all size error events will be captured.
As another example, where there is a compiler configuration flag setting of:
EC-SIZE-ZERO-DIVIDE:yes
In combination with trap-unhandled-exception:yes
, setting EC-SIZE-ZERO-DIVIDE:yes
will capture all division by zero error events if no ON SIZE ERROR
clause is present.
This applies to the following EC-
compiler configuration flags:
EC-IMP-ACCEPT :yes
# For Accept exceptionEC-IMP-DISPLAY :yes
# For Display exceptionEC-SIZE : yes
# For Arithmetic exceptionEC-OVERFLOW : yes
# For String/Unstring exception
Note that all of the EC-
compiler configuration flags can be set to yes using the -debug
compiler flag. You may wish that your error procedure be always called on any exception, and thereby ensure that your server will handle it and not crash. In these cases, you should use the -debug
compiler flag together with the -ftrap-unhandled-exception
flag.
For details on how to install and uninstall error procedures, see the COBOL-IT Library Routines documentation for the CBL_ERROR_PROC
library routine.
CBL_ERROR_PROC
installs or uninstalls an error procedure, which is run when a program-ending error occurs. The Error Routine allows the user to register procedures that will automatically be executed either when a program-ending error occurs.
Example of -futf16-le:
Causes fields declared as PIC N
to be stored as UTF16-LE
(Little Endian).By default, fields declared as PIC N
are stored as UTF16-BE
(Big Endian). Big-Endian refers to a convention for the storage of integers in memory in which the most significant bytes are stored in the bytes with the lower addresses. The integer 256 is stored in Big- Endian format, as follows:
00000001 00000000.
Little-Endian refers to a convention of or the storage of integers in memory in which the least significant bytes are stored in the bytes with the lower addresses. The integer 256 is stored in Little-Endian format, as follows:
00000000 00000001.
"Endianness" is determined by the Processor of your computer. A simple rule of thumb is that if you have an x86 processor, your platform has alittle-endian data storage convention. Otherwise, you most likely have a a big-endian data storage convention. Check with your system administrator if you have any questions.
Used in conjunction with the compiler configuration file setting:
ls-utf16: yes