mirror of
https://github.com/sasjs/core.git
synced 2026-01-11 02:50:06 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b02a9e3478 | ||
|
|
3d3c76c836 | ||
|
|
e039f1cd83 | ||
|
|
6c8165601d | ||
|
|
596624c1bf | ||
|
|
4aca34d4c2 |
@@ -1,2 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
sasjs lint
|
sasjs lint
|
||||||
|
|
||||||
|
# Avoid commits to the master branch
|
||||||
|
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||||
|
|
||||||
|
if [[ "$BRANCH" =~ ^(master|main|develop)$ ]]; then
|
||||||
|
echo "You are on branch $BRANCH. Are you sure you want to commit to this branch?"
|
||||||
|
echo "If so, commit with -n to bypass the pre-commit hook."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
15
all.sas
15
all.sas
@@ -6169,6 +6169,7 @@ create table &outds as
|
|||||||
|
|
||||||
@param [in] libds dataset to hash
|
@param [in] libds dataset to hash
|
||||||
@param [in] salt= Provide a salt (could be, for instance, the dataset name)
|
@param [in] salt= Provide a salt (could be, for instance, the dataset name)
|
||||||
|
@param [in] iftrue= A condition under which the macro should be executed.
|
||||||
@param [out] outds= (work.mf_hashdataset) The output dataset to create. This
|
@param [out] outds= (work.mf_hashdataset) The output dataset to create. This
|
||||||
will contain one column (hashkey) with one observation (a hex32.
|
will contain one column (hashkey) with one observation (a hex32.
|
||||||
representation of the input hash)
|
representation of the input hash)
|
||||||
@@ -6183,10 +6184,14 @@ create table &outds as
|
|||||||
%macro mp_hashdataset(
|
%macro mp_hashdataset(
|
||||||
libds,
|
libds,
|
||||||
outds=,
|
outds=,
|
||||||
salt=
|
salt=,
|
||||||
|
iftrue=%str(1=1)
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
|
|
||||||
|
%if not(%eval(%unquote(&iftrue))) %then %return;
|
||||||
|
|
||||||
%if %mf_getattrn(&libds,NLOBS)=0 %then %do;
|
%if %mf_getattrn(&libds,NLOBS)=0 %then %do;
|
||||||
%put %str(WARN)ING: Dataset &libds is empty;, or is not a dataset;
|
%put %str(WARN)ING: Dataset &libds is empty, or is not a dataset;
|
||||||
%end;
|
%end;
|
||||||
%else %if %mf_getattrn(&libds,NLOBS)<0 %then %do;
|
%else %if %mf_getattrn(&libds,NLOBS)<0 %then %do;
|
||||||
%put %str(ERR)OR: Dataset &libds is not a dataset;
|
%put %str(ERR)OR: Dataset &libds is not a dataset;
|
||||||
@@ -6367,15 +6372,15 @@ filename &tempref clear;
|
|||||||
compress=CHAR /* default is none so ensure we have something! */
|
compress=CHAR /* default is none so ensure we have something! */
|
||||||
datastmtchk=ALLKEYWORDS /* protection from overwriting input datasets */
|
datastmtchk=ALLKEYWORDS /* protection from overwriting input datasets */
|
||||||
errorcheck=STRICT /* catch errors in libname/filename statements */
|
errorcheck=STRICT /* catch errors in libname/filename statements */
|
||||||
fmterr /* ensure error when a format cannot be found */
|
fmterr /* ensure err when a format cannot be found */
|
||||||
mergenoby=ERROR /*
|
mergenoby=%str(ERR)OR /* Throw err when a merge has no BY variables */
|
||||||
missing=. /* some sites change this which causes hard to detect errors */
|
missing=. /* some sites change this which causes hard to detect errors */
|
||||||
noquotelenmax /* avoid warnings for long strings */
|
noquotelenmax /* avoid warnings for long strings */
|
||||||
noreplace /* avoid overwriting permanent datasets */
|
noreplace /* avoid overwriting permanent datasets */
|
||||||
ps=max /* reduce log size slightly */
|
ps=max /* reduce log size slightly */
|
||||||
validmemname=COMPATIBLE /* avoid special characters etc in table names */
|
validmemname=COMPATIBLE /* avoid special characters etc in table names */
|
||||||
validvarname=V7 /* avoid special characters etc in variable names */
|
validvarname=V7 /* avoid special characters etc in variable names */
|
||||||
varlenchk=ERROR /* fail hard if truncation (data loss) can result */
|
varlenchk=%str(ERR)OR /* fail hard if truncation (data loss) can result */
|
||||||
;
|
;
|
||||||
|
|
||||||
%mend mp_init;/**
|
%mend mp_init;/**
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
@param [in] libds dataset to hash
|
@param [in] libds dataset to hash
|
||||||
@param [in] salt= Provide a salt (could be, for instance, the dataset name)
|
@param [in] salt= Provide a salt (could be, for instance, the dataset name)
|
||||||
|
@param [in] iftrue= A condition under which the macro should be executed.
|
||||||
@param [out] outds= (work.mf_hashdataset) The output dataset to create. This
|
@param [out] outds= (work.mf_hashdataset) The output dataset to create. This
|
||||||
will contain one column (hashkey) with one observation (a hex32.
|
will contain one column (hashkey) with one observation (a hex32.
|
||||||
representation of the input hash)
|
representation of the input hash)
|
||||||
@@ -35,10 +36,14 @@
|
|||||||
%macro mp_hashdataset(
|
%macro mp_hashdataset(
|
||||||
libds,
|
libds,
|
||||||
outds=,
|
outds=,
|
||||||
salt=
|
salt=,
|
||||||
|
iftrue=%str(1=1)
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
|
|
||||||
|
%if not(%eval(%unquote(&iftrue))) %then %return;
|
||||||
|
|
||||||
%if %mf_getattrn(&libds,NLOBS)=0 %then %do;
|
%if %mf_getattrn(&libds,NLOBS)=0 %then %do;
|
||||||
%put %str(WARN)ING: Dataset &libds is empty;, or is not a dataset;
|
%put %str(WARN)ING: Dataset &libds is empty, or is not a dataset;
|
||||||
%end;
|
%end;
|
||||||
%else %if %mf_getattrn(&libds,NLOBS)<0 %then %do;
|
%else %if %mf_getattrn(&libds,NLOBS)<0 %then %do;
|
||||||
%put %str(ERR)OR: Dataset &libds is not a dataset;
|
%put %str(ERR)OR: Dataset &libds is not a dataset;
|
||||||
|
|||||||
@@ -40,15 +40,15 @@
|
|||||||
compress=CHAR /* default is none so ensure we have something! */
|
compress=CHAR /* default is none so ensure we have something! */
|
||||||
datastmtchk=ALLKEYWORDS /* protection from overwriting input datasets */
|
datastmtchk=ALLKEYWORDS /* protection from overwriting input datasets */
|
||||||
errorcheck=STRICT /* catch errors in libname/filename statements */
|
errorcheck=STRICT /* catch errors in libname/filename statements */
|
||||||
fmterr /* ensure error when a format cannot be found */
|
fmterr /* ensure err when a format cannot be found */
|
||||||
mergenoby=ERROR /*
|
mergenoby=%str(ERR)OR /* Throw err when a merge has no BY variables */
|
||||||
missing=. /* some sites change this which causes hard to detect errors */
|
missing=. /* some sites change this which causes hard to detect errors */
|
||||||
noquotelenmax /* avoid warnings for long strings */
|
noquotelenmax /* avoid warnings for long strings */
|
||||||
noreplace /* avoid overwriting permanent datasets */
|
noreplace /* avoid overwriting permanent datasets */
|
||||||
ps=max /* reduce log size slightly */
|
ps=max /* reduce log size slightly */
|
||||||
validmemname=COMPATIBLE /* avoid special characters etc in table names */
|
validmemname=COMPATIBLE /* avoid special characters etc in table names */
|
||||||
validvarname=V7 /* avoid special characters etc in variable names */
|
validvarname=V7 /* avoid special characters etc in variable names */
|
||||||
varlenchk=ERROR /* fail hard if truncation (data loss) can result */
|
varlenchk=%str(ERR)OR /* fail hard if truncation (data loss) can result */
|
||||||
;
|
;
|
||||||
|
|
||||||
%mend mp_init;
|
%mend mp_init;
|
||||||
Reference in New Issue
Block a user