Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mp_searchdata.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mp_searchdata.sas
4
5 <h4> SAS Macros </h4>
6 @li mp_searchdata.sas
7 @li mp_assert.sas
8
9
10**/
11
12/* SYSWARNINGTEXT is an automatic variable and cannot be modified, so
13 capture the session start state (may contain a license expiry warning,
14 which is an environment issue) and later assert nothing new was added */
15%let initwarningtext=%superq(syswarningtext);
16
17/** Test 1 - generic useage */
18
19%mp_searchdata(lib=sashelp, ds=class, string=a)
20%mp_assert(
21 iftrue=(&syscc=0),
22 desc=No errors in regular usage,
23 outds=work.test_results
24)
25
26/** Test 2 - with obs issue */
27
28%mp_searchdata(lib=sashelp, ds=class, string=l,outobs=5)
29
30/* assert that mp_searchdata itself raised no new warnings */
31%mp_assert(
32 iftrue=("%superq(syswarningtext)"="%superq(initwarningtext)"),
33 desc=Ensuring WARN status is clean,
34 outds=work.test_results
35)