Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_getuniquelibref.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mf_getuniquelibref macro
4 @details To test performance you can also use the following macro:
5
6 <h4> SAS Macros </h4>
7 @li mf_getuniquelibref.sas
8 @li mp_assert.sas
9 @li mp_assertscope.sas
10
11**/
12
13/* check valid libs */
14%mp_assertscope(SNAPSHOT)
15%let libshort=%mf_getuniquelibref(prefix=lib);
16%mp_assertscope(COMPARE,ignorelist=LIBSHORT)
17libname &libshort (work);
18%mp_assert(
19 iftrue=(&syscc=0),
20 desc=Checking for valid libref &libshort,
21 outds=work.test_results
22)
23
24%let lib7=%mf_getuniquelibref(prefix=libref7);
25libname &lib7 (work);
26%mp_assert(
27 iftrue=(&syscc=0),
28 desc=Checking for valid libref &lib7,
29 outds=work.test_results
30)
31
32
33/* check for invalid libs */
34
35%let lib8=%mf_getuniquelibref(prefix=lib8char);
36%mp_assert(
37 iftrue=(&lib8=0),
38 desc=Invalid prefix (8 chars),
39 outds=work.test_results
40)
41
42%let liblong=%mf_getuniquelibref(prefix=invalidlib);
43%mp_assert(
44 iftrue=(&liblong=0),
45 desc=Checking for invalid libref (long),
46 outds=work.test_results
47)
48
49%let badlib=%mf_getuniquelibref(prefix=8adlib);
50%mp_assert(
51 iftrue=(&badlib=0),
52 desc=Checking for invalid libref (8adlib),
53 outds=work.test_results
54)