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 @sasjslint {"maxLineLength": 93}
20**/
21
22%macro mp_resetoption(option /* the option to reset */
23)/*/STORE SOURCE*/;
24
25%if "%substr(&sysver,1,1)" ne "4" and "%substr(&sysver,1,1)" ne "5" %then %do;
26 data _null_;
27 length code $1500;
28 startup=getoption("&option",'startupvalue');
29 current=getoption("&option");
30 if startup ne current then do;
31 code =cat('OPTIONS ',getoption("&option",'keyword','startupvalue'),';');
32 putlog "NOTE: Resetting system option: " code ;
33 call execute(code );
34 end;
35 run;
36%end;
37%else %do;
38 %put &sysmacroname: reset option feature unavailable on &sysvlong;
39%end;
40%mend mp_resetoption;