mirror of
https://github.com/sasjs/core.git
synced 2026-01-06 00:50:05 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a88689428f | ||
|
|
8843fa8bfc | ||
|
|
22d046cf5c | ||
|
|
29e3eb34aa |
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v2
|
uses: cycjimmy/semantic-release-action@v3
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|||||||
68
all.sas
68
all.sas
@@ -14061,7 +14061,8 @@ run;
|
|||||||
filename __us2grp temp;
|
filename __us2grp temp;
|
||||||
|
|
||||||
proc metadata in= "<UpdateMetadata><Reposid>$METAREPOSITORY</Reposid><Metadata>
|
proc metadata in= "<UpdateMetadata><Reposid>$METAREPOSITORY</Reposid><Metadata>
|
||||||
<Person Id='&uuri'><IdentityGroups><IdentityGroup ObjRef='&guri' />
|
<Person Id='%nrstr(&uuri)'>
|
||||||
|
<IdentityGroups><IdentityGroup ObjRef='%nrstr(&guri)' />
|
||||||
</IdentityGroups></Person></Metadata>
|
</IdentityGroups></Person></Metadata>
|
||||||
<NS>SAS</NS><Flags>268435456</Flags></UpdateMetadata>"
|
<NS>SAS</NS><Flags>268435456</Flags></UpdateMetadata>"
|
||||||
out=__us2grp verbose;
|
out=__us2grp verbose;
|
||||||
@@ -14078,7 +14079,8 @@ run;
|
|||||||
|
|
||||||
filename __us2grp clear;
|
filename __us2grp clear;
|
||||||
|
|
||||||
%mend mm_adduser2group;/**
|
%mend mm_adduser2group;
|
||||||
|
/**
|
||||||
@file
|
@file
|
||||||
@brief Assigns library directly using details from metadata
|
@brief Assigns library directly using details from metadata
|
||||||
@details Queries metadata to get the libname definition then allocates the
|
@details Queries metadata to get the libname definition then allocates the
|
||||||
@@ -22106,8 +22108,9 @@ options &optval;
|
|||||||
|
|
||||||
<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 mp_abort.sas
|
@li mp_abort.sas
|
||||||
|
@li mp_chop.sas
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@@ -22220,7 +22223,10 @@ run;
|
|||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
filename &outref temp lrecl=32767;
|
%local resp_path;
|
||||||
|
%let resp_path=%sysfunc(pathname(work))/%mf_getuniquename();
|
||||||
|
filename &outref "&resp_path" lrecl=32767;
|
||||||
|
|
||||||
/* prepare request*/
|
/* prepare request*/
|
||||||
proc http method='POST' headerin=&authref in=&mainref out=&outref
|
proc http method='POST' headerin=&authref in=&mainref out=&outref
|
||||||
url="&_sasjs_apiserverurl.&_sasjs_apipath?_program=&pgm%str(&)_debug=131";
|
url="&_sasjs_apiserverurl.&_sasjs_apipath?_program=&pgm%str(&)_debug=131";
|
||||||
@@ -22228,6 +22234,7 @@ proc http method='POST' headerin=&authref in=&mainref out=&outref
|
|||||||
debug level=2;
|
debug level=2;
|
||||||
%end;
|
%end;
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%if (&SYS_PROCHTTP_STATUS_CODE ne 200 and &SYS_PROCHTTP_STATUS_CODE ne 201)
|
%if (&SYS_PROCHTTP_STATUS_CODE ne 200 and &SYS_PROCHTTP_STATUS_CODE ne 201)
|
||||||
or &mdebug=1
|
or &mdebug=1
|
||||||
%then %do;
|
%then %do;
|
||||||
@@ -22243,11 +22250,22 @@ or &mdebug=1
|
|||||||
options &optval;
|
options &optval;
|
||||||
|
|
||||||
%if &outlogds ne _null_ or &mdebug=1 %then %do;
|
%if &outlogds ne _null_ or &mdebug=1 %then %do;
|
||||||
%local dumplib;
|
%local matchstr chopout;
|
||||||
%let dumplib=%mf_getuniquelibref();
|
%let matchstr=SASJS_LOGS_SEPARATOR_163ee17b6ff24f028928972d80a26784;
|
||||||
libname &dumplib json fileref=&outref;
|
%let chopout=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop);
|
||||||
|
|
||||||
|
%mp_chop("&resp_path"
|
||||||
|
,matchvar=matchstr
|
||||||
|
,keep=LAST
|
||||||
|
,matchpoint=END
|
||||||
|
,outfile="&chopout"
|
||||||
|
,mdebug=&mdebug
|
||||||
|
)
|
||||||
|
|
||||||
data &outlogds;
|
data &outlogds;
|
||||||
set &dumplib..log;
|
infile "&chopout" lrecl=2000;
|
||||||
|
length line $2000;
|
||||||
|
line=_infile_;
|
||||||
%if &mdebug=1 %then %do;
|
%if &mdebug=1 %then %do;
|
||||||
putlog line=;
|
putlog line=;
|
||||||
%end;
|
%end;
|
||||||
@@ -22374,50 +22392,38 @@ run;
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
/* SASjs services have the _webout embedded in wrapper JSON */
|
/* chop out JSON section */
|
||||||
/* Files can also be very large - so use a dedicated macro to chop it out */
|
%local matchstr chopout;
|
||||||
%local matchstr1 matchstr2 ;
|
%let matchstr=SASJS_LOGS_SEPARATOR_163ee17b6ff24f028928972d80a26784;
|
||||||
%let matchstr1={"status":"success","_webout":{;
|
%let chopout=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop);
|
||||||
%let matchstr2=},"log":[{;
|
|
||||||
%let chopout1=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop1);
|
|
||||||
%let chopout2=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop2);
|
|
||||||
|
|
||||||
%mp_chop("%sysfunc(pathname(&fref1,F))"
|
%mp_chop("%sysfunc(pathname(&fref1,F))"
|
||||||
,matchvar=matchstr1
|
,matchvar=matchstr
|
||||||
,keep=LAST
|
|
||||||
,matchpoint=END
|
|
||||||
,offset=-1
|
|
||||||
,outfile="&chopout1"
|
|
||||||
,mdebug=&mdebug
|
|
||||||
)
|
|
||||||
|
|
||||||
%mp_chop("&chopout1"
|
|
||||||
,matchvar=matchstr2
|
|
||||||
,keep=FIRST
|
,keep=FIRST
|
||||||
,matchpoint=START
|
,matchpoint=START
|
||||||
,offset=1
|
,offset=-1
|
||||||
,outfile="&chopout2"
|
,outfile="&chopout"
|
||||||
,mdebug=&mdebug
|
,mdebug=&mdebug
|
||||||
)
|
)
|
||||||
|
|
||||||
%if &outlib ne 0 %then %do;
|
%if &outlib ne 0 %then %do;
|
||||||
libname &outlib json "&chopout2";
|
libname &outlib json "&chopout";
|
||||||
%end;
|
%end;
|
||||||
%if &outref ne 0 %then %do;
|
%if &outref ne 0 %then %do;
|
||||||
filename &outref "&chopout2";
|
filename &outref "&chopout";
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if &mdebug=0 %then %do;
|
%if &mdebug=0 %then %do;
|
||||||
filename &webref clear;
|
filename &webref clear;
|
||||||
filename &fref1 clear;
|
filename &fref1 clear;
|
||||||
filename &fref2 clear;
|
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
%put &sysmacroname exit vars:;
|
%put &sysmacroname exit vars:;
|
||||||
%put _local_;
|
%put _local_;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%mend ms_testservice;/**
|
%mend ms_testservice;
|
||||||
|
/**
|
||||||
@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,
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ run;
|
|||||||
filename __us2grp temp;
|
filename __us2grp temp;
|
||||||
|
|
||||||
proc metadata in= "<UpdateMetadata><Reposid>$METAREPOSITORY</Reposid><Metadata>
|
proc metadata in= "<UpdateMetadata><Reposid>$METAREPOSITORY</Reposid><Metadata>
|
||||||
<Person Id='&uuri'><IdentityGroups><IdentityGroup ObjRef='&guri' />
|
<Person Id='%nrstr(&uuri)'>
|
||||||
|
<IdentityGroups><IdentityGroup ObjRef='%nrstr(&guri)' />
|
||||||
</IdentityGroups></Person></Metadata>
|
</IdentityGroups></Person></Metadata>
|
||||||
<NS>SAS</NS><Flags>268435456</Flags></UpdateMetadata>"
|
<NS>SAS</NS><Flags>268435456</Flags></UpdateMetadata>"
|
||||||
out=__us2grp verbose;
|
out=__us2grp verbose;
|
||||||
@@ -98,4 +99,4 @@ run;
|
|||||||
|
|
||||||
filename __us2grp clear;
|
filename __us2grp clear;
|
||||||
|
|
||||||
%mend mm_adduser2group;
|
%mend mm_adduser2group;
|
||||||
|
|||||||
@@ -39,8 +39,9 @@
|
|||||||
|
|
||||||
<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 mp_abort.sas
|
@li mp_abort.sas
|
||||||
|
@li mp_chop.sas
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@@ -153,7 +154,10 @@ run;
|
|||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
filename &outref temp lrecl=32767;
|
%local resp_path;
|
||||||
|
%let resp_path=%sysfunc(pathname(work))/%mf_getuniquename();
|
||||||
|
filename &outref "&resp_path" lrecl=32767;
|
||||||
|
|
||||||
/* prepare request*/
|
/* prepare request*/
|
||||||
proc http method='POST' headerin=&authref in=&mainref out=&outref
|
proc http method='POST' headerin=&authref in=&mainref out=&outref
|
||||||
url="&_sasjs_apiserverurl.&_sasjs_apipath?_program=&pgm%str(&)_debug=131";
|
url="&_sasjs_apiserverurl.&_sasjs_apipath?_program=&pgm%str(&)_debug=131";
|
||||||
@@ -161,6 +165,7 @@ proc http method='POST' headerin=&authref in=&mainref out=&outref
|
|||||||
debug level=2;
|
debug level=2;
|
||||||
%end;
|
%end;
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%if (&SYS_PROCHTTP_STATUS_CODE ne 200 and &SYS_PROCHTTP_STATUS_CODE ne 201)
|
%if (&SYS_PROCHTTP_STATUS_CODE ne 200 and &SYS_PROCHTTP_STATUS_CODE ne 201)
|
||||||
or &mdebug=1
|
or &mdebug=1
|
||||||
%then %do;
|
%then %do;
|
||||||
@@ -176,11 +181,22 @@ or &mdebug=1
|
|||||||
options &optval;
|
options &optval;
|
||||||
|
|
||||||
%if &outlogds ne _null_ or &mdebug=1 %then %do;
|
%if &outlogds ne _null_ or &mdebug=1 %then %do;
|
||||||
%local dumplib;
|
%local matchstr chopout;
|
||||||
%let dumplib=%mf_getuniquelibref();
|
%let matchstr=SASJS_LOGS_SEPARATOR_163ee17b6ff24f028928972d80a26784;
|
||||||
libname &dumplib json fileref=&outref;
|
%let chopout=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop);
|
||||||
|
|
||||||
|
%mp_chop("&resp_path"
|
||||||
|
,matchvar=matchstr
|
||||||
|
,keep=LAST
|
||||||
|
,matchpoint=END
|
||||||
|
,outfile="&chopout"
|
||||||
|
,mdebug=&mdebug
|
||||||
|
)
|
||||||
|
|
||||||
data &outlogds;
|
data &outlogds;
|
||||||
set &dumplib..log;
|
infile "&chopout" lrecl=2000;
|
||||||
|
length line $2000;
|
||||||
|
line=_infile_;
|
||||||
%if &mdebug=1 %then %do;
|
%if &mdebug=1 %then %do;
|
||||||
putlog line=;
|
putlog line=;
|
||||||
%end;
|
%end;
|
||||||
|
|||||||
@@ -108,47 +108,34 @@ run;
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
/* SASjs services have the _webout embedded in wrapper JSON */
|
/* chop out JSON section */
|
||||||
/* Files can also be very large - so use a dedicated macro to chop it out */
|
%local matchstr chopout;
|
||||||
%local matchstr1 matchstr2 ;
|
%let matchstr=SASJS_LOGS_SEPARATOR_163ee17b6ff24f028928972d80a26784;
|
||||||
%let matchstr1={"status":"success","_webout":{;
|
%let chopout=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop);
|
||||||
%let matchstr2=},"log":[{;
|
|
||||||
%let chopout1=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop1);
|
|
||||||
%let chopout2=%sysfunc(pathname(work))/%mf_getuniquename(prefix=chop2);
|
|
||||||
|
|
||||||
%mp_chop("%sysfunc(pathname(&fref1,F))"
|
%mp_chop("%sysfunc(pathname(&fref1,F))"
|
||||||
,matchvar=matchstr1
|
,matchvar=matchstr
|
||||||
,keep=LAST
|
|
||||||
,matchpoint=END
|
|
||||||
,offset=-1
|
|
||||||
,outfile="&chopout1"
|
|
||||||
,mdebug=&mdebug
|
|
||||||
)
|
|
||||||
|
|
||||||
%mp_chop("&chopout1"
|
|
||||||
,matchvar=matchstr2
|
|
||||||
,keep=FIRST
|
,keep=FIRST
|
||||||
,matchpoint=START
|
,matchpoint=START
|
||||||
,offset=1
|
,offset=-1
|
||||||
,outfile="&chopout2"
|
,outfile="&chopout"
|
||||||
,mdebug=&mdebug
|
,mdebug=&mdebug
|
||||||
)
|
)
|
||||||
|
|
||||||
%if &outlib ne 0 %then %do;
|
%if &outlib ne 0 %then %do;
|
||||||
libname &outlib json "&chopout2";
|
libname &outlib json "&chopout";
|
||||||
%end;
|
%end;
|
||||||
%if &outref ne 0 %then %do;
|
%if &outref ne 0 %then %do;
|
||||||
filename &outref "&chopout2";
|
filename &outref "&chopout";
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if &mdebug=0 %then %do;
|
%if &mdebug=0 %then %do;
|
||||||
filename &webref clear;
|
filename &webref clear;
|
||||||
filename &fref1 clear;
|
filename &fref1 clear;
|
||||||
filename &fref2 clear;
|
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
%put &sysmacroname exit vars:;
|
%put &sysmacroname exit vars:;
|
||||||
%put _local_;
|
%put _local_;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%mend ms_testservice;
|
%mend ms_testservice;
|
||||||
|
|||||||
Reference in New Issue
Block a user