Professional Documents
Culture Documents
Objectives
• Define the concept of a checkpoint.
• Restart a job from a checkpoint.
61
Copyri g ht © S A S Insti tute Inc. A l l ri g hts reserved.
2
Checkpoints
By default, if a job is interrupted during execution, it has to be rerun in its
entirety. With checkpoints established, the job can be restarted from the last
checkpoint before the interruption.
62
Copyri g ht © S A S Insti tute Inc. A l l ri g hts reserved.
A checkpoint
• consists of code that manages checkpoint restart information
• preserves checkpoint state information
• replaces the saved state information for any previous checkpoint in the job
• enables the job to be restarted from the checkpoint
• conserves resources by not reprocessing already completed steps.
Job Interruption
When a job is interrupted, the last checkpoint passed is the checkpoint that
is used to preserve the state of the job up to that point.
State of the job is preserved up
to most recent checkpoint
Error!
63
Copyri g ht © S A S Insti tute Inc. A l l ri g hts reserved.
Establishing Checkpoints 3
Restarting a Job
After an interruption, the job can be restarted
• from the beginning
• from the last checkpoint.
Note: This applies to running jobs interactively. To restart a batch job from checkpoint-restart data,
turn on the STEPRESTART option.
Checkpoint Caveats
A checkpoint does not preserve several items:
• SAS global options
• session compiled macros
• remote connections
Note: All transformations have an Options tab as part of the transformation properties, and every
transformation has the two checkpoint options, as shown.
4
Note: Different libraries can be specified for Restart point state library and
Alternative library for temporary tables if needed.
d. Click OK to close the Restart-point Setup window.
The Table Loader transformation is decorated with a symbol to indicate that this
transformation is assigned as a restart point.
4. Reassign the work table of the join to the alternative work library.
a. Right-click the Join work table and select Properties.
b. Click the Physical Storage tab.
c. Enter SQLJoin in the Physical name field.
6
The restart point libraries established earlier apply to all checkpoints in the job. Thus, the
Restart-point Setup window does not appear again.
6. Select File Save to save the job metadata.
7. Verify that the title bar of the job editor window has been enhanced with a note.
8. Verify that the restart point libraries established earlier are assigned at the job level.
a. Right-click in the background of the job and select Properties.
b. Click the Options tab.
c. Click the Checkpoint options group.
d. Verify that DIFT Restart Point Library is set as the job-level restart-point state library.
Establishing Checkpoints 7
g. Scroll through the code and notice that each transformation code block is surrounded by
additional code that processes if a job fails.
h. Click OK to close the Properties window.
9. Mimic “failure” of a job by stopping the job during Rank transformation processing.
a. Right-click the Rank transformation and select Properties to open the Properties window.
b. Click the Precode and Postcode tab.
c. Enter the following code in the precode of the Rank transformation:
data _null_;
abort abend;
run;
d. Click OK to close the Properties window.
e. In the job editor window, click Run.
The Details pane shows that the process was stopped.
10. Access Windows Explorer to investigate the physical contents of the restart point library.
a. Open Windows Explorer.
b. Navigate to D:\Workshop\dift\checkpoint.
Two data sets and a data set view were created. They are used to restart the job at the Table
Loader checkpoint.
11. Restart the job. (You would do this after the “problem” is resolved.)
a. Open the job DIFT Test Job – OrderFact Table Plus.
b. If necessary, remove the precode in the Rank transformation.
c. In the job editor window, click Run.
The Run Options window appears.
The restart skipped the Join transformation and completed all the remaining steps.
g. Select File Close to close the job editor window.
Establishing Checkpoints 9
7.10 Poll
When a job is stopped, the job can be restarted from any checkpoint it has
successfully passed.
True
False
68
Copyri g ht © S A S Insti tute Inc. A l l ri g hts reserved.