HP 3000 Manuals

Ch 1. Getting Started with ALLBASE/SQL Programming in COBOL [ ALLBASE/SQL COBOL Application Programming Guide ] MPE/iX 5.0 Documentation


ALLBASE/SQL COBOL Application Programming Guide

Chapter 1  Getting Started with ALLBASE/SQL Programming in COBOL 

The steps in creating a COBOL application program that accesses an
ALLBASE/SQL relational database environment (DBEnvironment) are
summarized in Figure 1-1.

	       Click here to view figure.
          Figure 1-1.  Creating an ALLBASE/SQL COBOL Application Program 

Using your favorite editor, you create COBOL source code.  The source
code is a compilable COBOL program or subprogram that contains SQL
commands.  The SQL commands contained within the COBOL program are said
to be embedded.  Refer to the ALLBASE/SQL Reference Manual for SQL
terminology and usage rules.  Material in this manual presumes a basic
understanding of information in that manual.

Before compiling the source code, you must preprocess it with the
ALLBASE/SQL COBOL preprocessor.  The preprocessor:

   *   Checks the syntax of the SQL commands.

   *   Stores a module in the system catalog of the DBEnvironment to be
       accessed at run time.  A module consists of ALLBASE/SQL
       instructions for executing SQL commands in your program.

   *   Creates an installable module file.  This file contains a copy of
       the module stored in the DBEnvironment at preprocessing time.  You
       can use this file to install the module into another DBEnvironment
       so that the application program can be run in that DBEnvironment. 

   *   Generates COBOL statements for executing the SQL commands and
       comments out the SQL commands.  Non-SQL statements are ignored.
       This modified version of your source code is placed in a file
       created by the preprocessor, referred to as a modified source code 
       file. 

   *   Creates two include files, which contain declarations of variables
       and constants used by the preprocessor generated COBOL statements. 

You use the COBOL compiler and system linker to create the executable 
program from the modified source code file and the two include files.
The executable program makes the appropriate database accesses at run
time in the DBEnvironment where the stored module resides. 



MPE/iX 5.0 Documentation