Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mfv_existfolder.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mfv_existfolder macro function
4
5 <h4> SAS Macros </h4>
6 @li mf_uid.sas
7 @li mfv_existfolder.sas
8 @li mp_assert.sas
9 @li mv_createfolder.sas
10
11**/
12
13options mprint sgen;
14
15%let folder=%mf_uid();
16
17/* create a folder */
18%mv_createfolder(path=&mcTestAppLoc/temp/&folder)
19
20
21%mp_assert(
22 iftrue=(%mfv_existfolder(&mcTestAppLoc/temp/&folder)=1),
23 desc=Check if created folder exists
24)
25
26%mp_assert(
27 iftrue=(%mfv_existfolder(&mcTestAppLoc/temp/&folder/%mf_uid()/noway)=0),
28 desc=Check if non created folder does not exist
29)
30
31/* the syscc guard: see mfv_existfile.test.sas */
32%let syscc=1012;
33%let guard_ret=%mfv_existfolder(&mcTestAppLoc/temp/&folder);
34%let guard_syscc=&syscc;
35%let syscc=0;
36%mp_assert(
37 iftrue=(&guard_ret=0),
38 desc=Check the syscc guard returns 0 rather than aborting
39)
40%mp_assert(
41 iftrue=(&guard_syscc=1012),
42 desc=Check the syscc guard leaves syscc alone
43)