User guide

Using ENFORM in Interactive Mode
Compiling and Executing a Query
058058 Tandem Computers Incorporated 4–3
If you specify the name of a compiled query file for the IN option of the ENFORM
command, ENFORM executes all the statements and clauses in the compiled query file
and any ?ASSIGN, ?DICTIONARY, or ?EXIT commands. Using a compiled query file
as the input file is particularly useful because you can pass a parameter value to a
compiled query file. For example, suppose you frequently issue the same query for
different branches of your business. You could store several queries in Edit files with
the only difference between the queries being the branch number. Alternatively, you
could use the ?COMPILE command to compile the query and pass the branch number
as a parameter before executing the compiled query file. For example, the following
example shows the contents of the compiled query file reportb:
PARAM bnum I2;
TITLE "Employee Names and Salaries for Branch " (bnum);
OPEN employee;
LIST BY branchnum,
empname,
salary,
WHERE branchnum = bnum;
To obtain a report for each branch, simply change the value you specify in the
Command Interpreter PARAM command before you issue ENFORM command. For
example:
:PARAM bnum 1
:ENFORM/ IN reportb, OUT $s/
:PARAM bnum 2
:ENFORM/ IN reportb, OUT $s/
...
When you use ENFORM in noninteractive mode, the session terminates as soon as an
end-of-file is encountered on the input file.
Using ENFORM in
Interactive Mode
Use ENFORM in interactive mode by specifying the ENFORM command without the
IN option. For example:
:ENFORM
ENFORM responds by displaying the ENFORM prompt (>). You can enter source
code either directly or indirectly.