Macros for SAS Application Developers
https://github.com/sasjs/core
mfv_existfile.test.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Testing mfv_existfile macro function
4 
5  <h4> SAS Macros </h4>
6  @li mf_uid.sas
7  @li mfv_existfile.sas
8  @li mp_assert.sas
9  @li mv_createfile.sas
10 
11 **/
12 
13 options mprint sgen;
14 
15 %let file=%mf_uid();
16 
17 /* create a folder */
18 filename somefile temp;
19 data _null_;
20  file somefile;
21  put 'hello testings';
22 run;
23 %mv_createfile(path=&mcTestAppLoc/temp, name=&file..txt,inref=somefile)
24 
25 
26 %mp_assert(
27  iftrue=(%mfv_existfile(&mcTestAppLoc/temp/&file..txt)=1),
28  desc=Check if created file exists
29 )
30 
31 %mp_assert(
32  iftrue=(%mfv_existfile(&mcTestAppLoc/temp/%mf_uid().txt)=0),
33  desc=Check if non created file does not exist
34 )