In the POSIX shell you can use the cobol command to invoke the COBOL2000 compiler and pass it control options.
Command-line syntax
cobol 'BLANK'option'BLANK' ... input-file'BLANK' ...
Input rules
Options and input files may be specified in any order.
Options without arguments (e.g.
-c, -v, -g
) may be grouped together (e.g.-cvg
).An option (such as
-C
) and its arguments must not be grouped in this way. There must always be a blank ( 'BLANK' ) between the option and the argument (e.g.-C EXPAND-COPY=YES
).The following options may appear more than once in the command line:
-C, -k, -L, -P, -l
All other options are only allowed once. If one of these options is specified more than once, the last instance in the command line will apply.
Options that are unknown to the compiler, i.e. which begin with an unknown character after the hyphen (“-”), are passed through to the linkage editor cobld. If a blank appears between the unknown option and an argument, the option is interpreted as one without an argument and passed accordingly.
By default, i.e. if the -c
option is not used to terminate the compiler run after compilation and if the program compiled without serious errors, a linkage run with the linkage editor cobld automatically follows compilation.
The options for controlling the compilation and linkage run are described below.