Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mp_perflog.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mp_perflog macro
4
5 <h4> SAS Macros </h4>
6 @li mp_perflog.sas
7 @li mf_existds.sas
8 @li mp_assert.sas
9
10**/
11
12%mp_perflog(started)
13%mp_perflog(finished)
14
15proc sql noprint;
16 select count(*) into: n_rows from work.mp_perflog;
17 select count(*) into: n_started from work.mp_perflog where label='started';
18quit;
19
20%mp_assert(
21 iftrue=(&n_rows=2),
22 desc=Checking that each call appends a row to the log dataset,
23 outds=work.test_results
24)
25
26%mp_assert(
27 iftrue=(&n_started=1),
28 desc=Checking that the label is stored on the row it was logged with,
29 outds=work.test_results
30)
31
32%mp_perflog(startanew,libds=work.perflog_two)
33%mp_assert(
34 iftrue=(%mf_existds(work.perflog_two)=1),
35 desc=Checking that a named log dataset is created on first use,
36 outds=work.test_results
37)