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

Library

Product

Contents

Index

PrevNext

3
Sample Programs

This chapter describes the sample programs that are provided with Pro*COBOL release 8.1.5 and release 1.8.50 for Windows NT and Windows 95/98.

Specific topics discussed are:

Sample Program Descriptions

The ORACLE_BASE\ORACLE_HOME\PRECOMP\DEMO\PROCOB2 directory (for release 8.1.5, ORACLE_BASE\ORACLE_HOME\PRECOMP\DEMO\PROCOB for 1.8.50) contains the following sample programs:

Sample Program Description

SAMPLE1.PCO 

Simple query 

SAMPLE2.PCO 

Cursor operations 

SAMPLE3.PCO 

Host tables 

SAMPLE4.PCO 

Datatype equivalence 

SAMPLE6.PCO 

Dynamic SQL Method 1 

SAMPLE7.PCO 

Dynamic SQL Method 2 

SAMPLE8.PCO 

Dynamic SQL Method 3 

SAMPLE9.PCO
CALLDEMO.SQL 

Stored procedure call 

SAMPLE10.PCO 

Dynamic SQL Method 4 

SAMPLE11.PCO
SAMPLE11.SQL 

Cursor variable operations 

SAMPLE12.PCO 

Dynamic SQL Method 4 using ANSI dynamic SQL 

SAMPLE13.PCO 

Nested program 

SAMPLECO.PCO 

Simple query and insert 

SAMPLE14.PCO 

Host table x (release 8.1.5 only) 

LOBDEMO1.PCO 

LOB datatypes (release 8.1.5 only) 

LOBDEMO1.SQL 

LOB datatypes (release 8.1.5 only) 

Building the Sample Tables

To run the sample programs, you must have a database account with the user name SCOTT and the password TIGER. If no such account exists on your database, create one before running the sample programs.

The SCOTT account must contain the DEPT and EMP tables. If the SCOTT account does not contain these tables, use the DEMOBLD.SQL script to create them.

To build the sample tables:

  1. Start SQL*Plus:
  2. C:\> SQLPLUS
  3. Connect as user name SCOTT with the password TIGER:
  4. Enter user-name: SCOTT/TIGER
  5. Run the DEMOBLD.SQL script:
  6. SQL> @ORACLE_BASE\ORACLE_HOME\DBS\DEMOBLD.SQL;

If you encounter errors, ensure that all paths and file names reflect the configuration of your system. The commands to run the sample programs assume that the ORACLE_BASE\ORACLE_HOME\PRECOMP\DEMO\PROCOB2 directory (for release 8.1.5, and the ORACLE_BASE\ORACLE_HOME\PRECOMP\DEMO\PROCOB directory (for release 1.8.50) is the current working directory. You may need to modify the sample link script to reflect the configuration of your system. See "Compiling and Linking Pro*COBOL Applications" in Chapter 2 for more information.

Building the Sample Programs

Pro*COBOL supplies batch files that precompile, compile, and link the sample programs.

Fujitsu COBOL

The sample directories for release 8.1.5 and release 1.8.50 contain a batch file called FJMAKEIT.BAT. This batch file does the following:

C:\> PROCOB INAME=FILENAME.PCO IRECLEN=132 MAXLITERAL=160
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

For release 1.8.50, this batch file does the following:

procob18 iname=%1.pco ireclen=132 maxliteral=160
cobol32 -M %1.cbl
link %1.obj f3bicimp.lib libc.lib kernel32.lib user32.lib
/out:%1.exe ORACLE_BASE\ORACLE_HOME\PRECOMP\LIB\ORASQL8.LIB

To build the sample programs, run FJMAKEIT.BAT with any sample file. Do not provide the file extension. For example:

FJMAKEIT SAMPLE1

Micro Focus COBOL

Before building the sample programs, ensure that you have an appropriate COBOL program installed on your system.

The sample directories for release 8.1.5 and release 1.8.50 contain a batch file called MAKEIT.BAT. This batch file does the following:

C:\> PROCOB INAME=FILENAME.PCO IRECLEN=132
C:\> COBOL FILENAME /GANIM /LITLINK MAKESYN "COMP-5" = "COMP";
C:\> CBLLINK FILENAME /MFILENAME ORACLE_BASE\ORACLE_HOME\PRECOMP\LIB\ORASQL8.LIB

For release 1.8.50, this batch file does the following:

procob18 iname=%1.pco ireclen=132
cobol %1 /ganim /litlink makesyn "COMP-5" = "COMP";
cbllink %1 /M%1 ORACLE_BASE\ORACLE_HOME\PRECOMP\LIB\ORASQL8.LIB

To build the sample programs, run MAKEIT.BAT with any sample file. Do not provide the file extension. For example:

MAKEIT SAMPLE1

Prev Next
Oracle
Copyright © 1999 Oracle Corporation.
All Rights Reserved.

Library

Product

Contents

Index