What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart...

12
What’s new in What’s new in Checkpoint/Resta Checkpoint/Resta Toronto A Toronto A Checkpoint/Resta Checkpoint/Resta n BASE SAS 9.2 n BASE SAS 9.2 art art Area SAS Society Area SAS Society 1 art art Rupinder Dhillon Dhillon Consulting Inc.

Transcript of What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart...

Page 1: What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

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

Checkpoint/Restart Checkpoint/Restart 

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

Checkpoint/Restart Checkpoint/Restart 

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

Checkpoint/Restart Checkpoint/Restart 

Toronto Area SAS Society Toronto Area SAS Society  1 1 

Checkpoint/Restart Checkpoint/Restart 

Rupinder Dhillon Dhillon Consulting Inc.

Page 2: What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

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

n n  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 

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

n n 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 occurred where the error occurred 

n n 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. 

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 

When resubmitted, the program will When resubmitted, the program will 

Toronto Area SAS Society Toronto Area SAS Society  2 2 

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 occurred where 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

Page 3: What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

Checkpoint/Restart Modes Checkpoint/Restart Modes 

n n  Checkpoint Mode: Checkpoint Mode: n n  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. 

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

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

n n  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. 

n n  Note Note: :  restart mode will always re restart mode will always re (ie. FILENAME, LIBNAME) and macros. (ie. FILENAME, LIBNAME) and macros. 

n n  Why Why? ?  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. 

Checkpoint/Restart Modes Checkpoint/Restart Modes 

SAS records info about the DATA and PROC steps in a SAS records info about the DATA and PROC steps in a 

SAS reads the checkpoint library to determine which SAS reads the checkpoint library to determine which 

Toronto Area SAS Society Toronto Area SAS Society  3 3 

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. 

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

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

Page 4: What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

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

n n  Add the statement Add the statement CHECKPOINT CHECKPOINT EXECUTE_ALWAYS EXECUTE_ALWAYS step. step. 

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

n n  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. 

What if a step should ALWAYS be re What if a step should ALWAYS be re­ ­ 

CHECKPOINT CHECKPOINT EXECUTE_ALWAYS EXECUTE_ALWAYS immediately before the immediately before the 

Toronto Area SAS Society Toronto Area SAS Society  4 4 

This statements tells SAS that this step This statements tells SAS that this step should ignore checkpoint/restart commands should ignore checkpoint/restart commands

Page 5: What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

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

– –  Add the Add the CHECKPOINT EXECUTE_ALWAYS CHECKPOINT 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. 

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

– –  If your checkpoint If your checkpoint­ ­restart library is a user restart library is a user library, you must add the library, you must add the defines the checkpoint defines the checkpoint statement in the batch program. statement in the batch program. 

– –  If you use the If you use the WORK WORK library, no LIBNAME statement is necessary. library, no LIBNAME statement is necessary. 

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

CHECKPOINT EXECUTE_ALWAYS CHECKPOINT 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 

Toronto Area SAS Society Toronto Area SAS Society  5 5 

restart library is a user restart library is a user­ ­defined defined library, you must add the library, you must add the LIBNAME LIBNAME statement that statement that defines the checkpoint defines the checkpoint­ ­restart libref as the first restart libref as the first statement in the batch program. statement in the batch program. 

WORK WORK 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 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

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

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

n n  STEPCHKPT: STEPCHKPT: enables checkpoint mode enables checkpoint mode 

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

n n  STEPCHKPT: STEPCHKPT: enables checkpoint mode enables checkpoint mode 

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

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

names the batch program (if req’d in your operating names the batch program (if req’d in your operating 

enables checkpoint mode enables checkpoint mode 

Toronto Area SAS Society Toronto Area SAS Society  6 6 

enables checkpoint mode enables checkpoint mode 

specifies the libref of the library where SAS specifies the libref of the library where SAS saves the checkpoint restart data saves the checkpoint restart data

Page 7: What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

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

n n  NOTE NOTE:  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: 

– –  NOWORKTERM NOWORKTERM ends ends 

– –  NOWORKINIT NOWORKINIT: does not initialize the WORK library : does not initialize the WORK library 

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

– –  NOWORKINIT NOWORKINIT: does not initialize the WORK library : does not initialize the WORK library when SAS starts when SAS starts 

n n  ERRORCHECK STRICT: ERRORCHECK STRICT: when an error occurs in the LIBNAME, FILENAME, %INCLUDE when an error occurs in the LIBNAME, FILENAME, %INCLUDE and LOCK statements and LOCK statements 

n n  ERRORABEND ERRORABEND specifies whether SAS terminates for most specifies whether SAS terminates for most errors errors 

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

:  if you are not using a user defined library and using the :  if you are not using a user defined library and using the 

NOWORKTERM NOWORKTERM: saves the WORK library when SAS : saves the WORK library when SAS 

: does not initialize the WORK library : does not initialize the WORK library 

Toronto Area SAS Society Toronto Area SAS Society  7 7 

: does not initialize the WORK library : does not initialize the WORK library when SAS starts when SAS starts 

puts SAS in syntax puts SAS in syntax­ ­check mode check mode when an error occurs in the LIBNAME, FILENAME, %INCLUDE when an error occurs in the LIBNAME, FILENAME, %INCLUDE 

specifies whether SAS terminates for most specifies whether SAS terminates for most

Page 8: What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

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

n n  Add: Add: 

– – STEPRESTART STEPRESTART: tells SAS to restart using : tells SAS to restart using checkpoint checkpoint­ ­restart data saved in restart data saved in 

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

checkpoint checkpoint­ ­restart data saved in restart data saved in checkpoint library (Work or usedefined) checkpoint library (Work or usedefined) 

To resubmit a batch job in To resubmit a batch job in 

: tells SAS to restart using : tells SAS to restart using restart data saved in restart data saved in 

Toronto Area SAS Society Toronto Area SAS Society  8 8 

restart data saved in restart data saved in checkpoint library (Work or usedefined) checkpoint library (Work or usedefined)

Page 9: What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

SAS Commands in batch mode SAS Commands in batch mode 

n n  In a Windows Operating Environment: In a Windows Operating Environment: sas sas ­ ­sysin `c: sysin `c:\ \mysas mysas\ \myprogram.sas' myprogram.sas' 

­ ­ stepchkptlib mylibref stepchkptlib mylibref 

Or: Or: 

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

n n  Or: Or: sas sas ­ ­sysin `c: sysin `c:\ \mysas mysas\ \myprogram.sas' myprogram.sas' ­ ­noworkterm noworkterm – –noworkinit noworkinit 

n n  Restarting: Restarting: sas sas ­ ­sysin `c: sysin `c:\ \sas sas\ \myprogram.sas' myprogram.sas' ­ ­stepchklib mylibref stepchklib mylibref ­ ­errorcheck strict errorcheck strict 

SAS Commands in batch mode SAS Commands in batch mode 

In a Windows Operating Environment: In a Windows Operating Environment: myprogram.sas' myprogram.sas' ­ ­stepchkpt stepchkpt 

stepchkptlib mylibref stepchkptlib mylibref ­ ­errorcheck strict errorcheck strict ­ ­errorabbend errorabbend 

Toronto Area SAS Society Toronto Area SAS Society  9 9 

myprogram.sas' myprogram.sas' ­ ­stepchkpt stepchkpt noworkinit noworkinit ­ ­errorcheck strict errorcheck strict ­ ­errorabend errorabend 

myprogram.sas' myprogram.sas' ­ ­stepchkpt stepchkpt ­ ­steprestart steprestart errorcheck strict errorcheck strict ­ ­errorabend errorabend

Page 10: What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

Display Manager Commands Display Manager Commands 

n n  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 

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

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. 

Display Manager Commands Display Manager Commands 

Since Checkpoint/Restart modes are Since Checkpoint/Restart modes are meant for batch processing, if SAS comes meant for batch processing, if SAS comes 

Toronto Area SAS Society Toronto Area SAS Society  10 10 

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

Page 11: What's New in BASE SAS 9 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

Checkpoint/Restart in LSF Checkpoint/Restart in LSF 

n n  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. 

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

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

n n  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’ 

Checkpoint/Restart in LSF Checkpoint/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 requeue Will work with Job rerun and Job requeue Latest word (from SAS Global Forum 2009), Latest word (from SAS Global Forum 2009), 

Toronto Area SAS Society Toronto Area SAS Society  11 11 

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 Group... · 2016-03-11 · What’s new in BASE SAS 9.2 Checkpoint/Restart June 12, 2009 Toronto Area SAS Society ocietyociety 1 1 Rupinder Dhillon Dhillon

For more info: For more info: 

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

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

Other new features in Base 9.2: Other new features in Base 9.2: 

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

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

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

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

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/61 http://support.sas.com/documentation/cdl/en/lrcon/61 722/HTML/default/a000993436.htm 722/HTML/default/a000993436.htm 

Other new features in Base 9.2: Other new features in Base 9.2: 

Toronto Area SAS Society Toronto Area SAS Society  12 12 

Other new features in Base 9.2: Other new features in Base 9.2: http://support.sas.com/documentation/cdl/en/whatsne http://support.sas.com/documentation/cdl/en/whatsne w/62435/HTML/default/baseovwhatsnew902.htm w/62435/HTML/default/baseovwhatsnew902.htm 

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