Macros for SAS Application Developers
https://github.com/sasjs/core
mv_createfile.test.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Testing mv_createfile macro
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 
14 options mprint;
15 
16 %let file=%mf_uid();
17 
18 %put TEST 1 - basic file upload ;
19 filename somefile temp;
20 data _null_;
21  file somefile;
22  put 'hello testings';
23 run;
24 %mv_createfile(path=&mcTestAppLoc/temp, name=&file..txt,inref=somefile)
25 
26 %mp_assert(
27  iftrue=(%mfv_existfile(&mcTestAppLoc/temp/&file..txt)=1),
28  desc=Check if created file exists
29 )
30 
31 %put TEST 2 - dataset upload ;
32 data temp;
33 x=1;
34 run;
35 filename ds "%sysfunc(pathname(work))/temp.sas7bdat";
36 
37 %mv_createfile(path=&mcTestAppLoc/temp, name=&file..sas7bdat,inref=ds)
38 
39 %mp_assert(
40  iftrue=(%mfv_existfile(&mcTestAppLoc/temp/&file..sas7bdat)=1),
41  desc=Check if created dataset exists
42 )