HPlogo ALLBASE/SQL FORTRAN Application Programming Guide: HP 3000 MPE/iX Computer Systems

Chapter 2 Using The ALLBASE/SQL FORTRAN Preprocessor

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

ALLBASE/SQL FORTRAN application programs have the same stages of development as any application program. They originate as FORTRAN source code files that are subsequently compiled with the FORTRAN compiler and linked by the system linker to create an executable program file. The development of ALLBASE/SQL programs, however, requires that you preprocess those portions of the program that contain SQL commands before compilation.

In the case illustrated in Title not available, the ALLBASE/SQL FORTRAN program consists of one source file and one user include file. The preprocessor merges any user include file into the source program, and preprocesses it. The result is a modified source code file and a preprocessor generated include file. This preprocessor include file contains all of the definitions of variables used by any FORTRAN statements in the modified source code file. These two files are then compiled to produce an object code module, and linked to produce an executable program file, in the same manner as any other FORTRAN program.

Figure 2-1 Developing a FORTRAN Program

[Developing a FORTRAN Program]

In other cases, the ALLBASE/SQL application program might consist of a main program unit and one or more subprogram units in separate files. In these cases, only source files containing embedded SQL code need to be preprocessed, as illustrated in Title not available. However, each program unit which contains SQL commands must be preprocessed and compiled before the next program unit is preprocessed. Separately preprocessed program units that are not immediately compiled will write over each other's preprocessor created include file and consequently create an error when compiled. You invoke the FORTRAN preprocessor and compiler as many times as necessary to create the desired number of object code modules.

Figure 2-2 Developing a FORTRAN Program with Subprograms

[Developing a FORTRAN Program with Subprograms]

During preprocessing, the FORTRAN preprocessor actually accesses the same DBEnvironment to be used by your main program or subprogram unit at runtime. The preprocessor stores a module in the DBEnvironment which is executed at runtime. The module is used at runtime to optimize and validate DBEnvironment operations.