Setting Up and Executing Checkpoint Mode and Restart Mode
To set up checkpoint mode and restart mode, make the following modifications to your
batch program:
• Add the CHECKPOINT EXECUTE_ALWAYS statement before any DATA and
PROC steps that you want to execute each time the batch program is submitted.
• If your checkpoint-restart library is a user-defined library, you must add the
LIBNAME statement that defines the checkpoint-restart libref as the first statement
in the batch program. If you use the Work library as your checkpoint library, no
LIBNAME statement is necessary.
Once the batch program has been modified, you start the program using the appropriate
system options:
• For checkpoint-restart data that is saved in the Work library, start a batch SAS
session that specifies these system options:
• SYSIN, if required in your operating environment, names the batch program.
• STEPCHKPT or LABELCHKPT enables checkpoint mode.
• NOWORKTERM saves the Work library when SAS ends.
• NOWORKINIT does not initialize the Work library when SAS starts.
• ERRORCHECK STRICT puts SAS in syntax-check mode when an error occurs
in the LIBNAME, FILENAME, %INCLUDE, and LOCK statements.
• ERRORABEND specifies whether SAS terminates for most errors.
• CHKPTCLEAN specifies whether to erase files in the Work library and delete
the Work library if the batch program runs successfully.
In the Windows operating environment, the following SAS command starts a batch
program in checkpoint mode using the Work library as the checkpoint-restart library:
sas -sysin 'c:mysasmyprogram.sas'-stepchkpt -noworkterm -noworkinit
-errorcheck strict -errorabend -chkptclean
• For checkpoint-restart data that is saved in a user-specified library, start a batch SAS
session that includes these system options:
• SYSIN, if required in your operating environment, names the batch program.
• STEPCHKPT or LABELCHKPT enables checkpoint mode.
• STEPCHKPTLIB or LABELCHKPTLIB specifies the libref of the library where
SAS saves the checkpoint-restart data.
• NOWORKTERM saves the Work library when SAS ends.
• NOWORKINIT does not initialize the Work library when SAS starts.
• ERRORCHECK STRICT puts SAS in syntax-check mode when an error occurs
in the LIBNAME, FILENAME, %INCLUDE, and LOCK statements.
• ERRORABEND specifies whether SAS terminates for most errors.
In the Windows operating environment, the following SAS command starts a batch
program in checkpoint mode using a user-specified checkpoint-restart library:
sas -sysin 'c:mysasmyprogram.sas' -labelchkpt -labelchkptlib mylibref
-noworkterm -noworkinit -errorcheck strict -errorabbend
In this case, the first statement in MyProgram.sas is the LIBNAME statement that
defines the MyLibref libref.
150 Chapter 8 • Error Processing and Debugging