Was this helpful?
Comments
Two kinds of comments can appear in an EQUEL program: EQUEL comments and host language comments. The /* and */ characters delimit EQUEL comments and must appear on lines beginning with the ## sign.
For example:
##   /* Update name and salary */
##   APPEND TO EMPLOYEE (ename = EMPNAME, esal = esal*.1)
##   MESSAGE "salary updated"   /* Updates done */
The preprocessor strips EQUEL comments that appear on lines beginning with the ## sign out of the program. These comments do not appear in the output file.
The preprocessor treats host language comments that appear on lines that do not begin with the ## sign as host code. It passes them through to the output file unchanged. Therefore, if you want source code comments in the preprocessor output, enter them as COBOL comments.
The following restrictions only apply to EQUEL comments:
In general, EQUEL comments can be put in EQUEL statements wherever a space can legally occur. However, comments cannot appear between two words that are reserved when they appear together, such as declare cursor. See the list of EQUEL reserved words in the QUEL Reference Guide.
EQUEL comments cannot appear in string constants. If this occurs, the preprocessor interprets the intended comment as part of the string constant.
The following additional restrictions apply only to COBOL comments:
COBOL comments cannot appear between component lines of EQUEL block-type statements. These include retrieve, initialize, activate, unloadtable, formdata, and tabledata, all of which have optional accompanying blocks delimited by open and close braces. Do not put COBOL comment lines between the statement and its block-opening delimiter.
For example:
##  RETRIEVE (ENAME = employee.name)
*   Illegal to put a host comment here!
##  {
*   A host comment is perfectly legal here
    DISPLAY "Employee name is" ENAME
##  }
COBOL comments cannot appear between the components of compound statements, in particular the display statement. It is illegal for a COBOL comment to appear between any two adjacent components of the display statement, including display itself and its accompanying initialize, activate, and finalize statements.
For example:
##  DISPLAY EMPFORM
*   illegal to put a host comment here!
##  INITIALIZE (empname = "FRISCO McMULLEN")
*   Host comment illegal here!
##  ACTIVATE MENUITEM "Clear":
##  {
*   Host comment here is fine
             CLEAR FIELD ALL
##  }
*   Host comment illegal here!
##  ACTIVATE MENUITEM "End":
##  {
##  BREAKDISPLAY
##  }
*   Host comment illegal here!
##  FINALIZE
These restrictions are discussed on a statement-by-statement basis in the QUEL Reference Guide.
On the other hand, EQUEL comments are legal in the locations described in the previous paragraph, as well as wherever a host comment is legal. For example:
##  RETRIEVE (ENAME = employee.name)
##  /* This is an EQUEL comment, legal in this location
##     and it can span multiple lines */
##  {
       DISPLAY "Employee name" ENAME
    . . .
##  }
Last modified date: 08/28/2024