Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mcf_stpsrv_header.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mcf_stpsrv_header macro
4
5 <h4> SAS Macros </h4>
6 @li mcf_stpsrv_header.sas
7 @li mp_assert.sas
8
9**/
10
11%let sasjs_stpsrv_header_loc=%sysfunc(pathname(work))/stpsrv_header.txt;
12
13%mcf_stpsrv_header(wrap=YES, insert_cmplib=YES)
14
15data _null_;
16 rc=stpsrv_header('Content-type','application/text');
17 rc=stpsrv_header('Content-disposition',"attachment; filename=file.txt");
18run;
19
20%let test1=FAIL;
21%let test2=FAIL;
22
23data _null_;
24 infile "&sasjs_stpsrv_header_loc";
25 input;
26 if _n_=1 and _infile_='Content-type: application/text'
27 then call symputx('test1','PASS');
28 else if _n_=2 & _infile_='Content-disposition: attachment; filename=file.txt'
29 then call symputx('test2','PASS');
30run;
31
32%mp_assert(
33 iftrue=(%str(&test1)=%str(PASS)),
34 desc=Check first header line
35)
36%mp_assert(
37 iftrue=(%str(&test2)=%str(PASS)),
38 desc=Check second header line
39)