1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-07 01:20:05 +00:00

Compare commits

..

53 Commits

Author SHA1 Message Date
github-actions
1db610a122 chore: updating all.sas 2023-11-16 15:44:38 +00:00
Allan Bowe
c9e431142c Merge branch 'main' into all-contributors/add-andyjessen 2023-11-16 15:44:20 +00:00
Allan Bowe
2b2aa5eb58 Merge pull request #366 from andyjessen/fix-macro
Add macro trigger to usage example
2023-11-16 15:44:08 +00:00
allcontributors[bot]
1ac2b480a6 docs: update .all-contributorsrc [skip ci] 2023-11-16 15:43:53 +00:00
allcontributors[bot]
4e53544b66 docs: update README.md [skip ci] 2023-11-16 15:43:52 +00:00
github-actions
9b5f1cf170 chore: updating all.sas 2023-11-16 14:23:42 +00:00
andyjessen
703fe4ef38 Add macro trigger to usage example
This commit adds macro trigger to mf_isblank usage example.
2023-11-16 07:22:54 -07:00
Allan Bowe
f4a4263046 Merge pull request #365 from sasjs/issue363
Issue363
2023-11-08 21:31:38 +00:00
github-actions
02bf9c85db chore: updating all.sas 2023-11-08 21:30:00 +00:00
Allan
5835cfaa83 fix: HLO variable label updates, closes #364
Removed line breaks and reduced label length by moving the information to the core doc site and providing a link instead
2023-11-08 21:28:17 +00:00
Allan
b50521a8de fix: adding missing mp_md5 dependency. Closes #363 2023-11-08 21:10:32 +00:00
Allan
fccd6fcc44 fix: updating PR desc to include conventional commit reference 2023-10-18 10:16:02 +01:00
Allan Bowe
487ff5faa9 Merge pull request #362 from rudvfaden/main
fixed error from %put message when mdebug=0
2023-10-18 09:03:06 +01:00
Rud Faden
5efc20eacc fixed error from %put message when mdebug=0 2023-10-18 09:37:11 +02:00
Allan Bowe
cbd62fbfab Merge pull request #361 from sasjs/bumpfix
chore: avoiding vpn start
2023-10-17 16:39:29 +01: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
16 changed files with 187 additions and 58 deletions

View File

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

View File

@@ -2,7 +2,7 @@
# Ensure lint is passing # Ensure lint is passing
LINT=`sasjs lint` 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 "$LINT"
echo "To commit in spite of these warnings, use the -n parameter." echo "To commit in spite of these warnings, use the -n parameter."
exit 1 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`) 1. Create your feature branch (`git checkout -b myfeature`)
2. Make your change 2. Make your change
3. Update the `all.sas` file (`python3 build.py`) 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

@@ -15,4 +15,4 @@ What code changes have been made to achieve the intent.
- [ ] Code is formatted correctly (`sasjs lint`). - [ ] Code is formatted correctly (`sasjs lint`).
- [ ] Any new functionality has been unit tested. - [ ] Any new functionality has been unit tested.
- [ ] All unit tests are passing (`sasjs test`). - [ ] All unit tests are passing (`sasjs test`).
- [ ] `all.sas` has been regenerated (`python3 build.py`) - [ ] The PR desc or underlying commits follow the [Conventional Commit](https://www.conventionalcommits.org) standard

View File

@@ -13,10 +13,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Install dependencies - name: Install dependencies
run: npm ci run: |
npm ci
- name: Check code style (aborts if errors found) - name: Check code style (aborts if errors found)
run: npx @sasjs/cli lint run: npx @sasjs/cli lint
@@ -36,14 +37,15 @@ jobs:
- name: Install Open VPN - name: Install Open VPN
run: | run: |
sudo apt install apt-transport-https #sudo apt install apt-transport-https
sudo wget https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub #sudo wget https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub
sudo apt-key add 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 wget -O /etc/apt/sources.list.d/openvpn3.list https://swupdate.openvpn.net/community/openvpn3/repos/openvpn3-jammy.list
sudo apt update #sudo apt update
sudo apt install openvpn3=17~betaUb22042+jammy #sudo apt install openvpn3=17~betaUb22042+jammy
- name: Start Open VPN 3 - 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 - name: Add credentials
run: | run: |
@@ -52,7 +54,7 @@ jobs:
echo "REFRESH_TOKEN=${{secrets.SAS9_4GL_IO_REFRESH_TOKEN}}" >> .env.server echo "REFRESH_TOKEN=${{secrets.SAS9_4GL_IO_REFRESH_TOKEN}}" >> .env.server
- name: Semantic Release - name: Semantic Release
uses: cycjimmy/semantic-release-action@v3 uses: cycjimmy/semantic-release-action@v4
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_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* *.env*
~ ~

View File

@@ -212,7 +212,8 @@ When contributing to this library, it is therefore important to ensure that all
## General Notes ## 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 ## Breaking Changes
@@ -247,7 +248,7 @@ The following repositories are also worth checking out:
## Contributors ✨ ## Contributors ✨
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> <!-- 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-15-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END --> <!-- ALL-CONTRIBUTORS-BADGE:END -->
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
@@ -272,6 +273,10 @@ 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://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://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="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>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/andyjessen"><img src="https://avatars.githubusercontent.com/u/62343929?v=4?s=100" width="100px;" alt="andyjessen"/><br /><sub><b>andyjessen</b></sub></a><br /><a href="https://github.com/sasjs/core/commits?author=andyjessen" title="Documentation">📖</a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

76
all.sas
View File

@@ -1684,7 +1684,7 @@ Usage:
Usage: Usage:
%put mf_isblank(&var); %put %mf_isblank(&var);
inspiration: inspiration:
https://support.sas.com/resources/papers/proceedings09/022-2009.pdf https://support.sas.com/resources/papers/proceedings09/022-2009.pdf
@@ -10184,6 +10184,7 @@ select distinct lowcase(memname)
@li mp_aligndecimal.sas @li mp_aligndecimal.sas
@li mp_cntlout.sas @li mp_cntlout.sas
@li mp_lockanytable.sas @li mp_lockanytable.sas
@li mp_md5.sas
@li mp_storediffs.sas @li mp_storediffs.sas
<h4> Related Macros </h4> <h4> Related Macros </h4>
@@ -13766,7 +13767,7 @@ alter table &libds modify &var char(&len);
%end; %end;
%else %if &rule=ISNUM %then %do; %else %if &rule=ISNUM %then %do;
/* /*
credit SØREN LASSEN credit SOREN LASSEN
https://sasmacro.blogspot.com/2009/06/welcome-isnum-macro.html https://sasmacro.blogspot.com/2009/06/welcome-isnum-macro.html
*/ */
&tempcol=input(&incol,?? best32.); &tempcol=input(&incol,?? best32.);
@@ -14176,6 +14177,22 @@ ods package close;
(given various practical restrictions) are described here to enable (given various practical restrictions) are described here to enable
consistency when dealing with format data. consistency when dealing with format data.
The HLO variable may have a number of values, documented here due to the
256 char label description length limit:
F=Standard format/informat.
H=Range ending value is HIGH.
I=Numeric informat.
J=Justification for an informat.
L=Range starting value is LOW.
M=MultiLabel.
N=Format or informat has no ranges, including no OTHER= range.
O=Range is OTHER.
R=ROUND option is in effect.
S=Specifies that NOTSORTED is in effect.
U=Specifies that the UPCASE option for an informat be used.
**/ **/
@@ -14183,9 +14200,11 @@ ods package close;
proc sql; proc sql;
create table &libds( create table &libds(
TYPE char(1) label='Type of format - either N (num fmt), C (char fmt), I (num infmt) or J (char infmt)' TYPE char(1) label=
'Format Type: either N (num fmt), C (char fmt), I (num infmt) or J (char infmt)'
,FMTNAME char(32) label='Format name' ,FMTNAME char(32) label='Format name'
,FMTROW num label='CALCULATED Position of record by FMTNAME (reqd for multilabel formats)' ,FMTROW num label=
'CALCULATED Position of record by FMTNAME (reqd for multilabel formats)'
,START char(32767) label='Starting value for format' ,START char(32767) label='Starting value for format'
/* /*
Keep lengths of START and END the same to avoid this err: Keep lengths of START and END the same to avoid this err:
@@ -14205,18 +14224,8 @@ ods package close;
,NOEDIT num length=3 label='Is picture string noedit?' ,NOEDIT num length=3 label='Is picture string noedit?'
,SEXCL char(1) label='Start exclusion' ,SEXCL char(1) label='Start exclusion'
,EEXCL char(1) label='End exclusion' ,EEXCL char(1) label='End exclusion'
,HLO char(13) label='Additional information. ,HLO char(13) label=
F=Standard format/informat. 'More info: https://core.sasjs.io/mddl__sas__cntlout_8sas_source.html'
H=Range ending value is HIGH.
I=Numeric informat.
J=Justification for an informat.
L=Range starting value is LOW.
M=MultiLabel.
N=Format or informat has no ranges, including no OTHER= range.
O=Range is OTHER.
R=ROUND option is in effect.
S=Specifies that NOTSORTED is in effect.
U=Specifies that the UPCASE option for an informat be used.'
,DECSEP char(1) label='Decimal separator' ,DECSEP char(1) label='Decimal separator'
,DIG3SEP char(1) label='Three-digit separator' ,DIG3SEP char(1) label='Three-digit separator'
,DATATYPE char(8) label='Date/time/datetime?' ,DATATYPE char(8) label='Date/time/datetime?'
@@ -14550,9 +14559,9 @@ run;
%end; %end;
%end; %end;
%else %if &engine=ODBC %then %do; %else %if &engine=ODBC %then %do;
&mD.%put NOTE: Retrieving ODBC connection details; %&mD.put NOTE: Retrieving ODBC connection details;
data _null_; 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_); call missing (of _all_);
/* get source connection ID */ /* get source connection ID */
rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri); rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri);
@@ -14567,6 +14576,13 @@ run;
rc2=-1; rc2=-1;
end; end;
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 */ /* get SCHEMA */
rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri); rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri);
rc7=metadata_getattr(up_uri,'SchemaName',schema); rc7=metadata_getattr(up_uri,'SchemaName',schema);
@@ -14583,7 +14599,7 @@ run;
(INSERT_SQL=YES DATASRC=&sql_dsn. CONNECTION=global); (INSERT_SQL=YES DATASRC=&sql_dsn. CONNECTION=global);
%end; %end;
%else %do; %else %do;
libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema; libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema &authdomain;
%end; %end;
%end; %end;
%else %if &engine=POSTGRES %then %do; %else %if &engine=POSTGRES %then %do;
@@ -15828,6 +15844,11 @@ filename &frefout temp;
a conflict) a conflict)
@param [in] repo= ServerContext is tied to a repo, if you are not using the @param [in] repo= ServerContext is tied to a repo, if you are not using the
foundation repo then select a different one here 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: @returns outds dataset containing the following columns:
- stpuri - stpuri
@@ -15867,6 +15888,7 @@ filename &frefout temp;
,minify=NO ,minify=NO
,frefin=mm_in ,frefin=mm_in
,frefout=mm_out ,frefout=mm_out
,LogicalServerType=Sps
)/*/STORE SOURCE*/; )/*/STORE SOURCE*/;
%local mD; %local mD;
@@ -15883,6 +15905,17 @@ filename &frefout temp;
%mp_dropmembers(%scan(&outds,2,.)) %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 * check tree exists
*/ */
@@ -16115,8 +16148,9 @@ run;
' <TextStore IsHidden="0" Name="Stored Process" UsageVersion="0" '/ ' <TextStore IsHidden="0" Name="Stored Process" UsageVersion="0" '/
' TextRole="StoredProcessConfiguration" TextType="XML" '/ ' TextRole="StoredProcessConfiguration" TextType="XML" '/
' StoredText="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&qu'@@ ' StoredText="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&qu'@@
'ot;?&gt;&lt;StoredProcess&gt;&lt;ServerContext LogicalServerType=&quot;S'@@ 'ot;?&gt;&lt;StoredProcess&gt;&lt;ServerContext LogicalServerType=&quot;'@@
'ps&quot; OtherAllowed=&quot;false&quot;/&gt;&lt;ResultCapabilities Packa'@@ "&LogicalServerType"@@
'&quot; OtherAllowed=&quot;false&quot;/&gt;&lt;ResultCapabilities Packa'@@
'ge=&quot;' @@ "&package" @@ '&quot; Streaming=&quot;' @@ "&streaming" @@ 'ge=&quot;' @@ "&package" @@ '&quot; Streaming=&quot;' @@ "&streaming" @@
'&quot;/&gt;&lt;OutputParameters/&gt;&lt;/StoredProcess&gt;" />' / '&quot;/&gt;&lt;OutputParameters/&gt;&lt;/StoredProcess&gt;" />' /
" </Notes> "/ " </Notes> "/

View File

@@ -7,7 +7,7 @@
Usage: Usage:
%put mf_isblank(&var); %put %mf_isblank(&var);
inspiration: inspiration:
https://support.sas.com/resources/papers/proceedings09/022-2009.pdf https://support.sas.com/resources/papers/proceedings09/022-2009.pdf

View File

@@ -40,6 +40,7 @@
@li mp_aligndecimal.sas @li mp_aligndecimal.sas
@li mp_cntlout.sas @li mp_cntlout.sas
@li mp_lockanytable.sas @li mp_lockanytable.sas
@li mp_md5.sas
@li mp_storediffs.sas @li mp_storediffs.sas
<h4> Related Macros </h4> <h4> Related Macros </h4>

View File

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

View File

@@ -6,6 +6,22 @@
(given various practical restrictions) are described here to enable (given various practical restrictions) are described here to enable
consistency when dealing with format data. consistency when dealing with format data.
The HLO variable may have a number of values, documented here due to the
256 char label description length limit:
F=Standard format/informat.
H=Range ending value is HIGH.
I=Numeric informat.
J=Justification for an informat.
L=Range starting value is LOW.
M=MultiLabel.
N=Format or informat has no ranges, including no OTHER= range.
O=Range is OTHER.
R=ROUND option is in effect.
S=Specifies that NOTSORTED is in effect.
U=Specifies that the UPCASE option for an informat be used.
**/ **/
@@ -13,9 +29,11 @@
proc sql; proc sql;
create table &libds( create table &libds(
TYPE char(1) label='Type of format - either N (num fmt), C (char fmt), I (num infmt) or J (char infmt)' TYPE char(1) label=
'Format Type: either N (num fmt), C (char fmt), I (num infmt) or J (char infmt)'
,FMTNAME char(32) label='Format name' ,FMTNAME char(32) label='Format name'
,FMTROW num label='CALCULATED Position of record by FMTNAME (reqd for multilabel formats)' ,FMTROW num label=
'CALCULATED Position of record by FMTNAME (reqd for multilabel formats)'
,START char(32767) label='Starting value for format' ,START char(32767) label='Starting value for format'
/* /*
Keep lengths of START and END the same to avoid this err: Keep lengths of START and END the same to avoid this err:
@@ -35,18 +53,8 @@
,NOEDIT num length=3 label='Is picture string noedit?' ,NOEDIT num length=3 label='Is picture string noedit?'
,SEXCL char(1) label='Start exclusion' ,SEXCL char(1) label='Start exclusion'
,EEXCL char(1) label='End exclusion' ,EEXCL char(1) label='End exclusion'
,HLO char(13) label='Additional information. ,HLO char(13) label=
F=Standard format/informat. 'More info: https://core.sasjs.io/mddl__sas__cntlout_8sas_source.html'
H=Range ending value is HIGH.
I=Numeric informat.
J=Justification for an informat.
L=Range starting value is LOW.
M=MultiLabel.
N=Format or informat has no ranges, including no OTHER= range.
O=Range is OTHER.
R=ROUND option is in effect.
S=Specifies that NOTSORTED is in effect.
U=Specifies that the UPCASE option for an informat be used.'
,DECSEP char(1) label='Decimal separator' ,DECSEP char(1) label='Decimal separator'
,DIG3SEP char(1) label='Three-digit separator' ,DIG3SEP char(1) label='Three-digit separator'
,DATATYPE char(8) label='Date/time/datetime?' ,DATATYPE char(8) label='Date/time/datetime?'

View File

@@ -210,9 +210,9 @@ run;
%end; %end;
%end; %end;
%else %if &engine=ODBC %then %do; %else %if &engine=ODBC %then %do;
&mD.%put NOTE: Retrieving ODBC connection details; %&mD.put NOTE: Retrieving ODBC connection details;
data _null_; 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_); call missing (of _all_);
/* get source connection ID */ /* get source connection ID */
rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri); rc=metadata_getnasn("&liburi",'LibraryConnection',1,connx_uri);
@@ -227,6 +227,13 @@ run;
rc2=-1; rc2=-1;
end; end;
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 */ /* get SCHEMA */
rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri); rc6=metadata_getnasn("&liburi",'UsingPackages',1,up_uri);
rc7=metadata_getattr(up_uri,'SchemaName',schema); rc7=metadata_getattr(up_uri,'SchemaName',schema);
@@ -243,7 +250,7 @@ run;
(INSERT_SQL=YES DATASRC=&sql_dsn. CONNECTION=global); (INSERT_SQL=YES DATASRC=&sql_dsn. CONNECTION=global);
%end; %end;
%else %do; %else %do;
libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema; libname &libref ODBC DATASRC=&sql_dsn SCHEMA=&sql_schema &authdomain;
%end; %end;
%end; %end;
%else %if &engine=POSTGRES %then %do; %else %if &engine=POSTGRES %then %do;

View File

@@ -67,6 +67,11 @@
a conflict) a conflict)
@param [in] repo= ServerContext is tied to a repo, if you are not using the @param [in] repo= ServerContext is tied to a repo, if you are not using the
foundation repo then select a different one here 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: @returns outds dataset containing the following columns:
- stpuri - stpuri
@@ -106,6 +111,7 @@
,minify=NO ,minify=NO
,frefin=mm_in ,frefin=mm_in
,frefout=mm_out ,frefout=mm_out
,LogicalServerType=Sps
)/*/STORE SOURCE*/; )/*/STORE SOURCE*/;
%local mD; %local mD;
@@ -122,6 +128,17 @@
%mp_dropmembers(%scan(&outds,2,.)) %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 * check tree exists
*/ */
@@ -354,8 +371,9 @@ run;
' <TextStore IsHidden="0" Name="Stored Process" UsageVersion="0" '/ ' <TextStore IsHidden="0" Name="Stored Process" UsageVersion="0" '/
' TextRole="StoredProcessConfiguration" TextType="XML" '/ ' TextRole="StoredProcessConfiguration" TextType="XML" '/
' StoredText="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&qu'@@ ' StoredText="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&qu'@@
'ot;?&gt;&lt;StoredProcess&gt;&lt;ServerContext LogicalServerType=&quot;S'@@ 'ot;?&gt;&lt;StoredProcess&gt;&lt;ServerContext LogicalServerType=&quot;'@@
'ps&quot; OtherAllowed=&quot;false&quot;/&gt;&lt;ResultCapabilities Packa'@@ "&LogicalServerType"@@
'&quot; OtherAllowed=&quot;false&quot;/&gt;&lt;ResultCapabilities Packa'@@
'ge=&quot;' @@ "&package" @@ '&quot; Streaming=&quot;' @@ "&streaming" @@ 'ge=&quot;' @@ "&package" @@ '&quot; Streaming=&quot;' @@ "&streaming" @@
'&quot;/&gt;&lt;OutputParameters/&gt;&lt;/StoredProcess&gt;" />' / '&quot;/&gt;&lt;OutputParameters/&gt;&lt;/StoredProcess&gt;" />' /
" </Notes> "/ " </Notes> "/