The following examples illustrate the use of cob2.
cob2 -c alpha.cbl
The compiled file is named alpha.o.
cob2 -c alpha.cbl beta.cbl
The compiled files are named alpha.o and beta.o.
cob2 alpha.cbl beta.cbl -o gamma
This command creates alpha.o and beta.o, then links alpha.o, beta.o, and the COBOL libraries. If the link step is successful, it produces an executable program named gamma.
cob2 -qlist,noadata alpha.cbl