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
9**/
10
11data work.shortnum;
12 length a 3 b 4 c 8;
13 a=1;b=2;c=3;
14 output;
15 stop;
16run;
17
18/**
19 * Test 1 - default CSV
20 */
21
22%mp_ds2csv(work.shortnum,outfile="&_sasjs_work/test1.csv",headerformat=SASJS)
23
24%let test1b=FAIL;
25data _null_;
26 infile "&_sasjs_work/test1.csv";
27 input;
28 list;
29 if _n_=1 then call symputx('test1a',_infile_);
30 else if _infile_=:'1,2,3' then call symputx('test1b','PASS');
31run;
32
33%mp_assert(
34 iftrue=("&test1a"="A:best3. B:best4. C:best32."),
35 desc=Checking header row Test 1,
36 outds=work.test_results
37)
38%mp_assert(
39 iftrue=("&test1b"="PASS"),
40 desc=Checking data row Test 1,
41 outds=work.test_results
42)