1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-12 06:54:35 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Allan Bowe
7b884d165f chore: automated commit 2021-06-21 17:21:45 +03:00
137 changed files with 920 additions and 2579 deletions

View File

@@ -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

View File

@@ -21,31 +21,6 @@ jobs:
with:
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-bionic.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
run: sudo apt-get install doxygen
@@ -56,16 +31,16 @@ jobs:
run: npm run lint
- name: Add client
run: echo "CLIENT=${{secrets.CLIENT}}"> .env.viya
run: echo "CLIENT=${{secrets.CLIENT}}"> .env.viya
- name: Add secret
run: echo "SECRET=${{secrets.SECRET}}" >> .env.viya
run: echo "SECRET=${{secrets.SECRET}}" >> .env.viya
- name: Add access token
run: echo "ACCESS_TOKEN=${{secrets.ACCESS_TOKEN}}" >> .env.viya
run: echo "ACCESS_TOKEN=${{secrets.ACCESS_TOKEN}}" >> .env.viya
- name: Add refresh token
run: echo "REFRESH_TOKEN=${{secrets.REFRESH_TOKEN}}" >> .env.viya
run: echo "REFRESH_TOKEN=${{secrets.REFRESH_TOKEN}}" >> .env.viya
- name: Build Project
run: npm run build

View File

@@ -2,7 +2,7 @@
"noTrailingSpaces": true,
"noEncodedPasswords": true,
"hasDoxygenHeader": true,
"hasMacroNameInMend": true,
"hasMacroNameInMend": false,
"hasMacroParentheses": true,
"noNestedMacros": false,
"noSpacesInFileNames": true,

518
all.sas

File diff suppressed because it is too large Load Diff

View File

@@ -42,6 +42,6 @@
-1
%put &sysmacroname: &feature not found;
%end;
%mend mf_existfeature;
%mend;
/** @endcond */

View File

@@ -24,4 +24,4 @@
0
%end;
%mend mf_existfileref;
%mend;

View File

@@ -30,6 +30,6 @@
%let rc=%sysfunc(close(&dsid));
%end;
%mend mf_existvar;
%mend;
/** @endcond */

View File

@@ -54,6 +54,6 @@
0
%put Vars not found: &found;
%end;
%mend mf_existvarlist;
%mend;
/** @endcond */

View File

@@ -31,4 +31,4 @@
%sysfunc(attrc(&dsid,&attr))
%let rc=%sysfunc(close(&dsid));
%end;
%mend mf_getattrc;
%mend;

View File

@@ -31,4 +31,4 @@
%sysfunc(attrn(&dsid,&attr))
%let rc=%sysfunc(close(&dsid));
%end;
%mend mf_getattrn;
%mend;

View File

@@ -48,6 +48,6 @@
&engine
%mend mf_getengine;
%mend;
/** @endcond */

View File

@@ -44,4 +44,4 @@
%sysfunc(INPUTN(&bytes, best.),sizekmg.)
%end;
%mend mf_getfilesize ;
%mend ;

View File

@@ -29,4 +29,4 @@
&valc
%end;
%else %put %str(ERR)OR: Unable to find key &key in ds &libds;
%mend mf_getkeyvalue;
%mend;

View File

@@ -62,4 +62,4 @@
%else %if &switch=VIYARESTAPI %then %do;
%mf_trimstr(%sysfunc(getoption(servicesbaseurl)),/)
%end;
%mend mf_getplatform;
%mend;

View File

@@ -50,4 +50,4 @@
&buffer
%mend mf_getquotedstr;
%mend;

View File

@@ -38,6 +38,6 @@
&schema
%mend mf_getschema;
%mend;
/** @endcond */

View File

@@ -34,4 +34,4 @@
%end;
%end;
%put unable to find available fileref in range &prefix.0-&maxtries;
%mend mf_getuniquefileref;
%mend;

View File

@@ -37,4 +37,4 @@
%end;
%end;
%put unable to find available libref in range &prefix.0-&maxtries;
%mend mf_getuniquelibref;
%mend;

View File

@@ -39,4 +39,4 @@
%quote(&user)
%mend mf_getuser;
%mend;

View File

@@ -30,4 +30,4 @@
%trim(&&&variable)
%end;
%mend mf_getvalue;
%mend;

View File

@@ -29,4 +29,4 @@
%let rc=%sysfunc(close(&dsid));
%end;
&nvars
%mend mf_getvarcount;
%mend;

View File

@@ -49,4 +49,4 @@
%let rc = %sysfunc(close(&dsid));
/* Return variable format */
&vlen
%mend mf_getVarLen;
%mend;

View File

@@ -51,4 +51,4 @@ returns:
/* Return variable number */
&vnum.
%mend mf_getVarNum;
%mend;

View File

@@ -40,4 +40,4 @@
&engine
%mend mf_getxengine;
%mend;

View File

@@ -24,4 +24,4 @@
%sysevalf(%superq(param)=,boolean)
%mend mf_isblank;
%mend;

View File

@@ -31,4 +31,4 @@
&is_directory
%mend mf_isdir;
%mend;

View File

@@ -26,4 +26,4 @@
&root
%end;
%mend mf_loc;
%mend;

View File

@@ -64,4 +64,4 @@ Usage:
%end;
%end;
/* exit quietly if directory did exist.*/
%mend mf_mkdir;
%mend;

View File

@@ -16,4 +16,4 @@
%if %symexist(&var) %then %do;
%superq(&var)
%end;
%mend mf_mval;
%mend;

View File

@@ -23,4 +23,4 @@
%macro mf_nobs(libds
)/*/STORE SOURCE*/;
%mf_getattrn(&libds,NLOBS)
%mend mf_nobs;
%mend;

View File

@@ -47,4 +47,4 @@
&basestr
%end;
%mend mf_trimstr;
%mend;

View File

@@ -62,4 +62,4 @@
%else %mf_abort(mac=mf_verifymacvars,type=&mabort,msg=&abortmsg);
%exit_success:
%mend mf_verifymacvars;
%mend;

View File

@@ -50,5 +50,5 @@
&outvar
%mend mf_wordsInStr1ButNotStr2;
%mend;

View File

@@ -165,7 +165,6 @@
sysuserid=symget('sysuserid');
iftrue=symget('iftrue');
put (_all_)(/=);
call symputx('syscc',0);
abort cancel nolist;
run;
%end;

View File

@@ -142,4 +142,4 @@
proc sql;
drop table &ds;
%mend mp_assertcols;
%mend;

View File

@@ -144,4 +144,4 @@
proc sql;
drop table &ds;
%mend mp_assertcolvals;
%mend;

View File

@@ -1,123 +0,0 @@
/**
@file
@brief Convert a file to/from base64 format
@details Creates a new version of a file either encoded or decoded using
Base64. Inspired by this post by Michael Dixon:
https://support.selerity.com.au/hc/en-us/articles/223345708-Tip-SAS-and-Base64
Usage:
filename tmp temp;
data _null_;
file tmp;
put 'base ik ally';
run;
%mp_base64copy(inref=tmp, outref=myref, action=ENCODE)
data _null_;
infile myref;
input;
put _infile_;
run;
%mp_base64copy(inref=myref, outref=mynewref, action=DECODE)
data _null_;
infile mynewref;
input;
put _infile_;
run;
@param [in] inref= Fileref of the input file (should exist)
@param [out] outref= Output fileref. If it does not exist, it is created.
@param [in] action= (ENCODE) The action to take. Valid values:
@li ENCODE - Convert the file to base64 format
@li DECODE - Decode the file from base64 format
@version 9.2
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> SAS Macros </h4>
@li mp_abort.sas
**/
%macro mp_base64copy(
inref=0,
outref=0,
action=ENCODE
)/*/STORE SOURCE*/;
%let inref=%upcase(&inref);
%let outref=%upcase(&outref);
%let action=%upcase(&action);
%local infound outfound;
%let infound=0;
%let outfound=0;
data _null_;
set sashelp.vextfl(where=(fileref="&inref" or fileref="&outref"));
if fileref="&inref" then call symputx('infound',1,'l');
if fileref="&outref" then call symputx('outfound',1,'l');
run;
%mp_abort(iftrue= (&infound=0)
,mac=&sysmacroname
,msg=%str(INREF &inref NOT FOUND!)
)
%mp_abort(iftrue= (&outref=0)
,mac=&sysmacroname
,msg=%str(OUTREF NOT PROVIDED!)
)
%mp_abort(iftrue= (&action ne ENCODE and &action ne DECODE)
,mac=&sysmacroname
,msg=%str(Invalid action! Should be ENCODE OR DECODE)
)
%if &outfound=0 %then %do;
filename &outref temp lrecl=2097088;
%%end;
%if &action=ENCODE %then %do;
data _null_;
length b64 $ 76 line $ 57;
retain line "";
infile &inref recfm=F lrecl= 1 end=eof;
input @1 stream $char1.;
file &outref lrecl=76;
substr(line,(_N_-(CEIL(_N_/57)-1)*57),1) = byte(rank(stream));
if mod(_N_,57)=0 or EOF then do;
if eof then b64=put(trim(line),$base64X76.);
else b64=put(line, $base64X76.);
put b64;
line="";
end;
run;
%end;
%else %if &action=DECODE %then %do;
data _null_;
length filein 8 fileout 8;
filein = fopen("&inref",'I',4,'B');
fileout = fopen("&outref",'O',3,'B');
char= '20'x;
do while(fread(filein)=0);
raw="1234";
do i=1 to 4;
rc=fget(filein,char,1);
substr(raw,i,1)=char;
end;
val="123";
val=input(raw,$base64X4.);
do i=1 to 3;
length byte $1;
byte=byte(rank(substr(val,i,1)));
rc = fput(fileout, byte);
end;
rc =fwrite(fileout);
end;
rc = fclose(filein);
rc = fclose(fileout);
run;
%end;
%mend mp_base64copy;

View File

@@ -53,4 +53,4 @@
%if &outref=____out %then %do;
filename &outref clear;
%end;
%mend mp_binarycopy;
%mend;

View File

@@ -67,5 +67,5 @@
else put inchar $char1.;
end;
run;
%mend mp_cleancsv;
%mend;
/** @endcond */

View File

@@ -64,4 +64,4 @@ data &outds;
output;
run;
%mend mp_createconstraints;
%mend;

View File

@@ -80,4 +80,4 @@ Usage:
)
%end;
%mend mp_createwebservice;
%mend;

View File

@@ -141,4 +141,4 @@ data &outds
%end;
run;
%mend mp_csv2ds;
%mend;

View File

@@ -49,4 +49,4 @@ data &outds;
end;
run;
%mend mp_deleteconstraints;
%mend;

View File

@@ -167,4 +167,4 @@ run;
by filepath file_or_folder filename ext ;
run;
%end;
%mend mp_dirlist;
%mend;

View File

@@ -47,4 +47,4 @@
%end;
as &outvar length=&varlen
from &libds;
%mend mp_distinctfmtvalues;
%mend;

View File

@@ -251,4 +251,4 @@ quit;
%put NOTE-;%put NOTE-;
%put NOTE- %sysfunc(dequote(&cards_file.));
%put NOTE-;%put NOTE-;
%mend mp_ds2cards;
%mend;

View File

@@ -55,4 +55,4 @@ data _null_;
run;
%mend mp_ds2csv;
%mend;

View File

@@ -99,4 +99,4 @@ filename &outref temp;
run;
%end;
%mend mp_filtergenerate;
%mend;

View File

@@ -57,4 +57,4 @@ create table &outds as
%end;
;
%mend mp_getconstraints;
%mend;

View File

@@ -332,4 +332,4 @@ run;
run;
%end;
%mend mp_getdbml;
%mend;

View File

@@ -115,7 +115,7 @@ create table _data_ as
end;
run;
%put &=constraints_used;
%mend addConst;
%mend;
data _null_;
file &fref;
@@ -378,4 +378,4 @@ run;
run;
%end;
%mend mp_getddl;
%mend;

View File

@@ -70,4 +70,4 @@ create table &outds (rename=(
out=&outds(rename=(_name_=NAME COL1=MAXLEN));
run;
%mend mp_getmaxvarlengths;
%mend;

View File

@@ -301,4 +301,4 @@
%return;
%end;
%mend mp_guesspk;
%mend;

View File

@@ -72,4 +72,4 @@
if &lastvar then output;
run;
%end;
%mend mp_hashdataset;
%mend;

View File

@@ -75,4 +75,4 @@ select distinct lowcase(memname)
)
%end;
%mend mp_lib2cards;
%mend;

View File

@@ -39,4 +39,4 @@
,dttm=%sysfunc(datetime());
quit;
%mend mp_perflog;
%mend;

View File

@@ -85,4 +85,4 @@
"with record &record and " _n_=;
%end;
%mend mp_prevobs;
%mend;

View File

@@ -87,4 +87,4 @@ insert into &outds select distinct * from &append_ds;
)
%end;
%mend mp_recursivejoin;
%mend;

View File

@@ -30,4 +30,4 @@ data _null_;
end;
run;
%mend mp_resetoption;
%mend;

View File

@@ -46,4 +46,4 @@
%mend mp_runddl;
%mend;

View File

@@ -117,4 +117,4 @@ proc sql
%put process finished at %sysfunc(datetime(),datetime19.);
%mend mp_searchdata;
%mend;

View File

@@ -49,4 +49,4 @@
quit;
%mend mp_setkeyvalue;
%mend;

View File

@@ -71,4 +71,4 @@
proc append base=&libds data=&syslast nowarn;run;
options &etls_syntaxcheck;
%mend mp_stprequests;
%mend;

View File

@@ -134,4 +134,4 @@ run;
%mp_binarycopy(inloc="&inloc",outref=_webout)
%end;
%mend mp_streamfile;
%mend;

View File

@@ -89,4 +89,4 @@ quit;
libname &lib clear;
%mend mp_testjob;
%mend;

View File

@@ -22,11 +22,8 @@
|mustbevalidname|can be anything, oops, %abort!!|
@param [in] debug= (log) Provide the _debug value
@param [in] mdebug= (0) Set to 1 to provide macro debugging
@param [in] viyaresult= (WEBOUT_JSON) The Viya result type to return. For
@param [in] viyaresult=(WEBOUT_JSON) The Viya result type to return. For
more info, see mv_getjobresult.sas
@param [in] viyacontext= (SAS Job Execution compute context) The Viya compute
context on which to run the service
@param [out] outlib= (0) Output libref to contain the final tables. Set to
0 if the service output is not in JSON format.
@param [out] outref= (0) Output fileref to create, to contain the full _webout
@@ -50,18 +47,17 @@
inputfiles=0,
inputparams=0,
debug=log,
mdebug=0,
outlib=0,
outref=0,
viyaresult=WEBOUT_JSON,
viyacontext=SAS Job Execution compute context
viyaresult=WEBOUT_JSON
)/*/STORE SOURCE*/;
%local dbg;
%if &mdebug=1 %then %do;
%local mdebug;
%if &debug ne 0 %then %do;
%let mdebug=1;
%put &sysmacroname entry vars:;
%put _local_;
%end;
%else %let dbg=*;
%else %let mdebug=0;
/* sanitise inputparams */
%local pcnt;
@@ -216,7 +212,6 @@
data &ds1;
retain _program "&program";
retain _contextname "&viyacontext";
set &ds1;
putlog "&sysmacroname inputparams:";
putlog (_all_)(=);

View File

@@ -56,4 +56,4 @@ data &outds;
duration_seconds=end_dttm-start_dttm;
run;
%mend mp_testwritespeedlibrary;
%mend;

View File

@@ -68,4 +68,4 @@ data &outds ;
rc=filename('tmp');
run;
%mend mp_tree;
%mend;

View File

@@ -63,4 +63,4 @@ data _null_;
!!'filename &fname2 clear; filename &fname3 clear;');
run;
%mend mp_unzip;
%mend;

View File

@@ -90,4 +90,4 @@ alter table &libds modify &var char(&len);
%mp_createconstraints(inds=&dsconst,outds=&dsconst._addd,execute=YES)
%mend mp_updatevarlength;
%mend;

View File

@@ -76,4 +76,4 @@ ods package publish archive properties
(archive_name="&outname..zip" archive_path="&outpath");
ods package close;
%mend mp_zip;
%mend;

View File

@@ -23,7 +23,7 @@ for file in files:
ml.write(" put '" + line.rstrip().replace("'","''") + " ';\n")
ml.write("run;\n\n")
ml.write("%inc \"%sysfunc(pathname(work))/" + name + ".lua\";\n\n")
ml.write("%mend " + name + ";\n")
ml.write("%mend;\n")
ml.close()

View File

@@ -391,4 +391,4 @@ run;
%inc "%sysfunc(pathname(work))/ml_json.lua";
%mend ml_json;
%mend;

View File

@@ -95,4 +95,4 @@ run;
filename __us2grp clear;
%mend mm_adduser2group;
%mend;

View File

@@ -460,4 +460,4 @@ run;
%return;
%end;
%mend mm_assigndirectlib;
%mend;

View File

@@ -75,4 +75,4 @@
%else %do;
%put NOTE: Library &libref is already assigned;
%end;
%mend mm_assignlib;
%mend;

View File

@@ -152,4 +152,4 @@ run;
%else %put NOTE: Application (&name) successfully created in (&tree)!;
%mend mm_createapplication;
%mend;

View File

@@ -80,4 +80,4 @@ data _null_;
if last then call execute('call missing(of _all_);stop;run;');
run;
%mend mm_createdataset;
%mend;

View File

@@ -122,4 +122,4 @@ run;
run;
%end;
%mend mm_createdocument;
%mend;

View File

@@ -157,4 +157,4 @@ run;
%end;
%put &sysmacroname: execution finished for &path;
%mend mm_createfolder;
%mend;

View File

@@ -318,4 +318,4 @@ filename &frefout temp;
filename &frefout clear;
%end;
%mend mm_createlibrary;
%mend;

View File

@@ -385,4 +385,4 @@ run;
%put %str(WARN)ING: STPTYPE=*&stptype* not recognised!;
%end;
%mend mm_createstp;
%mend;

View File

@@ -415,7 +415,7 @@ data _null_;
put ' ';
put ' %quote(&user) ';
put ' ';
put '%mend mf_getuser; ';
put '%mend; ';
/* WEBOUT END */
put '%macro webout(action,ds,dslabel=,fmt=);';
put ' %mm_webout(&action,ds=&ds,dslabel=&dslabel,fmt=&fmt)';

View File

@@ -68,4 +68,4 @@ run;
%return;
%end;
%mend mm_deletedocument;
%mend;

View File

@@ -89,4 +89,4 @@ run;
%put &sysmacroname: Library &name (&liburi) was successfully deleted;
%mend mm_deletelibrary;
%mend;

View File

@@ -67,4 +67,4 @@ run;
%return;
%end;
%mend mm_deletestp;
%mend;

View File

@@ -113,4 +113,4 @@ run;
filename &fileref clear;
%mend mm_getauthinfo;
%mend;

View File

@@ -50,4 +50,4 @@ proc sort;
by colname;
run;
%mend mm_getcols;
%mend;

View File

@@ -62,4 +62,4 @@ proc sort;
by type name;
run;
%mend mm_getdetails;
%mend;

View File

@@ -54,4 +54,4 @@ data &outds (keep=directoryuri name directoryname directorydesc );
end;
run;
%mend mm_getDirectories;
%mend;

View File

@@ -143,4 +143,4 @@ run;
filename __getdoc clear;
filename __outdoc clear;
%mend mm_getdocument;
%mend;

View File

@@ -93,4 +93,4 @@
run;
%end;
%mend mm_getfoldermembers;
%mend;

View File

@@ -88,4 +88,4 @@ data _null_;
!!",level=%eval(&level+1),append=YES)");
run;
%mend mm_getfoldertree;
%mend;

View File

@@ -69,4 +69,4 @@
end;
run;
%mend mm_getgroupmembers;
%mend;

View File

@@ -92,4 +92,4 @@
options metarepository=&oldrepo;
%end;
%mend mm_getGroups;
%mend;

View File

@@ -94,4 +94,4 @@ filename sxlemap clear;
filename response clear;
libname _XML_ clear;
%mend mm_getlibs;
%mend;

View File

@@ -67,4 +67,4 @@ filename sxlemap clear;
filename response clear;
libname _XML_ clear;
%mend mm_getobjects;
%mend;

View File

@@ -83,4 +83,4 @@ insert into &outds values ('User');
insert into &outds values ('UserGroup');
quit;
%mend mm_getpublictypes;
%mend;

View File

@@ -129,4 +129,4 @@ filename sxlemap clear;
filename response clear;
libname _XML_ clear;
%mend mm_getrepos;
%mend;

View File

@@ -70,4 +70,4 @@ filename sxlemap clear;
filename response clear;
libname _XML_ clear;
%mend mm_getroles;
%mend;

Some files were not shown because too many files have changed in this diff Show More