mirror of
https://github.com/sasjs/core.git
synced 2026-01-06 17:10:05 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6fd215ceff | ||
|
|
0297509aa0 | ||
|
|
c5a8bc745d | ||
|
|
36aa466561 | ||
|
|
009485e5b9 | ||
|
|
eb01c8772d | ||
|
|
e3fb69928c | ||
|
|
65afa14466 | ||
|
|
0176b19616 | ||
|
|
9f3dfd9a59 | ||
|
|
513ea354ab | ||
|
|
7b686e11c9 | ||
|
|
3997000266 |
9
.github/dependabot.yml
vendored
Normal file
9
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: '/'
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
open-pull-requests-limit: 3
|
||||||
|
allow:
|
||||||
|
- dependency-type: "production"
|
||||||
102
all.sas
102
all.sas
@@ -4715,7 +4715,7 @@ quit;
|
|||||||
numbers).
|
numbers).
|
||||||
@param [out] outfile= The output filename - should be quoted.
|
@param [out] outfile= The output filename - should be quoted.
|
||||||
@param [out] outref= (0) The output fileref (takes precedence if provided)
|
@param [out] outref= (0) The output fileref (takes precedence if provided)
|
||||||
@param [in] outencoding= (0) The output encoding to use (unquoted)
|
@param [in] outencoding= (0) The (quoted) output encoding to use, eg `"UTF-8"`
|
||||||
@param [in] termstr= (CRLF) The line seperator to use. For SASJS, will
|
@param [in] termstr= (CRLF) The line seperator to use. For SASJS, will
|
||||||
always be CRLF. Valid values:
|
always be CRLF. Valid values:
|
||||||
@li CRLF
|
@li CRLF
|
||||||
@@ -4751,7 +4751,7 @@ quit;
|
|||||||
%if %index(&ds,.)=0 %then %let ds=WORK.&ds;
|
%if %index(&ds,.)=0 %then %let ds=WORK.&ds;
|
||||||
|
|
||||||
%if &outencoding=0 %then %let outencoding=;
|
%if &outencoding=0 %then %let outencoding=;
|
||||||
%else %let outencoding=encoding="&outencoding";
|
%else %let outencoding=encoding=&outencoding;
|
||||||
|
|
||||||
%if &outref=0 %then %let outloc=&outfile;
|
%if &outref=0 %then %let outloc=&outfile;
|
||||||
%else %let outloc=&outref;
|
%else %let outloc=&outref;
|
||||||
@@ -10800,17 +10800,19 @@ create table &outds as
|
|||||||
|
|
||||||
%mp_streamfile(contenttype=csv,inloc=/some/where.txt,outname=myfile.txt)
|
%mp_streamfile(contenttype=csv,inloc=/some/where.txt,outname=myfile.txt)
|
||||||
|
|
||||||
|
@param [in] contenttype= (TEXTS) Either TEXT, ZIP, CSV, EXCEL
|
||||||
|
@param [in] inloc= /path/to/file.ext to be sent
|
||||||
|
@param [in] inref= fileref of file to be sent (if provided, overrides `inloc`)
|
||||||
|
@param [in] iftrue= (1=1) Provide a condition under which to execute.
|
||||||
|
@param [out] outname= the name of the file, as downloaded by the browser
|
||||||
|
@param [out] outref= (_webout) The destination where the file should be
|
||||||
|
streamed.
|
||||||
|
|
||||||
<h4> SAS Macros </h4>
|
<h4> SAS Macros </h4>
|
||||||
@li mf_getplatform.sas
|
@li mf_getplatform.sas
|
||||||
@li mp_binarycopy.sas
|
@li mp_binarycopy.sas
|
||||||
|
|
||||||
@param contenttype= Either TEXT, ZIP, CSV, EXCEL (default TEXT)
|
|
||||||
@param inloc= /path/to/file.ext to be sent
|
|
||||||
@param inref= fileref of file to be sent (if provided, overrides `inloc`)
|
|
||||||
@param outname= the name of the file, as downloaded by the browser
|
|
||||||
|
|
||||||
@author Allan Bowe
|
@author Allan Bowe
|
||||||
@source https://github.com/sasjs/core
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@@ -10818,12 +10820,16 @@ create table &outds as
|
|||||||
contenttype=TEXT
|
contenttype=TEXT
|
||||||
,inloc=
|
,inloc=
|
||||||
,inref=0
|
,inref=0
|
||||||
|
,iftrue=%str(1=1)
|
||||||
,outname=
|
,outname=
|
||||||
|
,outref=_webout
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
|
|
||||||
%let contentype=%upcase(&contenttype);
|
%if not(%eval(%unquote(&iftrue))) %then %return;
|
||||||
%local platform; %let platform=%mf_getplatform();
|
|
||||||
|
|
||||||
|
%let contentype=%upcase(&contenttype);
|
||||||
|
%let outref=%upcase(&outref);
|
||||||
|
%local platform; %let platform=%mf_getplatform();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check engine type to avoid the below err message:
|
* check engine type to avoid the below err message:
|
||||||
@@ -10832,20 +10838,20 @@ create table &outds as
|
|||||||
%local streamweb;
|
%local streamweb;
|
||||||
%let streamweb=0;
|
%let streamweb=0;
|
||||||
data _null_;
|
data _null_;
|
||||||
set sashelp.vextfl(where=(upcase(fileref)="_WEBOUT"));
|
set sashelp.vextfl(where=(upcase(fileref)="&outref"));
|
||||||
if xengine='STREAM' then call symputx('streamweb',1,'l');
|
if xengine='STREAM' then call symputx('streamweb',1,'l');
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%if &contentype=ZIP %then %do;
|
%if &contentype=CSV %then %do;
|
||||||
%if &platform=SASMETA and &streamweb=1 %then %do;
|
%if &platform=SASMETA and &streamweb=1 %then %do;
|
||||||
data _null_;
|
data _null_;
|
||||||
rc=stpsrv_header('Content-type','application/zip');
|
rc=stpsrv_header('Content-type','application/csv');
|
||||||
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%else %if &platform=SASVIYA %then %do;
|
%else %if &platform=SASVIYA %then %do;
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.zip'
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.txt'
|
||||||
contenttype='application/zip'
|
contenttype='application/csv'
|
||||||
contentdisp="attachment; filename=&outname";
|
contentdisp="attachment; filename=&outname";
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
@@ -10858,11 +10864,41 @@ run;
|
|||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%else %if &platform=SASVIYA %then %do;
|
%else %if &platform=SASVIYA %then %do;
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.xls'
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.xls'
|
||||||
contenttype='application/vnd.ms-excel'
|
contenttype='application/vnd.ms-excel'
|
||||||
contentdisp="attachment; filename=&outname";
|
contentdisp="attachment; filename=&outname";
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
|
%else %if &contentype=HTML %then %do;
|
||||||
|
%if &platform=SASVIYA %then %do;
|
||||||
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name="_webout.json"
|
||||||
|
contenttype="text/html";
|
||||||
|
%end;
|
||||||
|
%end;
|
||||||
|
%else %if &contentype=TEXT %then %do;
|
||||||
|
%if &platform=SASMETA and &streamweb=1 %then %do;
|
||||||
|
data _null_;
|
||||||
|
rc=stpsrv_header('Content-type','application/text');
|
||||||
|
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
||||||
|
run;
|
||||||
|
%end;
|
||||||
|
%else %if &platform=SASVIYA %then %do;
|
||||||
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.txt'
|
||||||
|
contenttype='application/text'
|
||||||
|
contentdisp="attachment; filename=&outname";
|
||||||
|
%end;
|
||||||
|
%end;
|
||||||
|
%else %if &contentype=WOFF or &contentype=WOFF2 or &contentype=TTF %then %do;
|
||||||
|
%if &platform=SASMETA and &streamweb=1 %then %do;
|
||||||
|
data _null_;
|
||||||
|
rc=stpsrv_header('Content-type',"font/%lowcase(&contenttype)");
|
||||||
|
run;
|
||||||
|
%end;
|
||||||
|
%else %if &platform=SASVIYA %then %do;
|
||||||
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI"
|
||||||
|
contenttype="font/%lowcase(&contenttype)";
|
||||||
|
%end;
|
||||||
|
%end;
|
||||||
%else %if &contentype=XLSX %then %do;
|
%else %if &contentype=XLSX %then %do;
|
||||||
%if &platform=SASMETA and &streamweb=1 %then %do;
|
%if &platform=SASMETA and &streamweb=1 %then %do;
|
||||||
data _null_;
|
data _null_;
|
||||||
@@ -10872,54 +10908,34 @@ run;
|
|||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%else %if &platform=SASVIYA %then %do;
|
%else %if &platform=SASVIYA %then %do;
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.xls'
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.xls'
|
||||||
contenttype=
|
contenttype=
|
||||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
contentdisp="attachment; filename=&outname";
|
contentdisp="attachment; filename=&outname";
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
%else %if &contentype=TEXT %then %do;
|
%else %if &contentype=ZIP %then %do;
|
||||||
%if &platform=SASMETA and &streamweb=1 %then %do;
|
%if &platform=SASMETA and &streamweb=1 %then %do;
|
||||||
data _null_;
|
data _null_;
|
||||||
rc=stpsrv_header('Content-type','application/text');
|
rc=stpsrv_header('Content-type','application/zip');
|
||||||
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%else %if &platform=SASVIYA %then %do;
|
%else %if &platform=SASVIYA %then %do;
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.txt'
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.zip'
|
||||||
contenttype='application/text'
|
contenttype='application/zip'
|
||||||
contentdisp="attachment; filename=&outname";
|
contentdisp="attachment; filename=&outname";
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
%else %if &contentype=CSV %then %do;
|
|
||||||
%if &platform=SASMETA and &streamweb=1 %then %do;
|
|
||||||
data _null_;
|
|
||||||
rc=stpsrv_header('Content-type','application/csv');
|
|
||||||
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
|
||||||
run;
|
|
||||||
%end;
|
|
||||||
%else %if &platform=SASVIYA %then %do;
|
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.txt'
|
|
||||||
contenttype='application/csv'
|
|
||||||
contentdisp="attachment; filename=&outname";
|
|
||||||
%end;
|
|
||||||
%end;
|
|
||||||
%else %if &contentype=HTML %then %do;
|
|
||||||
%if &platform=SASVIYA %then %do;
|
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name="_webout.json"
|
|
||||||
contenttype="text/html";
|
|
||||||
%end;
|
|
||||||
%end;
|
|
||||||
%else %do;
|
%else %do;
|
||||||
%put %str(ERR)OR: Content Type &contenttype NOT SUPPORTED by &sysmacroname!;
|
%put %str(ERR)OR: Content Type &contenttype NOT SUPPORTED by &sysmacroname!;
|
||||||
%return;
|
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if &inref ne 0 %then %do;
|
%if &inref ne 0 %then %do;
|
||||||
%mp_binarycopy(inref=&inref,outref=_webout)
|
%mp_binarycopy(inref=&inref,outref=&outref)
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
%mp_binarycopy(inloc="&inloc",outref=_webout)
|
%mp_binarycopy(inloc="&inloc",outref=&outref)
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%mend mp_streamfile;
|
%mend mp_streamfile;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
numbers).
|
numbers).
|
||||||
@param [out] outfile= The output filename - should be quoted.
|
@param [out] outfile= The output filename - should be quoted.
|
||||||
@param [out] outref= (0) The output fileref (takes precedence if provided)
|
@param [out] outref= (0) The output fileref (takes precedence if provided)
|
||||||
@param [in] outencoding= (0) The output encoding to use (unquoted)
|
@param [in] outencoding= (0) The (quoted) output encoding to use, eg `"UTF-8"`
|
||||||
@param [in] termstr= (CRLF) The line seperator to use. For SASJS, will
|
@param [in] termstr= (CRLF) The line seperator to use. For SASJS, will
|
||||||
always be CRLF. Valid values:
|
always be CRLF. Valid values:
|
||||||
@li CRLF
|
@li CRLF
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
%if %index(&ds,.)=0 %then %let ds=WORK.&ds;
|
%if %index(&ds,.)=0 %then %let ds=WORK.&ds;
|
||||||
|
|
||||||
%if &outencoding=0 %then %let outencoding=;
|
%if &outencoding=0 %then %let outencoding=;
|
||||||
%else %let outencoding=encoding="&outencoding";
|
%else %let outencoding=encoding=&outencoding;
|
||||||
|
|
||||||
%if &outref=0 %then %let outloc=&outfile;
|
%if &outref=0 %then %let outloc=&outfile;
|
||||||
%else %let outloc=&outref;
|
%else %let outloc=&outref;
|
||||||
|
|||||||
@@ -12,17 +12,19 @@
|
|||||||
|
|
||||||
%mp_streamfile(contenttype=csv,inloc=/some/where.txt,outname=myfile.txt)
|
%mp_streamfile(contenttype=csv,inloc=/some/where.txt,outname=myfile.txt)
|
||||||
|
|
||||||
|
@param [in] contenttype= (TEXTS) Either TEXT, ZIP, CSV, EXCEL
|
||||||
|
@param [in] inloc= /path/to/file.ext to be sent
|
||||||
|
@param [in] inref= fileref of file to be sent (if provided, overrides `inloc`)
|
||||||
|
@param [in] iftrue= (1=1) Provide a condition under which to execute.
|
||||||
|
@param [out] outname= the name of the file, as downloaded by the browser
|
||||||
|
@param [out] outref= (_webout) The destination where the file should be
|
||||||
|
streamed.
|
||||||
|
|
||||||
<h4> SAS Macros </h4>
|
<h4> SAS Macros </h4>
|
||||||
@li mf_getplatform.sas
|
@li mf_getplatform.sas
|
||||||
@li mp_binarycopy.sas
|
@li mp_binarycopy.sas
|
||||||
|
|
||||||
@param contenttype= Either TEXT, ZIP, CSV, EXCEL (default TEXT)
|
|
||||||
@param inloc= /path/to/file.ext to be sent
|
|
||||||
@param inref= fileref of file to be sent (if provided, overrides `inloc`)
|
|
||||||
@param outname= the name of the file, as downloaded by the browser
|
|
||||||
|
|
||||||
@author Allan Bowe
|
@author Allan Bowe
|
||||||
@source https://github.com/sasjs/core
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@@ -30,12 +32,16 @@
|
|||||||
contenttype=TEXT
|
contenttype=TEXT
|
||||||
,inloc=
|
,inloc=
|
||||||
,inref=0
|
,inref=0
|
||||||
|
,iftrue=%str(1=1)
|
||||||
,outname=
|
,outname=
|
||||||
|
,outref=_webout
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
|
|
||||||
%let contentype=%upcase(&contenttype);
|
%if not(%eval(%unquote(&iftrue))) %then %return;
|
||||||
%local platform; %let platform=%mf_getplatform();
|
|
||||||
|
|
||||||
|
%let contentype=%upcase(&contenttype);
|
||||||
|
%let outref=%upcase(&outref);
|
||||||
|
%local platform; %let platform=%mf_getplatform();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check engine type to avoid the below err message:
|
* check engine type to avoid the below err message:
|
||||||
@@ -44,20 +50,20 @@
|
|||||||
%local streamweb;
|
%local streamweb;
|
||||||
%let streamweb=0;
|
%let streamweb=0;
|
||||||
data _null_;
|
data _null_;
|
||||||
set sashelp.vextfl(where=(upcase(fileref)="_WEBOUT"));
|
set sashelp.vextfl(where=(upcase(fileref)="&outref"));
|
||||||
if xengine='STREAM' then call symputx('streamweb',1,'l');
|
if xengine='STREAM' then call symputx('streamweb',1,'l');
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%if &contentype=ZIP %then %do;
|
%if &contentype=CSV %then %do;
|
||||||
%if &platform=SASMETA and &streamweb=1 %then %do;
|
%if &platform=SASMETA and &streamweb=1 %then %do;
|
||||||
data _null_;
|
data _null_;
|
||||||
rc=stpsrv_header('Content-type','application/zip');
|
rc=stpsrv_header('Content-type','application/csv');
|
||||||
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%else %if &platform=SASVIYA %then %do;
|
%else %if &platform=SASVIYA %then %do;
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.zip'
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.txt'
|
||||||
contenttype='application/zip'
|
contenttype='application/csv'
|
||||||
contentdisp="attachment; filename=&outname";
|
contentdisp="attachment; filename=&outname";
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
@@ -70,11 +76,41 @@ run;
|
|||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%else %if &platform=SASVIYA %then %do;
|
%else %if &platform=SASVIYA %then %do;
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.xls'
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.xls'
|
||||||
contenttype='application/vnd.ms-excel'
|
contenttype='application/vnd.ms-excel'
|
||||||
contentdisp="attachment; filename=&outname";
|
contentdisp="attachment; filename=&outname";
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
|
%else %if &contentype=HTML %then %do;
|
||||||
|
%if &platform=SASVIYA %then %do;
|
||||||
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name="_webout.json"
|
||||||
|
contenttype="text/html";
|
||||||
|
%end;
|
||||||
|
%end;
|
||||||
|
%else %if &contentype=TEXT %then %do;
|
||||||
|
%if &platform=SASMETA and &streamweb=1 %then %do;
|
||||||
|
data _null_;
|
||||||
|
rc=stpsrv_header('Content-type','application/text');
|
||||||
|
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
||||||
|
run;
|
||||||
|
%end;
|
||||||
|
%else %if &platform=SASVIYA %then %do;
|
||||||
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.txt'
|
||||||
|
contenttype='application/text'
|
||||||
|
contentdisp="attachment; filename=&outname";
|
||||||
|
%end;
|
||||||
|
%end;
|
||||||
|
%else %if &contentype=WOFF or &contentype=WOFF2 or &contentype=TTF %then %do;
|
||||||
|
%if &platform=SASMETA and &streamweb=1 %then %do;
|
||||||
|
data _null_;
|
||||||
|
rc=stpsrv_header('Content-type',"font/%lowcase(&contenttype)");
|
||||||
|
run;
|
||||||
|
%end;
|
||||||
|
%else %if &platform=SASVIYA %then %do;
|
||||||
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI"
|
||||||
|
contenttype="font/%lowcase(&contenttype)";
|
||||||
|
%end;
|
||||||
|
%end;
|
||||||
%else %if &contentype=XLSX %then %do;
|
%else %if &contentype=XLSX %then %do;
|
||||||
%if &platform=SASMETA and &streamweb=1 %then %do;
|
%if &platform=SASMETA and &streamweb=1 %then %do;
|
||||||
data _null_;
|
data _null_;
|
||||||
@@ -84,54 +120,34 @@ run;
|
|||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%else %if &platform=SASVIYA %then %do;
|
%else %if &platform=SASVIYA %then %do;
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.xls'
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.xls'
|
||||||
contenttype=
|
contenttype=
|
||||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
contentdisp="attachment; filename=&outname";
|
contentdisp="attachment; filename=&outname";
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
%else %if &contentype=TEXT %then %do;
|
%else %if &contentype=ZIP %then %do;
|
||||||
%if &platform=SASMETA and &streamweb=1 %then %do;
|
%if &platform=SASMETA and &streamweb=1 %then %do;
|
||||||
data _null_;
|
data _null_;
|
||||||
rc=stpsrv_header('Content-type','application/text');
|
rc=stpsrv_header('Content-type','application/zip');
|
||||||
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%else %if &platform=SASVIYA %then %do;
|
%else %if &platform=SASVIYA %then %do;
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.txt'
|
filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.zip'
|
||||||
contenttype='application/text'
|
contenttype='application/zip'
|
||||||
contentdisp="attachment; filename=&outname";
|
contentdisp="attachment; filename=&outname";
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
%else %if &contentype=CSV %then %do;
|
|
||||||
%if &platform=SASMETA and &streamweb=1 %then %do;
|
|
||||||
data _null_;
|
|
||||||
rc=stpsrv_header('Content-type','application/csv');
|
|
||||||
rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
|
|
||||||
run;
|
|
||||||
%end;
|
|
||||||
%else %if &platform=SASVIYA %then %do;
|
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name='_webout.txt'
|
|
||||||
contenttype='application/csv'
|
|
||||||
contentdisp="attachment; filename=&outname";
|
|
||||||
%end;
|
|
||||||
%end;
|
|
||||||
%else %if &contentype=HTML %then %do;
|
|
||||||
%if &platform=SASVIYA %then %do;
|
|
||||||
filename _webout filesrvc parenturi="&SYS_JES_JOB_URI" name="_webout.json"
|
|
||||||
contenttype="text/html";
|
|
||||||
%end;
|
|
||||||
%end;
|
|
||||||
%else %do;
|
%else %do;
|
||||||
%put %str(ERR)OR: Content Type &contenttype NOT SUPPORTED by &sysmacroname!;
|
%put %str(ERR)OR: Content Type &contenttype NOT SUPPORTED by &sysmacroname!;
|
||||||
%return;
|
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if &inref ne 0 %then %do;
|
%if &inref ne 0 %then %do;
|
||||||
%mp_binarycopy(inref=&inref,outref=_webout)
|
%mp_binarycopy(inref=&inref,outref=&outref)
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
%mp_binarycopy(inloc="&inloc",outref=_webout)
|
%mp_binarycopy(inloc="&inloc",outref=&outref)
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%mend mp_streamfile;
|
%mend mp_streamfile;
|
||||||
|
|||||||
425
package-lock.json
generated
425
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -59,6 +59,7 @@
|
|||||||
"tests/sas9only"
|
"tests/sas9only"
|
||||||
],
|
],
|
||||||
"programFolders": [],
|
"programFolders": [],
|
||||||
|
"binaryFolders": [],
|
||||||
"deployConfig": {
|
"deployConfig": {
|
||||||
"deployServicePack": true,
|
"deployServicePack": true,
|
||||||
"deployScripts": []
|
"deployScripts": []
|
||||||
|
|||||||
28
tests/crossplatform/mp_streamfile.test.sas
Normal file
28
tests/crossplatform/mp_streamfile.test.sas
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
@file
|
||||||
|
@brief Testing mp_streamfile.sas macro
|
||||||
|
@details This is tricky to test as it streams to webout. For now just
|
||||||
|
check the compilation, and for macro leakage.
|
||||||
|
|
||||||
|
<h4> SAS Macros </h4>
|
||||||
|
@li mp_assert.sas
|
||||||
|
@li mp_assertscope.sas
|
||||||
|
@li mp_streamfile.sas
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
%mp_assertscope(SNAPSHOT)
|
||||||
|
|
||||||
|
%mp_streamfile(iftrue=(1=0)
|
||||||
|
,contenttype=csv,inloc=/some/where.txt
|
||||||
|
,outname=myfile.txt
|
||||||
|
)
|
||||||
|
|
||||||
|
%mp_assertscope(COMPARE)
|
||||||
|
|
||||||
|
%mp_assert(
|
||||||
|
iftrue=(&syscc=0),
|
||||||
|
desc=Checking error condition,
|
||||||
|
outds=work.test_results
|
||||||
|
)
|
||||||
|
|
||||||
@@ -2,8 +2,18 @@
|
|||||||
@file
|
@file
|
||||||
@brief term file for tests
|
@brief term file for tests
|
||||||
|
|
||||||
|
<h4> SAS Macros </h4>
|
||||||
|
@li mp_assert.sas
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
%mp_assert(
|
||||||
|
iftrue=(&syscc=0),
|
||||||
|
desc=Checking final error condition,
|
||||||
|
outds=work.test_results
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
%webout(OPEN)
|
%webout(OPEN)
|
||||||
%webout(OBJ, TEST_RESULTS)
|
%webout(OBJ, TEST_RESULTS)
|
||||||
%webout(CLOSE)
|
%webout(CLOSE)
|
||||||
Reference in New Issue
Block a user