mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2025-12-11 03:04:35 +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:
@@ -8,7 +8,7 @@ A **SAS package** is an automatically generated, single, stand alone *zip* file
|
||||
|
||||
The *purpose of a package* is to be a simple, and easy to access, code sharing medium, which will allow: on the one hand, to separate the code complex dependencies created by the developer from the user experience with the final product and, on the other hand, reduce developer's and user's unnecessary frustration related to a remote deployment process.
|
||||
|
||||
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. **The latest version** of SPF is **`20220930`**.
|
||||
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. **The latest version** of SPF is **`20221001`**.
|
||||
|
||||
To get started with SAS Packages try this [**`Getting Started with SAS Packages`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/Getting_Started_with_SAS_Packages.pdf "Getting Started with SAS Packages") presentation (see the `./SPF/Documentation` directory).
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
when empty the "packages" value is used */
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to list directories pointed by "packages" fileref, version 20220930. Run %extendPackagesFileref(HELP) for help info.'
|
||||
des = 'Macro to list directories pointed by "packages" fileref, version 20221001. Run %extendPackagesFileref(HELP) for help info.'
|
||||
;
|
||||
|
||||
%if %QUPCASE(&packages.) = HELP %then
|
||||
@@ -22,7 +22,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20220930
|
||||
%put ### This is short help information for the `extendPackagesFileref` macro #;
|
||||
%put #-----------------------------------------------------------------------------------------#;;
|
||||
%put # #;
|
||||
%put # Macro to list directories pointed by 'packages' fileref, version `20220930` #;
|
||||
%put # Macro to list directories pointed by 'packages' fileref, version `20221001` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
|
||||
@@ -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; ' /;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to get help about SAS package, version 20220930. Run %helpPackage() for help info.'
|
||||
des = 'Macro to get help about SAS package, version 20221001. Run %helpPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -39,7 +39,7 @@ des = 'Macro to get help about SAS package, version 20220930. Run %helpPackage()
|
||||
%put ### This is short help information for the `helpPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to get help about SAS packages, version `20220930` #;
|
||||
%put # Macro to get help about 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 #;
|
||||
@@ -169,7 +169,7 @@ TODO:
|
||||
- add MD5(&packageName.) value hash instead "package" word in filenames [DONE]
|
||||
*/
|
||||
|
||||
/* Macros to install SAS packages, version 20220930 */
|
||||
/* Macros to install SAS packages, version 20221001 */
|
||||
/* A SAS package is a zip file containing a group of files
|
||||
with SAS code (macros, functions, data steps generating
|
||||
data, etc.) wrapped up together and %INCLUDEed by
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/secure
|
||||
minoperator
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to install SAS package, version 20220930. Run %%installPackage() for help info.'
|
||||
des = 'Macro to install SAS package, version 20221001. Run %%installPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||
%do;
|
||||
@@ -29,7 +29,7 @@ des = 'Macro to install SAS package, version 20220930. Run %%installPackage() fo
|
||||
%put ### This is short help information for the `installPackage` macro #;
|
||||
%put #--------------------------------------------------------------------------------------------#;;
|
||||
%put # #;
|
||||
%put # Macro to install SAS packages, version `20220930` #;
|
||||
%put # Macro to install 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 #;
|
||||
@@ -57,13 +57,13 @@ des = 'Macro to install SAS package, version 20220930. Run %%installPackage() fo
|
||||
%put # - `sourcePath=` Location of the package, e.g. "www.some.web.page/" #;
|
||||
%put # Mind the "/" at the end of the path! #;
|
||||
%put # Current default location for packages is: #;
|
||||
%put # `https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/packages/` #;
|
||||
%put # `https://github.com/SASPAC/` #;
|
||||
%put # Current default location for the framework is: #;
|
||||
%put # `https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/` #;
|
||||
%put # #;
|
||||
%put # - `mirror=` Indicates which web location for packages installation is used. #;
|
||||
%put # Value `0` indicates: #;
|
||||
%put # `https://raw.githubusercontent.com/SASPAC/` #;
|
||||
%put # `https://github.com/SASPAC/` #;
|
||||
%put # Value `1` indicates: #;
|
||||
%put # `https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main` #;
|
||||
%put # Value `2` indicates: #;
|
||||
@@ -148,7 +148,7 @@ des = 'Macro to install SAS package, version 20220930. Run %%installPackage() fo
|
||||
%if 0 = %superq(mirror) %then
|
||||
%do;
|
||||
%let SPFinitMirror = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.sas;
|
||||
%let sourcePath = https://raw.githubusercontent.com/SASPAC/;
|
||||
%let sourcePath = https://github.com/SASPAC/; /*usercontent*/
|
||||
%goto mirrorEnd;
|
||||
%end;
|
||||
|
||||
@@ -199,10 +199,12 @@ des = 'Macro to install SAS package, version 20220930. Run %%installPackage() fo
|
||||
%do;
|
||||
%if 0 = %superq(mirror) %then
|
||||
%do;
|
||||
%let packageSubDir = %lowcase(&packageName.)/main/;
|
||||
%let packageSubDir = %lowcase(&packageName.)/raw/main/;
|
||||
|
||||
%if %superq(version) ne %then
|
||||
%do;
|
||||
%let packageSubDir = %lowcase(&packageName.)/main/hist/&version./;
|
||||
/*%let packageSubDir = %lowcase(&packageName.)/main/hist/&version./;*/
|
||||
%let packageSubDir = %lowcase(&packageName.)/raw/&version./;
|
||||
%end;
|
||||
%end;
|
||||
filename &in URL "&sourcePath.&packageSubDir.%lowcase(&packageName.).zip"
|
||||
@@ -390,7 +392,7 @@ des = 'Macro to install SAS package, version 20220930. Run %%installPackage() fo
|
||||
|
||||
/* Macro to list SAS packages in packages folder.
|
||||
|
||||
Version 20220930
|
||||
Version 20221001
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*+listPackages+*/
|
||||
|
||||
%macro listPackages()/secure PARMBUFF
|
||||
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20220930.'
|
||||
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20221001.'
|
||||
;
|
||||
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
|
||||
%do;
|
||||
@@ -16,7 +16,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
|
||||
%put ### This is short help information for the `listPackages` macro #;
|
||||
%put #-----------------------------------------------------------------------------------------#;;
|
||||
%put # #;
|
||||
%put # Macro to list available SAS packages, version `20220930` #;
|
||||
%put # Macro to list available 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 #;
|
||||
@@ -166,7 +166,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
||||
|
||||
/* Macro to generate SAS packages.
|
||||
|
||||
Version 20220930
|
||||
Version 20221001
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to load SAS package, version 20220930. Run %loadPackage() for help info.'
|
||||
des = 'Macro to load SAS package, version 20221001. Run %loadPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -42,7 +42,7 @@ des = 'Macro to load SAS package, version 20220930. Run %loadPackage() for help
|
||||
%put ### This is short help information for the `loadPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to *load* SAS packages, version `20220930` #;
|
||||
%put # Macro to *load* 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 #;
|
||||
@@ -155,7 +155,17 @@ des = 'Macro to load SAS package, version 20220930. Run %loadPackage() for help
|
||||
filename &_PackageFileref_. clear;
|
||||
|
||||
/* test if required version of package is "good enough" */
|
||||
%if %sysevalf(&requiredVersion. > &packageVersion.) %then
|
||||
%local rV pV;
|
||||
%let pV = %sysfunc(compress(&packageVersion.,.,kd));
|
||||
%let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8
|
||||
+ (%scan(&pV.,2,.,M)+0)*1e4
|
||||
+ (%scan(&pV.,3,.,M)+0)*1e0);
|
||||
%let rV = %sysfunc(compress(&requiredVersion.,.,kd));
|
||||
%let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8
|
||||
+ (%scan(&rV.,2,.,M)+0)*1e4
|
||||
+ (%scan(&rV.,3,.,M)+0)*1e0);
|
||||
|
||||
%if %sysevalf(&rV. > &pV.) %then
|
||||
%do;
|
||||
%put ERROR: Package &packageName. will not be loaded!;
|
||||
%put ERROR- Required version is &requiredVersion.;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to load multiple SAS packages at one run, version 20220930. Run %loadPackages() for help info.'
|
||||
des = 'Macro to load multiple SAS packages at one run, version 20221001. Run %loadPackages() for help info.'
|
||||
parmbuff
|
||||
;
|
||||
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||
@@ -27,7 +27,7 @@ parmbuff
|
||||
%put ### This is short help information for the `loadPackageS` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro wrapper for the loadPackage macro, version `20220930` #;
|
||||
%put # Macro wrapper for the loadPackage macro, version `20221001` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to preview content of a SAS package, version 20220930. Run %previewPackage() for help info.'
|
||||
des = 'Macro to preview content of a SAS package, version 20221001. Run %previewPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -38,7 +38,7 @@ des = 'Macro to preview content of a SAS package, version 20220930. Run %preview
|
||||
%put ### This is short help information for the `previewPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to get previwe of a SAS packages, version `20220930` #;
|
||||
%put # Macro to get previwe of a 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 #;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to unload SAS package, version 20220930. Run %unloadPackage() for help info.'
|
||||
des = 'Macro to unload SAS package, version 20221001. Run %unloadPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -35,7 +35,7 @@ des = 'Macro to unload SAS package, version 20220930. Run %unloadPackage() for h
|
||||
%put ### This is short help information for the `unloadPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to unload SAS packages, version `20220930` #;
|
||||
%put # Macro to unload 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 #;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
hashing_file() function, SAS 9.4M6 */
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to verify SAS package with the hash digest, version 20220930. Run %verifyPackage() for help info.'
|
||||
des = 'Macro to verify SAS package with the hash digest, version 20221001. Run %verifyPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -28,7 +28,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20220930. Run %
|
||||
%put ### This is short help information for the `verifyPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to verify SAS package with it hash digest, version `20220930` #;
|
||||
%put # Macro to verify SAS package with it hash digest, version `20221001` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
|
||||
@@ -21,7 +21,7 @@ A **SAS package** is an automatically generated, single, stand alone *zip* file
|
||||
|
||||
The *purpose of a package* is to be a simple, and easy to access, code sharing medium, which will allow: on the one hand, to separate the code complex dependencies created by the developer from the user experience with the final product and, on the other hand, reduce developer's and user's unnecessary frustration related to a remote deployment process.
|
||||
|
||||
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20220930`**.
|
||||
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20221001`**.
|
||||
|
||||
**To get started with SAS Packages** try this [**`Getting Started with SAS Packages`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/Getting_Started_with_SAS_Packages.pdf "Getting Started with SAS Packages") presentation (see the `./SPF/Documentation` directory).
|
||||
|
||||
@@ -39,7 +39,7 @@ After assigning the directory do not change them when using the SPF since it may
|
||||
## This is short help information for the `installPackage` macro <a name="installpackage"></a>
|
||||
--------------------------------------------------------------------------------------------
|
||||
|
||||
Macro to install SAS packages, version `20220930`
|
||||
Macro to install SAS packages, version `20221001`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -65,14 +65,14 @@ After assigning the directory do not change them when using the SPF since it may
|
||||
then the framework itself is downloaded.
|
||||
|
||||
- `sourcePath=` Location of the package, e.g. "www.some.web.page/" (mind the "/" at the end of the path!)
|
||||
Current default location for packages is:
|
||||
`https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/packages/`
|
||||
Current default location for the framework is:
|
||||
`https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/`
|
||||
Current default location for packages is:
|
||||
`https://github.com/SASPAC/`
|
||||
Current default location for the framework is:
|
||||
`https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/`
|
||||
|
||||
- `mirror=` Indicates which web location for packages installation is used.
|
||||
Value `0` indicates:
|
||||
`https://raw.githubusercontent.com/SASPAC/`
|
||||
`https://github.com/SASPAC/`
|
||||
Value `1` indicates:
|
||||
`https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main`
|
||||
Value `2` indicates:
|
||||
@@ -121,7 +121,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `helpPackage` macro <a name="helppackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to get help about SAS packages, version `20220930`
|
||||
Macro to get help about SAS packages, version `20221001`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -191,7 +191,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `loadPackage` macro <a name="loadpackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to *load* SAS packages, version `20220930`
|
||||
Macro to *load* SAS packages, version `20221001`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -264,7 +264,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `loadPackageS` macro <a name="loadpackages"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro wrapper for the loadPackage macro, version `20220930`
|
||||
Macro wrapper for the loadPackage macro, version `20221001`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -313,7 +313,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `unloadPackage` macro <a name="unloadpackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to unload SAS packages, version `20220930`
|
||||
Macro to unload SAS packages, version `20221001`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -378,7 +378,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `listPackages` macro <a name="listpackages"></a>
|
||||
-----------------------------------------------------------------------------------------
|
||||
|
||||
Macro to list available SAS packages, version `20220930`
|
||||
Macro to list available SAS packages, version `20221001`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -419,7 +419,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `verifyPackage` macro <a name="verifypackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to verify SAS package with it hash digest, version `20220930`
|
||||
Macro to verify SAS package with it hash digest, version `20221001`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -473,7 +473,7 @@ filename packages "C:/SAS_PACKAGES"; %* set-up a directory for packages;
|
||||
## This is short help information for the `previewPackage` macro <a name="previewpackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to get previwe of a SAS packages, version `20220930`
|
||||
Macro to get previwe of a SAS packages, version `20221001`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -540,7 +540,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `generatePackage` macro <a name="generatepackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to generate SAS packages, version `20220930`
|
||||
Macro to generate SAS packages, version `20221001`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -721,7 +721,7 @@ All files have to have `.sas` extension. Other files are ignored.
|
||||
## This is short help information for the `extendPackagesFileref` macro <a name="extendpackagesfileref"></a>
|
||||
-----------------------------------------------------------------------------------------
|
||||
|
||||
Macro to list directories pointed by 'packages' fileref, version `20220930`
|
||||
Macro to list directories pointed by 'packages' fileref, version `20221001`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
- to unload, or
|
||||
- to generate SAS packages.
|
||||
|
||||
Version 20220930.
|
||||
Version 20221001.
|
||||
See examples below.
|
||||
|
||||
A SAS package is a zip file containing a group of files
|
||||
@@ -82,7 +82,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to load SAS package, version 20220930. Run %loadPackage() for help info.'
|
||||
des = 'Macro to load SAS package, version 20221001. Run %loadPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -97,7 +97,7 @@ des = 'Macro to load SAS package, version 20220930. Run %loadPackage() for help
|
||||
%put ### This is short help information for the `loadPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to *load* SAS packages, version `20220930` #;
|
||||
%put # Macro to *load* 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 #;
|
||||
@@ -210,7 +210,17 @@ des = 'Macro to load SAS package, version 20220930. Run %loadPackage() for help
|
||||
filename &_PackageFileref_. clear;
|
||||
|
||||
/* test if required version of package is "good enough" */
|
||||
%if %sysevalf(&requiredVersion. > &packageVersion.) %then
|
||||
%local rV pV;
|
||||
%let pV = %sysfunc(compress(&packageVersion.,.,kd));
|
||||
%let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8
|
||||
+ (%scan(&pV.,2,.,M)+0)*1e4
|
||||
+ (%scan(&pV.,3,.,M)+0)*1e0);
|
||||
%let rV = %sysfunc(compress(&requiredVersion.,.,kd));
|
||||
%let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8
|
||||
+ (%scan(&rV.,2,.,M)+0)*1e4
|
||||
+ (%scan(&rV.,3,.,M)+0)*1e0);
|
||||
|
||||
%if %sysevalf(&rV. > &pV.) %then
|
||||
%do;
|
||||
%put ERROR: Package &packageName. will not be loaded!;
|
||||
%put ERROR- Required version is &requiredVersion.;
|
||||
@@ -273,7 +283,7 @@ des = 'Macro to load SAS package, version 20220930. Run %loadPackage() for help
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to unload SAS package, version 20220930. Run %unloadPackage() for help info.'
|
||||
des = 'Macro to unload SAS package, version 20221001. Run %unloadPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -288,7 +298,7 @@ des = 'Macro to unload SAS package, version 20220930. Run %unloadPackage() for h
|
||||
%put ### This is short help information for the `unloadPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to unload SAS packages, version `20220930` #;
|
||||
%put # Macro to unload 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 #;
|
||||
@@ -433,7 +443,7 @@ des = 'Macro to unload SAS package, version 20220930. Run %unloadPackage() for h
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to get help about SAS package, version 20220930. Run %helpPackage() for help info.'
|
||||
des = 'Macro to get help about SAS package, version 20221001. Run %helpPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -448,7 +458,7 @@ des = 'Macro to get help about SAS package, version 20220930. Run %helpPackage()
|
||||
%put ### This is short help information for the `helpPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to get help about SAS packages, version `20220930` #;
|
||||
%put # Macro to get help about 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 #;
|
||||
@@ -578,7 +588,7 @@ TODO:
|
||||
- add MD5(&packageName.) value hash instead "package" word in filenames [DONE]
|
||||
*/
|
||||
|
||||
/* Macros to install SAS packages, version 20220930 */
|
||||
/* Macros to install SAS packages, version 20221001 */
|
||||
/* A SAS package is a zip file containing a group of files
|
||||
with SAS code (macros, functions, data steps generating
|
||||
data, etc.) wrapped up together and %INCLUDEed by
|
||||
@@ -601,7 +611,7 @@ TODO:
|
||||
/secure
|
||||
minoperator
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to install SAS package, version 20220930. Run %%installPackage() for help info.'
|
||||
des = 'Macro to install SAS package, version 20221001. Run %%installPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||
%do;
|
||||
@@ -616,7 +626,7 @@ des = 'Macro to install SAS package, version 20220930. Run %%installPackage() fo
|
||||
%put ### This is short help information for the `installPackage` macro #;
|
||||
%put #--------------------------------------------------------------------------------------------#;;
|
||||
%put # #;
|
||||
%put # Macro to install SAS packages, version `20220930` #;
|
||||
%put # Macro to install 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 #;
|
||||
@@ -644,13 +654,13 @@ des = 'Macro to install SAS package, version 20220930. Run %%installPackage() fo
|
||||
%put # - `sourcePath=` Location of the package, e.g. "www.some.web.page/" #;
|
||||
%put # Mind the "/" at the end of the path! #;
|
||||
%put # Current default location for packages is: #;
|
||||
%put # `https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/packages/` #;
|
||||
%put # `https://github.com/SASPAC/` #;
|
||||
%put # Current default location for the framework is: #;
|
||||
%put # `https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/` #;
|
||||
%put # #;
|
||||
%put # - `mirror=` Indicates which web location for packages installation is used. #;
|
||||
%put # Value `0` indicates: #;
|
||||
%put # `https://raw.githubusercontent.com/SASPAC/` #;
|
||||
%put # `https://github.com/SASPAC/` #;
|
||||
%put # Value `1` indicates: #;
|
||||
%put # `https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main` #;
|
||||
%put # Value `2` indicates: #;
|
||||
@@ -735,7 +745,7 @@ des = 'Macro to install SAS package, version 20220930. Run %%installPackage() fo
|
||||
%if 0 = %superq(mirror) %then
|
||||
%do;
|
||||
%let SPFinitMirror = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.sas;
|
||||
%let sourcePath = https://raw.githubusercontent.com/SASPAC/;
|
||||
%let sourcePath = https://github.com/SASPAC/; /*usercontent*/
|
||||
%goto mirrorEnd;
|
||||
%end;
|
||||
|
||||
@@ -786,10 +796,12 @@ des = 'Macro to install SAS package, version 20220930. Run %%installPackage() fo
|
||||
%do;
|
||||
%if 0 = %superq(mirror) %then
|
||||
%do;
|
||||
%let packageSubDir = %lowcase(&packageName.)/main/;
|
||||
%let packageSubDir = %lowcase(&packageName.)/raw/main/;
|
||||
|
||||
%if %superq(version) ne %then
|
||||
%do;
|
||||
%let packageSubDir = %lowcase(&packageName.)/main/hist/&version./;
|
||||
/*%let packageSubDir = %lowcase(&packageName.)/main/hist/&version./;*/
|
||||
%let packageSubDir = %lowcase(&packageName.)/raw/&version./;
|
||||
%end;
|
||||
%end;
|
||||
filename &in URL "&sourcePath.&packageSubDir.%lowcase(&packageName.).zip"
|
||||
@@ -977,7 +989,7 @@ des = 'Macro to install SAS package, version 20220930. Run %%installPackage() fo
|
||||
|
||||
/* Macro to list SAS packages in packages folder.
|
||||
|
||||
Version 20220930
|
||||
Version 20221001
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -998,7 +1010,7 @@ des = 'Macro to install SAS package, version 20220930. Run %%installPackage() fo
|
||||
/*+listPackages+*/
|
||||
|
||||
%macro listPackages()/secure PARMBUFF
|
||||
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20220930.'
|
||||
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20221001.'
|
||||
;
|
||||
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
|
||||
%do;
|
||||
@@ -1013,7 +1025,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
|
||||
%put ### This is short help information for the `listPackages` macro #;
|
||||
%put #-----------------------------------------------------------------------------------------#;;
|
||||
%put # #;
|
||||
%put # Macro to list available SAS packages, version `20220930` #;
|
||||
%put # Macro to list available 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 #;
|
||||
@@ -1163,7 +1175,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
||||
|
||||
/* Macro to generate SAS packages.
|
||||
|
||||
Version 20220930
|
||||
Version 20221001
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -1200,7 +1212,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
||||
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;
|
||||
@@ -1215,7 +1227,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 #;
|
||||
@@ -1513,7 +1525,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.';
|
||||
@@ -1902,6 +1918,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.; ';
|
||||
@@ -2769,7 +2794,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; ' /;
|
||||
|
||||
@@ -3627,7 +3652,7 @@ TODO: (in Polish)
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to load multiple SAS packages at one run, version 20220930. Run %loadPackages() for help info.'
|
||||
des = 'Macro to load multiple SAS packages at one run, version 20221001. Run %loadPackages() for help info.'
|
||||
parmbuff
|
||||
;
|
||||
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||
@@ -3643,7 +3668,7 @@ parmbuff
|
||||
%put ### This is short help information for the `loadPackageS` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro wrapper for the loadPackage macro, version `20220930` #;
|
||||
%put # Macro wrapper for the loadPackage macro, version `20221001` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -3730,7 +3755,7 @@ parmbuff
|
||||
hashing_file() function, SAS 9.4M6 */
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to verify SAS package with the hash digest, version 20220930. Run %verifyPackage() for help info.'
|
||||
des = 'Macro to verify SAS package with the hash digest, version 20221001. Run %verifyPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -3745,7 +3770,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20220930. Run %
|
||||
%put ### This is short help information for the `verifyPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to verify SAS package with it hash digest, version `20220930` #;
|
||||
%put # Macro to verify SAS package with it hash digest, version `20221001` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -3916,7 +3941,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20220930. Run %
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to preview content of a SAS package, version 20220930. Run %previewPackage() for help info.'
|
||||
des = 'Macro to preview content of a SAS package, version 20221001. Run %previewPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -3931,7 +3956,7 @@ des = 'Macro to preview content of a SAS package, version 20220930. Run %preview
|
||||
%put ### This is short help information for the `previewPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to get previwe of a SAS packages, version `20220930` #;
|
||||
%put # Macro to get previwe of a 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 #;
|
||||
@@ -4058,7 +4083,7 @@ des = 'Macro to preview content of a SAS package, version 20220930. Run %preview
|
||||
when empty the "packages" value is used */
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to list directories pointed by "packages" fileref, version 20220930. Run %extendPackagesFileref(HELP) for help info.'
|
||||
des = 'Macro to list directories pointed by "packages" fileref, version 20221001. Run %extendPackagesFileref(HELP) for help info.'
|
||||
;
|
||||
|
||||
%if %QUPCASE(&packages.) = HELP %then
|
||||
@@ -4074,7 +4099,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20220930
|
||||
%put ### This is short help information for the `extendPackagesFileref` macro #;
|
||||
%put #-----------------------------------------------------------------------------------------#;;
|
||||
%put # #;
|
||||
%put # Macro to list directories pointed by 'packages' fileref, version `20220930` #;
|
||||
%put # Macro to list directories pointed by 'packages' fileref, version `20221001` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
|
||||
Reference in New Issue
Block a user