mirror of
https://github.com/sasjs/core.git
synced 2026-01-03 23:50:06 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
055e8d2f13 | ||
|
|
abfe7fe339 |
26
all.sas
26
all.sas
@@ -2248,7 +2248,8 @@ Usage:
|
|||||||
, mode=REGULAR
|
, mode=REGULAR
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
|
|
||||||
%global sysprocessmode sysprocessname;
|
%global sysprocessmode sysprocessname sasjs_stpsrv_header_loc;
|
||||||
|
%local fref fid i;
|
||||||
|
|
||||||
%if not(%eval(%unquote(&iftrue))) %then %return;
|
%if not(%eval(%unquote(&iftrue))) %then %return;
|
||||||
|
|
||||||
@@ -2342,7 +2343,7 @@ Usage:
|
|||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if %symexist(SYS_JES_JOB_URI) %then %do;
|
%if %symexist(SYS_JES_JOB_URI) %then %do;
|
||||||
/* setup webout */
|
/* setup webout for Viya */
|
||||||
OPTIONS NOBOMFILE;
|
OPTIONS NOBOMFILE;
|
||||||
%if "X&SYS_JES_JOB_URI.X"="XX" %then %do;
|
%if "X&SYS_JES_JOB_URI.X"="XX" %then %do;
|
||||||
filename _webout temp lrecl=999999 mod;
|
filename _webout temp lrecl=999999 mod;
|
||||||
@@ -2352,11 +2353,23 @@ Usage:
|
|||||||
name="_webout.json" lrecl=999999 mod;
|
name="_webout.json" lrecl=999999 mod;
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
|
%else %if %sysfunc(filename(fref,&sasjs_stpsrv_header_loc))=0 %then %do;
|
||||||
|
/* set up http header for SASjs Server */
|
||||||
|
%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(Content-Type: application/json)));
|
||||||
|
%let rc=%sysfunc(fwrite(&fid));
|
||||||
|
%let rc=%sysfunc(fclose(&fid));
|
||||||
|
%let rc=%sysfunc(filename(&fref));
|
||||||
|
%end;
|
||||||
|
|
||||||
/* send response in SASjs JSON format */
|
/* send response in SASjs JSON format */
|
||||||
data _null_;
|
data _null_;
|
||||||
file _webout mod lrecl=32000 encoding='utf-8';
|
file _webout mod lrecl=32000 encoding='utf-8';
|
||||||
length msg syswarningtext syserrortext $32767 ;
|
length msg syswarningtext syserrortext $32767 mode $10 ;
|
||||||
sasdatetime=datetime();
|
sasdatetime=datetime();
|
||||||
msg=symget('msg');
|
msg=symget('msg');
|
||||||
%if &logline>0 %then %do;
|
%if &logline>0 %then %do;
|
||||||
@@ -2372,7 +2385,8 @@ Usage:
|
|||||||
msg=cats('"',msg,'"');
|
msg=cats('"',msg,'"');
|
||||||
if symexist('_debug') then debug=quote(trim(symget('_debug')));
|
if symexist('_debug') then debug=quote(trim(symget('_debug')));
|
||||||
else debug='""';
|
else debug='""';
|
||||||
put '>>weboutBEGIN<<';
|
if symget('sasjsprocessmode')='Stored Program' then mode='SASJS';
|
||||||
|
if mode ne 'SASJS' then put '>>weboutBEGIN<<';
|
||||||
put '{"SYSDATE" : "' "&SYSDATE" '"';
|
put '{"SYSDATE" : "' "&SYSDATE" '"';
|
||||||
put ',"SYSTIME" : "' "&SYSTIME" '"';
|
put ',"SYSTIME" : "' "&SYSTIME" '"';
|
||||||
put ',"sasjsAbort" : [{';
|
put ',"sasjsAbort" : [{';
|
||||||
@@ -2404,8 +2418,8 @@ Usage:
|
|||||||
syswarningtext=quote(trim(symget('syswarningtext')));
|
syswarningtext=quote(trim(symget('syswarningtext')));
|
||||||
put ",""SYSWARNINGTEXT"" : " syswarningtext;
|
put ",""SYSWARNINGTEXT"" : " syswarningtext;
|
||||||
put ',"END_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '" ';
|
put ',"END_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '" ';
|
||||||
put "}" @;
|
put "}" ;
|
||||||
put '>>weboutEND<<';
|
if mode ne 'SASJS' then put '>>weboutEND<<';
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%put _all_;
|
%put _all_;
|
||||||
|
|||||||
@@ -63,7 +63,8 @@
|
|||||||
, mode=REGULAR
|
, mode=REGULAR
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
|
|
||||||
%global sysprocessmode sysprocessname;
|
%global sysprocessmode sysprocessname sasjs_stpsrv_header_loc;
|
||||||
|
%local fref fid i;
|
||||||
|
|
||||||
%if not(%eval(%unquote(&iftrue))) %then %return;
|
%if not(%eval(%unquote(&iftrue))) %then %return;
|
||||||
|
|
||||||
@@ -157,7 +158,7 @@
|
|||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if %symexist(SYS_JES_JOB_URI) %then %do;
|
%if %symexist(SYS_JES_JOB_URI) %then %do;
|
||||||
/* setup webout */
|
/* setup webout for Viya */
|
||||||
OPTIONS NOBOMFILE;
|
OPTIONS NOBOMFILE;
|
||||||
%if "X&SYS_JES_JOB_URI.X"="XX" %then %do;
|
%if "X&SYS_JES_JOB_URI.X"="XX" %then %do;
|
||||||
filename _webout temp lrecl=999999 mod;
|
filename _webout temp lrecl=999999 mod;
|
||||||
@@ -167,11 +168,23 @@
|
|||||||
name="_webout.json" lrecl=999999 mod;
|
name="_webout.json" lrecl=999999 mod;
|
||||||
%end;
|
%end;
|
||||||
%end;
|
%end;
|
||||||
|
%else %if %sysfunc(filename(fref,&sasjs_stpsrv_header_loc))=0 %then %do;
|
||||||
|
/* set up http header for SASjs Server */
|
||||||
|
%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(Content-Type: application/json)));
|
||||||
|
%let rc=%sysfunc(fwrite(&fid));
|
||||||
|
%let rc=%sysfunc(fclose(&fid));
|
||||||
|
%let rc=%sysfunc(filename(&fref));
|
||||||
|
%end;
|
||||||
|
|
||||||
/* send response in SASjs JSON format */
|
/* send response in SASjs JSON format */
|
||||||
data _null_;
|
data _null_;
|
||||||
file _webout mod lrecl=32000 encoding='utf-8';
|
file _webout mod lrecl=32000 encoding='utf-8';
|
||||||
length msg syswarningtext syserrortext $32767 ;
|
length msg syswarningtext syserrortext $32767 mode $10 ;
|
||||||
sasdatetime=datetime();
|
sasdatetime=datetime();
|
||||||
msg=symget('msg');
|
msg=symget('msg');
|
||||||
%if &logline>0 %then %do;
|
%if &logline>0 %then %do;
|
||||||
@@ -187,7 +200,8 @@
|
|||||||
msg=cats('"',msg,'"');
|
msg=cats('"',msg,'"');
|
||||||
if symexist('_debug') then debug=quote(trim(symget('_debug')));
|
if symexist('_debug') then debug=quote(trim(symget('_debug')));
|
||||||
else debug='""';
|
else debug='""';
|
||||||
put '>>weboutBEGIN<<';
|
if symget('sasjsprocessmode')='Stored Program' then mode='SASJS';
|
||||||
|
if mode ne 'SASJS' then put '>>weboutBEGIN<<';
|
||||||
put '{"SYSDATE" : "' "&SYSDATE" '"';
|
put '{"SYSDATE" : "' "&SYSDATE" '"';
|
||||||
put ',"SYSTIME" : "' "&SYSTIME" '"';
|
put ',"SYSTIME" : "' "&SYSTIME" '"';
|
||||||
put ',"sasjsAbort" : [{';
|
put ',"sasjsAbort" : [{';
|
||||||
@@ -219,8 +233,8 @@
|
|||||||
syswarningtext=quote(trim(symget('syswarningtext')));
|
syswarningtext=quote(trim(symget('syswarningtext')));
|
||||||
put ",""SYSWARNINGTEXT"" : " syswarningtext;
|
put ",""SYSWARNINGTEXT"" : " syswarningtext;
|
||||||
put ',"END_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '" ';
|
put ',"END_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '" ';
|
||||||
put "}" @;
|
put "}" ;
|
||||||
put '>>weboutEND<<';
|
if mode ne 'SASJS' then put '>>weboutEND<<';
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%put _all_;
|
%put _all_;
|
||||||
|
|||||||
Reference in New Issue
Block a user