The Preprocessor and Application Development [ ALLBASE/SQL COBOL Application Programming Guide ] MPE/iX 5.0 Documentation
ALLBASE/SQL COBOL Application Programming Guide
The Preprocessor and Application Development
COBOL ALLBASE/SQL application development involves the following steps:
* Preprocess those programs in the application that contain SQL
commands.
* Compile the preprocessed (modified) source code as well as any
source code not requiring preprocessing.
* Run the resulting code (either intermediate or executable), as
discussed in the preceding chapter.
In the simplest case, the ALLBASE/SQL COBOL application is derived from
one source file. In other cases, the ALLBASE/SQL COBOL application might
consist of a source file main program and one or more source file
subprograms. These source files may or may not contain SQL code. Only
source files containing SQL code need to be preprocessed, as illustrated
in Figure 2-1.
Figure 2-1. Developing a COBOL ALLBASE/SQL Program with Subprograms
During preprocessing, the COBOL preprocessor actually accesses the same
DBEnvironment to be used by your program at run time. The preprocessor
stores a module in the DBEnvironment which is executed at run time. The
module is used at run time to optimize and validate DBEnvironment
operations.
During any invocation, the COBOL preprocessor can access only one
DBEnvironment. You can create separate subprograms that all access the
same DBEnvironment. Each subprogram is separately preprocessed and
compiled. In this case, the preprocessor stores multiple modules in one
DBEnvironment.
The criteria governing the division of an application program into
subprograms is very application-dependent. As in the development of any
application program, factors such as program size, program complexity,
expected recompilation frequency, and number of programmers affect how a
program is subdivided. In the case of ALLBASE/SQL COBOL application
programs, the following factors should also be noted:
* All code containing embedded SQL commands must be preprocessed.
* The preprocessor can access only one DBEnvironment at a time.
* Each program or subprogram (preprocessed unit) that accesses the
same DBEnvironment must have a unique OwnerName.ModuleName.
* The preprocessor can process only one program or subprogram per
invocation.
MPE/iX 5.0 Documentation