mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2026-01-09 07:50:06 +00:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e97c8e31ad | ||
|
|
16d55d7dcb | ||
|
|
c54ef20fac | ||
|
|
be2af5883a | ||
|
|
b867ed4309 | ||
|
|
6a53bbe50a | ||
|
|
3e44e6b8ae | ||
|
|
f3f7a3896a | ||
|
|
7491d42378 | ||
|
|
16a20907af | ||
|
|
f3107f0db3 | ||
|
|
0ca3eac3c9 | ||
|
|
4eac2a0fea | ||
|
|
ad81e0cb0e | ||
|
|
f542d70332 | ||
|
|
80fdc9f214 | ||
|
|
f23afe7486 | ||
|
|
e467959d77 | ||
|
|
035e184b74 | ||
|
|
61d5806e79 | ||
|
|
98871647dd | ||
|
|
16b744a763 | ||
|
|
4765dc5c43 | ||
|
|
e1c95da0b7 | ||
|
|
319dd8c46b | ||
|
|
96555584a3 |
34
README.md
34
README.md
@@ -6,7 +6,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.
|
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 `20200811`.
|
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20200911`**.
|
||||||
|
|
||||||
To get started with SAS Packages try this [**`Getting Started with SAS Packages`**](https://github.com/yabwon/SAS_PACKAGES/blob/master/SPF/Documentation/Getting_Started_with_SAS_Packages.pdf "Getting Started with SAS Packages") presentation (see the `./SPF/Documentation` directory).
|
To get started with SAS Packages try this [**`Getting Started with SAS Packages`**](https://github.com/yabwon/SAS_PACKAGES/blob/master/SPF/Documentation/Getting_Started_with_SAS_Packages.pdf "Getting Started with SAS Packages") presentation (see the `./SPF/Documentation` directory).
|
||||||
|
|
||||||
@@ -71,24 +71,37 @@ data class;
|
|||||||
set %SQL(select * from sashelp.class order by age);
|
set %SQL(select * from sashelp.class order by age);
|
||||||
run;
|
run;
|
||||||
```
|
```
|
||||||
|
SHA256 digest for SQLinDS: 3EBC11A0890B6128DDB51643DC91F9DA1BDBF283535664540887FA7E7EA9744F
|
||||||
|
|
||||||
|
|
||||||
- **DFA** (Dynamic Function Arrays)\[0.2\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples.
|
- **DFA** (Dynamic Function Arrays)\[0.2\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples.
|
||||||
- **macroArray**\[0.3\], implementation of an array concept in a macrolanguage, e.g.
|
|
||||||
|
SHA256 digest for DFA: BB8768E977D62429368CFF2E5338A6553C35C998AEC09AF24088BA713BB54DDA
|
||||||
|
|
||||||
|
|
||||||
|
- **macroArray**\[0.4\], implementation of an array concept in a macrolanguage, e.g.
|
||||||
```
|
```
|
||||||
%array(ABC[17] (111:127), macarray=Y);
|
%array(ABC[17] (111:127), macarray=Y);
|
||||||
|
|
||||||
|
%macro test();
|
||||||
%do i = 1 %to 17;
|
%do i = 1 %to 17;
|
||||||
%put &i.) %ABC(&i.);
|
%put &i.) %ABC(&i.);
|
||||||
%end;
|
%end;
|
||||||
|
%mend;
|
||||||
|
%test()
|
||||||
|
|
||||||
%let %ABC(13,i) = 999; /* i = insert */
|
%let %ABC(13,i) = 99999; /* i = insert */
|
||||||
|
|
||||||
%do i = 1 %to 17;
|
%do_over(ABC, phrase=%nrstr(
|
||||||
%put &i.) %ABC(&i.);
|
%put &_i_.%) %ABC(&_i_.);
|
||||||
%end;
|
),
|
||||||
|
which = 1:H:2
|
||||||
|
);
|
||||||
```
|
```
|
||||||
|
SHA256 digest for macroArray: 5C9208ADD091E354794C24FA830F527D17CFC758C24CB77BF2154949059F7E6F
|
||||||
|
|
||||||
- **BasePlus**\[0.52\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
|
||||||
|
- **BasePlus**\[0.62\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
||||||
```
|
```
|
||||||
call arrMissToRight(myArray);
|
call arrMissToRight(myArray);
|
||||||
call arrFillMiss(17, myArray);
|
call arrFillMiss(17, myArray);
|
||||||
@@ -100,9 +113,14 @@ string = catXFn("date9.", "#", myArray);
|
|||||||
|
|
||||||
format x bool.;
|
format x bool.;
|
||||||
|
|
||||||
%put %getVars(sashelp.class, patern = ght$, sep = +, varRange = _numeric_);
|
%put %getVars(sashelp.class, pattern = ght$, sep = +, varRange = _numeric_);
|
||||||
```
|
```
|
||||||
|
SHA256 digest for BasePlus: 278621A6D8BBBB791DEA4C215D4261F2CB8F8B76B1397F7FA9B2E4219E77CB5A
|
||||||
|
|
||||||
|
|
||||||
- **dynMacroArray**\[0.2\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA)
|
- **dynMacroArray**\[0.2\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA)
|
||||||
|
|
||||||
|
SHA256 digest for dynMacroArray: 066186B94B2976167C797C6A6E6217E361E8DEB10F2AB81906E0A325E5243084
|
||||||
|
|
||||||
|
|
||||||
### ======
|
### ======
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
502
SPF/SPFinit.sas
502
SPF/SPFinit.sas
@@ -42,7 +42,7 @@
|
|||||||
- to unload, or
|
- to unload, or
|
||||||
- to generate SAS packages.
|
- to generate SAS packages.
|
||||||
|
|
||||||
Version 20200811.
|
Version 20200911.
|
||||||
See examples below.
|
See examples below.
|
||||||
|
|
||||||
A SAS package is a zip file containing a group of files
|
A SAS package is a zip file containing a group of files
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
*/
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to load SAS package, version 20200811. Run %loadPackage() for help info.'
|
des = 'Macro to load SAS package, version 20200911. Run %loadPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -96,7 +96,7 @@ des = 'Macro to load SAS package, version 20200811. Run %loadPackage() for help
|
|||||||
%put # This is short help information for the loadPackage macro #;
|
%put # This is short help information for the loadPackage macro #;
|
||||||
%put ###############################################################################;
|
%put ###############################################################################;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to load SAS packages, version 20200811 #;
|
%put # Macro to load SAS packages, version 20200911 #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # A SAS package is a zip file containing a group #;
|
%put # A SAS package is a zip file containing a group #;
|
||||||
%put # of SAS codes (macros, functions, data steps generating #;
|
%put # of SAS codes (macros, functions, data steps generating #;
|
||||||
@@ -165,7 +165,7 @@ des = 'Macro to load SAS package, version 20200811. Run %loadPackage() for help
|
|||||||
%put ###############################################################################;
|
%put ###############################################################################;
|
||||||
%put ;
|
%put ;
|
||||||
options &options_tmp.;
|
options &options_tmp.;
|
||||||
%RETURN;
|
%GOTO ENDofloadPackage;
|
||||||
%end;
|
%end;
|
||||||
%local ls_tmp ps_tmp notes_tmp source_tmp fullstimer_tmp stimer_tmp msglevel_tmp;
|
%local ls_tmp ps_tmp notes_tmp source_tmp fullstimer_tmp stimer_tmp msglevel_tmp;
|
||||||
%let ls_tmp = %sysfunc(getoption(ls));
|
%let ls_tmp = %sysfunc(getoption(ls));
|
||||||
@@ -191,9 +191,12 @@ des = 'Macro to load SAS package, version 20200811. Run %loadPackage() for help
|
|||||||
/* test if required version of package is "good enough" */
|
/* test if required version of package is "good enough" */
|
||||||
%if %sysevalf(&requiredVersion. > &packageVersion.) %then
|
%if %sysevalf(&requiredVersion. > &packageVersion.) %then
|
||||||
%do;
|
%do;
|
||||||
%put ERROR: Required version is &requiredVersion.;
|
%put ERROR: Package &packageName. will not be loaded!;
|
||||||
|
%put ERROR- Required version is &requiredVersion.;
|
||||||
%put ERROR- Provided version is &packageVersion.;
|
%put ERROR- Provided version is &packageVersion.;
|
||||||
%ABORT;
|
%put ERROR- Verify installed version of the package.;
|
||||||
|
%put ERROR- ;
|
||||||
|
%GOTO WrongVersionOFPackage; /*%RETURN;*/
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
||||||
@@ -213,12 +216,15 @@ des = 'Macro to load SAS package, version 20200811. Run %loadPackage() for help
|
|||||||
%end;
|
%end;
|
||||||
|
|
||||||
%end;
|
%end;
|
||||||
%else %put ERROR:[&sysmacroname] File "&path./&packageName..&zip." does not exist;
|
%else %put ERROR:[&sysmacroname] File "&path./&packageName..&zip." does not exist!;
|
||||||
filename &_PackageFileref_. clear;
|
filename &_PackageFileref_. clear;
|
||||||
|
|
||||||
|
%WrongVersionOFPackage:
|
||||||
options ls = &ls_tmp. ps = &ps_tmp.
|
options ls = &ls_tmp. ps = &ps_tmp.
|
||||||
¬es_tmp. &source_tmp.
|
¬es_tmp. &source_tmp.
|
||||||
&stimer_tmp. &fullstimer_tmp.
|
&stimer_tmp. &fullstimer_tmp.
|
||||||
msglevel=&msglevel_tmp.;
|
msglevel=&msglevel_tmp.;
|
||||||
|
%ENDofloadPackage:
|
||||||
%mend loadPackage;
|
%mend loadPackage;
|
||||||
|
|
||||||
/*** HELP START ***/
|
/*** HELP START ***/
|
||||||
@@ -242,7 +248,7 @@ des = 'Macro to load SAS package, version 20200811. Run %loadPackage() for help
|
|||||||
*/
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to unload SAS package, version 20200811. Run %unloadPackage() for help info.'
|
des = 'Macro to unload SAS package, version 20200911. Run %unloadPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -257,7 +263,7 @@ des = 'Macro to unload SAS package, version 20200811. Run %unloadPackage() for h
|
|||||||
%put # This is short help information for the unloadPackage macro #;
|
%put # This is short help information for the unloadPackage macro #;
|
||||||
%put ###############################################################################;
|
%put ###############################################################################;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to unload SAS packages, version 20200811 #;
|
%put # Macro to unload SAS packages, version 20200911 #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # A SAS package is a zip file containing a group #;
|
%put # A SAS package is a zip file containing a group #;
|
||||||
%put # of SAS codes (macros, functions, data steps generating #;
|
%put # of SAS codes (macros, functions, data steps generating #;
|
||||||
@@ -317,7 +323,7 @@ des = 'Macro to unload SAS package, version 20200811. Run %unloadPackage() for h
|
|||||||
%put ###############################################################################;
|
%put ###############################################################################;
|
||||||
%put ;
|
%put ;
|
||||||
options &options_tmp.;
|
options &options_tmp.;
|
||||||
%RETURN;
|
%GOTO ENDofunloadPackage;
|
||||||
%end;
|
%end;
|
||||||
%local ls_tmp ps_tmp notes_tmp source_tmp msglevel_tmp;
|
%local ls_tmp ps_tmp notes_tmp source_tmp msglevel_tmp;
|
||||||
%let ls_tmp = %sysfunc(getoption(ls));
|
%let ls_tmp = %sysfunc(getoption(ls));
|
||||||
@@ -346,9 +352,10 @@ des = 'Macro to unload SAS package, version 20200811. Run %unloadPackage() for h
|
|||||||
;
|
;
|
||||||
%include &_PackageFileref_.(unload.sas) / &source2.;
|
%include &_PackageFileref_.(unload.sas) / &source2.;
|
||||||
%end;
|
%end;
|
||||||
%else %put ERROR:[&sysmacroname] File "&path./&packageName..&zip." does not exist;
|
%else %put ERROR:[&sysmacroname] File "&path./&packageName..&zip." does not exist!;
|
||||||
filename &_PackageFileref_. clear;
|
filename &_PackageFileref_. clear;
|
||||||
options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp. msglevel = &msglevel_tmp.;
|
options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp. msglevel = &msglevel_tmp.;
|
||||||
|
%ENDofunloadPackage:
|
||||||
%mend unloadPackage;
|
%mend unloadPackage;
|
||||||
|
|
||||||
/*** HELP START ***/
|
/*** HELP START ***/
|
||||||
@@ -376,7 +383,7 @@ des = 'Macro to unload SAS package, version 20200811. Run %unloadPackage() for h
|
|||||||
*/
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to get help about SAS package, version 20200811. Run %helpPackage() for help info.'
|
des = 'Macro to get help about SAS package, version 20200911. Run %helpPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -391,7 +398,7 @@ des = 'Macro to get help about SAS package, version 20200811. Run %helpPackage()
|
|||||||
%put # This is short help information for the helpPackage macro #;
|
%put # This is short help information for the helpPackage macro #;
|
||||||
%put ###############################################################################;
|
%put ###############################################################################;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to get help about SAS packages, version 20200811 #;
|
%put # Macro to get help about SAS packages, version 20200911 #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # A SAS package is a zip file containing a group #;
|
%put # A SAS package is a zip file containing a group #;
|
||||||
%put # of SAS codes (macros, functions, data steps generating #;
|
%put # of SAS codes (macros, functions, data steps generating #;
|
||||||
@@ -456,7 +463,7 @@ des = 'Macro to get help about SAS package, version 20200811. Run %helpPackage()
|
|||||||
%put ###############################################################################;
|
%put ###############################################################################;
|
||||||
%put ;
|
%put ;
|
||||||
options &options_tmp.;
|
options &options_tmp.;
|
||||||
%RETURN;
|
%GOTO ENDofhelpPackage;
|
||||||
%end;
|
%end;
|
||||||
%local ls_tmp ps_tmp notes_tmp source_tmp msglevel_tmp;
|
%local ls_tmp ps_tmp notes_tmp source_tmp msglevel_tmp;
|
||||||
%let ls_tmp = %sysfunc(getoption(ls));
|
%let ls_tmp = %sysfunc(getoption(ls));
|
||||||
@@ -485,9 +492,10 @@ des = 'Macro to get help about SAS package, version 20200811. Run %helpPackage()
|
|||||||
;
|
;
|
||||||
%include &_PackageFileref_.(help.sas) / &source2.;
|
%include &_PackageFileref_.(help.sas) / &source2.;
|
||||||
%end;
|
%end;
|
||||||
%else %put ERROR:[&sysmacroname] File "&path./&packageName..&zip." does not exist;
|
%else %put ERROR:[&sysmacroname] File "&path./&packageName..&zip." does not exist!;
|
||||||
filename &_PackageFileref_. clear;
|
filename &_PackageFileref_. clear;
|
||||||
options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp. msglevel = &msglevel_tmp.;
|
options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp. msglevel = &msglevel_tmp.;
|
||||||
|
%ENDofhelpPackage:
|
||||||
%mend helpPackage;
|
%mend helpPackage;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -496,7 +504,7 @@ TODO:
|
|||||||
- add MD5(&packageName.) value hash instead "package" word in filenames [DONE]
|
- add MD5(&packageName.) value hash instead "package" word in filenames [DONE]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Macros to install SAS packages, version 20200811 */
|
/* Macros to install SAS packages, version 20200911 */
|
||||||
/* A SAS package is a zip file containing a group of files
|
/* A SAS package is a zip file containing a group of files
|
||||||
with SAS code (macros, functions, data steps generating
|
with SAS code (macros, functions, data steps generating
|
||||||
data, etc.) wrapped up together and %INCLUDEed by
|
data, etc.) wrapped up together and %INCLUDEed by
|
||||||
@@ -505,15 +513,15 @@ TODO:
|
|||||||
|
|
||||||
/*** HELP START ***/
|
/*** HELP START ***/
|
||||||
%macro installPackage(
|
%macro installPackage(
|
||||||
packageName /* package name, without the zip extension */
|
packagesNames /* space separated list of packages names, without the zip extension */
|
||||||
, sourcePath = /* location of the package, e.g. "www.some.page/", mind the "/" at the end */
|
, sourcePath = /* location of the package, e.g. "www.some.page/", mind the "/" at the end */
|
||||||
, replace = 1 /* 1 = replace if the package already exist, 0 = otherwise */
|
, replace = 1 /* 1 = replace if the package already exist, 0 = otherwise */
|
||||||
)
|
)
|
||||||
/secure
|
/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to install SAS package, version 20200811. Run %%installPackage() for help info.'
|
des = 'Macro to install SAS package, version 20200911. Run %%installPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
%local options_tmp ;
|
%local options_tmp ;
|
||||||
%let options_tmp = ls=%sysfunc(getoption(ls))ps=%sysfunc(getoption(ps))
|
%let options_tmp = ls=%sysfunc(getoption(ls))ps=%sysfunc(getoption(ps))
|
||||||
@@ -522,11 +530,11 @@ des = 'Macro to install SAS package, version 20200811. Run %%installPackage() fo
|
|||||||
;
|
;
|
||||||
options NOnotes NOsource ls=MAX ps=MAX msglevel=N;
|
options NOnotes NOsource ls=MAX ps=MAX msglevel=N;
|
||||||
%put ;
|
%put ;
|
||||||
%put ########################################################################################;
|
%put #########################################################################################;
|
||||||
%put # This is short help information for the installPackage macro #;
|
%put # This is short help information for the installPackage macro #;
|
||||||
%put ########################################################################################;
|
%put #########################################################################################;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to install SAS packages, version 20200811 #;
|
%put # Macro to install SAS packages, version 20200911 #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # A SAS package is a zip file containing a group #;
|
%put # A SAS package is a zip file containing a group #;
|
||||||
%put # of SAS codes (macros, functions, data steps generating #;
|
%put # of SAS codes (macros, functions, data steps generating #;
|
||||||
@@ -539,9 +547,10 @@ des = 'Macro to install SAS package, version 20200811. Run %%installPackage() fo
|
|||||||
%put # #;
|
%put # #;
|
||||||
%put # Parameters: #;
|
%put # Parameters: #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # packageName Name of a package, e.g. myPackage, #;
|
%put # packagesNames Space separated list of packages names _without_ #;
|
||||||
|
%put # the zip extension, e.g. myPackage1 myPackage2, #;
|
||||||
%put # Required and not null, default use case: #;
|
%put # Required and not null, default use case: #;
|
||||||
%put # %nrstr(%%installPackage(myPackage)). #;
|
%put # %nrstr(%%installPackage(myPackage1 myPackage2)). #;
|
||||||
%put # If empty displays this help information. #;
|
%put # If empty displays this help information. #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # sourcePath= Location of the package, e.g. "www.some.web.page/" #;
|
%put # sourcePath= Location of the package, e.g. "www.some.web.page/" #;
|
||||||
@@ -552,12 +561,12 @@ des = 'Macro to install SAS package, version 20200811. Run %%installPackage() fo
|
|||||||
%put # replace= With default value of 1 it causes existing package file #;
|
%put # replace= With default value of 1 it causes existing package file #;
|
||||||
%put # to be replaceed by new downloaded file. #;
|
%put # to be replaceed by new downloaded file. #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put ########################################################################################;
|
%put #########################################################################################;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Visit: https://github.com/yabwon/SAS_PACKAGES/tree/master/SPF/Documentation #;
|
%put # Visit: https://github.com/yabwon/SAS_PACKAGES/tree/master/SPF/Documentation #;
|
||||||
%put # to learn more. #;
|
%put # to learn more. #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Example ##############################################################################;
|
%put # Example ###############################################################################;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Enabling the SAS Package Framework #;
|
%put # Enabling the SAS Package Framework #;
|
||||||
%put # from the local directory and installing & loading #;
|
%put # from the local directory and installing & loading #;
|
||||||
@@ -576,10 +585,10 @@ des = 'Macro to install SAS package, version 20200811. Run %%installPackage() fo
|
|||||||
%put %nrstr( %%loadPackage(SQLinDS) %%* load the package content into the SAS session; );
|
%put %nrstr( %%loadPackage(SQLinDS) %%* load the package content into the SAS session; );
|
||||||
%put %nrstr( %%unloadPackage(SQLinDS) %%* unload the package content from the SAS session; );
|
%put %nrstr( %%unloadPackage(SQLinDS) %%* unload the package content from the SAS session; );
|
||||||
%put ;
|
%put ;
|
||||||
%put ########################################################################################;
|
%put #########################################################################################;
|
||||||
%put ;
|
%put ;
|
||||||
options &options_tmp.;
|
options &options_tmp.;
|
||||||
%RETURN;
|
%GOTO ENDofinstallPackage;
|
||||||
%end;
|
%end;
|
||||||
%local ls_tmp ps_tmp notes_tmp source_tmp fullstimer_tmp stimer_tmp msglevel_tmp;
|
%local ls_tmp ps_tmp notes_tmp source_tmp fullstimer_tmp stimer_tmp msglevel_tmp;
|
||||||
%let ls_tmp = %sysfunc(getoption(ls));
|
%let ls_tmp = %sysfunc(getoption(ls));
|
||||||
@@ -591,12 +600,6 @@ des = 'Macro to install SAS package, version 20200811. Run %%installPackage() fo
|
|||||||
%let msglevel_tmp = %sysfunc(getoption(msglevel));
|
%let msglevel_tmp = %sysfunc(getoption(msglevel));
|
||||||
options NOnotes NOsource ls=MAX ps=MAX NOfullstimer NOstimer msglevel=N;
|
options NOnotes NOsource ls=MAX ps=MAX NOfullstimer NOstimer msglevel=N;
|
||||||
|
|
||||||
%local in out;
|
|
||||||
%let in = i%sysfunc(md5(&packageName.),hex7.);
|
|
||||||
%let out = o%sysfunc(md5(&packageName.),hex7.);
|
|
||||||
|
|
||||||
/*options MSGLEVEL=i;*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Reference:
|
Reference:
|
||||||
https://blogs.sas.com/content/sasdummy/2011/06/17/how-to-use-sas-data-step-to-copy-a-file-from-anywhere/
|
https://blogs.sas.com/content/sasdummy/2011/06/17/how-to-use-sas-data-step-to-copy-a-file-from-anywhere/
|
||||||
@@ -606,6 +609,21 @@ des = 'Macro to install SAS package, version 20200811. Run %%installPackage() fo
|
|||||||
%do;
|
%do;
|
||||||
%let sourcePath = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/master/packages/;
|
%let sourcePath = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/master/packages/;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
|
%local i;
|
||||||
|
%do i = 1 %to %sysfunc(countw(&packagesNames., , S));
|
||||||
|
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||||
|
%local packageName;
|
||||||
|
%let packageName = %scan(&packagesNames., &i., , S);
|
||||||
|
|
||||||
|
%put ;
|
||||||
|
%put *** %lowcase(&packageName.) start *****************************************;
|
||||||
|
%local in out;
|
||||||
|
%let in = i%sysfunc(md5(&packageName.),hex7.);
|
||||||
|
%let out = o%sysfunc(md5(&packageName.),hex7.);
|
||||||
|
|
||||||
|
/*options MSGLEVEL=i;*/
|
||||||
|
|
||||||
filename &in URL "&sourcePath.%lowcase(&packageName.).zip" recfm=N lrecl=1;
|
filename &in URL "&sourcePath.%lowcase(&packageName.).zip" recfm=N lrecl=1;
|
||||||
filename &out "%sysfunc(pathname(packages))/%lowcase(&packageName.).zip" recfm=N lrecl=1;
|
filename &out "%sysfunc(pathname(packages))/%lowcase(&packageName.).zip" recfm=N lrecl=1;
|
||||||
/*
|
/*
|
||||||
@@ -639,8 +657,6 @@ des = 'Macro to install SAS package, version 20200811. Run %%installPackage() fo
|
|||||||
rc = FCLOSE(filein);
|
rc = FCLOSE(filein);
|
||||||
put;
|
put;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if FEXIST("&out") = 0 then
|
if FEXIST("&out") = 0 then
|
||||||
do;
|
do;
|
||||||
put @2 "Installing the &packageName. package.";
|
put @2 "Installing the &packageName. package.";
|
||||||
@@ -664,15 +680,19 @@ des = 'Macro to install SAS package, version 20200811. Run %%installPackage() fo
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
put @2 "Done with return code " rc=;
|
put @2 "Done with return code " rc= "(zero = success)";
|
||||||
run;
|
run;
|
||||||
|
|
||||||
filename &in clear;
|
filename &in clear;
|
||||||
filename &out clear;
|
filename &out clear;
|
||||||
|
%put *** %lowcase(&packageName.) end *******************************************;
|
||||||
|
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||||
|
%end;
|
||||||
options ls = &ls_tmp. ps = &ps_tmp.
|
options ls = &ls_tmp. ps = &ps_tmp.
|
||||||
¬es_tmp. &source_tmp.
|
¬es_tmp. &source_tmp.
|
||||||
&stimer_tmp. &fullstimer_tmp.
|
&stimer_tmp. &fullstimer_tmp.
|
||||||
msglevel=&msglevel_tmp.;
|
msglevel=&msglevel_tmp.;
|
||||||
|
%ENDofinstallPackage:
|
||||||
%mend installPackage;
|
%mend installPackage;
|
||||||
|
|
||||||
/*** HELP START ***/
|
/*** HELP START ***/
|
||||||
@@ -790,7 +810,7 @@ des = 'Macro to install SAS package, version 20200811. Run %%installPackage() fo
|
|||||||
|
|
||||||
/* Macro to list SAS packages in packages folder.
|
/* Macro to list SAS packages in packages folder.
|
||||||
|
|
||||||
Version 20200811
|
Version 20200911
|
||||||
|
|
||||||
A SAS package is a zip file containing a group
|
A SAS package is a zip file containing a group
|
||||||
of SAS codes (macros, functions, data steps generating
|
of SAS codes (macros, functions, data steps generating
|
||||||
@@ -810,7 +830,7 @@ des = 'Macro to install SAS package, version 20200811. Run %%installPackage() fo
|
|||||||
|
|
||||||
|
|
||||||
%macro listPackages()/PARMBUFF
|
%macro listPackages()/PARMBUFF
|
||||||
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20200811.'
|
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20200911.'
|
||||||
;
|
;
|
||||||
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
|
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -825,7 +845,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
|
|||||||
%put # This is short help information for the listPackages macro #;
|
%put # This is short help information for the listPackages macro #;
|
||||||
%put ########################################################################################;
|
%put ########################################################################################;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to list available SAS packages, version 20200811 #;
|
%put # Macro to list available SAS packages, version 20200911 #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # A SAS package is a zip file containing a group #;
|
%put # A SAS package is a zip file containing a group #;
|
||||||
%put # of SAS codes (macros, functions, data steps generating #;
|
%put # of SAS codes (macros, functions, data steps generating #;
|
||||||
@@ -863,7 +883,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
|
|||||||
%put ########################################################################################;
|
%put ########################################################################################;
|
||||||
%put ;
|
%put ;
|
||||||
options &options_tmp.;
|
options &options_tmp.;
|
||||||
%RETURN;
|
%GOTO ENDoflistPackages;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%local ls_tmp ps_tmp notes_tmp source_tmp filesWithCodes;
|
%local ls_tmp ps_tmp notes_tmp source_tmp filesWithCodes;
|
||||||
@@ -884,14 +904,14 @@ data _null_;
|
|||||||
stop;
|
stop;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
length folder file $ 256 folderRef fileRef $ 8;
|
length folder $ 64 file $ 1024 folderRef fileRef $ 8;
|
||||||
|
|
||||||
folderRef = "_%sysfunc(datetime(), hex6.)0";
|
folderRef = "_%sysfunc(datetime(), hex6.)0";
|
||||||
|
|
||||||
rc=filename(folderRef, base);
|
rc=filename(folderRef, base);
|
||||||
folderid=dopen(folderRef);
|
folderid=dopen(folderRef);
|
||||||
|
|
||||||
put;
|
putlog " ";
|
||||||
put "/*" 100*"+" ;
|
put "/*" 100*"+" ;
|
||||||
do i=1 to dnum(folderId); drop i;
|
do i=1 to dnum(folderId); drop i;
|
||||||
folder = dread(folderId, i);
|
folder = dread(folderId, i);
|
||||||
@@ -904,13 +924,24 @@ data _null_;
|
|||||||
if fileId = 0 and lowcase(scan(folder, -1, ".")) = 'zip' then
|
if fileId = 0 and lowcase(scan(folder, -1, ".")) = 'zip' then
|
||||||
do;
|
do;
|
||||||
file = catx('/',base, folder);
|
file = catx('/',base, folder);
|
||||||
|
|
||||||
|
rc1 = filename("package", strip(file), 'zip', 'member="description.sas"');
|
||||||
|
rcE = fexist("package");
|
||||||
|
rc2 = filename("package", " ");
|
||||||
|
|
||||||
|
if rcE then /* if the description.sas exists in the zip then read it */
|
||||||
|
do;
|
||||||
|
putlog " * ";
|
||||||
length nn $ 96;
|
length nn $ 96;
|
||||||
|
if (96-lengthn(file)) < 1 then
|
||||||
|
put " * " file;
|
||||||
|
else
|
||||||
|
do;
|
||||||
nn = repeat("*", (96-lengthn(file)));
|
nn = repeat("*", (96-lengthn(file)));
|
||||||
|
put " * " file nn;
|
||||||
|
end;
|
||||||
|
|
||||||
putlog " ";
|
infile _DUMMY_ ZIP FILEVAR=file member="description.sas" end=EOF;
|
||||||
put " * " file @; put nn /;
|
|
||||||
|
|
||||||
infile package ZIP FILEVAR=file member="description.sas" end=EOF;
|
|
||||||
|
|
||||||
do until(EOF);
|
do until(EOF);
|
||||||
input;
|
input;
|
||||||
@@ -922,12 +953,13 @@ data _null_;
|
|||||||
if upcase(strip(_INFILE_)) =: "DESCRIPTION START:" then leave;
|
if upcase(strip(_INFILE_)) =: "DESCRIPTION START:" then leave;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
rc = dclose(fileId);
|
rc = dclose(fileId);
|
||||||
rc = filename(fileRef);
|
rc = filename(fileRef);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
putlog " ";
|
putlog " * ";
|
||||||
put 100*"+" "*/";
|
put 100*"+" "*/";
|
||||||
rc = dclose(folderid);
|
rc = dclose(folderid);
|
||||||
rc = filename(folderRef);
|
rc = filename(folderRef);
|
||||||
@@ -935,6 +967,7 @@ data _null_;
|
|||||||
run;
|
run;
|
||||||
|
|
||||||
options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
||||||
|
%ENDoflistPackages:
|
||||||
%mend listPackages;
|
%mend listPackages;
|
||||||
|
|
||||||
|
|
||||||
@@ -942,7 +975,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
|||||||
|
|
||||||
/* Macro to generate SAS packages.
|
/* Macro to generate SAS packages.
|
||||||
|
|
||||||
Version 20200811
|
Version 20200911
|
||||||
|
|
||||||
A SAS package is a zip file containing a group
|
A SAS package is a zip file containing a group
|
||||||
of SAS codes (macros, functions, data steps generating
|
of SAS codes (macros, functions, data steps generating
|
||||||
@@ -965,7 +998,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
|||||||
dependencies in loading */
|
dependencies in loading */
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to generate SAS packages, version 20200811. Run %generatePackage() for help info.'
|
des = 'Macro to generate SAS packages, version 20200911. Run %generatePackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
|
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -980,7 +1013,7 @@ des = 'Macro to generate SAS packages, version 20200811. Run %generatePackage()
|
|||||||
%put # This is short help information for the generatePackage macro #;
|
%put # This is short help information for the generatePackage macro #;
|
||||||
%put ###############################################################################;
|
%put ###############################################################################;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to generate SAS packages, version 20200811 #;
|
%put # Macro to generate SAS packages, version 20200911 #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # A SAS package is a zip file containing a group #;
|
%put # A SAS package is a zip file containing a group #;
|
||||||
%put # of SAS codes (macros, functions, data steps generating #;
|
%put # of SAS codes (macros, functions, data steps generating #;
|
||||||
@@ -1012,7 +1045,7 @@ des = 'Macro to generate SAS packages, version 20200811. Run %generatePackage()
|
|||||||
%put ###############################################################################;
|
%put ###############################################################################;
|
||||||
%put ;
|
%put ;
|
||||||
options &options_tmp.;
|
options &options_tmp.;
|
||||||
%RETURN;
|
%GOTO ENDofgeneratePackage;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%local zipReferrence filesWithCodes _DESCR_ _LIC_ _RC_ _PackageFileref_;
|
%local zipReferrence filesWithCodes _DESCR_ _LIC_ _RC_ _PackageFileref_;
|
||||||
@@ -1695,7 +1728,7 @@ data _null_;
|
|||||||
*/
|
*/
|
||||||
/* test for supported types */
|
/* test for supported types */
|
||||||
if not (upcase(type) in:
|
if not (upcase(type) in:
|
||||||
('LIBNAME' 'MACRO' 'DATA' 'FUNCTION' /*'FUNCTIONS'*/ 'FORMAT' 'IMLMODULE' 'EXEC' 'CLEAN' 'LAZYDATA' 'TEST'))
|
('LIBNAME' 'MACRO' 'DATA' 'FUNCTION' /*'FUNCTIONS'*/ 'FORMAT' 'IMLMODULE' 'PROTO' 'EXEC' 'CLEAN' 'LAZYDATA' 'TEST'))
|
||||||
then
|
then
|
||||||
do;
|
do;
|
||||||
putlog 'WARNING: Type ' type 'is not yet supported.';
|
putlog 'WARNING: Type ' type 'is not yet supported.';
|
||||||
@@ -1718,11 +1751,15 @@ data _null_;
|
|||||||
put '%put NOTE- ;';
|
put '%put NOTE- ;';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
/* HEADERS for IML and FCMP */
|
/* HEADERS for IML, FCMP, and PROTO */
|
||||||
if 1 = FIRST.type and upcase(type)='FUNCTIONS' then /* header, for multiple functions in one FCMP run */
|
if 1 = FIRST.type and upcase(type)='FUNCTIONS' then /* header, for multiple functions in one FCMP run */
|
||||||
do;
|
do;
|
||||||
put "proc fcmp outlib = work.%lowcase(&packageName.fcmp).package; ";
|
put "proc fcmp outlib = work.%lowcase(&packageName.fcmp).package; ";
|
||||||
end;
|
end;
|
||||||
|
if 1 = FIRST.type and upcase(type)='PROTO' then /* header, for multiple functions in one FCMP run */
|
||||||
|
do;
|
||||||
|
put "proc proto package = work.%lowcase(&packageName.proto).package; ";
|
||||||
|
end;
|
||||||
if 1 = FIRST.type and upcase(type)='IMLMODULE' then /* header, for IML modules */
|
if 1 = FIRST.type and upcase(type)='IMLMODULE' then /* header, for IML modules */
|
||||||
do;
|
do;
|
||||||
put "proc iml; ";
|
put "proc iml; ";
|
||||||
@@ -1731,7 +1768,7 @@ data _null_;
|
|||||||
/* include the file with the code of the element */
|
/* include the file with the code of the element */
|
||||||
put '%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;' /;
|
put '%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;' /;
|
||||||
|
|
||||||
/* FOOTERS for IML and FCMP */
|
/* FOOTERS for IML, FCMP, and PROTO */
|
||||||
if 1 = LAST.type and upcase(type)='FUNCTIONS' then /* footer, for multiple functions in one FCMP run */
|
if 1 = LAST.type and upcase(type)='FUNCTIONS' then /* footer, for multiple functions in one FCMP run */
|
||||||
do;
|
do;
|
||||||
put "run; ";
|
put "run; ";
|
||||||
@@ -1742,11 +1779,17 @@ data _null_;
|
|||||||
put "store module = _ALL_; "; /* and store all created modules */
|
put "store module = _ALL_; "; /* and store all created modules */
|
||||||
put "quit; ";
|
put "quit; ";
|
||||||
end;
|
end;
|
||||||
|
if 1 = LAST.type and upcase(type)='PROTO' then /* footer, for multiple functions in one PROTO run */
|
||||||
|
do;
|
||||||
|
put "run; ";
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
isFunction + (upcase(type)=:'FUNCTION');
|
isFunction + (upcase(type)=:'FUNCTION');
|
||||||
isFormat + (upcase(type)=:'FORMAT');
|
isFormat + (upcase(type)=:'FORMAT');
|
||||||
|
isProto + (upcase(type)=:'PROTO');
|
||||||
|
|
||||||
/* add the link to the functions' dataset, only for the first occurrence */
|
/* add the link to the functions dataset, only for the first occurrence */
|
||||||
if 1 = isFunction and (upcase(type)=:'FUNCTION') then
|
if 1 = isFunction and (upcase(type)=:'FUNCTION') then
|
||||||
do;
|
do;
|
||||||
put "options APPEND=(cmplib = work.%lowcase(&packageName.fcmp));";
|
put "options APPEND=(cmplib = work.%lowcase(&packageName.fcmp));";
|
||||||
@@ -1754,7 +1797,15 @@ data _null_;
|
|||||||
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
|
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
/* add the link to the formats' catalog, only for the first occurrence */
|
/* add the link to the proto functions dataset, only for the first occurrence */
|
||||||
|
if 1 = isProto and (upcase(type)=:'PROTO') then
|
||||||
|
do;
|
||||||
|
put "options APPEND=(cmplib = work.%lowcase(&packageName.proto));";
|
||||||
|
put '%put NOTE- ;';
|
||||||
|
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
|
||||||
|
end;
|
||||||
|
|
||||||
|
/* add the link to the formats catalog, only for the first occurrence */
|
||||||
if 1 = isFormat and (upcase(type)=:'FORMAT') then
|
if 1 = isFormat and (upcase(type)=:'FORMAT') then
|
||||||
do;
|
do;
|
||||||
put "options INSERT=( fmtsearch = work.%lowcase(&packageName.format) );";
|
put "options INSERT=( fmtsearch = work.%lowcase(&packageName.format) );";
|
||||||
@@ -1955,6 +2006,31 @@ data _null_;
|
|||||||
put '%put NOTE:[FMTSEARCH] %sysfunc(getoption(fmtsearch));' /;
|
put '%put NOTE:[FMTSEARCH] %sysfunc(getoption(fmtsearch));' /;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
/* delete proto functions */
|
||||||
|
isProto = 0;
|
||||||
|
EOF = 0;
|
||||||
|
do until(EOF);
|
||||||
|
set &filesWithCodes. end = EOF;
|
||||||
|
if not (upcase(type)=:'PROTO') then continue;
|
||||||
|
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
||||||
|
put '%put NOTE- ;' /;
|
||||||
|
isProto + 1;
|
||||||
|
end;
|
||||||
|
/* delete the link to the proto functions dataset */
|
||||||
|
if isProto then
|
||||||
|
do;
|
||||||
|
put "proc delete data = work.%lowcase(&packageName.proto);";
|
||||||
|
put "run;" /;
|
||||||
|
put 'options cmplib = (%unquote(%sysfunc(tranwrd(' /
|
||||||
|
'%lowcase(%sysfunc(getoption(cmplib)))' /
|
||||||
|
',%str(' "work.%lowcase(&packageName.proto)" '), %str() ))));';
|
||||||
|
put 'options cmplib = (%unquote(%sysfunc(compress(' /
|
||||||
|
'%sysfunc(getoption(cmplib))' /
|
||||||
|
',%str(()) ))));';
|
||||||
|
put '%put; %put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
/* delete functions */
|
/* delete functions */
|
||||||
put "proc fcmp outlib = work.%lowcase(&packageName.fcmp).package;";
|
put "proc fcmp outlib = work.%lowcase(&packageName.fcmp).package;";
|
||||||
isFunction = 0;
|
isFunction = 0;
|
||||||
@@ -2139,7 +2215,7 @@ data _null_;
|
|||||||
put ' end ; ';
|
put ' end ; ';
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
put 'put "***"; put "* SAS package generated by generatePackage, version 20200811 *"; put "***";';
|
put 'put "***"; put "* SAS package generated by generatePackage, version 20200911 *"; put "***";';
|
||||||
|
|
||||||
put 'run; ' /;
|
put 'run; ' /;
|
||||||
|
|
||||||
@@ -2177,9 +2253,11 @@ data _null_;
|
|||||||
|
|
||||||
select;
|
select;
|
||||||
when (upcase(type) in ("DATA" "LAZYDATA")) fileshort2 = fileshort;
|
when (upcase(type) in ("DATA" "LAZYDATA")) fileshort2 = fileshort;
|
||||||
when (upcase(type) = "MACRO") fileshort2 = cats('%',fileshort,'()');
|
when (upcase(type) = "MACRO") fileshort2 = cats('''%',fileshort,'()''');
|
||||||
when (upcase(type) =:"FUNCTION") fileshort2 = cats(fileshort,'()');
|
when (upcase(type) =:"FUNCTION") fileshort2 = cats("'",fileshort,"()'");
|
||||||
when (upcase(type) = "FORMAT") fileshort2 = cats('$',fileshort);
|
when (upcase(type) =:"IMLMODULE") fileshort2 = cats("'",fileshort,"()'");
|
||||||
|
when (upcase(type) =:"PROTO") fileshort2 = cats("'",fileshort,"()'");
|
||||||
|
when (upcase(type) = "FORMAT") fileshort2 = cats("'$",fileshort,".'");
|
||||||
otherwise fileshort2 = fileshort;
|
otherwise fileshort2 = fileshort;
|
||||||
end;
|
end;
|
||||||
strX = catx('/', folder, order, type, file, fileshort, fileshort2);
|
strX = catx('/', folder, order, type, file, fileshort, fileshort2);
|
||||||
@@ -2262,7 +2340,7 @@ data _null_;
|
|||||||
call execute(' if upcase(strip(_infile_)) = "/*** HELP END ***/" then test + (-1); ');
|
call execute(' if upcase(strip(_infile_)) = "/*** HELP END ***/" then test + (-1); ');
|
||||||
call execute(' if (test not in (.,0,1)) or (EOF and test) then ');
|
call execute(' if (test not in (.,0,1)) or (EOF and test) then ');
|
||||||
call execute(' do; ');
|
call execute(' do; ');
|
||||||
call execute(' put "ERR" "OR: unmatching or nested HELP tags!" _N_=; ');
|
call execute(' put "ERR" "OR: unmatched or nested HELP tags!" _N_=; ');
|
||||||
call execute(' abort; ');
|
call execute(' abort; ');
|
||||||
call execute(' end; ');
|
call execute(' end; ');
|
||||||
call execute(' if (EOF and test=.) then put "WARN" "ING: no HELP tags in the file." ; ');
|
call execute(' if (EOF and test=.) then put "WARN" "ING: no HELP tags in the file." ; ');
|
||||||
@@ -2280,6 +2358,28 @@ filename &_DESCR_. clear;
|
|||||||
filename &_LIC_. clear;
|
filename &_LIC_. clear;
|
||||||
filename &zipReferrence. clear;
|
filename &zipReferrence. clear;
|
||||||
|
|
||||||
|
/* create hash SHA256 id */
|
||||||
|
filename &zipReferrence. "&filesLocation./%lowcase(&packageName.).zip";
|
||||||
|
filename &zipReferrence. list;
|
||||||
|
data _null_;
|
||||||
|
set sashelp.vfunc(keep=fncname);
|
||||||
|
where fncname = "HASHING_FILE";
|
||||||
|
call execute('
|
||||||
|
data the_SHA256_hash_id;
|
||||||
|
SHA256 = HASHING_FILE("SHA256", "&zipReferrence.", 4);
|
||||||
|
lable SHA256 = "The SHA256 hash digest for package &packageName.";
|
||||||
|
put SHA256=;
|
||||||
|
run;
|
||||||
|
proc print data = the_SHA256_hash_id noobs label;
|
||||||
|
run;
|
||||||
|
');
|
||||||
|
stop;
|
||||||
|
run;
|
||||||
|
filename &zipReferrence. clear;
|
||||||
|
/*+++++++++++++++++++++++*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* tests of package are executed by default */
|
/* tests of package are executed by default */
|
||||||
%if %bquote(&testPackage.) ne Y %then
|
%if %bquote(&testPackage.) ne Y %then
|
||||||
%do;
|
%do;
|
||||||
@@ -2362,6 +2462,16 @@ data _null_;
|
|||||||
put " path=&filesLocation.) " /;
|
put " path=&filesLocation.) " /;
|
||||||
run;
|
run;
|
||||||
|
|
||||||
|
/*
|
||||||
|
setup for testing session:
|
||||||
|
-sysin - file with the test code
|
||||||
|
-print - location of the *.lst output file
|
||||||
|
-log - location of the log file
|
||||||
|
-config - location of the default config file, i.e. "&SASROOT./sasv9.cfg"
|
||||||
|
-work - location for work
|
||||||
|
-noterminal - for batch execution mode
|
||||||
|
-rsasuser - to avoid the "Unable to copy SASUSER registry to WORK registry." warning
|
||||||
|
*/
|
||||||
systask kill sas0 wait;
|
systask kill sas0 wait;
|
||||||
%local sasstat0 TEST_0 TESTRC_0;;
|
%local sasstat0 TEST_0 TESTRC_0;;
|
||||||
%let TEST_0 = loading;
|
%let TEST_0 = loading;
|
||||||
@@ -2372,7 +2482,8 @@ systask command
|
|||||||
-log ""&dirForTest./&TEST_0..log""
|
-log ""&dirForTest./&TEST_0..log""
|
||||||
-config ""&SASROOT./sasv9.cfg""
|
-config ""&SASROOT./sasv9.cfg""
|
||||||
-work ""&dirForTest./work""
|
-work ""&dirForTest./work""
|
||||||
-noterminal"
|
-noterminal
|
||||||
|
-rsasuser"
|
||||||
taskname=sas0
|
taskname=sas0
|
||||||
status=sasstat0
|
status=sasstat0
|
||||||
WAIT
|
WAIT
|
||||||
@@ -2382,7 +2493,6 @@ WAIT
|
|||||||
data _null_;
|
data _null_;
|
||||||
infile "./loading.log" dlm='0a0d'x end=EOF;
|
infile "./loading.log" dlm='0a0d'x end=EOF;
|
||||||
input;
|
input;
|
||||||
if _N_ > 10; /* due to "Unable to copy SASUSER registry to WORK registry." */
|
|
||||||
if _INFILE_ =: 'WARNING:' then
|
if _INFILE_ =: 'WARNING:' then
|
||||||
do;
|
do;
|
||||||
warning+1;
|
warning+1;
|
||||||
@@ -2454,7 +2564,8 @@ systask command
|
|||||||
-config ""&SASROOT./sasv9.cfg""
|
-config ""&SASROOT./sasv9.cfg""
|
||||||
-work ""&dirForTest./work""
|
-work ""&dirForTest./work""
|
||||||
-autoexec ""&dirForTest./autoexec.sas""
|
-autoexec ""&dirForTest./autoexec.sas""
|
||||||
-noterminal"
|
-noterminal
|
||||||
|
-rsasuser"
|
||||||
taskname=sas&t.
|
taskname=sas&t.
|
||||||
status=sasstat&t.
|
status=sasstat&t.
|
||||||
WAIT
|
WAIT
|
||||||
@@ -2464,7 +2575,6 @@ WAIT
|
|||||||
data _null_;
|
data _null_;
|
||||||
infile "./&&TEST_&t...log" dlm='0a0d'x end=EOF;
|
infile "./&&TEST_&t...log" dlm='0a0d'x end=EOF;
|
||||||
input;
|
input;
|
||||||
if _N_ > 10; /* due to "Unable to copy SASUSER registry to WORK registry." */
|
|
||||||
if _INFILE_ =: 'WARNING:' then
|
if _INFILE_ =: 'WARNING:' then
|
||||||
do;
|
do;
|
||||||
warning+1;
|
warning+1;
|
||||||
@@ -2520,6 +2630,7 @@ proc sql;
|
|||||||
drop table &filesWithCodes.;
|
drop table &filesWithCodes.;
|
||||||
quit;
|
quit;
|
||||||
|
|
||||||
|
%ENDofgeneratePackage:
|
||||||
%mend generatePackage;
|
%mend generatePackage;
|
||||||
|
|
||||||
|
|
||||||
@@ -2540,6 +2651,8 @@ TODO: (in Polish)
|
|||||||
|
|
||||||
- dodac typ "iml" [v] (as imlmodule)
|
- dodac typ "iml" [v] (as imlmodule)
|
||||||
|
|
||||||
|
- dodac typ "proto" [v]
|
||||||
|
|
||||||
- lista wymaganych komponentow potrzebnych do działania SASa (na bazie proc SETINIT) [v]
|
- lista wymaganych komponentow potrzebnych do działania SASa (na bazie proc SETINIT) [v]
|
||||||
|
|
||||||
- sparwdzanie domknietosci, parzystosci i wystepowania tagow HELP START - HELP END w plikach [v]
|
- sparwdzanie domknietosci, parzystosci i wystepowania tagow HELP START - HELP END w plikach [v]
|
||||||
@@ -2548,13 +2661,13 @@ TODO: (in Polish)
|
|||||||
|
|
||||||
- infolista o required packahes w unloadPackage [v]
|
- infolista o required packahes w unloadPackage [v]
|
||||||
|
|
||||||
- weryfikacja nadpisywania makr [ ]
|
|
||||||
|
|
||||||
- dodac ICEloadPackage() [v]
|
- dodac ICEloadPackage() [v]
|
||||||
|
|
||||||
|
- weryfikacja nadpisywania makr [ ]
|
||||||
|
|
||||||
- weryfikacja srodowiska [ ]
|
- weryfikacja srodowiska [ ]
|
||||||
|
|
||||||
- dodac typ "ds2", "proto" [ ]
|
- dodac typ "ds2" [ ]
|
||||||
|
|
||||||
- dodac mozliwosc szyfrowania pliku z pakietem (haslo do zip, sprawdzic istnienie funkcjonalnosci) [ ]
|
- dodac mozliwosc szyfrowania pliku z pakietem (haslo do zip, sprawdzic istnienie funkcjonalnosci) [ ]
|
||||||
|
|
||||||
@@ -2583,3 +2696,254 @@ TODO: (in Polish)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
|
|
||||||
|
/*** HELP START ***/
|
||||||
|
|
||||||
|
%macro loadPackageS(
|
||||||
|
packagesNames /* A comma separated list of packages name,
|
||||||
|
e.g. myPackage, myPackage1, myPackage2, myPackage3
|
||||||
|
required and not null.
|
||||||
|
Package version, in brackets behind a package name,
|
||||||
|
can be provided, e.g.
|
||||||
|
%loadPackageS(myPackage1(1.7), myPackage2(4.2))
|
||||||
|
*/
|
||||||
|
)/secure
|
||||||
|
/*** HELP END ***/
|
||||||
|
des = 'Macro to load multiple SAS packages at one run, version 20200911. Run %loadPackages() for help info.'
|
||||||
|
parmbuff
|
||||||
|
;
|
||||||
|
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||||
|
%do;
|
||||||
|
%local options_tmp ;
|
||||||
|
%let options_tmp = ls=%sysfunc(getoption(ls))ps=%sysfunc(getoption(ps))
|
||||||
|
%sysfunc(getoption(notes)) %sysfunc(getoption(source))
|
||||||
|
msglevel=%sysfunc(getoption(msglevel))
|
||||||
|
;
|
||||||
|
options NOnotes NOsource ls=MAX ps=MAX msglevel=N;
|
||||||
|
%put ;
|
||||||
|
%put ###############################################################################;
|
||||||
|
%put # This is short help information for the loadPackageS macro #;
|
||||||
|
%put ###############################################################################;
|
||||||
|
%put # #;
|
||||||
|
%put # Macro wrapper for the loadPackage macro, version 20200911 #;
|
||||||
|
%put # #;
|
||||||
|
%put # A SAS package is a zip file containing a group #;
|
||||||
|
%put # of SAS codes (macros, functions, data steps generating #;
|
||||||
|
%put # data, etc.) wrapped up together and included by #;
|
||||||
|
%put # a single load.sas file (also embedded inside the zip). #;
|
||||||
|
%put # #;
|
||||||
|
%put # The %nrstr(%%loadPackageS()) allows to load multiple packages at one time, #;
|
||||||
|
%put # ONLY from the ZIP with DEFAULT OPTIONS, into the SAS session. #;
|
||||||
|
%put # #;
|
||||||
|
%put # Parameters: #;
|
||||||
|
%put # #;
|
||||||
|
%put # packagesNames A comma separated list of packages names, #;
|
||||||
|
%put # e.g. myPackage, myPackage1, myPackage2, myPackage3 #;
|
||||||
|
%put # Required and not null, default use case: #;
|
||||||
|
%put # %nrstr(%%loadPackageS(myPackage1, myPackage2, myPackage3)). #;
|
||||||
|
%put # Package version, in brackets behind a package name, can #;
|
||||||
|
%put # be provided, example is the following: #;
|
||||||
|
%put # %nrstr(%%loadPackageS(myPackage1(1.7), myPackage2(4.2))). #;
|
||||||
|
%put # If empty displays this help information. #;
|
||||||
|
%put # #;
|
||||||
|
%put # #;
|
||||||
|
%put ###############################################################################;
|
||||||
|
%put # #;
|
||||||
|
%put # Visit: https://github.com/yabwon/SAS_PACKAGES/tree/master/SPF/Documentation #;
|
||||||
|
%put # to learn more. #;
|
||||||
|
%put # #;
|
||||||
|
%put # Example #####################################################################;
|
||||||
|
%put # #;
|
||||||
|
%put # Enabling the SAS Package Framework #;
|
||||||
|
%put # from the local directory and installing & loading #;
|
||||||
|
%put # the SQLinDS package from the Internet. #;
|
||||||
|
%put # #;
|
||||||
|
%put # Assume that the SPFinit.sas file #;
|
||||||
|
%put # is located in the "C:/SAS_PACKAGES/" folder. #;
|
||||||
|
%put # #;
|
||||||
|
%put # Run the following code in your SAS session: #;
|
||||||
|
%put ;
|
||||||
|
%put %nrstr( filename packages "C:/SAS_PACKAGES"; %%* setup a directory for packages; );
|
||||||
|
%put %nrstr( %%include packages(SPFinit.sas); %%* enable the framework; );
|
||||||
|
%put ;
|
||||||
|
%put %nrstr( %%installPackage(SQLinDS DFA) %%* install packages from the Internet; );
|
||||||
|
%put %nrstr( %%loadPackageS(SQLinDS, DFA) %%* load packags content into the SAS session; );
|
||||||
|
%put ;
|
||||||
|
%put ###############################################################################;
|
||||||
|
%put ;
|
||||||
|
options &options_tmp.;
|
||||||
|
%GOTO ENDofloadPackageS;
|
||||||
|
%end;
|
||||||
|
%local lengthOfsyspbuff numberOfPackagesNames i packageElement packageName packageVersion;
|
||||||
|
|
||||||
|
%let lengthOfsyspbuff = %qsysfunc(length(&syspbuff.));
|
||||||
|
%let packagesNames = %qsysfunc(compress(%qsubstr(&syspbuff., 2, %eval(&lengthOfsyspbuff.-2)), %str((._,)), KDA));
|
||||||
|
%let numberOfPackagesNames = %qsysfunc(countw(&packagesNames., %str(,)));
|
||||||
|
|
||||||
|
%put NOTE: List op packages to be loaded contains &numberOfPackagesNames. element(s).;
|
||||||
|
%put NOTE- The list is: &packagesNames..;
|
||||||
|
%put NOTE- ;
|
||||||
|
|
||||||
|
%do i = 1 %to &numberOfPackagesNames.;
|
||||||
|
%let packageElement = %qscan(&packagesNames., &i., %str(,) );
|
||||||
|
%let packageName = %qscan(&packageElement., 1, %str(()));
|
||||||
|
%let packageVersion = %qscan(&packageElement., 2, %str(()));
|
||||||
|
%if %superq(packageVersion) = %then %let packageVersion = .;
|
||||||
|
|
||||||
|
%loadPackage(%unquote(&packageName.), requiredVersion=%unquote(&packageVersion.))
|
||||||
|
%end;
|
||||||
|
%ENDofloadPackageS:
|
||||||
|
%mend loadPackageS;
|
||||||
|
|
||||||
|
|
||||||
|
/*** HELP START ***/
|
||||||
|
|
||||||
|
%macro verifyPackage(
|
||||||
|
packageName /* name of a package,
|
||||||
|
e.g. myPackage,
|
||||||
|
required and not null */
|
||||||
|
, path = %sysfunc(pathname(packages)) /* location of a package,
|
||||||
|
by default it looks for
|
||||||
|
location of "packages" fileref */
|
||||||
|
, hash = /* The SHA256 hash digest for
|
||||||
|
the package generated by
|
||||||
|
hashing_file() function, SAS 9.4M6 */
|
||||||
|
)/secure
|
||||||
|
/*** HELP END ***/
|
||||||
|
des = 'Macro to verify SAS package with the hash digest, version 20200911. Run %verifyPackage() for help info.'
|
||||||
|
;
|
||||||
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
|
%do;
|
||||||
|
%local options_tmp ;
|
||||||
|
%let options_tmp = ls=%sysfunc(getoption(ls))ps=%sysfunc(getoption(ps))
|
||||||
|
%sysfunc(getoption(notes)) %sysfunc(getoption(source))
|
||||||
|
msglevel=%sysfunc(getoption(msglevel))
|
||||||
|
;
|
||||||
|
options NOnotes NOsource ls=MAX ps=MAX msglevel=N;
|
||||||
|
%put ;
|
||||||
|
%put ###############################################################################;
|
||||||
|
%put # This is short help information for the verifyPackage macro #;
|
||||||
|
%put ###############################################################################;
|
||||||
|
%put # #;
|
||||||
|
%put # Macro to verify SAS package with it hash digest, version 20200911 #;
|
||||||
|
%put # #;
|
||||||
|
%put # A SAS package is a zip file containing a group #;
|
||||||
|
%put # of SAS codes (macros, functions, data steps generating #;
|
||||||
|
%put # data, etc.) wrapped up together and included by #;
|
||||||
|
%put # a single load.sas file (also embedded inside the zip). #;
|
||||||
|
%put # #;
|
||||||
|
%put # The %nrstr(%%verifyPackage()) macro generate package SHA256 hash #;
|
||||||
|
%put # and compares it with the one provided by the user. #;
|
||||||
|
%put # #;
|
||||||
|
%put # #;
|
||||||
|
%put # Minimum SAS version required for the process is 9.4M6. #;
|
||||||
|
%put # #;
|
||||||
|
%put # Parameters: #;
|
||||||
|
%put # #;
|
||||||
|
%put # packageName Name of a package, e.g. myPackage, #;
|
||||||
|
%put # Required and not null, default use case: #;
|
||||||
|
%put # %nrstr(%%loadPackage(myPackage)). #;
|
||||||
|
%put # If empty displays this help information. #;
|
||||||
|
%put # #;
|
||||||
|
%put # path= Location of a package. By default it looks for #;
|
||||||
|
%put # location of the "packages" fileref, i.e. #;
|
||||||
|
%put # %nrstr(%%sysfunc(pathname(packages))) #;
|
||||||
|
%put # #;
|
||||||
|
%put # hash= A value of the package SHA256 hash. #;
|
||||||
|
%put # Provided by the user. #;
|
||||||
|
%put # #;
|
||||||
|
%put ###############################################################################;
|
||||||
|
%put # #;
|
||||||
|
%put # Visit: https://github.com/yabwon/SAS_PACKAGES/tree/master/SPF/Documentation #;
|
||||||
|
%put # to learn more. #;
|
||||||
|
%put # #;
|
||||||
|
%put # Example #####################################################################;
|
||||||
|
%put # #;
|
||||||
|
%put # Enabling the SAS Package Framework #;
|
||||||
|
%put # from the local directory and installing & loading #;
|
||||||
|
%put # the SQLinDS package from the Internet. #;
|
||||||
|
%put # #;
|
||||||
|
%put # Assume that the SPFinit.sas file #;
|
||||||
|
%put # is located in the "C:/SAS_PACKAGES/" folder. #;
|
||||||
|
%put # #;
|
||||||
|
%put # Run the following code in your SAS session: #;
|
||||||
|
%put ;
|
||||||
|
%put %nrstr( filename packages "C:/SAS_PACKAGES"; %%* set-up a directory for packages; );
|
||||||
|
%put %nrstr( %%include packages(SPFinit.sas); %%* enable the framework; );
|
||||||
|
%put ;
|
||||||
|
%put %nrstr( %%installPackage(SQLinDS) %%* install the package from the Internet; );
|
||||||
|
%put %nrstr( %%verifPackage%(SQLinDS, %%* verify the package with provided hash; );
|
||||||
|
%put %nrstr( hash=HDA478ANJ3HKHRY327FGE88HF89VH89HFFFV73GCV98RF390VB4%) );
|
||||||
|
%put ;
|
||||||
|
%put ###############################################################################;
|
||||||
|
%put ;
|
||||||
|
options &options_tmp.;
|
||||||
|
%GOTO ENDofverifyPackage;
|
||||||
|
%end;
|
||||||
|
%local ls_tmp ps_tmp notes_tmp source_tmp fullstimer_tmp stimer_tmp msglevel_tmp;
|
||||||
|
%let ls_tmp = %sysfunc(getoption(ls));
|
||||||
|
%let ps_tmp = %sysfunc(getoption(ps));
|
||||||
|
%let notes_tmp = %sysfunc(getoption(notes));
|
||||||
|
%let source_tmp = %sysfunc(getoption(source));
|
||||||
|
%let stimer_tmp = %sysfunc(getoption(stimer));
|
||||||
|
%let fullstimer_tmp = %sysfunc(getoption(fullstimer));
|
||||||
|
%let msglevel_tmp = %sysfunc(getoption(msglevel));
|
||||||
|
options NOnotes NOsource ls=MAX ps=MAX NOfullstimer NOstimer msglevel=N;
|
||||||
|
%local _PackageFileref_;
|
||||||
|
%let _PackageFileref_ = P%sysfunc(MD5(%lowcase(&packageName.)),hex7.);
|
||||||
|
|
||||||
|
filename &_PackageFileref_.
|
||||||
|
/* put location of package myPackageFile.zip here */
|
||||||
|
"&path./%lowcase(&packageName.).zip"
|
||||||
|
;
|
||||||
|
%if %sysfunc(fexist(&_PackageFileref_.)) %then
|
||||||
|
%do;
|
||||||
|
/* create hash SHA256 id *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||||
|
%local HASHING_FILE_exist;
|
||||||
|
%let HASHING_FILE_exist = 0;
|
||||||
|
data _null_;
|
||||||
|
set sashelp.vfunc(keep=fncname);
|
||||||
|
where fncname = "HASHING_FILE";
|
||||||
|
call symputX('HASHING_FILE_exist', 1, "L");
|
||||||
|
stop;
|
||||||
|
run;
|
||||||
|
|
||||||
|
%if &HASHING_FILE_exist. = 1 %then
|
||||||
|
%do;
|
||||||
|
options notes;
|
||||||
|
filename &_PackageFileref_. list;
|
||||||
|
|
||||||
|
data _null_;
|
||||||
|
SHA256 = HASHING_FILE("SHA256", "&_PackageFileref_.", 4);
|
||||||
|
providedHash = "&hash.";
|
||||||
|
put "Provided Hash: " providedHash;
|
||||||
|
put "SHA256 digest: " SHA256;
|
||||||
|
put " ";
|
||||||
|
|
||||||
|
if SHA256 = providedHash then
|
||||||
|
do;
|
||||||
|
put "NOTE: Package verification SUCCESFUL.";
|
||||||
|
put "NOTE- Generated hash is EQUAL to the provided one.";
|
||||||
|
end;
|
||||||
|
else
|
||||||
|
do;
|
||||||
|
put "ERROR: Package verification FAILED!!";
|
||||||
|
put "ERROR- Generated hash is DIFFERENT than the provided one.";
|
||||||
|
put "ERROR- Confirm if the package is genuine.";
|
||||||
|
end;
|
||||||
|
run;
|
||||||
|
%let HASHING_FILE_exist = 0;
|
||||||
|
%end;
|
||||||
|
%else
|
||||||
|
%put WARNING: Verification impossible! Minimum SAS version required for the process is 9.4M6. ;
|
||||||
|
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||||
|
%end;
|
||||||
|
%else %put ERROR:[&sysmacroname] File "&path./&packageName..zip" does not exist!;
|
||||||
|
filename &_PackageFileref_. clear;
|
||||||
|
|
||||||
|
options ls = &ls_tmp. ps = &ps_tmp.
|
||||||
|
¬es_tmp. &source_tmp.
|
||||||
|
&stimer_tmp. &fullstimer_tmp.
|
||||||
|
msglevel=&msglevel_tmp.;
|
||||||
|
%ENDofverifyPackage:
|
||||||
|
%mend verifyPackage;
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ data class;
|
|||||||
WH = weight + height;
|
WH = weight + height;
|
||||||
run;
|
run;
|
||||||
```
|
```
|
||||||
|
SHA256 digest for SQLinDS: 3EBC11A0890B6128DDB51643DC91F9DA1BDBF283535664540887FA7E7EA9744F
|
||||||
|
|
||||||
|
|
||||||
- **DFA** (Dynamic Function Arrays)\[0.2\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples.
|
- **DFA** (Dynamic Function Arrays)\[0.2\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples.
|
||||||
```
|
```
|
||||||
@@ -44,23 +46,32 @@ data _null_;
|
|||||||
end;
|
end;
|
||||||
run;
|
run;
|
||||||
```
|
```
|
||||||
|
SHA256 digest for DFA: BB8768E977D62429368CFF2E5338A6553C35C998AEC09AF24088BA713BB54DDA
|
||||||
|
|
||||||
- **macroArray**\[0.3\], implementation of an array concept in a macrolanguage, e.g.
|
|
||||||
|
- **macroArray**\[0.4\], implementation of an array concept in a macrolanguage, e.g.
|
||||||
```
|
```
|
||||||
%array(ABC[17] (111:127), macarray=Y);
|
%array(ABC[17] (111:127), macarray=Y);
|
||||||
|
|
||||||
|
%macro test();
|
||||||
%do i = 1 %to 17;
|
%do i = 1 %to 17;
|
||||||
%put &i.) %ABC(&i.);
|
%put &i.) %ABC(&i.);
|
||||||
%end;
|
%end;
|
||||||
|
%mend;
|
||||||
|
%test()
|
||||||
|
|
||||||
%let %ABC(13,i) = 999; /* i = insert */
|
%let %ABC(13,i) = 99999; /* i = insert */
|
||||||
|
|
||||||
%do i = 1 %to 17;
|
%do_over(ABC, phrase=%nrstr(
|
||||||
%put &i.) %ABC(&i.);
|
%put &_i_.%) %ABC(&_i_.);
|
||||||
%end;
|
),
|
||||||
|
which = 1:H:2
|
||||||
|
);
|
||||||
```
|
```
|
||||||
|
SHA256 digest for macroArray: 5C9208ADD091E354794C24FA830F527D17CFC758C24CB77BF2154949059F7E6F
|
||||||
|
|
||||||
- **BasePlus**\[0.52\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
|
||||||
|
- **BasePlus**\[0.62\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
||||||
```
|
```
|
||||||
call arrMissToRight(myArray);
|
call arrMissToRight(myArray);
|
||||||
call arrFillMiss(17, myArray);
|
call arrFillMiss(17, myArray);
|
||||||
@@ -72,8 +83,11 @@ string = catXFn("date9.", "#", myArray);
|
|||||||
|
|
||||||
format x bool.;
|
format x bool.;
|
||||||
|
|
||||||
%put %getVars(sashelp.class, patern = ght$, sep = +, varRange = _numeric_);
|
%put %getVars(sashelp.class, pattern = ght$, sep = +, varRange = _numeric_);
|
||||||
```
|
```
|
||||||
|
SHA256 digest for BasePlus: 278621A6D8BBBB791DEA4C215D4261F2CB8F8B76B1397F7FA9B2E4219E77CB5A
|
||||||
|
|
||||||
|
|
||||||
- **dynMacroArray**\[0.2\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA)
|
- **dynMacroArray**\[0.2\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA)
|
||||||
|
SHA256 digest for dynMacroArray: 066186B94B2976167C797C6A6E6217E361E8DEB10F2AB81906E0A325E5243084
|
||||||
|
|
||||||
|
|||||||
7
packages/SHA256_for_packages.txt
Normal file
7
packages/SHA256_for_packages.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/* 20200911 */
|
||||||
|
sqlindsdemo: CCA3CB51587E30D1A4338EAF732EF03E0922918AAA21C3ECF85CABE93CD2FB15
|
||||||
|
macroArray: 5C9208ADD091E354794C24FA830F527D17CFC758C24CB77BF2154949059F7E6F
|
||||||
|
BasePlus: 278621A6D8BBBB791DEA4C215D4261F2CB8F8B76B1397F7FA9B2E4219E77CB5A
|
||||||
|
SQLinDS: 3EBC11A0890B6128DDB51643DC91F9DA1BDBF283535664540887FA7E7EA9744F
|
||||||
|
dynMacroArray: 066186B94B2976167C797C6A6E6217E361E8DEB10F2AB81906E0A325E5243084
|
||||||
|
DFA: BB8768E977D62429368CFF2E5338A6553C35C998AEC09AF24088BA713BB54DDA
|
||||||
Binary file not shown.
BIN
packages/dfa.zip
BIN
packages/dfa.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user