Production Ready 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
14options mprint;
15
16%let file=%mf_uid();
17
18%put TEST 1 - basic file upload ;
19filename somefile temp;
20data _null_;
21 file somefile;
22 put 'hello testings';
23run;
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 ;
32data temp;
33x=1;
34run;
35filename 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)