A variety of temporary fields can be created from existing fields in the database by using the COMPUTE and DEFINE commands. Both methods calculate the temporary fields after records are selected per the screening criteria. The major difference between COMPUTE and DEFINE is the point of calculation.
Computed fields are calculated on the results of a display command after the selected records have been sorted and summed.
TABLE FILE AC
PRINT AC:CLASS AC:BASEPAY
AND COMPUTE NEWSAL = AC:BASEPAY * 1.03;
IF AC:CBID EQ R03
Defined fields are calculated on the selected records before the sorts and display commands are applied.
DEFINE FILE AC ADD
NEWSAL = AC:BASEPAY * 1.03;
PRINT AC:CLASS AC:BASEPAY NEWSAL
Related Topic: How FOCUS Processes A Report Request and Generating A Running Total
Last Updated: February 22, 2024