Syntax
DETERMINE ACTUAL <variant> [ GS status ] <logic_block> END | ENDEXIT | ENDNOPRINT <variant> := <databaseVariant> | <extractFileVariant> | <sqlVariant> <extractFileVariant> := extract_file EXTRACTEDAS { records | EVENT } RETAINEDAS file_name
Parameters
extract_file
The extract file to read. This extract file must have been previously saved using an Extract logic command.
EXTRACTEDAS
EXTRACTEDAS can be abbreviated as EAS. Reads records from the extract file as the specified class.
RETAINEDAS file_name
RETAINEDAS can be abbreviated as RAS. Specifies the filename under which the Extract file was previously saved with an Extract command.
Note: If you use RETAINEDAS and SetTitle for the same Extract file in a report, the Extract file is purged when the SetTitle is performed. It is recommended that you do not use RetainedAs and SetTitle on the same file.
GS status
Indicates if there are no records retrieved, using the specified qualifier.
Description
The extract file variant of the Determine Actual logic command reads class records into memory from an extract file.
Set the Record built-in segment attribute to the record to start reading from. This should be set before the Determine Actual logic command is executed.
The behavior of the Determine Actual (or Match) logic command when reading an extract file is influenced by:
The category of the extract file (Temporary, Permanent, or Existing). Refer to Extract File Categories for more information on the extract file categories.
Whether it is the first access of the extract file.
A first access is defined as the first execution of any Determine Actual, Match, or Extract logic statement, or Sort method invocation for a specific extract file, either in the logic of the report, or following a SetTitle or Restart logic statement.
The behavior the Determine Actual (or Match) logic command also depends on the presence of the ExtractedAs command option.
EXTRACTEDAS
If the ExtractedAs command option is specified, it implies that the file was not written by this report (the report does not include an Extract logic command that writes the file and defines its layout). The Determine Actual (or Match) logic command attempts to read a record from the specified extract file in the following mode:
If this is not the first access of the file, the record is read.
If this is the first access of the file, the behavior of the Determine Actual (or Match) logic command also depends on the category of the extract file, as listed in the following table.
File Status | Temporary File | Permanent File | Existing File |
---|---|---|---|
File exists | Cleared (refer to note below) | Record is read | Record is read |
File does not exist | Created (refer to note below) | Report aborts Report becomes waiting entry (on MCP-based systems) | Report aborts Report becomes waiting entry (on MCP-based systems) |
Note: The read of the empty Temporary extract file sets the Glb.Status built-in segment attribute to "*****".
If the ExtractedAs command option is not specified, it implies that the file was written by this report (the report includes an Extract logic command that writes the file and defines its layout). The Determine Actual (or Match) logic command attempts to read a record from the specified extract file in the following manner:
If this is not the first access of the file, the record is read.
If this is the first access of the file, the behavior of the Determine Actual (or Match) logic command also depends on the category of the extract file, as listed in the following table.
File Status | Temporary File | Permanent File | Existing File |
---|---|---|---|
File exists | Cleared (refer to note below) | Cleared (refer to note below) | Record is read |
File does not exist | Created (refer to note below) | Created (refer to note below) | Report aborts Report becomes waiting entry (on MCP-based systems) |
Note: The read of the empty Temporary or Permanent extract file sets the Glb.Status built-in segment attribute to "*****".
Example
This example creates an extract file that lists all customers with balances over $1000. This file is sorted, and might be used by other reports.
If no customers exist with a balance over $1000, the CustFile extract file is created as an empty file. This ensures that the customer records from a previous run are not processed.
SetTitle FileA "CustFile" LookUp Every Cust If Cust.Balance > 1000 Extract Cust As FileA End End FileA.Sort(Key(FileA.Cust.Balance,“Ascending”)) Determine Actual FileA Frame10.Print() End