mirror of
https://github.com/sasjs/core.git
synced 2025-12-19 01:34:34 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df832a184f | ||
|
|
15084be09d | ||
|
|
92ff1a53dc | ||
|
|
7dd219e9f1 | ||
|
|
cdd2b88b09 | ||
|
|
7e4fb4a640 | ||
|
|
a428b4f66c | ||
|
|
e2f0577e78 | ||
|
|
d53eff7771 | ||
|
|
5b56c85455 |
3
.github/FUNDING.yml
vendored
3
.github/FUNDING.yml
vendored
@@ -1,3 +0,0 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
custom: https://getalby.com/p/sasjs
|
||||
@@ -1,6 +0,0 @@
|
||||
FROM gitpod/workspace-full
|
||||
|
||||
RUN sudo apt-get update \
|
||||
&& sudo apt-get install -y doxygen \
|
||||
&& sudo apt-get install -y graphviz \
|
||||
&& sudo rm -rf /var/lib/apt/lists/*
|
||||
27
.gitpod.yml
27
.gitpod.yml
@@ -1,27 +0,0 @@
|
||||
tasks:
|
||||
- init: npm install -g npm
|
||||
- command: npm i
|
||||
- command: npm i -g @sasjs/cli
|
||||
|
||||
image:
|
||||
file: .gitpod.dockerfile
|
||||
vscode:
|
||||
extensions:
|
||||
- sasjs.sasjs-for-vscode
|
||||
|
||||
github:
|
||||
prebuilds:
|
||||
# enable for the master/default branch (defaults to true)
|
||||
master: true
|
||||
# enable for all branches in this repo (defaults to false)
|
||||
branches: false
|
||||
# enable for pull requests coming from this repo (defaults to true)
|
||||
pullRequests: true
|
||||
# enable for pull requests coming from forks (defaults to false)
|
||||
pullRequestsFromForks: true
|
||||
# add a "Review in Gitpod" button as a comment to pull requests (defaults to true)
|
||||
addComment: true
|
||||
# add a "Review in Gitpod" button to pull requests (defaults to false)
|
||||
addBadge: false
|
||||
# add a label once the prebuild is ready to pull requests (defaults to false)
|
||||
addLabel: prebuilt-in-gitpod
|
||||
13
README.md
13
README.md
@@ -1,19 +1,12 @@
|
||||
# Macro Core
|
||||
[![npm package][npm-image]][npm-url]
|
||||
[![Github Workflow][githubworkflow-image]][githubworkflow-url]
|
||||
|
||||
[](http://npmjs.org/package/@sasjs/core)
|
||||
[](https://github.com/sasjs/core/blob/main/.github/workflows/main.yml)
|
||||

|
||||

|
||||
[](https://github.com/sasjs/core/issues?q=is%3Aissue+is%3Aclosed)
|
||||
[](https://github.com/sasjs/core/issues)
|
||||

|
||||
[](https://gitpod.io/#https://github.com/sasjs/core)
|
||||
|
||||
|
||||
[npm-image]:https://img.shields.io/npm/v/@sasjs/core.svg
|
||||
[npm-url]:http://npmjs.org/package/@sasjs/core
|
||||
[githubworkflow-image]:https://github.com/sasjs/core/actions/workflows/main.yml/badge.svg
|
||||
[githubworkflow-url]:https://github.com/sasjs/core/blob/main/.github/workflows/main.yml
|
||||
[dependency-url]:https://github.com/sasjs/core/blob/main/package.json
|
||||
|
||||
|
||||
Much quality. Many standards. The **Macro Core** library exists to save time and development effort! Herein ye shall find a veritable host of MIT-licenced, production quality SAS macros. These are a mix of tools, utilities, functions and code generators that are useful in the context of [Application Development](https://sasapps.io) on the SAS platform (eg https://datacontroller.io). [Contributions](https://github.com/sasjs/core/blob/main/.github/CONTRIBUTING.md) are welcome.
|
||||
|
||||
19
all.sas
19
all.sas
@@ -11943,7 +11943,7 @@ data _null_;
|
||||
run;
|
||||
|
||||
/* END */
|
||||
*%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run;
|
||||
/* %put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) secs to run; */
|
||||
|
||||
%mend mp_replace;
|
||||
/**
|
||||
@@ -24098,12 +24098,14 @@ run;
|
||||
msg=Cannot enter mfv_existfolder.sas with syscc=&syscc
|
||||
)
|
||||
|
||||
%local fref rc;
|
||||
%local fref rc var;
|
||||
%let fref=%mf_getuniquefileref();
|
||||
|
||||
%if %sysfunc(filename(fref,,filesrvc,folderPath="&path"))=0 %then %do;
|
||||
1
|
||||
%let var=_FILESRVC_&fref._URI;
|
||||
%let rc=%sysfunc(filename(fref));
|
||||
%symdel &var;
|
||||
%end;
|
||||
%else %do;
|
||||
0
|
||||
@@ -24461,6 +24463,11 @@ run;
|
||||
,mac=MV_CREATEFILE
|
||||
,msg=%str(File &path/&name already exists and force=&force)
|
||||
)
|
||||
%mp_abort(
|
||||
iftrue=(&syscc ne 0),
|
||||
mac=MV_CREATEFILE182
|
||||
msg=syscc=&syscc after mfv_getpathuri
|
||||
)
|
||||
|
||||
%if %mf_isblank(&fileuri)=0 and &force=YES %then %do;
|
||||
proc http method="DELETE" url="&base_uri&fileuri" &oauth_bearer;
|
||||
@@ -24530,8 +24537,8 @@ data &outds;
|
||||
end;
|
||||
run;
|
||||
|
||||
%put &sysmacroname: &name created at %mfv_getpathuri(&path/&name);%put;
|
||||
%put &base_uri/SASJobExecution?_file=&path/&name;%put;
|
||||
%put &sysmacroname: %trim(&base_uri)%mfv_getpathuri(&path/&name);
|
||||
%put /SASJobExecution?_file=&path/&name;%put;
|
||||
|
||||
%if &mdebug=0 %then %do;
|
||||
/* clear refs */
|
||||
@@ -24664,7 +24671,7 @@ options noquotelenmax;
|
||||
%if &SYS_PROCHTTP_STATUS_CODE=401 %then %do;
|
||||
/* relates to: https://github.com/sasjs/core/issues/400 */
|
||||
%put 401 thrown in &sysmacroname;
|
||||
%put sleeping: %sysfunc(sleep(10,1)) - will try once more;
|
||||
%put sleeping: %sysfunc(sleep(12,1)) secs - will try again;
|
||||
proc http method='GET' out=&fname1 &oauth_bearer
|
||||
url="&base_uri/folders/folders/@item?path=&newpath";
|
||||
%if &grant_type=authorization_code %then %do;
|
||||
@@ -24728,7 +24735,7 @@ options noquotelenmax;
|
||||
'Content-Type'='application/vnd.sas.content.folder+json'
|
||||
'Accept'='application/vnd.sas.content.folder+json';
|
||||
run;
|
||||
%if &SYS_PROCHTTP_STATUS_CODE ne 200 %then %do;
|
||||
%if &SYS_PROCHTTP_STATUS_CODE ne 201 %then %do;
|
||||
%put &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||
%end;
|
||||
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)
|
||||
|
||||
@@ -148,6 +148,6 @@ data _null_;
|
||||
run;
|
||||
|
||||
/* END */
|
||||
*%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run;
|
||||
/* %put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) secs to run; */
|
||||
|
||||
%mend mp_replace;
|
||||
|
||||
@@ -33,12 +33,14 @@
|
||||
msg=Cannot enter mfv_existfolder.sas with syscc=&syscc
|
||||
)
|
||||
|
||||
%local fref rc;
|
||||
%local fref rc var;
|
||||
%let fref=%mf_getuniquefileref();
|
||||
|
||||
%if %sysfunc(filename(fref,,filesrvc,folderPath="&path"))=0 %then %do;
|
||||
1
|
||||
%let var=_FILESRVC_&fref._URI;
|
||||
%let rc=%sysfunc(filename(fref));
|
||||
%symdel &var;
|
||||
%end;
|
||||
%else %do;
|
||||
0
|
||||
|
||||
@@ -177,6 +177,11 @@ run;
|
||||
,mac=MV_CREATEFILE
|
||||
,msg=%str(File &path/&name already exists and force=&force)
|
||||
)
|
||||
%mp_abort(
|
||||
iftrue=(&syscc ne 0),
|
||||
mac=MV_CREATEFILE182
|
||||
msg=syscc=&syscc after mfv_getpathuri
|
||||
)
|
||||
|
||||
%if %mf_isblank(&fileuri)=0 and &force=YES %then %do;
|
||||
proc http method="DELETE" url="&base_uri&fileuri" &oauth_bearer;
|
||||
@@ -246,8 +251,8 @@ data &outds;
|
||||
end;
|
||||
run;
|
||||
|
||||
%put &sysmacroname: &name created at %mfv_getpathuri(&path/&name);%put;
|
||||
%put &base_uri/SASJobExecution?_file=&path/&name;%put;
|
||||
%put &sysmacroname: %trim(&base_uri)%mfv_getpathuri(&path/&name);
|
||||
%put /SASJobExecution?_file=&path/&name;%put;
|
||||
|
||||
%if &mdebug=0 %then %do;
|
||||
/* clear refs */
|
||||
|
||||
@@ -117,7 +117,7 @@ options noquotelenmax;
|
||||
%if &SYS_PROCHTTP_STATUS_CODE=401 %then %do;
|
||||
/* relates to: https://github.com/sasjs/core/issues/400 */
|
||||
%put 401 thrown in &sysmacroname;
|
||||
%put sleeping: %sysfunc(sleep(10,1)) - will try once more;
|
||||
%put sleeping: %sysfunc(sleep(12,1)) secs - will try again;
|
||||
proc http method='GET' out=&fname1 &oauth_bearer
|
||||
url="&base_uri/folders/folders/@item?path=&newpath";
|
||||
%if &grant_type=authorization_code %then %do;
|
||||
@@ -181,7 +181,7 @@ options noquotelenmax;
|
||||
'Content-Type'='application/vnd.sas.content.folder+json'
|
||||
'Accept'='application/vnd.sas.content.folder+json';
|
||||
run;
|
||||
%if &SYS_PROCHTTP_STATUS_CODE ne 200 %then %do;
|
||||
%if &SYS_PROCHTTP_STATUS_CODE ne 201 %then %do;
|
||||
%put &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
||||
%end;
|
||||
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)
|
||||
|
||||
Reference in New Issue
Block a user