Macros for SAS Application Developers
https://github.com/sasjs/core
mp_jsonout.test.3.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Testing mp_jsonout.sas macro with non-standard chars
4 
5  <h4> SAS Macros </h4>
6  @li mp_jsonout.sas
7  @li mp_assert.sas
8 
9 **/
10 
11 filename webref temp;
12 
13 data demo;
14  do x='"','0A'x,'0D'x,'09'x,'00'x,'0E'x,'0F'x,'01'x,'02'x,'10'x,'11'x,'\';
15  output;
16  end;
17 run;
18 %mp_jsonout(OPEN,jref=webref)
19 %mp_jsonout(OBJ,demo,jref=webref)
20 %mp_jsonout(CLOSE,jref=webref)
21 
22 data _null_;
23  infile webref;
24  input;
25  putlog _infile_;
26 run;
27 
28 libname web JSON fileref=webref;
29 
30 %mp_assert(
31  iftrue=(&syscc=0),
32  desc=Checking for error condition with special chars export,
33  outds=work.test_results
34 )
35 
36 /*
37 data _null_;
38  set work.demo (in=start) web.demo (in=end);
39  put (_all_)(=);
40 run;
41 proc sql;
42 describe table work.demo;
43 describe table web.demo;
44 */
45 
46 proc compare base=work.demo compare=web.demo(keep=x);
47 quit;
48 
49 %mp_assert(
50  iftrue=(&sysinfo=0),
51  desc=Returned json is identical to input table for all special chars,
52  outds=work.test_results
53 )