What’s new in BASE SAS 9.2

12
June 12, 2009 June 12, 2009 Toronto Area SAS Society Toronto Area SAS Society 1 What’s new in BASE SAS 9.2 What’s new in BASE SAS 9.2 Checkpoint/Restart Checkpoint/Restart Rupinder Dhillon Dhillon Consulting Inc.

description

What’s new in BASE SAS 9.2. Checkpoint/Restart. Rupinder Dhillon Dhillon Consulting Inc. What is Checkpoint/Restart?. Using Checkpoint and restart modes together allows you to resubmit batch SAS programs that failed. - PowerPoint PPT Presentation

Transcript of What’s new in BASE SAS 9.2

Page 1: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 11

What’s new in BASE SAS 9.2What’s new in BASE SAS 9.2

Checkpoint/RestartCheckpoint/Restart

Rupinder DhillonDhillon Consulting Inc.

Page 2: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 22

What is Checkpoint/Restart?What is Checkpoint/Restart?

Using Checkpoint and restart modes together Using Checkpoint and restart modes together allows you to resubmit batch SAS programs allows you to resubmit batch SAS programs that failed.that failed.

When resubmitted, the program will When resubmitted, the program will resume at the DATA or PROC step resume at the DATA or PROC step where the error occurredwhere the error occurred

DATA and PROC steps that completed DATA and PROC steps that completed successfully in the failed run will not be successfully in the failed run will not be resubmitted.resubmitted.

Page 3: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 33

Checkpoint/Restart ModesCheckpoint/Restart Modes

Checkpoint Mode:Checkpoint Mode: SAS records info about the DATA and PROC steps in a SAS records info about the DATA and PROC steps in a

Checkpoint library.Checkpoint library.

Restart Mode: Restart Mode: SAS reads the checkpoint library to determine which SAS reads the checkpoint library to determine which

steps completed successfully. The program resumes at steps completed successfully. The program resumes at the step where the failure occurred.the step where the failure occurred.

NoteNote:: restart mode will always re-execute GLOBAL statements restart mode will always re-execute GLOBAL statements (ie. FILENAME, LIBNAME) and macros.(ie. FILENAME, LIBNAME) and macros.

WhyWhy?? Because the checkpoint library only stores info about the Because the checkpoint library only stores info about the steps that succeeded and failed. It does not store information steps that succeeded and failed. It does not store information about macro variables, macro definitions, SAS datasets or any about macro variables, macro definitions, SAS datasets or any other info that might have been processed in the step that other info that might have been processed in the step that failed.failed.

Page 4: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 44

What if a step should ALWAYS be re-What if a step should ALWAYS be re-run?run?

Add the statement Add the statement CHECKPOINT CHECKPOINT EXECUTE_ALWAYSEXECUTE_ALWAYS immediately before the immediately before the step.step.

This statements tells SAS that this step This statements tells SAS that this step should ignore checkpoint/restart commands should ignore checkpoint/restart commands and always execute.and always execute.

Page 5: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 55

Adding Checkpoint/Restart to Adding Checkpoint/Restart to your batch program: your batch program:

– Add the Add the CHECKPOINT EXECUTE_ALWAYSCHECKPOINT EXECUTE_ALWAYS statement before any DATA and PROC steps that statement before any DATA and PROC steps that you want to execute each time the batch program is you want to execute each time the batch program is submitted.submitted.

– If your checkpoint-restart library is a user-defined If your checkpoint-restart library is a user-defined library, you must add the library, you must add the LIBNAMELIBNAME statement that statement that defines the checkpoint-restart libref as the first defines the checkpoint-restart libref as the first statement in the batch program. statement in the batch program.

– If you use the If you use the WORKWORK library as your checkpoint library as your checkpoint library, no LIBNAME statement is necessary.library, no LIBNAME statement is necessary.

Page 6: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 66

Run your batch program using Run your batch program using the following system options:the following system options:

SYSIN:SYSIN: names the batch program (if req’d in your operating names the batch program (if req’d in your operating environment)environment)

STEPCHKPT:STEPCHKPT: enables checkpoint mode enables checkpoint mode

STEPCHKPTLIB:STEPCHKPTLIB: specifies the libref of the library where SAS specifies the libref of the library where SAS saves the checkpoint restart datasaves the checkpoint restart data

Page 7: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 77

Run your batch program using Run your batch program using the following system options:the following system options:

NOTENOTE: if you are not using a user defined library and using the : if you are not using a user defined library and using the WORK library instead then:WORK library instead then:

– NOWORKTERMNOWORKTERM: saves the WORK library when SAS : saves the WORK library when SAS endsends

– NOWORKINITNOWORKINIT: does not initialize the WORK library : does not initialize the WORK library when SAS startswhen SAS starts

ERRORCHECK STRICT:ERRORCHECK STRICT: puts SAS in syntax-check mode puts SAS in syntax-check mode when an error occurs in the LIBNAME, FILENAME, %INCLUDE when an error occurs in the LIBNAME, FILENAME, %INCLUDE and LOCK statementsand LOCK statements

ERRORABENDERRORABEND specifies whether SAS terminates for most specifies whether SAS terminates for most errorserrors

Page 8: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 88

To resubmit a batch job in To resubmit a batch job in restart moderestart mode

Add: Add:

– STEPRESTARTSTEPRESTART: tells SAS to restart using : tells SAS to restart using checkpoint-restart data saved in checkpoint checkpoint-restart data saved in checkpoint library (Work or usedefined)library (Work or usedefined)

Page 9: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 99

SAS Commands in batch modeSAS Commands in batch mode

In a Windows Operating Environment:In a Windows Operating Environment: sas -sysin `c:\mysas\myprogram.sas' -stepchkpt sas -sysin `c:\mysas\myprogram.sas' -stepchkpt

- stepchkptlib mylibref -errorcheck strict -errorabbend- stepchkptlib mylibref -errorcheck strict -errorabbend

Or:Or: sas -sysin `c:\mysas\myprogram.sas' -stepchkpt sas -sysin `c:\mysas\myprogram.sas' -stepchkpt -noworkterm –noworkinit-noworkterm –noworkinit -errorcheck strict -errorabend -errorcheck strict -errorabend

Restarting:Restarting: sas -sysin `c:\sas\myprogram.sas' -stepchkpt sas -sysin `c:\sas\myprogram.sas' -stepchkpt -steprestart-steprestart -stepchklib mylibref -errorcheck strict -errorabend-stepchklib mylibref -errorcheck strict -errorabend

Page 10: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 1010

Display Manager CommandsDisplay Manager Commands

Keep in mind…Keep in mind…

– Since Checkpoint/Restart modes are Since Checkpoint/Restart modes are meant for batch processing, if SAS comes meant for batch processing, if SAS comes across a DM command, checkpoint restart across a DM command, checkpoint restart modes are turned off and the checkpoint modes are turned off and the checkpoint library is deleted.library is deleted.

Page 11: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 1111

Checkpoint/Restart in LSFCheckpoint/Restart in LSF

SAS is currently looking for ways to integrate SAS is currently looking for ways to integrate Checkpoint/Restart into the LSF scheduler.Checkpoint/Restart into the LSF scheduler.

Will work with Job rerun and Job requeueWill work with Job rerun and Job requeue Latest word (from SAS Global Forum 2009), Latest word (from SAS Global Forum 2009),

look for this functionality in ‘an early 9.2 look for this functionality in ‘an early 9.2 maintenance release’maintenance release’

Page 12: What’s new in BASE SAS 9.2

June 12, 2009June 12, 2009 Toronto Area SAS SocietyToronto Area SAS Society 1212

For more info:For more info:

Checkpoint/Restart on Support.sas.com:Checkpoint/Restart on Support.sas.com: http://support.sas.com/documentation/cdl/en/lrcon/61http://support.sas.com/documentation/cdl/en/lrcon/61

722/HTML/default/a000993436.htm722/HTML/default/a000993436.htm

Other new features in Base 9.2:Other new features in Base 9.2: http://support.sas.com/documentation/cdl/en/whatsnehttp://support.sas.com/documentation/cdl/en/whatsne

w/62435/HTML/default/baseovwhatsnew902.htmw/62435/HTML/default/baseovwhatsnew902.htm

All SAS 9.2 Product Documentation:All SAS 9.2 Product Documentation: http://support.sas.com/cdlsearch?ct=80000http://support.sas.com/cdlsearch?ct=80000