Was this helpful?
Generating an Executable Program
Once you have written your EQUEL program, it must be preprocessed to convert the EQUEL statements into Pascal code. This section describes the use of the EQUEL preprocessor. Additionally, it describes how to compile and link the resulting code to obtain an executable file.
The EQUEL Preprocessor Command
The Pascal preprocessor is invoked by the following command line:
eqp {flags} {filename}
where flags are
-d
Adds debugging information to the runtime database error messages generated by EQUEL. The source file name, line number, and the erroneous statement itself are printed with the error message.
-f[filename]
Writes preprocessor output to the named file. If the -f flag is specified without a filename, the output is sent to standard output, one screen at a time. If the -f flag is omitted, output is given the basename of the input file, suffixed ".pas".
-l
Writes preprocessor error messages to the preprocessor's listing file, as well as to the terminal. The listing file includes preprocessor error messages and your source text in a file named filename.lis, where filename is the name of the input file.
-lo
Like -l, but the generated Pascal code also appears in the listing file
-n. ext
Specifies the extension used for filenames in ## include and ## include inline statements in the source code. If -n is omitted, include filenames in the source code must be given the extension ".qp".
-o
Directs the preprocessor not to generate output files for include files.
This flag does not affect the translated include statements in the main program. The preprocessor will generate a default extension for the translated include files statements unless you use the -o.ext flag.
-o. ext
Specifies the extension given by the preprocessor to both the translated include statements in the main program and the generated output files. If this flag is not provided, the default extension is ".pas".
If you use this flag in combination with the -o flag, then the preprocessor generates the specified extension for the translated include statements, but does not generate new output files for the include statements.
-s
Reads input from standard input and generates Pascal code to standard output. This is useful for testing statements you are not familiar with. If the -l option is specified with this flag, the listing file is called "stdin.lis". Type Ctrl Z to terminate the interactive session.
-w
Prints warning messages
-?
Shows the available command line options for eqp
The EQUEL/Pascal preprocessor assumes that input files are named with the extension ".qp". This default can be overridden by specifying the file extension of the input file(s) on the command line. The output of the preprocessor is a file of generated Pascal statements with the same name and the extension ".pas".
If you enter the command without specifying any flags or a filename, Ingres displays a list of flags available for the command.
The following table presents the options available with eqp.
Eqp Command Examples
The following are examples of eqp commands:
eqp file1
Preprocesses "file1.qp" to "file1.pas"
eqp -l file2.xp
Preprocesses "file2.xp" to "file2.pas" and creates listing "file2.lis"
eqp -s
Accepts input from standard input and writes generated code to standard output
eqp -ffile4.out file4
Preprocesses "file4.qp" to "file4.out"
eqp
Displays a list of flags available for this command
The Pascal Compiler
As mentioned above, the preprocessor generates Pascal code. You should use the VMS Pascal command to compile this code. Most of the Pascal command line options can be used. You must not use the g_floating qualifier if real variables in the file are interacting with Ingres floating-point objects. You should also not use the old_version qualifier, because the preprocessor generates code for Version 3. Note, too, that many of the statements that the EQUEL/Pascal preprocessor generates are nonstandard extensions provided by VAX/VMS. Consequently, you should not use the standard qualifier.
The following example preprocesses and compiles the file "test1." Note that both the EQUEL/Pascal preprocessor and the Pascal compiler assume the default extensions:
$ eqp test1
$ Pascal/list test1
Installing the EQUEL/Pascal Environment File
As explained in The Inherit Attribute, EQUEL/Pascal programs can inherit the EQUEL/Pascal declarations from an environment file, as an alternative to the declare statement. If the program specifies this alternative, the preprocessor will generate an "Inherit" attribute referencing this environment file. The file is named "eqenv.pen" and is located in the Ingres files directory, which, by default, is "ii_system:[ingres.files]".
Before using the environment file, you should ensure that your System Administrator has installed it, using the following sequence of operating system commands:
$ set def ii_system:[ingres.files]
$ eqp eqenv
$ Pascal eqenv
$ delete eqenv.pas;*, eqenv.obj;*
Note:  Check the Readme file for any operating system specific information on compiling and linking EQUEL/Pascal programs.
Linking an EQUEL Program
EQUEL programs require procedures from several VMS shared libraries in order to run properly. Once you have preprocessed and compiled an EQUEL program, you can link it. Assuming the object file for your program is called "dbentry," use the following link command:
$ link dbentry.obj,-
  ii_system:[ingres.files]equel.opt/opt
It is recommended that you do not explicitly link in the libraries referenced in the EQUEL.OPT file. The members of these libraries change with different releases of Ingres. Consequently, you may be required to change your link command files in order to link your EQUEL programs.
Assembling and Linking Precompiled Forms
The technique of declaring a precompiled form to the FRS is discussed in the QUEL Reference Guide. To use such a form in your program, you must also follow the steps described here.
In VIFRED, you can select a menu item to compile a form. When you do this, VIFRED creates a file in your directory describing the form in the VAX-11 MACRO language. VIFRED lets you select the name for the file. After you have created the MACRO file this way, you can assemble it into linkable object code with the VMS command
macro filename
The output of this command is a file with the extension ".obj". You then link this object file with your program (in this case named "formentry" by listing it in the link command, as in the following example:
$ link formentry,-
  empform.obj,-
  ii_system:[ingres.files]equel.opt/opt
Linking an EQUEL Program without Shared Libraries
While the use of shared libraries in linking EQUEL programs is recommended for optimal performance and ease-of-maintenance, non-shared versions of the libraries have been included in case you require them. Non-shared libraries required by EQUEL are listed in the equel.noshare options file. The options file must be included in your link command after all user modules. Libraries must be specified in the order given in the options file.
The following example demonstrates the link command of an EQUEL program called "dbentry" that has been preprocessed and compiled:
$ link dbentry,-
  ii_system:[ingres.files]equel.noshare/opt
Last modified date: 06/10/2024