(edited 14-Jun) (Using Journal Files to Protect Work Sessions\anticipate_chap)

(Usingjournal files) (Work sessionprotecting) (Protecting work session) (Malfunctionanticipating system) (System crashanticipating) (Crash, systemanticipating) If you begin your work session as described in Sections (CREATE_SEC\value), (edit_sec\value), or (editsize_sec\value) and your work session ends abnormally due to a power failure, user error, or system malfunction, you will lose all the work you performed. But, if you begin your work session as described below, you can recover all or most of the work you performed and then continue with your work session. (Beginning Your Work Session\beginjournal_sec)

(Beginning work session) (Work sessionbeginning) A command line for beginning your work session with journal file protection has the general format: (/JOURNAL command option) (Command options/JOURNAL) EDIT/JOURNAL filespec[/option] (2\9) (/JOURNAL\can be abbreviated to /JOUR.) (filespec\is an output file specification if you want to create a new file or an input file specification if you want to edit an existing file.) (/option\can be any option you would normally include in beginning the work session, except /INSPECT.)

That format produces a journal file, which will contain all or most of your work (the text you type and the changes you make). The journal file will have the file name you specify for (filespec), but its file type will be JOU.

For example: (.)(EDIT/JOURNAL WEEK.TXT/CREATE (RET))

KED creates journal file WEEK.JOU, which will contain all or most of your work.

In some cases, you may want to use a different file specification for the journal file. A command line to do that has the general format: (/JOURNAL:filespec command option) (Command options/JOURNAL:filespec) EDIT/JOURNAL:jou-filespec filespec[/option]

(2\10) (jou-filespec\is the different file specification you want to use for the journal file. You can type the file name, or you can type the file name and file type. If you type just the file name, the file type will be JOU.)

For example, the following command line creates journal file RETAIN.JOU: (.)(EDIT/JOURNAL:RETAIN WEEK.TXT (RET))

Once you create a journal file, if your work session is terminated by an error or malfunction, you can use the /RECOVER option, as described in (recoverjournal_sec), to recover all or most of the work you performed. (Recovering the Work You Performed\recoverjournal_sec)

(Recovering work performed) (Work sessionrecovering work performed) (Recovering from system crash) (System crashrecovering from) (Crash, systemrecovering from) A command line for beginning another work session and recovering all or most of the work you performed has the general format: (/RECOVER command option) (Command options/RECOVER) EDIT/RECOVER filespec[/option]

If you used a different file specification for the journal file, the general format is: (/RECOVER:filespec command option) (Command options/RECOVER:filespec) EDIT/RECOVER:jou-filespec filespec[/option]

(2\10) (/RECOVER\can be abbreviated to /REC.) (filespec\is an output file specification if you created a new file or an input file specification if you edited an existing file.) (jou-filespec\is the file specification you used for a different journal file.)

Either format uses the journal file to produce an output file that will contain all or most of the work you performed. The recovery operation starts at the beginning of a work session, before KED can execute an initialization file and before you can perform any additional work.

For example, type: (.)(EDIT/RECOVER WEEK.TXT (RET))

or (.)(EDIT/RECOVER:RETAIN WEEK.TXT (RET))

KED begins another work session and uses the journal file (WEEK.JOU or RETAIN.JOU) to recover all or most of the work you performed. You can then continue the work session or end it with an EXIT command.

A recovery operation does not automatically stop on an error, so you should watch your screen and check for any missing changes as the operation is being performed. The recovery operation reperforms the editing session and displays the session as it progresses. You can press (HOLD SCREEN) or (CTRL/S) to interrupt the recovery operation if you want to examine some part of the recovery more closely. Pressing again (HOLD SCREEN) or pressing (CTRL/Q) resumes the recovery operation.

You can terminate the recovery operation, if necessary, by twice pressing (CTRL/C). Terminating recovery leaves you in the editor at that point in the file, so you can begin editing. If you terminated recovery because you noticed some correctable error in the work session you are recovering, you can issue the QUIT command, edit the journal file to correct the error, and restart the recovery operation.

Also, before you start a recovery operation: (unnumbered) Make sure the conditions that existed during your previous work session still exist.

Did the command line that began your previous work session execute an initialization file? If so, your command line for beginning the recovery operation should execute the same file.

During your previous work session, did you copy text to any auxiliary files? If so, those files should not contain any required text that cannot be replaced.

Did you also insert text or execute macros from any auxiliary files? If so, those files must exist in their previous condition. If the error or malfunction occurred while you were creating a new file, an output file was not produced. Therefore, you should use the following command line to begin the recovery operation. (.)(EDIT/CREATE/RECOVER output-filespec (RET)) In the rare circumstance that you were editing an existing file and you think that the error or malfunction occurred after the input file type was renamed to BAK but before the output file could be closed, use the following command line to see if the output file was produced. (.)(DIRECTORY input-filename.* (RET))

Use the EDIT/INSPECT command to look at any files displayed by the DIRECTORY command. (Recovering the Work You Performed and Journaling Any Additional Work)

(Recovering work performedjournaling additional work) (Work sessionrecovering work performedjournaling additional work) (Recovering from system crash) (System crashrecovering from) (Crash, systemrecovering from) You can recover the work you performed and at the same time produce a new journal file that will contain the work you recovered and any additional work you might perform. A command line to do that has the general format: EDIT/JOURNAL/RECOVER filespec[/option]

or EDIT/JOURNAL:jou-filespec/RECOVER:jou-filespec filespec[/option]

If the new journal file and the old journal file (the recovery file) have the same file name and file type, KED changes the file type of the old journal file to JBK. For example, you can type: (.)(EDIT/JOURNAL/RECOVER WEEK.TXT (RET))

or (.)(EDIT/JOURNAL:RETAIN.REC/RECOVER:RETAIN.REC WEEK.TXT (RET))

In either example, the old journal file will have the JBK file type (WEEK.JBK or RETAIN.JBK). In the first example, the new journal file will have the JOU file type (WEEK.JOU). In the second example, the new journal file will have the REC file type (RETAIN.REC). (Changing the Journal Process)

(Changingjournal process) (Journal processchanging) When you begin your work session as described in (beginjournal_sec), KED counts and stores the text you type and the changes you make in a journal buffer that can contain a minimum of 512 characters (some systems allow a larger number). When the count reaches a (Modification count) certain number of modifications (the default is 10) or when the journal buffer (Journal filecontents of journal buffer) (Filesjournalcontents of journal buffer) becomes full, KED moves the contents of that buffer to the journal file. Later, when you end your work session with an EXIT or QUIT command, KED deletes the journal file.

The following sections tell you how to: (unnumbered) Change the modification count that determines when the contents of the journal buffer will be moved to the journal file. Move the contents of the journal buffer to the journal file without waiting for the modification count to be reached. Save the journal file when you end your work session with an EXIT or QUIT command. (Changing the Modification Count)

(Changingmodification count) (Modification countchanging) To change the modification count that determines when the contents of the journal buffer will be moved to the journal file: (SET FREQUENCY number command) (CommandsSET FREQUENCY number) (numbered) Press (GOLD) and (COMMAND). Type: (SET FREQUENCY number)

(number) is the new modification count you want KED to use in determining when the contents of the journal buffer will be moved to the journal file. The highest number allowed is 511. Low numbers can affect system performance, depending on the device you specified for the journal file. Press (ENTER).

KED changes the modification count to the number you specified.

In other words: (simple) ((GOLD) (COMMAND) SET FREQUENCY number (ENTER)) (Moving the Contents of the Journal Buffer to the Journal File)

(Moving contents of journal buffer to journal file) (Movingcontents of journal buffer to journal file) (Journal buffermoving contents to journal file) (Buffersjournalmoving contents to journal file) To move the contents of the journal buffer to the journal file without waiting for the modification count to be reached: (WRITE JOURNAL command) (CommandsWRITE JOURNAL) (numbered) Press (GOLD) and (COMMAND). Type: (WRITE JOURNAL) Press (ENTER).

KED moves the contents of the journal buffer to the journal file you specified when you began your work session.

In other words: (simple) ((GOLD) (COMMAND) WRITE JOURNAL (ENTER)) (Saving the Journal File\savejournal_sec)

(Savingjournal file) (Journal filesaving) (Filesjournalsaving) If you terminate your work session normally (if you end your work session with an EXIT or QUIT command), KED does not save the journal file. (To save the journal file when you plan to end your work session with an EXIT or QUIT command:) (SET JOURNAL SAVE command) (CommandsSET JOURNAL SAVE) (numbered) Press (GOLD) and (COMMAND). Type: (SET JOURNAL SAVE) Press (ENTER).

KED will save the journal file you specified when you began your work session, after you enter an EXIT or QUIT command.

In other words: (simple) ((GOLD) (COMMAND) SET JOURNAL SAVE (ENTER))

If you do not use the SET JOURNAL SAVE command to save the journal file, you can still save it by using one of the following commands to end your work session. (To save the journal file when you decide to end your work session with an EXIT command:) (EXIT SAVE command) (CommandsEXIT SAVE) (numbered) Press (GOLD) and (COMMAND). Type: (EXIT SAVE) Press (ENTER).

KED saves the output file and the journal file you specified when you began your work session.

In other words: (simple) ((GOLD) (COMMAND) EXIT SAVE (ENTER)) (To save the journal file when you decide to end your work session with a QUIT command:) (QUIT SAVE command) (CommandsQUIT SAVE) (numbered) Press (GOLD) and (COMMAND). Type: (QUIT SAVE) Press (ENTER).

KED does not save the output file, but it saves the journal file you specified when you began your work session.

In other words: (simple) ((GOLD) (COMMAND) QUIT SAVE (ENTER)) (Restrictions) (Restrictions, journal process) (Journal processrestrictions)

The following operations are invalid. (unnumbered) Using the /JOURNAL or /RECOVER command option with the /INSPECT file specification option Using the @ or LOAD command to execute a journal file Copying a journal file with the COPY/ASCII command

In addition, any commands that change the journal process must be placed at the end of an initialization file. Any such commands cause all subsequent commands in the file to be skipped unless the file was executed by an EDIT command with the /JOURNAL option. (Example)

This section summarizes most of the information in this chapter by providing an example of the steps necessary for recovering all the work you performed before a system crash or similar malfunction.

Each step has two parts. (numbered) An instruction to complete The keys you must type to complete the instruction

The keys you must type are presented in a horizontal line, and the strings of letters and numbers you must type are not enclosed by boxes. (numbered) Begin your work session to edit file WEEK.TXT. (.)(EDIT/JOURNAL WEEK.TXT (RET))

KED displays: ((M)onday was cold and rainy. On Tuesday, it snowed. Wednesday was sunny and hot. On Thursday, the lilacs bloomed.) You add a line of text at the bottom of the file. (Friday was just like Monday, cold and rainy. (RET)) You decide to decrease the modification count, thereby increasing the number of times that KED moves the contents of the journal buffer to the journal file. (GOLD) (COMMAND) SET FREQUENCY 5 (ENTER) You add another line of text at the bottom of the file. (On Saturday, it snowed again and the wind was very strong. (RET)) Anticipating a system malfunction, you decide to move the contents of the journal buffer to the journal file without waiting for the new modification count to be reached. (GOLD) (COMMAND) WRITE JOURNAL (ENTER) The malfunction occurs. Simulate it by typing: (GOLD) (COMMAND) QUIT SAVE (ENTER) After resolving the simulated problem, you restart your system and then recover all the work you performed. (.)(EDIT/RECOVER WEEK.TXT (RET))

KED displays: (Monday was cold and rainy. On Tuesday, it snowed. Wednesday was sunny and hot. On Thursday, the lilacs bloomed. Friday was just like Monday, cold and rainy. On Saturday, it snowed again and the wind was very strong.( )) Finally, you add another line of text at the bottom of the file and then end your work session. (On Sunday, we decided to leave New England. (RET)) (GOLD) (COMMAND) EXIT (ENTER)