Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mfv_getpathuri.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mfv_getpathuri macro function
4
5 <h4> SAS Macros </h4>
6 @li mf_uid.sas
7 @li mfv_existfile.sas
8 @li mfv_getpathuri.sas
9 @li mp_assert.sas
10 @li mv_createfile.sas
11
12**/
13
14options mprint sgen;
15
16%let file=%mf_uid();
17
18/* create a file */
19filename somefile temp;
20data _null_;
21 file somefile;
22 put 'hello testings';
23run;
24%let path=&mcTestAppLoc/temp;
25%mv_createfile(path=&path, name=&file..txt,inref=somefile)
26
27
28%mp_assert(
29 iftrue=(%mfv_existfile(&path/&file..txt)=1),
30 desc=Check if created file exists
31)
32
33%mp_assert(
34 iftrue=(%length(%mfv_getpathuri(&path/&file..txt))>0),
35 desc=Check that a URI was returned
36)
37
38/* the syscc guard: an empty uri, and syscc untouched */
39%let syscc=1012;
40%let guard_uri=%mfv_getpathuri(&path/&file..txt);
41%let guard_syscc=&syscc;
42%let syscc=0;
43%mp_assert(
44 iftrue=(%length(&guard_uri)=0),
45 desc=Check the syscc guard returns no uri rather than aborting
46)
47%mp_assert(
48 iftrue=(&guard_syscc=1012),
49 desc=Check the syscc guard leaves syscc alone
50)