Pro*COBOL Precompiler for Windows NT and Windows 95/98
Getting Started 
A67993-01

Library

Product

Contents

Index

PrevNext

2
Using Pro*COBOL

This chapter provides an overview of how to use Pro*COBOL release 8.1.5 and 1.8.50 for Windows NT and Windows 95/98.

Specific topics discussed are:

Directory Structure

When you install Pro*COBOL release 8.1.5, Oracle Universal Installer creates a directory called \PRECOMP in your ORACLE_BASE\ORACLE_HOME directory.
 


Note:

The \PRECOMP directory can contain files for other products, such as Pro*C/C++. 


The \PRECOMP directory contains the following directories:

Directory Name Contents

\ADMIN 

Configuration files 

\DEMO 

Sample programs 

    \PROCOB2

    for Pro*COBOL 8.1.5

    \PROCOB

    for Pro*COBOL 1.8.50

\DOC 

Readme files 

    \PROCOB2

    for Pro*COBOL 8.1.5

    \PROCOB

    for Pro*COBOL 1.8.50

\LIB 

Library files 

\MESG 

Message files 

\PUBLIC 

Header files 

The Pro*COBOL Commands

Use the following commands to precompile a file:
Use . . . For Pro*COBOL Release . . .

PROCOB FILENAME

8.1.5 

PROCOB18 FILENAME

1.8.50 

By default, if no extension is provided, Pro*COBOL tries to open FILENAME.PCO.

If you do not specify the ONAME option, Pro*COBOL generates a file named FILENAME.CBL.

Header Files

The ORACLE_BASE\ORACLE_HOME\PRECOMP\PUBLIC directory contains the Pro*COBOL header files.
 

Additional Information:

See the Pro*COBOL Precompiler Programmer's Guide for more information about ORACA, SQLCA, and SQLDA. 


Header File Description

ORACA.COB 

Contains the Oracle Communications Area (ORACA), which helps you to diagnose runtime errors and to monitor your program's use of various Oracle8 resources. 

ORACA5.COB 

ORACA5 is the COMP-5 version of ORACA. 

SQLCA.COB 

Contains the SQL Communications Area (SQLCA), which helps you to diagnose runtime errors. The SQLCA is updated after every executable SQL statement. 

SQLCA5.COB 

SQLCA5 is the COMP-5 version of SQLCA. 

SQLDA.COB 

Contains the SQL Descriptor Area (SQLDA), which is a data structure required for programs that use dynamic SQL Method 4. 

SQLDA5.COB 

This is the COMP-5 version of SQLDA. 

Library File

The ORACLE_BASE\ORACLE_HOME\PRECOMP\LIB directory contains the library file that you use when linking Pro*COBOL applications.

The library file is called ORASQL8.LIB.

Precompiler Options

Chapter 7 of the Pro*COBOL Precompiler Programmer's Guide describes the precompiler options. This section highlights issues related to Pro*COBOL for Windows NT and Windows 95/98.

Configuration File

A configuration file is a text file that contains precompiler options.

For release 8.1.5, the system configuration file is called PCBCFG.CFG. This file is located in the ORACLE_BASE\ORACLE_HOME\PRECOMP\ADMIN directory. It has the following option:

For release 1.8.50, the system configuration file is called PCCCOB.CFG This file is located in ORACLE_BASE\ORACLE_HOME\PRECOMP\ADMIN.

See the following section, "COMP5", for more information about this option.

COMP5

The following table describes how to set the value of COMP5:

If you are using Fujitsu COBOL... If you are using Micro Focus COBOL...

COMP5 must be set to YES:

  • All COMP data items (if they are potential host variables) are converted to COMP-5.
  • All data items generated by the precompiler are declared as COMP-5.

  •  

     

 

COMP5 can be set to YES or NO.

If COMP5=YES:

  • All COMP data items (if they are potential host variables) are converted to COMP-5.
  • All data items generated by the precompiler are declared as COMP-5.

  •  

     

If COMP5=NO:

  • The precompiler ignores COMP-5 host variables.
  • Precompiled files generally do not run on Intel platforms.

  •  

     

Workaround: During the compilation stage, use the Micro Focus COBOL compiler directive:

MAKESYN "COMP-5" = "COMP"

This statement directs the compiler to treat COMP items as if they are COMP-5 items. 

MAXLITERAL (Fujitsu COBOL)

If you are using the Fujitsu COBOL compiler, set the MAXLITERAL option to 160. The Fujitsu COBOL compiler cannot handle string literals that are longer than 160 characters.

You can set this option in a configuration file as well as at the command line.

The default value of the MAXLITERAL option is 256.

Compiling and Linking Pro*COBOL Applications

This section describes how to compile and link Pro*COBOL applications using the following compilers:

Fujitsu COBOL

You can compile and link a Fujitsu COBOL application in either of two ways:

Using Fujitsu COBOL PROGRAMMING-STAFF

Programs generated by Pro*COBOL can be compiled and run from within Fujitsu COBOL PROGRAMMING-STAFF.

To avoid potential inconsistencies when calling routines in the Oracle libraries, use the "COMP5YES" option. This step is required because binary numbers for COBOL BINARY/COMP data are stored in Big Endian format. Oracle libraries expect binary numbers to be stored in Little Endian format (machine format).

The compiler option "TEST" must be selected when the COBOL application is compiled.

When you click Build/Rebuild, PROGRAMMING-STAFF generates the executable and WINSVD debug information.

After building the application, you can debug the application using the Interactive Debugger WINSVD. To start WINSVD, choose WINSVD from the Tools menu of PROGRAMMING-STAFF.

Using the COBOL32 and LINK Commands

For release 8.1.5, use the following commands to build an executable:

C:\> COBOL32 -M FILENAME.CBL
C:\> LINK FILENAME.OBJ F3BICIMP.LIB LIBC.LIB KERNEL32.LIB USER32.LIB
/OUT:FILENAME.EXE ORACLE_BASE\ORACLE_HOME\PRECOMP\LIB\ORASQL8.LIB

These commands produce an .EXE file, which you can run like any other Windows NT or Windows 95/98 program.

For release 1.8.50, the following commands can be used to build an executable:

COBOL32 -M sample1.cbl
LINK sample1.obj f3bicimp.lib libc.lib kernel32.lib user32.lib
/out:sample1.exe ORACLE_BASE\ORACLE_HOME\PRECOMP\LIB\ORASQL8.LIB

Use the following commands to build an executable for debugging:

C:\> COBOL32 -M -Dt FILENAME.CBL
C:\> LINK FILENAME.OBJ F3BICIMP.LIB LIBC.LIB KERNEL32.LIB USER32.LIB
/OUT:FILENAME.EXE ORACLE_BASE\ORACLE_HOME\PRECOMP\LIB\ORASQL8.LIB
/DEBUG /DEBUGTYPE:COFF

These commands produce an .EXE file, as well as WINSVD debug information. You can debug the application using the Interactive Debugger WINSVD.

For release 1.8.50, the following commands can be used to build an executable for debugging:

COBOL32 -M -Dt sample1.cbl
LINK sample1.obj f3bicimp.lib libc.lib kernel32.lib user32.lib
/out:sample1.exe ORACLE_BASE\ORACLE_HOME\PRECOMP\LIB\ORASQL8.LIB /DEBUG 
/DEBUGTYPE:COFF

Micro Focus COBOL

You can compile and link a Micro Focus COBOL application in either of two ways:

Using Animator

Programs can be compiled and run from within the Micro Focus COBOL debugger, Animator V2.

To avoid potential inconsistencies when calling routines in the Oracle libraries, choose the Compiler Directives menu option and enter:

MAKESYN "COMP-5" = "COMP"

This step is required because Micro Focus COBOL stores binary numbers in Big Endian format. Oracle libraries expect binary numbers to be stored in Little Endian format (machine format).

Using the COBOL and CBLLINK Commands

By default, Micro Focus COBOL subprograms are compiled to be dynamically linked at runtime. In these programs, called subprograms, names are resolved and linked at runtime. The name is resolved by looking for the file SUBPROGRAM.OBJ or SUBPROGRAM.DLL.

For release 8.1.5, use the following commands to build a dynamic linking executable:

C:\> COBOL FILENAME /MAKESYN "COMP-5" = "COMP"
C:\> CBLLINK FILENAME ORACLE_BASE\ORACLE_HOME\PRECOMP\LIB\ORASQL8.LIB

For release 1.8.50, the following commands can be used to build a dynamic linking executable:

COBOL sample1 /MAKESYN "COMP-5" = "COMP"

CBLLINK sample1 ORACLE_BASE\ORACLE_HOME\PRECOMP\LIB\ORASQL8.LIB

These commands produce an .EXE file, which you can run like any other Windows NT or Windows 95/98 program.
 


Note:

Micro Focus COBOL must be installed on the same system as Pro*COBOL to successfully run the file. 



Prev Next
Oracle
Copyright © 1999 Oracle Corporation.
All Rights Reserved.
Library Product Contents Index