HPlogo ALLBASE/SQL COBOL Application Programming Guide: HP 9000 Computer Systems

Chapter 1 Getting Started with ALLBASE/SQL Programming in COBOL

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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

Figure 1-1 Creating an ALLBASE/SQL COBOL Application Program

[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.

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 copy files, which contain declarations of variables and constants used by the preprocessor-generated COBOL statements.

You use the COBOL compiler to create either intermediate code or executable code from the modified source code file and the two copy files. The Runtime System makes the appropriate database accesses at run time in the DBEnvironment where the stored module resides.