Oracle7 Administrator's Reference for UNIX

Contents Index Home Previous Next

Pro*COBOL

Administering Pro*COBOL

For each supported COBOL compiler, the demonstration program is usually in $ORACLE_HOME/procob/lib/lpi_cobol and the makefile in $ORACLE_HOME/procob/lib/mf_cobol.

See Also: Chapter 3, "Oracle7 Interfaces", in the Oracle7 Reference Addendum for your platform for the default location of these files.

Pro*COBOL may support more than one COBOL vendor for your operating system. If more than one vendor is supported, you receive a message during installation asking you to select a COBOL vendor. The custom procob.mk for the selected vendor is copied to $ORACLE_HOME/precomp/demo/procob.

Using Pro*COBOL

On UNIX platforms, both dynamic and static linking with Pro*COBOL programs are supported. Dynamic linking uses the COBOL runtime system, to create the rtsora executable. Check your procob.mk file for details about this procedure, and the Oracle7 Installation Guide for your platform to determine if your platform supports dynamic or static linking.

The $ORACLE_HOME/precomp/demo/procob directory contains the sample1 sample COBOL program. Before running this program, use the demobld.sql file to build a demonstration database, as described in Chapter 7, "SQL*Plus".

To precompile, compile, and link the program with dynamic linking, enter:

$ make -f procob.mk sample1.gnt

To run the program, enter:

$ rtsora sample1.gnt

Note: Some systems use filename extension .int instead of .gnt.

To precompile, compile and link the program with static linking, enter:

$ make -f procob.mk sample1

To run the program, enter:

$ sample1

Building Pro*COBOL Programs

You can build your own Pro*COBOL programs with procob.mk. For example, to precompile, compile, and link the userprog.pco program, enter:

$ make -f procob.mk userprog.gnt

To run the program, enter:

$ rtsora userprog.gnt

The resulting executable is named userprog.gnt.

Note: If your program depends on non-Oracle libraries, you may have to alter procob.mk to include them.

To precompile, compile and link this program with static linking, enter:

$ make -f procob.mk userprog

To run this program, enter:

$ userprog

The FORMAT precompiler option specifies the format of input lines for COBOL. If you specify FORMAT=ANSI, the default, columns 1 to 6 contain an optional sequence number, column 7 indicates comments or continuation lines, paragraph names begin in columns 8 to 11, and statements begin in columns 12 to 72.

If you specify FORMAT=TERMINAL, columns 1 to 6 are dropped, making column 7 the leftmost column.

Pro*COBOL user exits are not supported on all platforms. Refer to the Oracle7 Installation Guide for your platform and README.doc file for supported user exits. If Pro*COBOL user exits are supported, use the procobxt.mk makefile to create your Pro*COBOL user exit.

Note: When using Pro*COBOL user exits, Oracle Corporation recommends you specify the SQL*Net version 2 connect alias and the username.


Contents Index Home Previous Next