Macros for SAS Application Developers
https://github.com/sasjs/core
mp_resetoption.test.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Testing mp_resetoption macro
4 
5  <h4> SAS Macros </h4>
6  @li mp_assert.sas
7  @li mp_assertscope.sas
8  @li mp_resetoption.sas
9 
10 **/
11 
12 
13 %let orig=%sysfunc(getoption(obs));
14 
15 options obs=30;
16 
17 %mp_assertscope(SNAPSHOT)
18 %mp_resetoption(OBS)
19 %mp_assertscope(COMPARE)
20 
21 %let new=%sysfunc(ifc(
22  "%substr(&sysver,1,1)" ne "4" and "%substr(&sysver,1,1)" ne "5",
23  %sysfunc(getoption(obs)), /* test it worked */
24  &orig /* cannot test as option unavailable */
25 ));
26 
27 %mp_assert(
28  iftrue=(&new=&orig),
29  desc=Checking option was reset (if reset option available),
30  outds=work.test_results
31 )