The work file currently being updated resides in a TEXT file separate from the compiled object work file that exists as a CODE file. All other information about an active work file, including any changes since the last update, is kept in the tankfile. A recovery file is created by transcribing the information in the tankfile that pertains to the station whose session was aborted. This transcription is performed immediately, or when CANDE is next initiated.
Recovery information is contained in three files:
-
A RECOVERY file contains any work file changes since the last update, as well as the title and other attributes of that work file. This file has the title CANDE/RECV<recovery number>.
-
A TEXT file is created if the work file has been updated but not yet saved. This file has the title CANDE/TEXT<recovery number>.
-
A CODE file is generated if the work file has been compiled but not yet saved. This file has the title of CANDE/CODE<recovery number>.
A TEXT or CODE file is generated at update or compilation time and is written onto the work file family. The recovery file is produced when or after the session is aborted and can be written on one of two families. If possible, the recovery file is written on the default work file family, as defined by the work file family specifications established by the user at log-on time. If that family is not available, the recovery file is written on the family containing the code file for the CANDE MCS.
The recovery number consists of the logical station number (LSN) (in decimal) followed by a digit to distinguish among multiple recovery files from the same station. The recovery number for a session is determined at the beginning of the session by using the system; this number is suffixed to the TEXT and CODE files created by updating and compiling the work file. If a recovery file must be created, the same number is suffixed to the RECV file.
This scheme imposes a limit of 10 recovery files from the same station and a total of 25 recovery files under any one usercode. (The second limit is an arbitrary define, MAXRECFILES, that the installation can modify by compiling CANDE; its upper bound is 149.) If 25 or more recovery files exist, only the first 25 are listed at log-on time or by the RECOVER command, and any attempt to get or make another work file is rejected with the message:
#RECOVER OR DISCARD A WORKFILE.
For example, if 10 recovery files exist for LSN 23, any GET or MAKE or an attempt to recover a file created from another station is rejected with a message such as the following:
#RECOVER OR DISCARD A WORKFILE IN THE RANGE 230-239
If one or more recovery files exist and the AUTORECOVER option of the USERDATAFILE file attribute is set to TRUE, then recovery files are not displayed when a user logs on. The AUTORECOVER option causes an automatic attempt to recover recovery files created under the user's usercode and station.
A high level of consistency checking is applied to recovery files to screen out files harmful to CANDE. If a CANDE fault or error occurs in a work file editing or output operation (a CANDE worker), the following actions are taken to invoke the consistency checking of CANDE work file recovery:
-
The tankfile data is saved in a recovery file, as though the station had disconnected.
-
CANDE displays the message “#AUTORECOVERY INITIATED.”
-
The action of a RECOVER command is taken using the appropriate recovery file.
If the consistency checking fails, normal invalid recovery file action follows. The contents of the RECV file are listed in the CANDE taskfile to permit diagnosis of the failure. The file is then purged. If a TEXT work file exists (that is, if the file was updated since GET or MAKE), then that file is recovered.
The results of such recovery follow:
#WORKFILE IS NOT NAMED; ALGOL, 347 RECORDS #INVALID RECOVERY FILE; NAME AND ANY CHANGES WERE LOST
If no text existed or if the recovery failed, the message is
#INVALID RECOVERY FILE
The RECOVER command displays and recovers recovery files in up to three places in the following order of precedence:
-
The USERDATAFILE default work file family
-
The CANDE MCS family
-
The current work file family
The DISCARD command removes RECV, TEXT, and CODE files with the specified number or numbers from all three of these families.
A display listing recovery files is grouped according to the family containing the recovery files. If a recovery file pertains to a work file on a different family, the phrase ON <family name> appears in the display.
Recovering a work file sets the session specifications LANGUAGE, CONVENTION, and PRINTDEFAULTS to those in effect when the work file was saved. New session specifications are displayed if different from those in effect before recovery.
If the file part of a recovered work file is not present, the recovery action is aborted with an appropriate message. However, since the system does not purge the recovery file, you may attempt a recovery by making the missing file present with a GET command.