mirror of
https://github.com/sasjs/core.git
synced 2026-01-09 18:30:06 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f5fa414e1 | ||
|
|
4b142f1f45 | ||
|
|
3f73a565a6 | ||
|
|
d3f1c8e960 | ||
|
|
0d10441b89 | ||
|
|
85e1f56400 | ||
|
|
c5ec21c7a0 | ||
|
|
e049ab99a7 | ||
|
|
e9deab3885 | ||
|
|
8d2f084316 |
21
README.md
21
README.md
@@ -147,16 +147,17 @@ filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
|
|||||||
- macro names must be lowercase
|
- macro names must be lowercase
|
||||||
- one macro per file
|
- one macro per file
|
||||||
- prefixes:
|
- prefixes:
|
||||||
- _mcf_ for macro compiled functions (proc fcmp)
|
- _mcf__: macro compiled functions (proc fcmp)
|
||||||
- _mddl_ for macros containing DDL (Data Definition Language)
|
- _mddl__: macros containing DDL (Data Definition Language)
|
||||||
- _mf_ for macro functions (can be used in open code).
|
- _mf__: macro functions (can be used in open code).
|
||||||
- _ml_ for macros that are used to compile LUA modules
|
- _mfv__: macro functions that work only in Viya
|
||||||
- _mm_ for metadata macros (interface with the metadata server).
|
- _ml__: macros that are used to compile LUA modules
|
||||||
- _mmx_ for macros that use metadata and are XCMD enabled (working on both windows and unix)
|
- _mm__: metadata macros (interface with the metadata server).
|
||||||
- _mp_ for macro procedures (which generate sas code)
|
- _mmx__: macros that use metadata and are XCMD enabled (working on both windows and unix)
|
||||||
- _ms_ for macro procedures that will only work with [@sasjs/server](https://github.com/sasjs/server)
|
- _mp__: macro procedures (which generate sas code)
|
||||||
- _mv_ for macro procedures that will only work in Viya
|
- _ms__: macro procedures that will only work with [@sasjs/server](https://github.com/sasjs/server)
|
||||||
- _mx_ for macros that work on Viya, SAS 9 EBI and SASjs Server
|
- _mv__: macro procedures that will only work in Viya
|
||||||
|
- _mx__: macros that work on Viya, SAS 9 EBI and SASjs Server
|
||||||
- follow verb-noun convention
|
- follow verb-noun convention
|
||||||
- unix style line endings (lf)
|
- unix style line endings (lf)
|
||||||
- individual lines should be no more than 80 characters long
|
- individual lines should be no more than 80 characters long
|
||||||
|
|||||||
68
all.sas
68
all.sas
@@ -24379,26 +24379,28 @@ run;
|
|||||||
%end;
|
%end;
|
||||||
"Accept"="*/*";
|
"Accept"="*/*";
|
||||||
run;
|
run;
|
||||||
%put &sysmacroname DELETE &base_uri&fileuri
|
%put &sysmacroname DELETE &base_uri&fileuri;
|
||||||
&=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
%if &SYS_PROCHTTP_STATUS_CODE ne 204 %then %do;
|
||||||
|
%put &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||||
|
%end;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%local url mimetype;
|
%local url mimetype ext;
|
||||||
%let url=&base_uri/files/files?parentFolderUri=&self_uri;
|
%let url=&base_uri/files/files?parentFolderUri=&self_uri;
|
||||||
|
%let ext=%upcase(%scan(&name,-1,.));
|
||||||
|
|
||||||
/* fetch job info */
|
/* fetch job info */
|
||||||
%local fname1;
|
%local fname1;
|
||||||
%let fname1=%mf_getuniquefileref();
|
%let fname1=%mf_getuniquefileref();
|
||||||
proc http method='POST' out=&fname1 &oauth_bearer in=&fref
|
proc http method='POST' out=&fname1 &oauth_bearer in=&fref
|
||||||
%if "&ctype" = "0" %then %do;
|
%if "&ctype" = "0" %then %do;
|
||||||
%let mimetype=%mf_mimetype(%scan(&name,-1,.));
|
%let mimetype=%mf_mimetype(&ext);
|
||||||
ct="&mimetype"
|
ct="&mimetype"
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
ct="&ctype"
|
ct="&ctype"
|
||||||
%end;
|
%end;
|
||||||
%if "&mimetype"="text/html" or "&mimetype"="text/css"
|
%if "&ext"="HTML" or "&ext"="CSS" or "&ext"="JS" or "&ext"="SVG" %then %do;
|
||||||
or "&mimetype"="text/javascript" %then %do;
|
|
||||||
url="&url%str(&)typeDefName=file";
|
url="&url%str(&)typeDefName=file";
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
@@ -24409,9 +24411,16 @@ proc http method='POST' out=&fname1 &oauth_bearer in=&fref
|
|||||||
%if &grant_type=authorization_code %then %do;
|
%if &grant_type=authorization_code %then %do;
|
||||||
"Authorization"="Bearer &&&access_token_var"
|
"Authorization"="Bearer &&&access_token_var"
|
||||||
%end;
|
%end;
|
||||||
"Content-Disposition"= "&contentdisp filename=""&name""; name=""&name"";";
|
"Content-Disposition"=
|
||||||
|
%if "&ext"="SVG" %then %do;
|
||||||
|
"filename=""&name"";"
|
||||||
|
%end;
|
||||||
|
%else %do;
|
||||||
|
"&contentdisp filename=""&name""; name=""&name"";"
|
||||||
|
%end;
|
||||||
|
;
|
||||||
run;
|
run;
|
||||||
%put &sysmacroname POST &=url
|
%if &mdebug=1 %then %put &sysmacroname POST &=url
|
||||||
&=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
&=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||||
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)
|
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)
|
||||||
,mac=MV_CREATEFILE
|
,mac=MV_CREATEFILE
|
||||||
@@ -24420,7 +24429,7 @@ run;
|
|||||||
%local libref2;
|
%local libref2;
|
||||||
%let libref2=%mf_getuniquelibref();
|
%let libref2=%mf_getuniquelibref();
|
||||||
libname &libref2 JSON fileref=&fname1;
|
libname &libref2 JSON fileref=&fname1;
|
||||||
%put Grabbing the follow on link ;
|
/* Grab the follow on link */
|
||||||
data &outds;
|
data &outds;
|
||||||
set &libref2..links end=last;
|
set &libref2..links end=last;
|
||||||
if rel='createChild' then do;
|
if rel='createChild' then do;
|
||||||
@@ -24429,10 +24438,8 @@ data &outds;
|
|||||||
end;
|
end;
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%put &sysmacroname: File &name successfully created:;%put;
|
%put &sysmacroname: &name created at %mfv_getpathuri(&path/&name);%put;
|
||||||
%put &base_uri%mfv_getpathuri(&path/&name);%put;
|
|
||||||
%put &base_uri/SASJobExecution?_file=&path/&name;%put;
|
%put &base_uri/SASJobExecution?_file=&path/&name;%put;
|
||||||
%put &sysmacroname:;
|
|
||||||
|
|
||||||
%mend mv_createfile;/**
|
%mend mv_createfile;/**
|
||||||
@file mv_createfolder.sas
|
@file mv_createfolder.sas
|
||||||
@@ -24483,7 +24490,7 @@ run;
|
|||||||
%else %let dbg=*;
|
%else %let dbg=*;
|
||||||
|
|
||||||
%if %mfv_existfolder(&path)=1 %then %do;
|
%if %mfv_existfolder(&path)=1 %then %do;
|
||||||
%put &sysmacroname: &path already exists;
|
%&dbg.put &sysmacroname: &path already exists;
|
||||||
data &outds;
|
data &outds;
|
||||||
self_uri="%mfv_getpathuri(&path)";
|
self_uri="%mfv_getpathuri(&path)";
|
||||||
output;
|
output;
|
||||||
@@ -24600,8 +24607,9 @@ options noquotelenmax;
|
|||||||
'Content-Type'='application/vnd.sas.content.folder+json'
|
'Content-Type'='application/vnd.sas.content.folder+json'
|
||||||
'Accept'='application/vnd.sas.content.folder+json';
|
'Accept'='application/vnd.sas.content.folder+json';
|
||||||
run;
|
run;
|
||||||
%put &=SYS_PROCHTTP_STATUS_CODE;
|
%if &SYS_PROCHTTP_STATUS_CODE ne 200 %then %do;
|
||||||
%put &=SYS_PROCHTTP_STATUS_PHRASE;
|
%put &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||||
|
%end;
|
||||||
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)
|
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)
|
||||||
,mac=&sysmacroname
|
,mac=&sysmacroname
|
||||||
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
|
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
|
||||||
@@ -25108,7 +25116,7 @@ options noquotelenmax;
|
|||||||
%let path=%substr(&path,1,%length(&path)-1);
|
%let path=%substr(&path,1,%length(&path)-1);
|
||||||
|
|
||||||
/* ensure folder exists */
|
/* ensure folder exists */
|
||||||
%put &sysmacroname: Path &path being checked / created;
|
%&dbg.put &sysmacroname: Path &path being checked / created;
|
||||||
%mv_createfolder(path=&path)
|
%mv_createfolder(path=&path)
|
||||||
|
|
||||||
%local base_uri; /* location of rest apis */
|
%local base_uri; /* location of rest apis */
|
||||||
@@ -25941,13 +25949,8 @@ run;
|
|||||||
libname &libref1 clear;
|
libname &libref1 clear;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%put &sysmacroname: Job &name successfully created in &path;
|
%put &sysmacroname: Job &name created! Check it out:;
|
||||||
%put &sysmacroname:;
|
%put &url/SASJobExecution?_PROGRAM=&path/&name;
|
||||||
%put &sysmacroname: Check it out here:;
|
|
||||||
%put &sysmacroname:;%put;
|
|
||||||
%put &url/SASJobExecution?_PROGRAM=&path/&name;%put;
|
|
||||||
%put &sysmacroname:;
|
|
||||||
%put &sysmacroname:;
|
|
||||||
|
|
||||||
%mend mv_createwebservice;
|
%mend mv_createwebservice;
|
||||||
/**
|
/**
|
||||||
@@ -26063,13 +26066,15 @@ proc http method='GET' out=&fname1a &oauth_bearer
|
|||||||
headers "Authorization"="Bearer &&&access_token_var";
|
headers "Authorization"="Bearer &&&access_token_var";
|
||||||
%end;
|
%end;
|
||||||
run;
|
run;
|
||||||
%put &=SYS_PROCHTTP_STATUS_CODE;
|
%if &SYS_PROCHTTP_STATUS_CODE ne 200 %then %do;
|
||||||
|
%put &=sysmacroname &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||||
|
%end;
|
||||||
%local libref1a;
|
%local libref1a;
|
||||||
%let libref1a=%mf_getuniquelibref();
|
%let libref1a=%mf_getuniquelibref();
|
||||||
libname &libref1a JSON fileref=&fname1a;
|
libname &libref1a JSON fileref=&fname1a;
|
||||||
%local uri found;
|
%local uri found;
|
||||||
%let found=0;
|
%let found=0;
|
||||||
%put Getting object uri from &libref1a..items;
|
/* %put Getting object uri from &libref1a..items; */
|
||||||
data _null_;
|
data _null_;
|
||||||
length contenttype name $1000;
|
length contenttype name $1000;
|
||||||
set &libref1a..items;
|
set &libref1a..items;
|
||||||
@@ -26174,8 +26179,7 @@ libname &libref1a clear;
|
|||||||
options noquotelenmax;
|
options noquotelenmax;
|
||||||
%local base_uri; /* location of rest apis */
|
%local base_uri; /* location of rest apis */
|
||||||
%let base_uri=%mf_getplatform(VIYARESTAPI);
|
%let base_uri=%mf_getplatform(VIYARESTAPI);
|
||||||
|
/* fetch the members of the folder to get the uri */
|
||||||
%put &sysmacroname: fetching details for &path ;
|
|
||||||
%local fname1;
|
%local fname1;
|
||||||
%let fname1=%mf_getuniquefileref();
|
%let fname1=%mf_getuniquefileref();
|
||||||
proc http method='GET' out=&fname1 &oauth_bearer
|
proc http method='GET' out=&fname1 &oauth_bearer
|
||||||
@@ -26195,7 +26199,7 @@ run;
|
|||||||
)
|
)
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%put &sysmacroname: grab the follow on link ;
|
/* grab the follow on link */
|
||||||
%local libref1;
|
%local libref1;
|
||||||
%let libref1=%mf_getuniquelibref();
|
%let libref1=%mf_getuniquelibref();
|
||||||
libname &libref1 JSON fileref=&fname1;
|
libname &libref1 JSON fileref=&fname1;
|
||||||
@@ -26213,13 +26217,15 @@ proc http method='GET' out=&fname1a &oauth_bearer
|
|||||||
headers "Authorization"="Bearer &&&access_token_var";
|
headers "Authorization"="Bearer &&&access_token_var";
|
||||||
%end;
|
%end;
|
||||||
run;
|
run;
|
||||||
%put &=SYS_PROCHTTP_STATUS_CODE;
|
%if &SYS_PROCHTTP_STATUS_CODE ne 200 %then %do;
|
||||||
|
%put &=sysmacroname &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||||
|
%end;
|
||||||
%local libref1a;
|
%local libref1a;
|
||||||
%let libref1a=%mf_getuniquelibref();
|
%let libref1a=%mf_getuniquelibref();
|
||||||
libname &libref1a JSON fileref=&fname1a;
|
libname &libref1a JSON fileref=&fname1a;
|
||||||
%local uri found;
|
%local uri found;
|
||||||
%let found=0;
|
%let found=0;
|
||||||
%put Getting object uri from &libref1a..items;
|
/* %put Getting object uri from &libref1a..items; */
|
||||||
data _null_;
|
data _null_;
|
||||||
length contenttype name $1000;
|
length contenttype name $1000;
|
||||||
set &libref1a..items;
|
set &libref1a..items;
|
||||||
@@ -26245,7 +26251,7 @@ run;
|
|||||||
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
|
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
|
||||||
)
|
)
|
||||||
%end;
|
%end;
|
||||||
%else %put &sysmacroname: &path/&name successfully deleted;
|
%else %put &sysmacroname: &path/&name deleted;
|
||||||
|
|
||||||
/* clear refs */
|
/* clear refs */
|
||||||
filename &fname1 clear;
|
filename &fname1 clear;
|
||||||
|
|||||||
@@ -157,26 +157,28 @@ run;
|
|||||||
%end;
|
%end;
|
||||||
"Accept"="*/*";
|
"Accept"="*/*";
|
||||||
run;
|
run;
|
||||||
%put &sysmacroname DELETE &base_uri&fileuri
|
%put &sysmacroname DELETE &base_uri&fileuri;
|
||||||
&=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
%if &SYS_PROCHTTP_STATUS_CODE ne 204 %then %do;
|
||||||
|
%put &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||||
|
%end;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%local url mimetype;
|
%local url mimetype ext;
|
||||||
%let url=&base_uri/files/files?parentFolderUri=&self_uri;
|
%let url=&base_uri/files/files?parentFolderUri=&self_uri;
|
||||||
|
%let ext=%upcase(%scan(&name,-1,.));
|
||||||
|
|
||||||
/* fetch job info */
|
/* fetch job info */
|
||||||
%local fname1;
|
%local fname1;
|
||||||
%let fname1=%mf_getuniquefileref();
|
%let fname1=%mf_getuniquefileref();
|
||||||
proc http method='POST' out=&fname1 &oauth_bearer in=&fref
|
proc http method='POST' out=&fname1 &oauth_bearer in=&fref
|
||||||
%if "&ctype" = "0" %then %do;
|
%if "&ctype" = "0" %then %do;
|
||||||
%let mimetype=%mf_mimetype(%scan(&name,-1,.));
|
%let mimetype=%mf_mimetype(&ext);
|
||||||
ct="&mimetype"
|
ct="&mimetype"
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
ct="&ctype"
|
ct="&ctype"
|
||||||
%end;
|
%end;
|
||||||
%if "&mimetype"="text/html" or "&mimetype"="text/css"
|
%if "&ext"="HTML" or "&ext"="CSS" or "&ext"="JS" or "&ext"="SVG" %then %do;
|
||||||
or "&mimetype"="text/javascript" %then %do;
|
|
||||||
url="&url%str(&)typeDefName=file";
|
url="&url%str(&)typeDefName=file";
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
@@ -187,9 +189,16 @@ proc http method='POST' out=&fname1 &oauth_bearer in=&fref
|
|||||||
%if &grant_type=authorization_code %then %do;
|
%if &grant_type=authorization_code %then %do;
|
||||||
"Authorization"="Bearer &&&access_token_var"
|
"Authorization"="Bearer &&&access_token_var"
|
||||||
%end;
|
%end;
|
||||||
"Content-Disposition"= "&contentdisp filename=""&name""; name=""&name"";";
|
"Content-Disposition"=
|
||||||
|
%if "&ext"="SVG" %then %do;
|
||||||
|
"filename=""&name"";"
|
||||||
|
%end;
|
||||||
|
%else %do;
|
||||||
|
"&contentdisp filename=""&name""; name=""&name"";"
|
||||||
|
%end;
|
||||||
|
;
|
||||||
run;
|
run;
|
||||||
%put &sysmacroname POST &=url
|
%if &mdebug=1 %then %put &sysmacroname POST &=url
|
||||||
&=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
&=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||||
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)
|
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)
|
||||||
,mac=MV_CREATEFILE
|
,mac=MV_CREATEFILE
|
||||||
@@ -198,7 +207,7 @@ run;
|
|||||||
%local libref2;
|
%local libref2;
|
||||||
%let libref2=%mf_getuniquelibref();
|
%let libref2=%mf_getuniquelibref();
|
||||||
libname &libref2 JSON fileref=&fname1;
|
libname &libref2 JSON fileref=&fname1;
|
||||||
%put Grabbing the follow on link ;
|
/* Grab the follow on link */
|
||||||
data &outds;
|
data &outds;
|
||||||
set &libref2..links end=last;
|
set &libref2..links end=last;
|
||||||
if rel='createChild' then do;
|
if rel='createChild' then do;
|
||||||
@@ -207,9 +216,7 @@ data &outds;
|
|||||||
end;
|
end;
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%put &sysmacroname: File &name successfully created:;%put;
|
%put &sysmacroname: &name created at %mfv_getpathuri(&path/&name);%put;
|
||||||
%put &base_uri%mfv_getpathuri(&path/&name);%put;
|
|
||||||
%put &base_uri/SASJobExecution?_file=&path/&name;%put;
|
%put &base_uri/SASJobExecution?_file=&path/&name;%put;
|
||||||
%put &sysmacroname:;
|
|
||||||
|
|
||||||
%mend mv_createfile;
|
%mend mv_createfile;
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
%else %let dbg=*;
|
%else %let dbg=*;
|
||||||
|
|
||||||
%if %mfv_existfolder(&path)=1 %then %do;
|
%if %mfv_existfolder(&path)=1 %then %do;
|
||||||
%put &sysmacroname: &path already exists;
|
%&dbg.put &sysmacroname: &path already exists;
|
||||||
data &outds;
|
data &outds;
|
||||||
self_uri="%mfv_getpathuri(&path)";
|
self_uri="%mfv_getpathuri(&path)";
|
||||||
output;
|
output;
|
||||||
@@ -164,8 +164,9 @@ options noquotelenmax;
|
|||||||
'Content-Type'='application/vnd.sas.content.folder+json'
|
'Content-Type'='application/vnd.sas.content.folder+json'
|
||||||
'Accept'='application/vnd.sas.content.folder+json';
|
'Accept'='application/vnd.sas.content.folder+json';
|
||||||
run;
|
run;
|
||||||
%put &=SYS_PROCHTTP_STATUS_CODE;
|
%if &SYS_PROCHTTP_STATUS_CODE ne 200 %then %do;
|
||||||
%put &=SYS_PROCHTTP_STATUS_PHRASE;
|
%put &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||||
|
%end;
|
||||||
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)
|
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)
|
||||||
,mac=&sysmacroname
|
,mac=&sysmacroname
|
||||||
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
|
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ options noquotelenmax;
|
|||||||
%let path=%substr(&path,1,%length(&path)-1);
|
%let path=%substr(&path,1,%length(&path)-1);
|
||||||
|
|
||||||
/* ensure folder exists */
|
/* ensure folder exists */
|
||||||
%put &sysmacroname: Path &path being checked / created;
|
%&dbg.put &sysmacroname: Path &path being checked / created;
|
||||||
%mv_createfolder(path=&path)
|
%mv_createfolder(path=&path)
|
||||||
|
|
||||||
%local base_uri; /* location of rest apis */
|
%local base_uri; /* location of rest apis */
|
||||||
@@ -955,12 +955,7 @@ run;
|
|||||||
libname &libref1 clear;
|
libname &libref1 clear;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%put &sysmacroname: Job &name successfully created in &path;
|
%put &sysmacroname: Job &name created! Check it out:;
|
||||||
%put &sysmacroname:;
|
%put &url/SASJobExecution?_PROGRAM=&path/&name;
|
||||||
%put &sysmacroname: Check it out here:;
|
|
||||||
%put &sysmacroname:;%put;
|
|
||||||
%put &url/SASJobExecution?_PROGRAM=&path/&name;%put;
|
|
||||||
%put &sysmacroname:;
|
|
||||||
%put &sysmacroname:;
|
|
||||||
|
|
||||||
%mend mv_createwebservice;
|
%mend mv_createwebservice;
|
||||||
|
|||||||
@@ -111,13 +111,15 @@ proc http method='GET' out=&fname1a &oauth_bearer
|
|||||||
headers "Authorization"="Bearer &&&access_token_var";
|
headers "Authorization"="Bearer &&&access_token_var";
|
||||||
%end;
|
%end;
|
||||||
run;
|
run;
|
||||||
%put &=SYS_PROCHTTP_STATUS_CODE;
|
%if &SYS_PROCHTTP_STATUS_CODE ne 200 %then %do;
|
||||||
|
%put &=sysmacroname &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||||
|
%end;
|
||||||
%local libref1a;
|
%local libref1a;
|
||||||
%let libref1a=%mf_getuniquelibref();
|
%let libref1a=%mf_getuniquelibref();
|
||||||
libname &libref1a JSON fileref=&fname1a;
|
libname &libref1a JSON fileref=&fname1a;
|
||||||
%local uri found;
|
%local uri found;
|
||||||
%let found=0;
|
%let found=0;
|
||||||
%put Getting object uri from &libref1a..items;
|
/* %put Getting object uri from &libref1a..items; */
|
||||||
data _null_;
|
data _null_;
|
||||||
length contenttype name $1000;
|
length contenttype name $1000;
|
||||||
set &libref1a..items;
|
set &libref1a..items;
|
||||||
|
|||||||
@@ -69,8 +69,7 @@
|
|||||||
options noquotelenmax;
|
options noquotelenmax;
|
||||||
%local base_uri; /* location of rest apis */
|
%local base_uri; /* location of rest apis */
|
||||||
%let base_uri=%mf_getplatform(VIYARESTAPI);
|
%let base_uri=%mf_getplatform(VIYARESTAPI);
|
||||||
|
/* fetch the members of the folder to get the uri */
|
||||||
%put &sysmacroname: fetching details for &path ;
|
|
||||||
%local fname1;
|
%local fname1;
|
||||||
%let fname1=%mf_getuniquefileref();
|
%let fname1=%mf_getuniquefileref();
|
||||||
proc http method='GET' out=&fname1 &oauth_bearer
|
proc http method='GET' out=&fname1 &oauth_bearer
|
||||||
@@ -90,7 +89,7 @@ run;
|
|||||||
)
|
)
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%put &sysmacroname: grab the follow on link ;
|
/* grab the follow on link */
|
||||||
%local libref1;
|
%local libref1;
|
||||||
%let libref1=%mf_getuniquelibref();
|
%let libref1=%mf_getuniquelibref();
|
||||||
libname &libref1 JSON fileref=&fname1;
|
libname &libref1 JSON fileref=&fname1;
|
||||||
@@ -108,13 +107,15 @@ proc http method='GET' out=&fname1a &oauth_bearer
|
|||||||
headers "Authorization"="Bearer &&&access_token_var";
|
headers "Authorization"="Bearer &&&access_token_var";
|
||||||
%end;
|
%end;
|
||||||
run;
|
run;
|
||||||
%put &=SYS_PROCHTTP_STATUS_CODE;
|
%if &SYS_PROCHTTP_STATUS_CODE ne 200 %then %do;
|
||||||
|
%put &=sysmacroname &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||||
|
%end;
|
||||||
%local libref1a;
|
%local libref1a;
|
||||||
%let libref1a=%mf_getuniquelibref();
|
%let libref1a=%mf_getuniquelibref();
|
||||||
libname &libref1a JSON fileref=&fname1a;
|
libname &libref1a JSON fileref=&fname1a;
|
||||||
%local uri found;
|
%local uri found;
|
||||||
%let found=0;
|
%let found=0;
|
||||||
%put Getting object uri from &libref1a..items;
|
/* %put Getting object uri from &libref1a..items; */
|
||||||
data _null_;
|
data _null_;
|
||||||
length contenttype name $1000;
|
length contenttype name $1000;
|
||||||
set &libref1a..items;
|
set &libref1a..items;
|
||||||
@@ -140,7 +141,7 @@ run;
|
|||||||
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
|
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
|
||||||
)
|
)
|
||||||
%end;
|
%end;
|
||||||
%else %put &sysmacroname: &path/&name successfully deleted;
|
%else %put &sysmacroname: &path/&name deleted;
|
||||||
|
|
||||||
/* clear refs */
|
/* clear refs */
|
||||||
filename &fname1 clear;
|
filename &fname1 clear;
|
||||||
|
|||||||
Reference in New Issue
Block a user