3. Embedded QUEL for COBOL : COBOL Variables and Data Types : Data Types : Assembling and Declaring External Compiled Forms -VMS
 
Share this page                  
Assembling and Declaring External Compiled Forms -VMS
You can pre-compile your forms in VIFRED. This saves the time otherwise required at runtime to extract the form's definition from the database forms catalogs. When you compile a form in VIFRED, VIFRED creates a file in your directory describing the form in the VAX-11 MACRO language. VIFRED prompts you for the name of the file with the MACRO description. After the MACRO file is created, you can use the VMS command to assemble it into a linkable object module:
macro filename
This command produces an object file containing a global symbol with the same name as your form. Before the EQUEL/FORMS statement addform can refer to this global object, you must declare it to EQUEL, with the following syntax:
01 formid PIC S9(9) [USAGE [IS]] COMP VALUE [ISEXTERNAL
        formname.
Syntax Notes:
The formid is a COBOL data item. It is used with the addform statement to declare the form to the Forms Runtime System (FRS).
The formname is the actual name of the form. VIFRED gives this name to the global object. The formname is used to refer to the form in EQUEL/FORMS statements after the form is made known to the FRS with the addform statement.
The EXTERNAL clause causes the VAX linker to associate the formid data item with the external formname symbol.
The example below shows a typical form declaration and illustrates the difference between using the form's object definition (the formid) and the form's name (the formname).
DATA DIVISION.
WORKING-STORAGE SECTION.

##  01  EMPFORM-ID PIC S9(9) USAGE COMP VALUE IS EXTERNAL 
##      empform.

* Other data declarations.

PROCEDURE DIVISION.

Program initialization.

*     Making the form known to the FRS via the global form
*     object.
##      ADDFORM EMPFORM-ID.

*     Displaying the form via the name of the form.
##    DISPLAY empform

*  The program continues.