mirror of
https://github.com/sasjs/core.git
synced 2026-01-07 01:20:05 +00:00
chore: updates to address comments
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
<h4> SAS Macros </h4>
|
<h4> SAS Macros </h4>
|
||||||
@li mf_getuniquefileref.sas
|
@li mf_getuniquefileref.sas
|
||||||
|
@li mf_getuniquelibref.sas
|
||||||
@li mf_getuniquename.sas
|
@li mf_getuniquename.sas
|
||||||
@li mp_abort.sas
|
@li mp_abort.sas
|
||||||
@li mp_dropmembers.sas
|
@li mp_dropmembers.sas
|
||||||
@@ -54,7 +55,7 @@
|
|||||||
,outds=work.ms_triggerstp
|
,outds=work.ms_triggerstp
|
||||||
,mdebug=0
|
,mdebug=0
|
||||||
);
|
);
|
||||||
%local dbg mainref authref boundary triggered_sid;
|
%local dbg mainref authref boundary libref triggered_sid;
|
||||||
%let mainref=%mf_getuniquefileref();
|
%let mainref=%mf_getuniquefileref();
|
||||||
%let authref=%mf_getuniquefileref();
|
%let authref=%mf_getuniquefileref();
|
||||||
%let boundary=%mf_getuniquename();
|
%let boundary=%mf_getuniquename();
|
||||||
@@ -81,16 +82,11 @@
|
|||||||
%let optval=%sysfunc(getoption(bomfile));
|
%let optval=%sysfunc(getoption(bomfile));
|
||||||
options nobomfile;
|
options nobomfile;
|
||||||
|
|
||||||
/* Add header to the content of the http request */
|
|
||||||
data _null_;
|
|
||||||
file &mainref termstr=crlf lrecl=32767;
|
|
||||||
put "--&boundary";
|
|
||||||
run;
|
|
||||||
|
|
||||||
/* Add params to the content */
|
/* Add params to the content */
|
||||||
data _null_;
|
data _null_;
|
||||||
file &mainref termstr=crlf lrecl=32767 mod;
|
file &mainref termstr=crlf lrecl=32767 mod;
|
||||||
length line $1000 name $32 value $32767;
|
length line $1000 name $32 value $32767;
|
||||||
|
put "--&boundary";
|
||||||
if _n_=1 then call missing(of _all_);
|
if _n_=1 then call missing(of _all_);
|
||||||
set &inputparams;
|
set &inputparams;
|
||||||
line=cats('Content-Disposition: form-data; name="',name,'"');
|
line=cats('Content-Disposition: form-data; name="',name,'"');
|
||||||
@@ -201,11 +197,12 @@
|
|||||||
/* reset options */
|
/* reset options */
|
||||||
options &optval;
|
options &optval;
|
||||||
|
|
||||||
libname response JSON fileref=&outref;
|
%let libref=%mf_getuniquelibref();
|
||||||
|
libname &libref JSON fileref=&outref;
|
||||||
%let triggered_sid=%mf_getuniquename(prefix=triggered_sid_);
|
%let triggered_sid=%mf_getuniquename(prefix=triggered_sid_);
|
||||||
|
|
||||||
data work.&triggered_sid (keep=sessionid);
|
data work.&triggered_sid (keep=sessionid);
|
||||||
set response.root;
|
set &libref..root;
|
||||||
|
|
||||||
%if &mdebug=1 %then %do;
|
%if &mdebug=1 %then %do;
|
||||||
putlog (_all_)(=);
|
putlog (_all_)(=);
|
||||||
@@ -226,6 +223,7 @@
|
|||||||
filename &authref;
|
filename &authref;
|
||||||
filename &mainref;
|
filename &mainref;
|
||||||
filename &outref;
|
filename &outref;
|
||||||
|
libname &libref clear;
|
||||||
/* and remove temp dataset */
|
/* and remove temp dataset */
|
||||||
%mp_dropmembers(&triggered_sid,libref=work);
|
%mp_dropmembers(&triggered_sid,libref=work);
|
||||||
%end;
|
%end;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
@li mf_existds.sas
|
@li mf_existds.sas
|
||||||
@li mp_assertdsobs.sas
|
@li mp_assertdsobs.sas
|
||||||
@li mp_assertcols.sas
|
@li mp_assertcols.sas
|
||||||
|
@li mf_getvartype.sas
|
||||||
@li ms_deletefile.sas
|
@li ms_deletefile.sas
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@@ -51,11 +52,12 @@ options mprint;
|
|||||||
,outds=work.mySessions
|
,outds=work.mySessions
|
||||||
)
|
)
|
||||||
%mp_assertscope(COMPARE
|
%mp_assertscope(COMPARE
|
||||||
,ignorelist=RESPONSE_JADP1LEN RESPONSE_JADPNUM RESPONSE_JADVLEN)
|
,ignorelist=MCLIB0_JADP1LEN MCLIB0_JADPNUM MCLIB0_JADVLEN)
|
||||||
|
|
||||||
%mp_assert(iftrue=%str(%mf_existds(work.mySessions)=1)
|
%mp_assert(iftrue=%str(%mf_existds(work.mySessions)=1)
|
||||||
,desc=Testing output exists
|
,desc=Testing output exists
|
||||||
,outds=work.test_results)
|
,outds=work.test_results
|
||||||
|
)
|
||||||
|
|
||||||
%mp_assertdsobs(work.mySessions,
|
%mp_assertdsobs(work.mySessions,
|
||||||
test=EQUALS 2,
|
test=EQUALS 2,
|
||||||
@@ -65,7 +67,23 @@ options mprint;
|
|||||||
%mp_assertcols(work.mySessions,
|
%mp_assertcols(work.mySessions,
|
||||||
cols=sessionid,
|
cols=sessionid,
|
||||||
test=ALL,
|
test=ALL,
|
||||||
desc=Testing column exists
|
desc=Testing column exists,
|
||||||
|
outds=work.test_results
|
||||||
|
)
|
||||||
|
|
||||||
|
data _null_;
|
||||||
|
retain contentCheck 1;
|
||||||
|
set work.mySessions end=last;
|
||||||
|
if missing(sessionID) then contentCheck = 0;
|
||||||
|
if last then do;
|
||||||
|
call symputx("contentCheck",contentCheck,"l");
|
||||||
|
end;
|
||||||
|
run;
|
||||||
|
%let typeCheck = %mf_getvartype(work.mySessions,sessionid);
|
||||||
|
|
||||||
|
%mp_assert(iftrue=%str(&typeCheck = C and &contentCheck = 1)
|
||||||
|
,desc=Testing type and content of output
|
||||||
|
,outds=work.test_results
|
||||||
)
|
)
|
||||||
|
|
||||||
%ms_deletefile(/sasjs/tests/&fname1..sas)
|
%ms_deletefile(/sasjs/tests/&fname1..sas)
|
||||||
|
|||||||
Reference in New Issue
Block a user