Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mddl_derivedvars.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mddl_derivedvars macro
4
5 <h4> SAS Macros </h4>
6 @li mddl_derivedvars.sas
7 @li mf_existds.sas
8 @li mp_assert.sas
9
10**/
11
12%mddl_derivedvars(libds=work.derived_vars)
13
14proc sql noprint;
15 select count(*) into: n_cols from dictionary.columns
16 where upcase(libname)='WORK' and upcase(memname)='DERIVED_VARS';
17 select count(*) into: n_idx from sashelp.vindex
18 where upcase(libname)='WORK' and upcase(memname)='DERIVED_VARS'
19 and upcase(indxname)='PK_DERIVEDVARS';
20quit;
21
22%mp_assert(
23 iftrue=(%mf_existds(work.derived_vars)=1),
24 desc=Checking that the derived variables table is created,
25 outds=work.test_results
26)
27
28%mp_assert(
29 iftrue=(&n_cols=10),
30 desc=Checking that the table has the ten documented columns,
31 outds=work.test_results
32)
33
34%mp_assert(
35 iftrue=(&n_idx=3),
36 desc=Checking that the three column primary key index is created,
37 outds=work.test_results
38)