HPlogo ALLBASE/SQL C Application Programming Guide: HP 3000 MPE/iX Computer Systems > Chapter 2 Using the Preprocessor

Identifying Preprocessor Input

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

In the simplest case, illustrated earlier in Figure 1-1, the ALLBASE/SQL C program consists of one source code file and, optionally, one or more user include files; both the source code and the include files can contain SQL commands. The preprocessor merges any include files into the source program, and preprocesses it. The resulting modified source code file is then compiled and linked in the same manner as a C program not containing embedded SQL statements. (Include files must either exist in the current group or be specified with an account and group name.)

Regardless of the preprocessing mode you use, the source file and the ALLBASE/SQL message catalog must be available when you invoke the C preprocessor, as shown in Figure 2-5.

Source File

The source file is a file containing the source code of the C ALLBASE/SQL program with embedded SQL commands for one or more DBEnvironments. The default input filename is:

   SQLIN

An alternative name can be specified by using the DROP option in the preprocessor command line, as explained earlier in this chapter.

When parsing the source file, the C preprocessor ignores most C statements and C compiler directives in it. Only the following information is parsed by the C preprocessor:

  • The C compiler directive, include.

  • The source file name. Unless you specify a module name in the preprocessor command line, the preprocessor uses the source file name as the name for the module it stores. A module name can contain as many as 8 bytes and must follow the rules governing ALLBASE/SQL basic names (given in the ALLBASE/SQL Reference Manual).

  • Constructs found between the prefix EXEC SQL and the suffix ;. These constructs follow the rules given in Chapter 1 for how and where to embed these constructs.

  • Constructs found between the BEGIN DECLARE SECTION and END DECLARE SECTION commands. These commands delimit a declare section, which contains C data declarations for the host variables used in the program. Host variables are described in Chapter 3.

ALLBASE/SQL Message Catalog

The ALLBASE/SQL message catalog, contains preprocessor messages and ALLBASE/SQL error and warning messages. The fully qualified name for the default message catalog is:

   SQLCT000.PUB.SYS

For native language users, the name of the catalog is:

   SQLCTxxx.PUB.SYS

where xxx is the numerical value for the current language. If this catalog is not available, ALLBASE/SQL issues a warning and uses the default catalog instead.

When you run the preprocessor in full preprocessing mode, also ensure that the DBEnvironment accessed by the program is available.

Figure 2-5 Full Preprocessing Mode Input and Output

[Full Preprocessing Mode Input and Output]