1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-24 19:51:19 +00:00

Compare commits

...

39 Commits

Author SHA1 Message Date
github-actions
73f8cd8894 chore: updating all.sas 2023-10-17 15:39:42 +00:00
Allan Bowe
2808145302 Merge branch 'main' into bumpfix 2023-10-17 16:39:19 +01:00
Allan
815e5f3e0e chore: avoiding vpn start 2023-10-17 16:37:48 +01:00
Allan Bowe
843d6e5c2d Merge pull request #360 from sasjs/bumpfix
chore: Bumpfix
2023-10-17 16:37:23 +01:00
github-actions
b084f4e84b chore: updating all.sas 2023-10-17 15:37:03 +00:00
Allan Bowe
5b5116070e Merge branch 'main' into bumpfix 2023-10-17 16:36:39 +01:00
github-actions
a2002db838 chore: updating all.sas 2023-10-17 15:36:07 +00:00
Allan
dc6bcdd69e chore: merge msg 2023-10-17 16:34:40 +01:00
Allan
c97dc9a16d chore: commenting vpn due to package issues 2023-10-17 16:32:24 +01:00
github-actions
ef669db622 chore: updating all.sas 2023-10-17 15:15:30 +00:00
Allan Bowe
26499d2058 Merge pull request #359 from sasjs/bumpfix
chore: moving all.sas logic to another action
2023-10-17 16:15:15 +01:00
Allan Bowe
17e5d0f0e0 Merge branch 'main' into bumpfix 2023-10-17 16:15:04 +01:00
github-actions
fc9205e355 chore: updating all.sas 2023-10-17 15:14:17 +00:00
Allan
ce344fc8e2 chore: allow empty commit to avoid workflow error 2023-10-17 16:12:50 +01:00
Allan
40239c53d8 chore: removing utf char from pre-commit hook 2023-10-17 16:07:57 +01:00
Allan
814ecec94f chore: moving all.sas logic to another action 2023-10-17 16:05:32 +01:00
Allan Bowe
934c501fec Merge pull request #358 from sasjs/bumpfix
chore: adding cli dependency
2023-10-17 16:02:13 +01:00
Allan Bowe
091b2e28be Merge branch 'main' into bumpfix 2023-10-17 16:01:58 +01:00
Allan
d8ea29bf8c chore: -g param 2023-10-17 16:00:47 +01:00
Allan
993dec4610 chore: adding cli dependency 2023-10-17 16:00:05 +01:00
Allan Bowe
f905387d66 Merge pull request #357 from sasjs/bumpfix
fix: bumping semantic release and checkout actions to v4
2023-10-17 15:59:25 +01:00
Allan
7512423b04 fix: bumping semantic release and checkout actions to v4 2023-10-17 15:57:29 +01:00
Allan
50e6d416a4 fix: mentioning conv. commits in CONTRIBUTING.md and setting eol=lf in .gitattributes 2023-10-17 15:24:49 +01:00
Allan Bowe
18b6cadce6 Merge pull request #354 from sasjs/all-contributors/add-rudvfaden
fix: add rudvfaden as a contributor for code
2023-10-17 15:04:27 +01:00
Allan Bowe
413743bbe6 Merge branch 'main' into all-contributors/add-rudvfaden 2023-10-17 15:03:36 +01:00
Allan Bowe
fcafb1026e Merge pull request #353 from rudvfaden/main
added authdomain for odbc engine in MM_ASSIGNDIRECTLIB
2023-10-17 15:01:37 +01:00
allcontributors[bot]
b8f24264d4 docs: update .all-contributorsrc [skip ci] 2023-10-17 14:00:19 +00:00
allcontributors[bot]
5eb87a754e docs: update README.md [skip ci] 2023-10-17 14:00:14 +00:00
Rud Faden
3a5fd4bfc5 added .gitattributes 2023-10-17 15:54:27 +02:00
Rud Faden
b7ae9a2737 added backwards compebility 2023-10-17 15:45:44 +02:00
Rud Faden
4057ac4b2e fix lineending CRLF to LF 2023-10-17 14:00:42 +02:00
Rud Faden
fa0a6ab22d run build.py 2023-10-17 13:46:28 +02:00
Rud Faden
2ae7a60be5 added authdomain for odvc engine 2023-10-17 13:33:48 +02:00
Rud Faden
0a24f3ff7b add authdomain for odbc connection 2023-10-17 13:13:03 +02:00
Allan
592f477063 chore(docs): updated readme about non-ascii char recommendations 2023-10-11 22:42:25 +01:00
Allan Bowe
a91db81894 Merge pull request #352 from sasjs/dcissue50
fix: removing UTF 8 char to support LATIN9 environments
2023-10-11 22:18:30 +01:00
Allan
236e7cc4c0 fix: removing UTF 8 char to support LATIN9 environments
Source issue: https://git.datacontroller.io/dc/dc/issues/50
2023-10-11 22:12:19 +01:00
Allan Bowe
2b6882cb9c Merge pull request #351 from sasjs/issue350
feat: adding LogicalServerType option to mm_createstp.sas macro.
2023-10-05 16:09:41 +01:00
Allan
2a3071708a feat: adding LogicalServerType option to mm_createstp.sas macro. Closes #350 2023-10-05 16:06:11 +01:00
12 changed files with 124 additions and 25 deletions

View File

@@ -144,8 +144,18 @@
"contributions": [
"doc"
]
},
{
"login": "rudvfaden",
"name": "Rud Faden",
"avatar_url": "https://avatars.githubusercontent.com/u/2445577?v=4",
"profile": "http://rudvfaden.github.io/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"skipCi": true
"skipCi": true,
"commitType": "docs"
}

View File

@@ -2,7 +2,7 @@
# Ensure lint is passing
LINT=`sasjs lint`
if [[ "$LINT" != *"All matched files use @sasjs/lint code style!" ]]; then
if [[ "$LINT" != *"All matched files use @sasjs/lint code style!" ]]; then
echo "$LINT"
echo "To commit in spite of these warnings, use the -n parameter."
exit 1

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
* text=auto eol=lf

View File

@@ -27,5 +27,6 @@ To contribute:
1. Create your feature branch (`git checkout -b myfeature`)
2. Make your change
3. Update the `all.sas` file (`python3 build.py`)
4. Push and make a PR
4. Commit using a [Conventional Commit](https://www.conventionalcommits.org)
5. Push and make a PR

View File

@@ -13,10 +13,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
run: |
npm ci
- name: Check code style (aborts if errors found)
run: npx @sasjs/cli lint
@@ -36,14 +37,15 @@ jobs:
- 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-jammy.list
sudo apt update
sudo apt install openvpn3=17~betaUb22042+jammy
#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-jammy.list
#sudo apt update
#sudo apt install openvpn3=17~betaUb22042+jammy
- name: Start Open VPN 3
run: openvpn3 session-start --config .github/vpn/config.ovpn
run: |
# openvpn3 session-start --config .github/vpn/config.ovpn
- name: Add credentials
run: |
@@ -52,7 +54,7 @@ jobs:
echo "REFRESH_TOKEN=${{secrets.SAS9_4GL_IO_REFRESH_TOKEN}}" >> .env.server
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

32
.github/workflows/notmain.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: SASjs Core - Update all.sas
on:
push:
branches-ignore:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
npm ci
npm i -g @sasjs/cli@latest
- name: Ensure all.sas is always up to date
run: |
git config user.name github-actions
git config user.email github-actions@github.com
python3 build.py
git add all.sas
git commit -m "chore: updating all.sas" --allow-empty
git push

1
.gitignore vendored
View File

@@ -13,3 +13,4 @@ mc_*
*.env*
~

View File

@@ -212,7 +212,8 @@ When contributing to this library, it is therefore important to ensure that all
## General Notes
- All macros should be compatible with SAS versions from support level B and above (so currently 9.2 and later). If an earlier version is not supported, then the macro should say as such in the header documentation, and exit gracefully (eg `%if %sysevalf(&sysver<9.3) %then %return`).
- All macros should be compatible with SAS versions from support level B and above (so currently 9.3 and later). If an earlier version is not supported, then the macro should say as such in the header documentation, and exit gracefully.
- It's [best to avoid](https://git.datacontroller.io/dc/dc/issues/50) special / non-ASCII characters for compatibility with the widest variety of SAS installations.
## Breaking Changes
@@ -247,7 +248,7 @@ The following repositories are also worth checking out:
## Contributors ✨
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-14-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)):
@@ -272,6 +273,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yabwon"><img src="https://avatars.githubusercontent.com/u/9314894?v=4?s=100" width="100px;" alt="Bart Jablonski"/><br /><sub><b>Bart Jablonski</b></sub></a><br /><a href="https://github.com/sasjs/core/commits?author=yabwon" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://bandism.net/"><img src="https://avatars.githubusercontent.com/u/22633385?v=4?s=100" width="100px;" alt="Ikko Ashimine"/><br /><sub><b>Ikko Ashimine</b></sub></a><br /><a href="https://github.com/sasjs/core/commits?author=eltociear" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/henrik-forsell"><img src="https://avatars.githubusercontent.com/u/109935936?v=4?s=100" width="100px;" alt="Henrik Forsell"/><br /><sub><b>Henrik Forsell</b></sub></a><br /><a href="https://github.com/sasjs/core/commits?author=henrik-forsell" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://rudvfaden.github.io/"><img src="https://avatars.githubusercontent.com/u/2445577?v=4?s=100" width="100px;" alt="Rud Faden"/><br /><sub><b>Rud Faden</b></sub></a><br /><a href="https://github.com/sasjs/core/commits?author=rudvfaden" title="Code">💻</a></td>
</tr>
</tbody>
</table>

35
all.sas
View File

@@ -13766,7 +13766,7 @@ alter table &libds modify &var char(&len);
%end;
%else %if &rule=ISNUM %then %do;
/*
credit SØREN LASSEN
credit SOREN LASSEN
https://sasmacro.blogspot.com/2009/06/welcome-isnum-macro.html
*/
&tempcol=input(&incol,?? best32.);
@@ -14552,7 +14552,7 @@ run;
%else %if &engine=ODBC %then %do;
&mD.%put NOTE: Retrieving ODBC connection details;
data _null_;
length connx_uri conprop_uri value datasource up_uri schema $256.;
length connx_uri conprop_uri value datasource up_uri schema domprop_uri authdomain $256.;
call missing (of _all_);
/* get source connection ID */
rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri);
@@ -14567,6 +14567,13 @@ run;
rc2=-1;
end;
end;
/* get auth domain */
autrc=metadata_getnasn(connx_uri,"Domain",1,domprop_uri);
arc=metadata_getattr(domprop_uri,"Name",authdomain);
if not missing(authdomain) then authdomain=cats('AUTHDOMAIN=',authdomain);
call symputx('authdomain',authdomain,'l');
/* get SCHEMA */
rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri);
rc7=metadata_getattr(up_uri,'SchemaName',schema);
@@ -14583,7 +14590,7 @@ run;
(INSERT_SQL=YES DATASRC=&sql_dsn. CONNECTION=global);
%end;
%else %do;
libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema;
libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema &authdomain;
%end;
%end;
%else %if &engine=POSTGRES %then %do;
@@ -15828,6 +15835,11 @@ filename &frefout temp;
a conflict)
@param [in] repo= ServerContext is tied to a repo, if you are not using the
foundation repo then select a different one here
@param [in] LogicalServerType= (Sps) Server Type to use. Valid options:
@li Any - Uses the default server.
@li Sps - Stored Process Server, best choice for web app development. Runs
under a system account identity (eg sassrv).
@li Wks - Workspace Server. Runs under the end user identity.
@returns outds dataset containing the following columns:
- stpuri
@@ -15867,6 +15879,7 @@ filename &frefout temp;
,minify=NO
,frefin=mm_in
,frefout=mm_out
,LogicalServerType=Sps
)/*/STORE SOURCE*/;
%local mD;
@@ -15883,6 +15896,17 @@ filename &frefout temp;
%mp_dropmembers(%scan(&outds,2,.))
/* check LogicalServerType validity */
%mp_abort(
iftrue=(
&LogicalServerType ne Sps
and &LogicalServerType ne Wks
and &LogicalServerType ne Any
)
,mac=&sysmacroname
,msg=%str(Invalid value for LogicalServerType (&LogicalServerType))
)
/**
* check tree exists
*/
@@ -16115,8 +16139,9 @@ run;
' <TextStore IsHidden="0" Name="Stored Process" UsageVersion="0" '/
' TextRole="StoredProcessConfiguration" TextType="XML" '/
' StoredText="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&qu'@@
'ot;?&gt;&lt;StoredProcess&gt;&lt;ServerContext LogicalServerType=&quot;S'@@
'ps&quot; OtherAllowed=&quot;false&quot;/&gt;&lt;ResultCapabilities Packa'@@
'ot;?&gt;&lt;StoredProcess&gt;&lt;ServerContext LogicalServerType=&quot;'@@
"&LogicalServerType"@@
'&quot; OtherAllowed=&quot;false&quot;/&gt;&lt;ResultCapabilities Packa'@@
'ge=&quot;' @@ "&package" @@ '&quot; Streaming=&quot;' @@ "&streaming" @@
'&quot;/&gt;&lt;OutputParameters/&gt;&lt;/StoredProcess&gt;" />' /
" </Notes> "/

View File

@@ -57,7 +57,7 @@
%end;
%else %if &rule=ISNUM %then %do;
/*
credit SØREN LASSEN
credit SOREN LASSEN
https://sasmacro.blogspot.com/2009/06/welcome-isnum-macro.html
*/
&tempcol=input(&incol,?? best32.);

View File

@@ -212,7 +212,7 @@ run;
%else %if &engine=ODBC %then %do;
&mD.%put NOTE: Retrieving ODBC connection details;
data _null_;
length connx_uri conprop_uri value datasource up_uri schema $256.;
length connx_uri conprop_uri value datasource up_uri schema domprop_uri authdomain $256.;
call missing (of _all_);
/* get source connection ID */
rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri);
@@ -227,6 +227,13 @@ run;
rc2=-1;
end;
end;
/* get auth domain */
autrc=metadata_getnasn(connx_uri,"Domain",1,domprop_uri);
arc=metadata_getattr(domprop_uri,"Name",authdomain);
if not missing(authdomain) then authdomain=cats('AUTHDOMAIN=',authdomain);
call symputx('authdomain',authdomain,'l');
/* get SCHEMA */
rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri);
rc7=metadata_getattr(up_uri,'SchemaName',schema);
@@ -243,7 +250,7 @@ run;
(INSERT_SQL=YES DATASRC=&sql_dsn. CONNECTION=global);
%end;
%else %do;
libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema;
libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema &authdomain;
%end;
%end;
%else %if &engine=POSTGRES %then %do;

View File

@@ -67,6 +67,11 @@
a conflict)
@param [in] repo= ServerContext is tied to a repo, if you are not using the
foundation repo then select a different one here
@param [in] LogicalServerType= (Sps) Server Type to use. Valid options:
@li Any - Uses the default server.
@li Sps - Stored Process Server, best choice for web app development. Runs
under a system account identity (eg sassrv).
@li Wks - Workspace Server. Runs under the end user identity.
@returns outds dataset containing the following columns:
- stpuri
@@ -106,6 +111,7 @@
,minify=NO
,frefin=mm_in
,frefout=mm_out
,LogicalServerType=Sps
)/*/STORE SOURCE*/;
%local mD;
@@ -122,6 +128,17 @@
%mp_dropmembers(%scan(&outds,2,.))
/* check LogicalServerType validity */
%mp_abort(
iftrue=(
&LogicalServerType ne Sps
and &LogicalServerType ne Wks
and &LogicalServerType ne Any
)
,mac=&sysmacroname
,msg=%str(Invalid value for LogicalServerType (&LogicalServerType))
)
/**
* check tree exists
*/
@@ -354,8 +371,9 @@ run;
' <TextStore IsHidden="0" Name="Stored Process" UsageVersion="0" '/
' TextRole="StoredProcessConfiguration" TextType="XML" '/
' StoredText="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&qu'@@
'ot;?&gt;&lt;StoredProcess&gt;&lt;ServerContext LogicalServerType=&quot;S'@@
'ps&quot; OtherAllowed=&quot;false&quot;/&gt;&lt;ResultCapabilities Packa'@@
'ot;?&gt;&lt;StoredProcess&gt;&lt;ServerContext LogicalServerType=&quot;'@@
"&LogicalServerType"@@
'&quot; OtherAllowed=&quot;false&quot;/&gt;&lt;ResultCapabilities Packa'@@
'ge=&quot;' @@ "&package" @@ '&quot; Streaming=&quot;' @@ "&streaming" @@
'&quot;/&gt;&lt;OutputParameters/&gt;&lt;/StoredProcess&gt;" />' /
" </Notes> "/