Syntax
RESTART { profile_name | extract_file }
Parameters
Restart can be abbreviated as RT.
profile_name or extract_file
The profile or extract file to restart.
Description
The Restart logic command restarts a profile, or restarts specifying an extract file.
Restart and profiles
The Restart logic command restarts a profile if it is executed within a Determine Actual logic statement loop. It causes the containing Determine Actual logic command to restart the current profile from its beginning, after executing the remainder of the logic in the current loop.
Records deleted or flagged from the profile by the logic are not brought into memory after the Restart logic command.
Restart and extract files
The Restart logic command can be used to repeatedly extract, sort, and output data to an extract file, before clearing the file for the next iteration loop. This behavior occurs if the Restart logic command is executed outside a Determine Actual logic statement loop.
The Restart logic command purges the extract file. If an open extract file is currently being read, it is closed and purged, so that the name can be reused.
If a CriticalPoint logic statement is used in the print logic of the extract file, it is recommended that the Restart logic command is executed immediately before the CriticalPoint logic statement. This effectively eliminates the possibility of a report recovery situation encountering a no-file condition on the extract file.
The Restart logic command deletes all extract file types, whether temporary, permanent, or existing. Refer to Extract File Categories for more information.
Examples
Example 1
In this example, the RunRequest profile (over the Param ispec) has RTask and RComplete keys, and the following condition:
DoWhen RComplete <> "Y"
The Main method of the ThisRept report contains the following logic:
Determine Actual Param.RunRequest If Param.RTask = "ThisRept" Frame06.Print() : Move in parameters and process them. Flag "Y" Param.RComplete : Remove request. End : Another record could be added in the interim. If Param.RTask > "ThisRept" Restart End End
Example 2
In this example, the ThatRept report processes each customer order in product order:
Determine Actual Cust Determine Group Event.CustOrders() From (Cust.ID) Extract Order As FileA End FileA.Sort(Key(FileA.Order.Prod, “Ascending”)) Determine Actual FileA : Logic to process orders End Restart FileA End