mirror of
https://github.com/sasjs/core.git
synced 2026-01-15 20:40:05 +00:00
fix: removing wrapper for sasjs webout
This commit is contained in:
58
all.sas
58
all.sas
@@ -18499,6 +18499,58 @@ run;
|
|||||||
%inc &fref1;
|
%inc &fref1;
|
||||||
|
|
||||||
%mend mmx_spkexport;/**
|
%mend mmx_spkexport;/**
|
||||||
|
@file
|
||||||
|
@brief Sets the http headers in the SASjs/server response
|
||||||
|
@details For GET requests, SASjs server will use the file generated by this
|
||||||
|
macro for setting the appropriate http headers in the response.
|
||||||
|
|
||||||
|
It works by writing a file to the session directory, that is then ingested by
|
||||||
|
the server.
|
||||||
|
|
||||||
|
The location of this file is driven by the global variable
|
||||||
|
`sasjs_stpsrv_header_loc` which is made available in the autoexec.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
%mfs_httpheader(Content-type,application/csv)
|
||||||
|
|
||||||
|
@param [in] header_name Name of the http header to set
|
||||||
|
@param [in] header_value Value of the http header to set
|
||||||
|
|
||||||
|
<h4> Related Macros </h4>
|
||||||
|
@li mcf_stpsrv_header.sas
|
||||||
|
|
||||||
|
@version 9.3
|
||||||
|
@author Allan Bowe
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
%macro mfs_httpheader(header_name
|
||||||
|
,header_value
|
||||||
|
)/*/STORE SOURCE*/;
|
||||||
|
%local fref fid i;
|
||||||
|
|
||||||
|
%if %sysfunc(filename(fref,&sasjs_stpsrv_header_loc)) ne 0 %then %do;
|
||||||
|
%put &=fref &=sasjs_stpsrv_header_loc;
|
||||||
|
%put %str(ERR)OR: %sysfunc(sysmsg());
|
||||||
|
%return;
|
||||||
|
%end;
|
||||||
|
|
||||||
|
%let fid=%sysfunc(fopen(&fref,A));
|
||||||
|
|
||||||
|
%if &fid=0 %then %do;
|
||||||
|
%put %str(ERR)OR: %sysfunc(sysmsg());
|
||||||
|
%return;
|
||||||
|
%end;
|
||||||
|
|
||||||
|
%let rc=%sysfunc(fput(&fid,%str(&header_name): %str(&header_value)));
|
||||||
|
%let rc=%sysfunc(fwrite(&fid));
|
||||||
|
|
||||||
|
%let rc=%sysfunc(fclose(&fid));
|
||||||
|
%let rc=%sysfunc(filename(&fref));
|
||||||
|
|
||||||
|
%mend mfs_httpheader;
|
||||||
|
/**
|
||||||
@file
|
@file
|
||||||
@brief Send data to/from @sasjs/server
|
@brief Send data to/from @sasjs/server
|
||||||
@details This macro should be added to the start of each web service,
|
@details This macro should be added to the start of each web service,
|
||||||
@@ -18588,9 +18640,6 @@ run;
|
|||||||
|
|
||||||
/* setup json */
|
/* setup json */
|
||||||
data _null_;file &fref encoding='utf-8' termstr=lf;
|
data _null_;file &fref encoding='utf-8' termstr=lf;
|
||||||
%if %str(&_debug) ge 131 %then %do;
|
|
||||||
put '>>weboutBEGIN<<';
|
|
||||||
%end;
|
|
||||||
put '{"SYSDATE" : "' "&SYSDATE" '"';
|
put '{"SYSDATE" : "' "&SYSDATE" '"';
|
||||||
put ',"SYSTIME" : "' "&SYSTIME" '"';
|
put ',"SYSTIME" : "' "&SYSTIME" '"';
|
||||||
run;
|
run;
|
||||||
@@ -18670,9 +18719,6 @@ run;
|
|||||||
memsize=quote(cats(memsize));
|
memsize=quote(cats(memsize));
|
||||||
put ',"MEMSIZE" : ' memsize;
|
put ',"MEMSIZE" : ' memsize;
|
||||||
put "}" @;
|
put "}" @;
|
||||||
%if %str(&_debug) ge 131 %then %do;
|
|
||||||
put '>>weboutEND<<';
|
|
||||||
%end;
|
|
||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
|
|||||||
@@ -88,9 +88,6 @@
|
|||||||
|
|
||||||
/* setup json */
|
/* setup json */
|
||||||
data _null_;file &fref encoding='utf-8' termstr=lf;
|
data _null_;file &fref encoding='utf-8' termstr=lf;
|
||||||
%if %str(&_debug) ge 131 %then %do;
|
|
||||||
put '>>weboutBEGIN<<';
|
|
||||||
%end;
|
|
||||||
put '{"SYSDATE" : "' "&SYSDATE" '"';
|
put '{"SYSDATE" : "' "&SYSDATE" '"';
|
||||||
put ',"SYSTIME" : "' "&SYSTIME" '"';
|
put ',"SYSTIME" : "' "&SYSTIME" '"';
|
||||||
run;
|
run;
|
||||||
@@ -170,9 +167,6 @@
|
|||||||
memsize=quote(cats(memsize));
|
memsize=quote(cats(memsize));
|
||||||
put ',"MEMSIZE" : ' memsize;
|
put ',"MEMSIZE" : ' memsize;
|
||||||
put "}" @;
|
put "}" @;
|
||||||
%if %str(&_debug) ge 131 %then %do;
|
|
||||||
put '>>weboutEND<<';
|
|
||||||
%end;
|
|
||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user