Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Compiling from the command line

Issue the command cob2 to compile a COBOL program from the command line. (The cob2 command also invokes the linker.)

cob2 command syntax
Read syntax diagramSkip visual syntax diagram>>-cob2--+---------+--filenames--------------------------------><
         '-options-'             
 

To compile multiple files, specify the file-names at any position in the command line, using spaces to separate options and file-names. For example, the following two commands are equivalent:

cob2 -g filea.cbl fileb.cbl -v -qflag(w)
cob2 filea.cbl -qflag(w) -g -v fileb.cbl

cob2 accepts compiler and linker options in any order on the command line. Any options that you specify apply to all files on the command line. You do not need to capitalize cob2 and its options.

cob2 passes files with certain extensions (such as .cbl) to the compiler and passes all other files to the linker.

The default location for compiler input and output is the current directory.

Examples: using cob2 for compiling

related tasks
Linking programs

related references
File names and extensions supported by cob2
cob2 options
Compiler options


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)