mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2026-01-03 21:30:06 +00:00
SAS Packages Framework, version 20221001
**SAS Packages Framework**, version 20221001
Update in setting package version.
- Modified macros: `%loadPackage()` and `%generatePackage()`.
- The `major.minor.patch` approach is also accepted accepted. Now package version can be: `X`, `X.Y`, or `X.Y.Z`. Missing parts are treated as 0, e.g. 1 is equivalent with 1.0.0, 1.2 is 1.2.0, and .2 is 0.2.0.
Modification in path for mirror 0 in the `%installPackage()` macro, it is `https://github.com/SASPAC/` now.
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
default value 1 means "delete tests work" */
|
||||
)/secure minoperator
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to generate SAS packages, version 20220930. Run %generatePackage() for help info.'
|
||||
des = 'Macro to generate SAS packages, version 20221001. Run %generatePackage() for help info.'
|
||||
;
|
||||
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
|
||||
%do;
|
||||
@@ -38,7 +38,7 @@ des = 'Macro to generate SAS packages, version 20220930. Run %generatePackage()
|
||||
%put ### This is short help information for the `generatePackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to generate SAS packages, version `20220930` #;
|
||||
%put # Macro to generate SAS packages, version `20221001` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -336,7 +336,11 @@ data _null_; call symputX("_PackageFileref_", "P" !! put(MD5("%lowcase(&packageN
|
||||
|
||||
/* test if version is a number */
|
||||
data _null_;
|
||||
version = input("&packageVersion.", ?? best32.);
|
||||
v = "&packageVersion.";
|
||||
version = coalesce(input(scan(v,1,".","M"), ?? best32.),0)*1e8
|
||||
+ coalesce(input(scan(v,2,".","M"), ?? best32.),0)*1e4
|
||||
+ coalesce(input(scan(v,3,".","M"), ?? best32.),0)*1e0
|
||||
;
|
||||
if not (version > 0) then
|
||||
do;
|
||||
put 'ERROR: Package version should be a positive NUMBER.';
|
||||
@@ -725,6 +729,15 @@ data _null_;
|
||||
put ' filename &_PackageFileref_. clear; ';
|
||||
|
||||
/* test if required version of package is "good enough" */
|
||||
put ' %local rV pV; ';
|
||||
put ' %let pV = %sysfunc(compress(&packageVersion.,.,kd)); ';
|
||||
put ' %let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 ';
|
||||
put ' + (%scan(&pV.,2,.,M)+0)*1e4 ';
|
||||
put ' + (%scan(&pV.,3,.,M)+0)*1e0); ';
|
||||
put ' %let rV = %sysfunc(compress(&requiredVersion.,.,kd)); ';
|
||||
put ' %let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 ';
|
||||
put ' + (%scan(&rV.,2,.,M)+0)*1e4 ';
|
||||
put ' + (%scan(&rV.,3,.,M)+0)*1e0); ';
|
||||
put ' %if %sysevalf(&requiredVersion. > &packageVersion.) %then ';
|
||||
put ' %do; ';
|
||||
put ' %put ERROR: Required version is &requiredVersion.; ';
|
||||
@@ -1592,7 +1605,7 @@ data _null_;
|
||||
put ' end ; ';
|
||||
%end;
|
||||
|
||||
put 'put "***"; put "* SAS package generated by generatePackage, version 20220930 *"; put "***";';
|
||||
put 'put "***"; put "* SAS package generated by generatePackage, version 20221001 *"; put "***";';
|
||||
|
||||
put 'run; ' /;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user