mirror of
https://github.com/sasjs/core.git
synced 2026-01-03 23:50:06 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
984ea44f5d | ||
|
|
88f1222abd | ||
|
|
d88f028ee3 | ||
|
|
07d7c9df4b | ||
|
|
6765a1d025 | ||
|
|
952f28a872 | ||
|
|
8246b5a42c |
30
.github/vpn/config.ovpn
vendored
30
.github/vpn/config.ovpn
vendored
@@ -1,30 +0,0 @@
|
|||||||
cipher AES-256-CBC
|
|
||||||
setenv FORWARD_COMPATIBLE 1
|
|
||||||
client
|
|
||||||
server-poll-timeout 4
|
|
||||||
nobind
|
|
||||||
remote vpn.analytium.co.uk 1194 udp
|
|
||||||
remote vpn.analytium.co.uk 1194 udp
|
|
||||||
remote vpn.analytium.co.uk 443 tcp
|
|
||||||
remote vpn.analytium.co.uk 1194 udp
|
|
||||||
remote vpn.analytium.co.uk 1194 udp
|
|
||||||
remote vpn.analytium.co.uk 1194 udp
|
|
||||||
remote vpn.analytium.co.uk 1194 udp
|
|
||||||
remote vpn.analytium.co.uk 1194 udp
|
|
||||||
dev tun
|
|
||||||
dev-type tun
|
|
||||||
ns-cert-type server
|
|
||||||
setenv opt tls-version-min 1.0 or-highest
|
|
||||||
reneg-sec 604800
|
|
||||||
sndbuf 0
|
|
||||||
rcvbuf 0
|
|
||||||
# NOTE: LZO commands are pushed by the Access Server at connect time.
|
|
||||||
# NOTE: The below line doesn't disable LZO.
|
|
||||||
comp-lzo no
|
|
||||||
verb 3
|
|
||||||
setenv PUSH_PEER_INFO
|
|
||||||
|
|
||||||
ca ca.crt
|
|
||||||
cert user.crt
|
|
||||||
key user.key
|
|
||||||
tls-auth tls.key 1
|
|
||||||
25
.github/workflows/run-tests.yml
vendored
25
.github/workflows/run-tests.yml
vendored
@@ -21,31 +21,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Write VPN Files
|
|
||||||
run: |
|
|
||||||
echo "$CA_CRT" > .github/vpn/ca.crt
|
|
||||||
echo "$USER_CRT" > .github/vpn/user.crt
|
|
||||||
echo "$USER_KEY" > .github/vpn/user.key
|
|
||||||
echo "$TLS_KEY" > .github/vpn/tls.key
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
CA_CRT: ${{ secrets.CA_CRT}}
|
|
||||||
USER_CRT: ${{ secrets.USER_CRT }}
|
|
||||||
USER_KEY: ${{ secrets.USER_KEY }}
|
|
||||||
TLS_KEY: ${{ secrets.TLS_KEY }}
|
|
||||||
|
|
||||||
- name: Install Open VPN
|
|
||||||
run: |
|
|
||||||
sudo apt install apt-transport-https
|
|
||||||
sudo wget https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub
|
|
||||||
sudo apt-key add openvpn-repo-pkg-key.pub
|
|
||||||
sudo wget -O /etc/apt/sources.list.d/openvpn3.list https://swupdate.openvpn.net/community/openvpn3/repos/openvpn3-focal.list
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install openvpn3
|
|
||||||
|
|
||||||
- name: Start Open VPN 3
|
|
||||||
run: openvpn3 session-start --config .github/vpn/config.ovpn
|
|
||||||
|
|
||||||
- name: Install Doxygen
|
- name: Install Doxygen
|
||||||
run: sudo apt-get install doxygen
|
run: sudo apt-get install doxygen
|
||||||
|
|
||||||
|
|||||||
76
all.sas
76
all.sas
@@ -4112,11 +4112,14 @@ proc sql;
|
|||||||
%mp_deleteconstraints(inds=work.constraints,outds=dropped,execute=YES)
|
%mp_deleteconstraints(inds=work.constraints,outds=dropped,execute=YES)
|
||||||
%mp_createconstraints(inds=work.constraints,outds=created,execute=YES)
|
%mp_createconstraints(inds=work.constraints,outds=created,execute=YES)
|
||||||
|
|
||||||
@param inds= The input table containing the constraint info
|
@param inds= (work.mp_getconstraints) The input table containing the
|
||||||
@param outds= a table containing the create statements (create_statement column)
|
constraint info
|
||||||
@param execute= `YES|NO` - default is NO. To actually create, use YES.
|
@param outds= (work.mp_createconstraints) A table containing the create
|
||||||
|
statements (create_statement column)
|
||||||
|
@param execute= (NO) To actually create, use YES.
|
||||||
|
|
||||||
<h4> SAS Macros </h4>
|
<h4> Related Files </h4>
|
||||||
|
@li mp_getconstraints.sas
|
||||||
|
|
||||||
@version 9.2
|
@version 9.2
|
||||||
@author Allan Bowe
|
@author Allan Bowe
|
||||||
@@ -4124,7 +4127,7 @@ proc sql;
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
%macro mp_createconstraints(inds=mp_getconstraints
|
%macro mp_createconstraints(inds=mp_getconstraints
|
||||||
,outds=mp_createconstraints
|
,outds=work.mp_createconstraints
|
||||||
,execute=NO
|
,execute=NO
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
|
|
||||||
@@ -4158,7 +4161,8 @@ data &outds;
|
|||||||
output;
|
output;
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%mend mp_createconstraints;/**
|
%mend mp_createconstraints;
|
||||||
|
/**
|
||||||
@file mp_createwebservice.sas
|
@file mp_createwebservice.sas
|
||||||
@brief Create a web service in SAS 9, Viya or SASjs Server
|
@brief Create a web service in SAS 9, Viya or SASjs Server
|
||||||
@details This is actually a wrapper for mx_createwebservice.sas, remaining
|
@details This is actually a wrapper for mx_createwebservice.sas, remaining
|
||||||
@@ -4450,6 +4454,58 @@ run;
|
|||||||
%end;
|
%end;
|
||||||
%else %put &sysmacroname: &folder: is not a valid / accessible folder. ;
|
%else %put &sysmacroname: &folder: is not a valid / accessible folder. ;
|
||||||
%mend mp_deletefolder;/**
|
%mend mp_deletefolder;/**
|
||||||
|
@file mp_dictionary.sas
|
||||||
|
@brief Creates a portal (libref) into the SQL Dictionary Views
|
||||||
|
@details Provide a libref and the macro will create a series of views against
|
||||||
|
each view in the special PROC SQL dictionary libref.
|
||||||
|
|
||||||
|
This is useful if you would like to visualise (navigate) the views in a SAS
|
||||||
|
client such as Base SAS, Enterprise Guide, or Studio (or [Data Controller](
|
||||||
|
https://datacontroller.io)).
|
||||||
|
|
||||||
|
It works by extracting the dictionary.dictionaries view into
|
||||||
|
YOURLIB.dictionaries, then uses that to create a YOURLIB.{viewName} for every
|
||||||
|
other dictionary.view, eg:
|
||||||
|
|
||||||
|
proc sql;
|
||||||
|
create view YOURLIB.columns as select * from dictionary.columns;
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
libname demo "/lib/directory";
|
||||||
|
%mp_dictionary(lib=demo)
|
||||||
|
|
||||||
|
Or, to just create them in WORK:
|
||||||
|
|
||||||
|
%mp_dictionary()
|
||||||
|
|
||||||
|
If you'd just like to browse the dictionary data model, you can also check
|
||||||
|
out [this article](https://rawsas.com/dictionary-of-dictionaries/).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
@param lib= (WORK) The libref in which to create the views
|
||||||
|
|
||||||
|
<h4> Related Files </h4>
|
||||||
|
@li mp_dictionary.test.sas
|
||||||
|
|
||||||
|
@version 9.2
|
||||||
|
@author Allan Bowe
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
%macro mp_dictionary(lib=WORK)/*/STORE SOURCE*/;
|
||||||
|
%local list i mem;
|
||||||
|
proc sql noprint;
|
||||||
|
create view &lib..dictionaries as select * from dictionary.dictionaries;
|
||||||
|
select distinct memname into: list separated by ' ' from &lib..dictionaries;
|
||||||
|
%do i=1 %to %sysfunc(countw(&list,%str( )));
|
||||||
|
%let mem=%scan(&list,&i,%str( ));
|
||||||
|
create view &lib..&mem as select * from dictionary.&mem;
|
||||||
|
%end;
|
||||||
|
quit;
|
||||||
|
%mend mp_dictionary;
|
||||||
|
/**
|
||||||
@file
|
@file
|
||||||
@brief Returns all files and subdirectories within a specified parent
|
@brief Returns all files and subdirectories within a specified parent
|
||||||
@details When used with getattrs=NO, is not OS specific (uses dopen / dread).
|
@details When used with getattrs=NO, is not OS specific (uses dopen / dread).
|
||||||
@@ -21959,7 +22015,8 @@ run;
|
|||||||
@param [in] contentdisp= (inline) Content Disposition. Example values:
|
@param [in] contentdisp= (inline) Content Disposition. Example values:
|
||||||
@li inline
|
@li inline
|
||||||
@li attachment
|
@li attachment
|
||||||
|
@param [in] ctype= (0) Set a default HTTP Content-Type header to be returned
|
||||||
|
with the file when the content is retrieved from the Files service.
|
||||||
@param [in] access_token_var= The global macro variable to contain the access
|
@param [in] access_token_var= The global macro variable to contain the access
|
||||||
token, if using authorization_code grant type.
|
token, if using authorization_code grant type.
|
||||||
@param [in] grant_type= (sas_services) Valid values are:
|
@param [in] grant_type= (sas_services) Valid values are:
|
||||||
@@ -21987,6 +22044,7 @@ run;
|
|||||||
,inref=
|
,inref=
|
||||||
,intype=BINARY
|
,intype=BINARY
|
||||||
,contentdisp=inline
|
,contentdisp=inline
|
||||||
|
,ctype=0
|
||||||
,access_token_var=ACCESS_TOKEN
|
,access_token_var=ACCESS_TOKEN
|
||||||
,grant_type=sas_services
|
,grant_type=sas_services
|
||||||
,mdebug=0
|
,mdebug=0
|
||||||
@@ -22038,8 +22096,10 @@ filename &fref filesrvc
|
|||||||
folderPath="&path"
|
folderPath="&path"
|
||||||
filename="&name"
|
filename="&name"
|
||||||
cdisp="&contentdisp"
|
cdisp="&contentdisp"
|
||||||
|
%if "&ctype" ne "0" %then %do;
|
||||||
|
ctype="&ctype"
|
||||||
|
%end;
|
||||||
lrecl=1048544;
|
lrecl=1048544;
|
||||||
|
|
||||||
%if &intype=BINARY %then %do;
|
%if &intype=BINARY %then %do;
|
||||||
%mp_binarycopy(inref=&inref, outref=&fref)
|
%mp_binarycopy(inref=&inref, outref=&fref)
|
||||||
%end;
|
%end;
|
||||||
|
|||||||
@@ -18,11 +18,14 @@
|
|||||||
%mp_deleteconstraints(inds=work.constraints,outds=dropped,execute=YES)
|
%mp_deleteconstraints(inds=work.constraints,outds=dropped,execute=YES)
|
||||||
%mp_createconstraints(inds=work.constraints,outds=created,execute=YES)
|
%mp_createconstraints(inds=work.constraints,outds=created,execute=YES)
|
||||||
|
|
||||||
@param inds= The input table containing the constraint info
|
@param inds= (work.mp_getconstraints) The input table containing the
|
||||||
@param outds= a table containing the create statements (create_statement column)
|
constraint info
|
||||||
@param execute= `YES|NO` - default is NO. To actually create, use YES.
|
@param outds= (work.mp_createconstraints) A table containing the create
|
||||||
|
statements (create_statement column)
|
||||||
|
@param execute= (NO) To actually create, use YES.
|
||||||
|
|
||||||
<h4> SAS Macros </h4>
|
<h4> Related Files </h4>
|
||||||
|
@li mp_getconstraints.sas
|
||||||
|
|
||||||
@version 9.2
|
@version 9.2
|
||||||
@author Allan Bowe
|
@author Allan Bowe
|
||||||
@@ -30,7 +33,7 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
%macro mp_createconstraints(inds=mp_getconstraints
|
%macro mp_createconstraints(inds=mp_getconstraints
|
||||||
,outds=mp_createconstraints
|
,outds=work.mp_createconstraints
|
||||||
,execute=NO
|
,execute=NO
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
|
|
||||||
@@ -64,4 +67,4 @@ data &outds;
|
|||||||
output;
|
output;
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%mend mp_createconstraints;
|
%mend mp_createconstraints;
|
||||||
|
|||||||
52
base/mp_dictionary.sas
Normal file
52
base/mp_dictionary.sas
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/**
|
||||||
|
@file mp_dictionary.sas
|
||||||
|
@brief Creates a portal (libref) into the SQL Dictionary Views
|
||||||
|
@details Provide a libref and the macro will create a series of views against
|
||||||
|
each view in the special PROC SQL dictionary libref.
|
||||||
|
|
||||||
|
This is useful if you would like to visualise (navigate) the views in a SAS
|
||||||
|
client such as Base SAS, Enterprise Guide, or Studio (or [Data Controller](
|
||||||
|
https://datacontroller.io)).
|
||||||
|
|
||||||
|
It works by extracting the dictionary.dictionaries view into
|
||||||
|
YOURLIB.dictionaries, then uses that to create a YOURLIB.{viewName} for every
|
||||||
|
other dictionary.view, eg:
|
||||||
|
|
||||||
|
proc sql;
|
||||||
|
create view YOURLIB.columns as select * from dictionary.columns;
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
libname demo "/lib/directory";
|
||||||
|
%mp_dictionary(lib=demo)
|
||||||
|
|
||||||
|
Or, to just create them in WORK:
|
||||||
|
|
||||||
|
%mp_dictionary()
|
||||||
|
|
||||||
|
If you'd just like to browse the dictionary data model, you can also check
|
||||||
|
out [this article](https://rawsas.com/dictionary-of-dictionaries/).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
@param lib= (WORK) The libref in which to create the views
|
||||||
|
|
||||||
|
<h4> Related Files </h4>
|
||||||
|
@li mp_dictionary.test.sas
|
||||||
|
|
||||||
|
@version 9.2
|
||||||
|
@author Allan Bowe
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
%macro mp_dictionary(lib=WORK)/*/STORE SOURCE*/;
|
||||||
|
%local list i mem;
|
||||||
|
proc sql noprint;
|
||||||
|
create view &lib..dictionaries as select * from dictionary.dictionaries;
|
||||||
|
select distinct memname into: list separated by ' ' from &lib..dictionaries;
|
||||||
|
%do i=1 %to %sysfunc(countw(&list,%str( )));
|
||||||
|
%let mem=%scan(&list,&i,%str( ));
|
||||||
|
create view &lib..&mem as select * from dictionary.&mem;
|
||||||
|
%end;
|
||||||
|
quit;
|
||||||
|
%mend mp_dictionary;
|
||||||
@@ -107,4 +107,4 @@
|
|||||||
"contextName": "SAS Job Execution compute context"
|
"contextName": "SAS Job Execution compute context"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
26
tests/base/mp_dictionary.test.sas
Normal file
26
tests/base/mp_dictionary.test.sas
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
/**
|
||||||
|
@file
|
||||||
|
@brief Testing mp_dictionary.sas macro
|
||||||
|
|
||||||
|
<h4> SAS Macros </h4>
|
||||||
|
@li mp_dictionary.sas
|
||||||
|
@li mp_assert.sas
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
libname test (work);
|
||||||
|
%mp_dictionary(lib=test)
|
||||||
|
|
||||||
|
proc sql;
|
||||||
|
create table work.compare1 as select * from test.styles;
|
||||||
|
create table work.compare2 as select * from dictionary.styles;
|
||||||
|
|
||||||
|
proc compare base=compare1 compare=compare2;
|
||||||
|
run;
|
||||||
|
%put _all_;
|
||||||
|
|
||||||
|
%mp_assert(
|
||||||
|
iftrue=(%mf_existds(&sysinfo)=0),
|
||||||
|
desc=Compare was exact,
|
||||||
|
outds=work.test_results
|
||||||
|
)
|
||||||
@@ -24,7 +24,8 @@
|
|||||||
@param [in] contentdisp= (inline) Content Disposition. Example values:
|
@param [in] contentdisp= (inline) Content Disposition. Example values:
|
||||||
@li inline
|
@li inline
|
||||||
@li attachment
|
@li attachment
|
||||||
|
@param [in] ctype= (0) Set a default HTTP Content-Type header to be returned
|
||||||
|
with the file when the content is retrieved from the Files service.
|
||||||
@param [in] access_token_var= The global macro variable to contain the access
|
@param [in] access_token_var= The global macro variable to contain the access
|
||||||
token, if using authorization_code grant type.
|
token, if using authorization_code grant type.
|
||||||
@param [in] grant_type= (sas_services) Valid values are:
|
@param [in] grant_type= (sas_services) Valid values are:
|
||||||
@@ -52,6 +53,7 @@
|
|||||||
,inref=
|
,inref=
|
||||||
,intype=BINARY
|
,intype=BINARY
|
||||||
,contentdisp=inline
|
,contentdisp=inline
|
||||||
|
,ctype=0
|
||||||
,access_token_var=ACCESS_TOKEN
|
,access_token_var=ACCESS_TOKEN
|
||||||
,grant_type=sas_services
|
,grant_type=sas_services
|
||||||
,mdebug=0
|
,mdebug=0
|
||||||
@@ -103,8 +105,10 @@ filename &fref filesrvc
|
|||||||
folderPath="&path"
|
folderPath="&path"
|
||||||
filename="&name"
|
filename="&name"
|
||||||
cdisp="&contentdisp"
|
cdisp="&contentdisp"
|
||||||
|
%if "&ctype" ne "0" %then %do;
|
||||||
|
ctype="&ctype"
|
||||||
|
%end;
|
||||||
lrecl=1048544;
|
lrecl=1048544;
|
||||||
|
|
||||||
%if &intype=BINARY %then %do;
|
%if &intype=BINARY %then %do;
|
||||||
%mp_binarycopy(inref=&inref, outref=&fref)
|
%mp_binarycopy(inref=&inref, outref=&fref)
|
||||||
%end;
|
%end;
|
||||||
|
|||||||
Reference in New Issue
Block a user