Macros for SAS Application Developers
https://github.com/sasjs/core
mf_getuniquefileref.test.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Testing mf_getuniquefileref macro
4  @details To test performance you can also use the following macro:
5 
6  %macro x(prefix);
7  %let now=%sysfunc(datetime());
8  %do x=1 %to 1000;
9  %let rc=%mf_getuniquefileref(prefix=&prefix);
10  %end;
11  %put %sysevalf(%sysfunc(datetime())-&now);
12  %mend;
13  %x(_)
14  %x(0)
15 
16  <h4> SAS Macros </h4>
17  @li mf_getuniquefileref.sas
18  @li mp_assert.sas
19 
20 **/
21 
22 %mp_assert(
23  iftrue=(
24  "%substr(%mf_getuniquefileref(prefix=0),1,1)"="#"
25  ),
26  desc=Checking for a natively assigned fileref,
27  outds=work.test_results
28 )
29 
30 %mp_assert(
31  iftrue=(
32  "%substr(%mf_getuniquefileref(),1,1)"="_"
33  ),
34  desc=Checking for a default fileref,
35  outds=work.test_results
36 )