Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mp_lib2cards.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mp_lib2cards macro
4
5 <h4> SAS Macros </h4>
6 @li mp_lib2cards.sas
7 @li mf_mkdir.sas
8 @li mp_assert.sas
9
10**/
11
12%let root=%sysfunc(pathname(work))/lib2cards;
13%mf_mkdir(&root/lib)
14libname mclib "&root/lib";
15
16data mclib.one;
17 length lbl $20;
18 lbl='cards_value';
19run;
20
21%mp_lib2cards(lib=mclib,outloc=&root/out,outfile=all_cards.sas)
22
23%let cards=%sysfunc(pathname(work))/lib2cards/out/all_cards.sas;
24
25%mp_assert(
26 iftrue=(%sysfunc(fileexist(&cards))=1),
27 desc=Checking that a single output file is created when outfile is given,
28 outds=work.test_results
29)
30
31%let found=0;
32
33data _null_;
34 infile "&cards" truncover;
35 input;
36 if index(_infile_,'cards_value')>0 then call symputx('found',1,'g');
37run;
38
39%mp_assert(
40 iftrue=(&found=1),
41 desc=Checking that the table content reaches the cards file,
42 outds=work.test_results
43)