Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mp_resetoption.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Reset an option to original value
4  @details Inspired by the SAS Jedi - https://blogs.sas.com/content/sastraining/2012/08/14/jedi-sas-tricks-reset-sas-system-options/
5  Called as follows:
6 
7  options obs=30;
8  %mp_resetoption(OBS)
9 
10 
11  @param option the option to reset
12 
13  @version 9.2
14  @author Allan Bowe
15 
16 **/
17 
18 %macro mp_resetoption(option /* the option to reset */
19 )/*/STORE SOURCE*/;
20 
21 data _null_;
22  length code $1500;
23  startup=getoption("&option",'startupvalue');
24  current=getoption("&option");
25  if startup ne current then do;
26  code =cat('OPTIONS ',getoption("&option",'keyword','startupvalue'),';');
27  putlog "NOTE: Resetting system option: " code ;
28  call execute(code );
29  end;
30 run;
31 
32 %mend;