Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
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 -
5https://blogs.sas.com/content/sastraining/2012/08/14/jedi-sas-tricks-reset-sas-system-options
6
7 Called as follows:
8
9 options obs=30 ps=max;
10 %mp_resetoption(OBS)
11 %mp_resetoption(PS)
12
13
14 @param [in] option the option to reset
15
16 @version 9.2
17 @author Allan Bowe
18
19**/
20
21%macro mp_resetoption(option /* the option to reset */
22)/*/STORE SOURCE*/;
23
24%if "%substr(&sysver,1,1)" ne "4" and "%substr(&sysver,1,1)" ne "5" %then %do;
25 data _null_;
26 length code $1500;
27 startup=getoption("&option",'startupvalue');
28 current=getoption("&option");
29 if startup ne current then do;
30 code =cat('OPTIONS ',getoption("&option",'keyword','startupvalue'),';');
31 putlog "NOTE: Resetting system option: " code ;
32 call execute(code );
33 end;
34 run;
35%end;
36%else %do;
37 %put &sysmacroname: reset option feature unavailable on &sysvlong;
38%end;
39%mend mp_resetoption;