Macros for SAS Application Developers
https://github.com/sasjs/core
mf_existfileref.test.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Testing mf_existfileref macro
4 
5  <h4> SAS Macros </h4>
6  @li mf_existfileref.sas
7  @li mp_assert.sas
8 
9 **/
10 
11 filename ref1 temp;
12 filename ref2 temp;
13 
14 data _null_;
15  file ref1;
16  put 'exists';
17 run;
18 
19 %mp_assert(
20  iftrue=(%mf_existfileref(ref1)=1),
21  desc=Checking fileref WITH target file exists,
22  outds=work.test_results
23 )
24 
25 %mp_assert(
26  iftrue=(%mf_existfileref(ref2)=1),
27  desc=Checking fileref WITHOUT target file exists,
28  outds=work.test_results
29 )
30 
31 %mp_assert(
32  iftrue=(%mf_existfileref(ref3)=0),
33  desc=Checking non-existant fref does not exist,
34  outds=work.test_results
35 )