In this section: |
Compiling expressions into machine code provides faster processing.
How to: |
Two expression compilers are available. By issuing the appropriate command, you can select one of them or disable compilation of expressions. Both compilers cannot be active for the same request:
Among the benefits of the DEFINE compiler are:
After the native DEFINE compiler is invoked, any request that uses a DEFINE expression causes the expression to be compiled and then loaded into the system. For each record of the request that needs computation, the system executes the generated code. This compiler is most effective with TABLE requests that include a large number of DEFINE fields and read a large number of records because the speed of evaluation per record in such requests offsets the extra compilation and load steps.
Note: To compile expressions in MODIFY procedures in Mainframe environments, use the SET MODCOMPUTE command.
Issue the following command FOCPARM, a FOCEXEC, or at the command line:
SET DEFINES = {COMPILED|OLD}
where:
Implements expression compilation at request run time, compiling only those DEFINEs that are used in the request. COMPILED is the default value.
Leaves expression compilation up to the control of the current SET COMPUTE value. If you issue the SET DEFINES = OLD command, the COMPUTE parameter is automatically set to NEW.
How to: Reference: |
The compiler implemented with the SET COMPUTE = NEW command provides expression compilation for DEFINE, IF, and WHERE commands in TABLE procedures. Under this compiler, expressions are compiled at DEFINE time. Therefore, compilation may be invoked for expressions that are never actually used in a request.
SET COMPUTE = {NEW|OLD|NATV}
where:
Compiles DEFINE calculations when a request is executed.
Does not compile DEFINE calculations when a request is executed. The old logic is used.
Compiles DEFINE calculations using the native compiler. This setting is also activated by the SET DEFINES=COMPILED command, which is the default setting.
The following calculations are not compiled with SET COMPUTE = NEW:
Two expression compilers are available, but only one can be activated for any request. Activating either compiler automatically deactivates the other compiler:
Therefore, you can select either compiler by issuing the SET DEFINES command. DEFINES=COMPILED selects the new compiler, DEFINES=OLD selects the old compiler. To turn compilation off, issue SET COMPUTE=OLD.
The new compiler is recommended for TABLE requests that include a large number of DEFINE fields (especially those that use packed arithmetic or date expressions) and read a large number of records.
If a TABLE request retrieves a large number of records or if the DEFINE fields use packed arithmetic (especially with long packed fields) or date expressions, the new compiler is likely to provide the most benefit.
If compilation is not possible because of environmental conditions, the processing is handled without compilation. No message is generated indicating that compilation did not take place. To determine whether it did take place, issue the ? COMPILE command.
Information Builders |