Was this helpful?
Coding Requirements for Writing EQUEL Programs
The following sections describe coding requirements for writing EQUEL programs.
Comments Embedded in Fortran Output
Each EQUEL statement generates one comment and a few lines of Fortran code. You may find that the preprocessor translates 50 lines of EQUEL into 200 lines of Fortran. This may result in confusion about line numbers when you debug the original source code. To facilitate debugging, each group of Fortran statements associated with a particular statement is preceded by a comment corresponding to the original EQUEL source. (Only executable EQUEL statements are preceded by a comment.) Each comment is one line long and informs the reader of the file name, line number, and type of statement in the original source file.
EQUEL Statements and Fortran If Blocks
Because each EQUEL statement may generate several Fortran statements, you must use the block-style Fortran if statement to conditionally transfer control to EQUEL statements. For example:
if (error .eq. .true.) then
## message "Error on update"
## sleep 2
 end if
EQUEL also generates many nested constructs of do loops and if blocks specifically for block-structured statements, such as display and unloadtable. If you omit an end if from your Fortran source, the Fortran compiler complains that there is a missing end statement, which you may trace back to a preprocessor-generated if.
You can solve this problem by checking for matching if-end pairs in the original EQUEL/Fortran source file.
EQUEL Statements that Generate Labels
As mentioned, some EQUEL statements generate labels. These are the retrieve statement and all the EQUEL/FORMS block-type statements. Each of these statements reserves its own range of 200 labels in an overall range for such statements of 7000 through 12000. Consequently, you cannot have more than 200 of any single label-generating statement in the same program unit. For example, 201 display statements in a single subroutine will cause a compiler error indicating that a particular label has been used more than once. You could, however, have 200 display statements and 200 unloadtable statements without causing a problem.
An EQUEL Statement that Does Not Generate Code
The declare cursor statement does not generate any Fortran code. This statement should not be coded as the only statement in Fortran constructs that do not allow null statements.
Last modified date: 06/10/2024