1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-25 04:01:20 +00:00

Compare commits

..

1 Commits

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

View File

@@ -1,104 +0,0 @@
{
"projectName": "core",
"projectOwner": "sasjs",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitConvention": "angular",
"contributors": [
{
"login": "allanbowe",
"name": "Allan Bowe",
"avatar_url": "https://avatars.githubusercontent.com/u/4420615?v=4",
"profile": "https://github.com/allanbowe",
"contributions": [
"business",
"code",
"content",
"doc",
"infra",
"maintenance",
"mentoring",
"question",
"review",
"test"
]
},
{
"login": "rafgag",
"name": "rafgag",
"avatar_url": "https://avatars.githubusercontent.com/u/69139928?v=4",
"profile": "https://github.com/rafgag",
"contributions": [
"code"
]
},
{
"login": "tmoody",
"name": "Trevor Moody",
"avatar_url": "https://avatars.githubusercontent.com/u/79837106?v=4",
"profile": "https://github.com/tmoody",
"contributions": [
"code"
]
},
{
"login": "krishna-acondy",
"name": "Krishna Acondy",
"avatar_url": "https://avatars.githubusercontent.com/u/2980428?v=4",
"profile": "https://krishna-acondy.io/",
"contributions": [
"code",
"infra",
"blog",
"content",
"ideas",
"video"
]
},
{
"login": "saadjutt01",
"name": "Muhammad Saad ",
"avatar_url": "https://avatars.githubusercontent.com/u/8914650?v=4",
"profile": "https://github.com/saadjutt01",
"contributions": [
"code",
"ideas"
]
},
{
"login": "YuryShkoda",
"name": "Yury Shkoda",
"avatar_url": "https://avatars.githubusercontent.com/u/25773492?v=4",
"profile": "https://www.erudicat.com/",
"contributions": [
"code",
"infra",
"video"
]
},
{
"login": "medjedovicm",
"name": "Mihajlo Medjedovic",
"avatar_url": "https://avatars.githubusercontent.com/u/18329105?v=4",
"profile": "https://github.com/medjedovicm",
"contributions": [
"infra"
]
},
{
"login": "kkchandok",
"name": "kkchandok",
"avatar_url": "https://avatars.githubusercontent.com/u/46090627?v=4",
"profile": "https://github.com/kkchandok",
"contributions": [
"ideas"
]
}
],
"contributorsPerLine": 7
}

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,

View File

@@ -179,34 +179,3 @@ If you find this library useful, please leave a [star](https://github.com/sasjs/
## Contributors ✨
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/allanbowe"><img src="https://avatars.githubusercontent.com/u/4420615?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Allan Bowe</b></sub></a><br /><a href="#business-allanbowe" title="Business development">💼</a> <a href="https://github.com/sasjs/core/commits?author=allanbowe" title="Code">💻</a> <a href="#content-allanbowe" title="Content">🖋</a> <a href="https://github.com/sasjs/core/commits?author=allanbowe" title="Documentation">📖</a> <a href="#infra-allanbowe" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-allanbowe" title="Maintenance">🚧</a> <a href="#mentoring-allanbowe" title="Mentoring">🧑‍🏫</a> <a href="#question-allanbowe" title="Answering Questions">💬</a> <a href="https://github.com/sasjs/core/pulls?q=is%3Apr+reviewed-by%3Aallanbowe" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/sasjs/core/commits?author=allanbowe" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/rafgag"><img src="https://avatars.githubusercontent.com/u/69139928?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rafgag</b></sub></a><br /><a href="https://github.com/sasjs/core/commits?author=rafgag" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/tmoody"><img src="https://avatars.githubusercontent.com/u/79837106?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Trevor Moody</b></sub></a><br /><a href="https://github.com/sasjs/core/commits?author=tmoody" title="Code">💻</a></td>
<td align="center"><a href="https://krishna-acondy.io/"><img src="https://avatars.githubusercontent.com/u/2980428?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Krishna Acondy</b></sub></a><br /><a href="https://github.com/sasjs/core/commits?author=krishna-acondy" title="Code">💻</a> <a href="#infra-krishna-acondy" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#blog-krishna-acondy" title="Blogposts">📝</a> <a href="#content-krishna-acondy" title="Content">🖋</a> <a href="#ideas-krishna-acondy" title="Ideas, Planning, & Feedback">🤔</a> <a href="#video-krishna-acondy" title="Videos">📹</a></td>
<td align="center"><a href="https://github.com/saadjutt01"><img src="https://avatars.githubusercontent.com/u/8914650?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Muhammad Saad </b></sub></a><br /><a href="https://github.com/sasjs/core/commits?author=saadjutt01" title="Code">💻</a> <a href="#ideas-saadjutt01" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://www.erudicat.com/"><img src="https://avatars.githubusercontent.com/u/25773492?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yury Shkoda</b></sub></a><br /><a href="https://github.com/sasjs/core/commits?author=YuryShkoda" title="Code">💻</a> <a href="#infra-YuryShkoda" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#video-YuryShkoda" title="Videos">📹</a></td>
<td align="center"><a href="https://github.com/medjedovicm"><img src="https://avatars.githubusercontent.com/u/18329105?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mihajlo Medjedovic</b></sub></a><br /><a href="#infra-medjedovicm" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/kkchandok"><img src="https://avatars.githubusercontent.com/u/46090627?v=4?s=100" width="100px;" alt=""/><br /><sub><b>kkchandok</b></sub></a><br /><a href="#ideas-kkchandok" title="Ideas, Planning, & Feedback">🤔</a></td>
</tr>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

684
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,117 +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 recfm=N;
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 + (-1) @;
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);
length raw $4;
do i=1 to 4;
rc=fget(filein,char,1);
substr(raw,i,1)=char;
end;
rc = fput(fileout,input(raw,$base64X4.));
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

@@ -1,154 +0,0 @@
/**
@file
@brief Export a dataset to SQL insert statements
@details Converts dataset values to SQL insert statements for use across
multiple database types.
Usage:
%mp_ds2inserts(sashelp.class,outref=myref,outds=class)
data class;
set sashelp.class;
stop;
proc sql;
%inc myref;
@param [in] ds The dataset to be exported
@param [out] outref= (0) The output fileref. If it does not exist, it is
created. If it does exist, new records are APPENDED.
@param [out] outlib= (0) The library (or schema) in which the target table is
located. If not provided, is ignored.
@param [out] outds= (0) The output table to load. If not provided, will
default to the table in the &ds parameter.
@param [in] flavour= (BASE) The SQL flavour to be applied to the output. Valid
options:
@li BASE (default) - suitable for regular proc sql
@li PGSQL - Used for Postgres databases
<h4> SAS Macros </h4>
@li mf_existfileref.sas
@li mf_getvarcount.sas
@li mf_getvarlist.sas
@li mf_getvartype.sas
@version 9.2
@author Allan Bowe (credit mjsq)
**/
%macro mp_ds2inserts(ds, outref=0,outlib=0,outds=0,flavour=BASE
)/*/STORE SOURCE*/;
%if not %sysfunc(exist(&ds)) %then %do;
%put %str(WAR)NING: &ds does not exist;
%return;
%end;
%if not %sysfunc(exist(&ds)) %then %do;
%put %str(WAR)NING: &ds does not exist;
%return;
%end;
%if %index(&ds,.)=0 %then %let ds=WORK.&ds;
%let flavour=%upcase(&flavour);
%if &flavour ne BASE and &flavour ne PGSQL %then %do;
%put %str(WAR)NING: &flavour is not supported;
%return;
%end;
%if &outref=0 %then %do;
%put %str(WAR)NING: Please provide a fileref;
%return;
%end;
%if %mf_existfileref(&outref)=0 %then %do;
filename &outref temp lrecl=66000;
%end;
%if &outlib=0 %then %let outlib=;
%else %let outlib=&outlib..;
%if &outds=0 %then %let outds=%scan(&ds,2,.);
%local nobs;
proc sql noprint;
select count(*) into: nobs TRIMMED from &ds;
%if &nobs=0 %then %do;
data _null_;
file &outref mod;
put "/* No rows found in &ds */";
run;
%end;
%local vars;
%let vars=%mf_getvarcount(&ds);
%if &vars=0 %then %do;
data _null_;
file &outref mod;
put "/* No columns found in &ds */";
run;
%end;
%local varlist varlistcomma;
%let varlist=%mf_getvarlist(&ds);
%let varlistcomma=%mf_getvarlist(&ds,dlm=%str(,),quote=double);
/* next, export data */
data _null_;
file &outref mod ;
if _n_=1 then put "/* &outlib.&outds (&nobs rows, &vars columns) */";
set &ds;
length _____str $32767;
format _numeric_ best.;
format _character_ ;
%local i comma var vtype;
%do i=1 %to %sysfunc(countw(&varlist));
%let var=%scan(&varlist,&i);
%let vtype=%mf_getvartype(&ds,&var);
%if &i=1 %then %do;
%if &flavour=BASE %then %do;
put "insert into &outlib.&outds set ";
put " &var="@;
%end;
%else %if &flavour=PGSQL %then %do;
_____str=cats(
"INSERT INTO &outlib.&outds ("
,symget('varlistcomma')
,") VALUES ("
);
put _____str;
put " "@;
%end;
%end;
%else %do;
%if &flavour=BASE %then %do;
put " ,&var="@;
%end;
%else %if &flavour=PGSQL %then %do;
put " ,"@;
%end;
%end;
%if &vtype=N %then %do;
%if &flavour=BASE %then %do;
put &var;
%end;
%else %if &flavour=PGSQL %then %do;
if missing(&var) then put 'NULL';
else put &var;
%end;
%end;
%else %do;
_____str="'"!!trim(tranwrd(&var,"'","''"))!!"'";
put _____str;
%end;
%end;
%if &flavour=BASE %then %do;
put ';';
%end;
%else %if &flavour=PGSQL %then %do;
put ');';
%end;
if _n_=&nobs then put /;
run;
%mend mp_ds2inserts;

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

@@ -16,13 +16,12 @@
%mp_getddl(work,test,flavour=tsql,showlog=YES)
<h4> SAS Macros </h4>
@li mf_existfileref.sas
@li mp_getconstraints.sas
@param lib libref of the library to create DDL for. Should be assigned.
@param ds dataset to create ddl for (optional)
@param fref= the fileref to which to _append_ the DDL. If it does not exist,
it will be created.
@param fref= the fileref to which to write the DDL. If not preassigned, will
be assigned to TEMP.
@param flavour= The type of DDL to create (default=SAS). Supported=TSQL
@param showlog= Set to YES to show the DDL in the log
@param schema= Choose a preferred schema name (default is to use actual schema
@@ -38,10 +37,9 @@
)/*/STORE SOURCE*/;
/* check fileref is assigned */
%if %mf_existfileref(&outref)=0 %then %do;
filename &outref temp ;
%if %sysfunc(fileref(&fref)) > 0 %then %do;
filename &fref temp;
%end;
%if %length(&libref)=0 %then %let libref=WORK;
%let flavour=%upcase(&flavour);
@@ -117,10 +115,10 @@ create table _data_ as
end;
run;
%put &=constraints_used;
%mend addConst;
%mend;
data _null_;
file &fref mod;
file &fref;
put "/* DDL generated by &sysuserid on %sysfunc(datetime(),datetime19.) */";
run;
@@ -380,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

@@ -20,8 +20,6 @@
@li mf_getvartype.sas
@param [in] libds dataset to hash
@param [in] salt= Provide a salt (could be, for instance, the name of the
dataset). Max 32 chars.
@param [out] outds= (work.mf_hashdataset) The output dataset to create. This
will contain one column (hashkey) with one observation (a hex32.
representation of the input hash)
@@ -35,8 +33,7 @@
%macro mp_hashdataset(
libds,
outds=,
salt=
outds=
)/*/STORE SOURCE*/;
%if %mf_getattrn(&libds,NLOBS)=0 %then %do;
%put %str(WARN)ING: Dataset &libds is empty;, or is not a dataset;
@@ -56,7 +53,7 @@
%let varlist=%mf_getvarlist(&libds);
data &outds(rename=(&keyvar=hashkey) keep=&keyvar);
length &prevkeyvar &keyvar $32;
retain &prevkeyvar "&salt";
retain &prevkeyvar;
set &libds end=&lastvar;
/* hash should include previous row */
&keyvar=put(md5(&prevkeyvar
@@ -75,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;

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