Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
ms_deletefile.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing ms_deletefile.sas macro
4
5 <h4> SAS Macros </h4>
6 @li mf_getuniquename.sas
7 @li mp_assert.sas
8 @li mp_assertscope.sas
9 @li ms_createfile.sas
10 @li ms_deletefile.sas
11 @li ms_getfile.sas
12
13**/
14
15
16/* first make a remote file */
17filename stpcode temp;
18%let fname=%mf_getuniquename();
19data _null_;
20 file stpcode;
21 put "data &fname;run;";
22run;
23%ms_createfile(/sasjs/tests/&fname..sas
24 ,inref=stpcode
25 ,mdebug=1
26)
27
28%ms_getfile(/sasjs/tests/&fname..sas,outref=testref)
29
30%let test1=0;
31data _null_;
32 infile testref;
33 input;
34 call symputx('test1',_infile_);
35run;
36
37%mp_assert(
38 iftrue=("&test1"="data &fname;run;"),
39 desc=Make sure the file was created,
40 outds=work.test_results
41)
42
43%mp_assertscope(SNAPSHOT)
44%ms_deletefile(/sasjs/tests/&fname..sas,mdebug=1)
45%mp_assertscope(COMPARE)
46
47%ms_getfile(/sasjs/tests/&fname..sas,outref=testref2)
48
49%let test2=0;
50data _null_;
51 infile testref2;
52 input;
53 call symputx('test2',_infile_);
54run;
55
56%mp_assert(
57 iftrue=("&test2"="File doesn't exist."),
58 desc=Make sure the file was deleted,
59 outds=work.test_results
60)
61
62