Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mp_ds2csv.test.2.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mp_ds2csv.sas macro
4
5 <h4> SAS Macros </h4>
6 @li mp_ds2csv.sas
7 @li mp_assert.sas
8 @li mp_assertscope.sas
9
10**/
11
12data work.shortnum;
13 length a 3 b 4 c 8;
14 a=1;b=2;c=3;
15 output;
16 stop;
17run;
18
19/**
20 * Test 1 - default CSV
21 */
22
23%mp_ds2csv(work.shortnum,outfile="&sasjswork/test1.csv",headerformat=SASJS)
24
25%let test1b=FAIL;
26data _null_;
27 infile "&sasjswork/test1.csv";
28 input;
29 list;
30 if _n_=1 then call symputx('test1a',_infile_);
31 else if _infile_=:'1,2,3' then call symputx('test1b','PASS');
32run;
33
34%mp_assert(
35 iftrue=("&test1a"="A:best3. B:best4. C:best."),
36 desc=Checking header row Test 1,
37 outds=work.test_results
38)
39%mp_assert(
40 iftrue=("&test1b"="PASS"),
41 desc=Checking data row Test 1,
42 outds=work.test_results
43)