The options listed below apply to all of the invocation commands: cob2, cob2_j, and cob2_r.
The default is -comprc_ok=4.
The -host option changes the format of COBOL program command-line arguments from an array of pointers to an EBCDIC character string that has a halfword prefix that contains the string length. For additional information, see the related task below about using command-line arguments.
If you use the -host option and want a main routine in a C or PL/I object file to be the main entry point of your application, you must use the -cmain linker option as described below.
Only a single path is allowed for each -I option. To add multiple paths, use multiple -I options. Do not insert spaces between -I and xxx.
If you use the COPY statement, you must ensure that the LIB compiler option is in effect.
If a parenthesis is part of the compiler option or suboption, or if a series of options is specified, include them in quotation marks.
To specify multiple options, delimit each option by a blank or comma. For example, the following two option strings are equivalent:
-qoptiona,optionb
-q"optiona optionb"
If you plan to use a shell script to automate your cob2 tasks, a special syntax is provided for the -qxxx option. For details, see the related task about compiling using shell scripts.
If you link a C or PL/I object file that contains a main routine with one or more COBOL object files, you must use -cmain to designate the C or PL/I routine as the main entry point. A COBOL program cannot be the main entry point in an executable file that contains a C or PL/I main routine. Unpredictable behavior occurs if this is attempted, and no diagnostics are issued.
If -main is not specified, the first object, archive library, or source file specified in the command is the first file in the list of files passed to the linker.
If the syntax of -main:xxx is invalid, or if xxx is not the name of an object or source file processed by the command, the command terminates.
related tasks
Compiling from the command line
Compiling using shell scripts
Passing options to the linker
Using command-line arguments
related references
Compiler environment variables
ADDR