mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2025-12-14 12:34:36 +00:00
SAS Packages Framework, version 20221121
## SAS Packages Framework, version 20221121
---
### New feature of "Cherry picking" added to the SAS Packages Framework.
Sometimes a package offers so many features that the number may be "overwhelming".
In such case only some of them may be selected for loading. Such process
is called a "cherry picking". The feature is provided by the `%loadPackage()` macro
which uses a `cherryPick=` parameter (see description below).
For example, execution of the following code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%loadPackage(BasePlus, cherryPick=rainCloudPlot getVars)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
results with loading only the `rainCloudPlot` and the `getVars` elements.
If several object types (e.g., a macro and a format) share the same name
all will be loaded.
What is the trade-off?
- Since the cherry picking selects only a part of the package the `SYSloadedPackages`
macrovariable is not updated with the package name.
- Dependencies i.e., packages from the `ReqPackages` list, are not loaded automatically,
so they have to be loaded manually.
- The `%unloadPackage()` macro executed on such partially loaded package may issue
some (irrelevant) warnings.
---
### Changes in `%loadPackage()` macro:
- New `cherryPick=` parameter added to the macro.
As a value a *space separated* list of selected elements
of the package to be loaded into the SAS session is expected.
Default value of an asterisk (`*`) means: "load all elements of the package".
Empty list is equivalent to default.
- Documentation updated.
### Changes in `%generatePackage()` macro:
- Code adjustment for the cherry picking feature.
- Minor additional code refactoring.
- The `%ICEloadPackage()` macro does not support cherry picking.
---
### The following packages were regenerated with the latest version of the framework:
- BasePlus [1.17.2]
- DFA [0.5.2]
- dynMacroArray [0.2.2]
- GSM [0.20.2]
- macroArray [1.0.2]
- SQLinDS [2.2.2]
This commit is contained in:
28
README.md
28
README.md
@@ -14,7 +14,7 @@ In this repository we are presenting the **SAS Packages Framework** which allows
|
|||||||
|
|
||||||
### Current version:
|
### Current version:
|
||||||
|
|
||||||
**The latest version** of SPF is **`20221112`**.
|
**The latest version** of SPF is **`20221121`**.
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
||||||
@@ -134,6 +134,8 @@ The SAS Packages Framework [(short) documetation](https://github.com/yabwon/SAS_
|
|||||||
|
|
||||||
### Updates worth mentioning:
|
### Updates worth mentioning:
|
||||||
|
|
||||||
|
**Update**\[November 21st, 2022\]**:** ` %loadPackage()` **macro allows Cherry Picking of content (see [here]())**.
|
||||||
|
|
||||||
**Update**\[September 30th, 2022\]**:** **New dedicated repository:** *SASPAC - the SAS Packages Archive* **is available as new location for packages storage**. Location of SASPAC is: [`https://github.com/SASPAC`](https://github.com/SASPAC)
|
**Update**\[September 30th, 2022\]**:** **New dedicated repository:** *SASPAC - the SAS Packages Archive* **is available as new location for packages storage**. Location of SASPAC is: [`https://github.com/SASPAC`](https://github.com/SASPAC)
|
||||||
|
|
||||||
**Update**\[November 11th, 2021\]**:** `%extendPackagesFileref()` **macro is available**.
|
**Update**\[November 11th, 2021\]**:** `%extendPackagesFileref()` **macro is available**.
|
||||||
@@ -168,13 +170,13 @@ If you find the SPF useful **share info** about it or **give it a [star](https:/
|
|||||||
|
|
||||||
Packages:
|
Packages:
|
||||||
|
|
||||||
- **SQLinDS**\[2.2.1\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g.
|
- **SQLinDS**\[2.2.2\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g.
|
||||||
```sas
|
```sas
|
||||||
data class;
|
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: A070214517CC36590083FCF9D5F488AC6E746793E94B9AA55D09A419CF291B5B
|
SHA256 digest for SQLinDS: 085F0B8BD4A59343E2913FF9635EA6E551ADD54E9678C35F5096D4A0A895B9C5
|
||||||
|
|
||||||
[Documentation for SQLinDS](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/sqlinds.md "Documentation for SQLinDS")
|
[Documentation for SQLinDS](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/sqlinds.md "Documentation for SQLinDS")
|
||||||
|
|
||||||
@@ -184,13 +186,13 @@ SHA256 digest for MacroCore: A23C29529F3CE7D0C8BEE9545C5D22D5B5594907547374A5135
|
|||||||
|
|
||||||
[Documentation for MacroCore](https://core.sasjs.io "Documentation for MacroCore")
|
[Documentation for MacroCore](https://core.sasjs.io "Documentation for MacroCore")
|
||||||
|
|
||||||
- **DFA** (Dynamic Function Arrays)\[0.5.1\], 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.5.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.
|
||||||
|
|
||||||
SHA256 digest for DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6
|
SHA256 digest for DFA: 3F618EDAC8B4F4BE6C19D606E6BCC58121A16BA1383D2EE64C680B4B7FA9C96A
|
||||||
|
|
||||||
[Documentation for DFA](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/dfa.md "Documentation for DFA")
|
[Documentation for DFA](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/dfa.md "Documentation for DFA")
|
||||||
|
|
||||||
- **macroArray**\[1.0.1\], implementation of an array concept in a macrolanguage, e.g.
|
- **macroArray**\[1.0.2\], implementation of an array concept in a macrolanguage, e.g.
|
||||||
```sas
|
```sas
|
||||||
%array(ABC[17] (111:127), macarray=Y);
|
%array(ABC[17] (111:127), macarray=Y);
|
||||||
|
|
||||||
@@ -209,12 +211,12 @@ SHA256 digest for DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163B
|
|||||||
which = 1:H:2
|
which = 1:H:2
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
SHA256 digest for macroArray: 371B92A5ABBE82C53F7D63BC5C0D1EBD4695603D3894D8A9A5D5777D1AB59B30
|
SHA256 digest for macroArray: DA57FFE85F49201FD61A53411D19E97FB5A6AC3C34E34FDF4B913545699551FF
|
||||||
|
|
||||||
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")
|
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")
|
||||||
|
|
||||||
|
|
||||||
- **BasePlus**\[1.17.1\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
- **BasePlus**\[1.17.2\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
||||||
```sas
|
```sas
|
||||||
call arrMissToRight(myArray);
|
call arrMissToRight(myArray);
|
||||||
call arrFillMiss(17, myArray);
|
call arrFillMiss(17, myArray);
|
||||||
@@ -232,21 +234,21 @@ format x bool.;
|
|||||||
|
|
||||||
%zipLibrary(sashelp,libOut=work)
|
%zipLibrary(sashelp,libOut=work)
|
||||||
```
|
```
|
||||||
SHA256 digest for BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4
|
SHA256 digest for BasePlus: EBA9EDB3D50D854288970CC0E965DA6AD5B057F6E6433EEBEC4A02B9A25CF6E2
|
||||||
|
|
||||||
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
|
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
|
||||||
|
|
||||||
- **GSM** (Generate Secure Macros)\[0.20.1\], package allows
|
- **GSM** (Generate Secure Macros)\[0.20.2\], package allows
|
||||||
to create secured macros stored in SAS Proc FCMP functions.
|
to create secured macros stored in SAS Proc FCMP functions.
|
||||||
The dataset with functions can be shared between different operating systems
|
The dataset with functions can be shared between different operating systems
|
||||||
and allows to generate macros on site without showing their code.
|
and allows to generate macros on site without showing their code.
|
||||||
|
|
||||||
SHA256 digest for GSM: 5D1925970C9590CD195C15B8641B01D7857E3B2546323DC77D09154BCCA40922
|
SHA256 digest for GSM: E47C94B536B661DEE390F5C3EA1684DD1A246106F4FBBDAFA57F5E34D4BB16D5
|
||||||
|
|
||||||
[Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM")
|
[Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM")
|
||||||
|
|
||||||
- **dynMacroArray**\[0.2.1\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold.
|
- **dynMacroArray**\[0.2.2\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold.
|
||||||
|
|
||||||
SHA256 digest for dynMacroArray: C987C08615A53D7BD7AEC3911EADF436C676EAB3E233E7E422E42995B890E169
|
SHA256 digest for dynMacroArray: DD0BF1768DA05EBB5F8C6E7409A0929E28DF11CB499F75B433D9648855AACAE4
|
||||||
|
|
||||||
### ======
|
### ======
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -6,7 +6,7 @@
|
|||||||
when empty the "packages" value is used */
|
when empty the "packages" value is used */
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to list directories pointed by "packages" fileref, version 20221112. Run %extendPackagesFileref(HELP) for help info.'
|
des = 'Macro to list directories pointed by "packages" fileref, version 20221121. Run %extendPackagesFileref(HELP) for help info.'
|
||||||
;
|
;
|
||||||
|
|
||||||
%if %QUPCASE(&packages.) = HELP %then
|
%if %QUPCASE(&packages.) = HELP %then
|
||||||
@@ -22,7 +22,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20221112
|
|||||||
%put ### This is short help information for the `extendPackagesFileref` macro #;
|
%put ### This is short help information for the `extendPackagesFileref` macro #;
|
||||||
%put #-----------------------------------------------------------------------------------------#;;
|
%put #-----------------------------------------------------------------------------------------#;;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to list directories pointed by 'packages' fileref, version `20221112` #;
|
%put # Macro to list directories pointed by 'packages' fileref, version `20221121` #;
|
||||||
%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 #;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
default value 1 means "delete tests work" */
|
default value 1 means "delete tests work" */
|
||||||
)/ secure minoperator
|
)/ secure minoperator
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to generate SAS packages, version 20221112. Run %generatePackage() for help info.'
|
des = 'Macro to generate SAS packages, version 20221121. Run %generatePackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
|
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -38,7 +38,7 @@ des = 'Macro to generate SAS packages, version 20221112. 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 `20221112` #;
|
%put # Macro to generate SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -218,7 +218,7 @@ filename &_LIC_. "&filesLocation./license.sas" lrecl = 1024;
|
|||||||
%abort;
|
%abort;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if %bquote(&packageRequired.) ne %then
|
%if %superq(packageRequired) ne %then
|
||||||
%do;
|
%do;
|
||||||
/* turn off the note about quoted string length */
|
/* turn off the note about quoted string length */
|
||||||
%local qlenmax_fstimer_tmp;
|
%local qlenmax_fstimer_tmp;
|
||||||
@@ -267,7 +267,7 @@ filename &_LIC_. "&filesLocation./license.sas" lrecl = 1024;
|
|||||||
%if &tryExcept. %then %abort;
|
%if &tryExcept. %then %abort;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if %bquote(&packageReqPackages.) ne %then
|
%if %superq(packageReqPackages) ne %then
|
||||||
%do;
|
%do;
|
||||||
/* turn off the note about quoted string length */
|
/* turn off the note about quoted string length */
|
||||||
%local qlenmax_fstimer_tmp;
|
%local qlenmax_fstimer_tmp;
|
||||||
@@ -682,12 +682,12 @@ title3 "Package encoding: '&packageEncoding.', session encoding: '&SYSENCODING.'
|
|||||||
title4 " ______________________________ ";
|
title4 " ______________________________ ";
|
||||||
title5 "List of files for package: &packageName. (version &packageVersion.), license: &packageLicense.";
|
title5 "List of files for package: &packageName. (version &packageVersion.), license: &packageLicense.";
|
||||||
title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
|
title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
|
||||||
%if (%bquote(&packageRequired.) ne )
|
%if (%superq(packageRequired) ne )
|
||||||
or (%bquote(&packageReqPackages.) ne )
|
or (%superq(packageReqPackages) ne )
|
||||||
%then
|
%then
|
||||||
%do;
|
%do;
|
||||||
title7 "Required SAS licences: %qsysfunc(compress(%bquote(&packageRequired.), %str(%'%")))" ; /* ' */
|
title7 "Required SAS licences: %qsysfunc(compress(%superq(packageRequired), %str(%'%")))" ; /* ' */
|
||||||
title8 "Required SAS packages: %qsysfunc(compress(%bquote(&packageReqPackages.),%str(%'%")))" ; /* " */
|
title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
|
|
||||||
@@ -860,7 +860,14 @@ data _null_;
|
|||||||
put ' %if %bquote(&packageEncoding.) NE %then &packageEncoding. ; ';
|
put ' %if %bquote(&packageEncoding.) NE %then &packageEncoding. ; ';
|
||||||
put ' %else utf8 ; ';
|
put ' %else utf8 ; ';
|
||||||
put ' ; ';
|
put ' ; ';
|
||||||
|
|
||||||
|
put ' %local cherryPick; %let cherryPick=*; ';
|
||||||
|
put ' %local tempLoad_minoperator; ';
|
||||||
|
put ' %let tempLoad_minoperator = %sysfunc(getoption(minoperator)); ';
|
||||||
|
put ' options minoperator; ';
|
||||||
put ' %include &_PackageFileref_.(load.sas) / &source2.; ';
|
put ' %include &_PackageFileref_.(load.sas) / &source2.; ';
|
||||||
|
put ' options &tempLoad_minoperator.; ';
|
||||||
|
|
||||||
put ' filename &_PackageFileref_. clear; ';
|
put ' filename &_PackageFileref_. clear; ';
|
||||||
put ' %WrongVersionOFPackage: ';
|
put ' %WrongVersionOFPackage: ';
|
||||||
|
|
||||||
@@ -868,7 +875,6 @@ data _null_;
|
|||||||
put " ";
|
put " ";
|
||||||
run;
|
run;
|
||||||
|
|
||||||
|
|
||||||
/* loading package files */
|
/* loading package files */
|
||||||
%put NOTE-;
|
%put NOTE-;
|
||||||
%put NOTE: Preparing load file.;
|
%put NOTE: Preparing load file.;
|
||||||
@@ -892,12 +898,19 @@ data _null_;
|
|||||||
put ' %put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
put ' %put NOTE- *** START ***; ' /;
|
put ' %put NOTE- *** START ***; ' /;
|
||||||
|
|
||||||
|
put '%if NOT (%str(*)=%superq(cherryPick)) %then %do; '; /* Cherry Pick test0 start */
|
||||||
|
put ' %put NOTE- ;' /
|
||||||
|
' %put NOTE- *** Cherry Picking in action. ***; ' /
|
||||||
|
' %put NOTE- ;' ;
|
||||||
|
put '%end; '; /* Cherry Pick test0 end */
|
||||||
|
|
||||||
put '%include ' " &_PackageFileref_.(packagemetadata.sas) / nosource2; " /; /* <- copied also to loadPackage macro */
|
put '%include ' " &_PackageFileref_.(packagemetadata.sas) / nosource2; " /; /* <- copied also to loadPackage macro */
|
||||||
|
|
||||||
isFunction = 0;
|
isFunction = 0;
|
||||||
isFormat = 0;
|
isFormat = 0;
|
||||||
|
|
||||||
%if (%bquote(&packageRequired.) ne )
|
%if (%superq(packageRequired) ne )
|
||||||
or (%bquote(&packageReqPackages.) ne )
|
or (%superq(packageReqPackages) ne )
|
||||||
%then
|
%then
|
||||||
%do;
|
%do;
|
||||||
put ' data _null_; ';
|
put ' data _null_; ';
|
||||||
@@ -905,7 +918,7 @@ data _null_;
|
|||||||
put ' run; ';
|
put ' run; ';
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if %bquote(&packageRequired.) ne %then
|
%if %superq(packageRequired) ne %then
|
||||||
%do;
|
%do;
|
||||||
put ' %put NOTE- *Testing required SAS components*%sysfunc(DoSubL( '; /* <- DoSubL() is here */
|
put ' %put NOTE- *Testing required SAS components*%sysfunc(DoSubL( '; /* <- DoSubL() is here */
|
||||||
put ' options nonotes nosource %str(;) ';
|
put ' options nonotes nosource %str(;) ';
|
||||||
@@ -968,11 +981,13 @@ data _null_;
|
|||||||
put ' ))*; ';
|
put ' ))*; ';
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if %bquote(&packageReqPackages.) ne %then
|
%if %superq(packageReqPackages) ne %then
|
||||||
%do;
|
%do;
|
||||||
|
|
||||||
length packageReqPackages $ 32767;
|
length packageReqPackages $ 32767;
|
||||||
packageReqPackages = lowcase(symget('packageReqPackages'));
|
packageReqPackages = lowcase(symget('packageReqPackages'));
|
||||||
|
|
||||||
|
put '%if (%str(*)=%superq(cherryPick)) %then %do; /* test for Cherry Picking */ ';
|
||||||
/* try to load required packages */
|
/* try to load required packages */
|
||||||
put 'data _null_ ; ';
|
put 'data _null_ ; ';
|
||||||
put ' length req name $ 64 vers verR $ 24 versN verRN 8 SYSloadedPackages $ 32767; ';
|
put ' length req name $ 64 vers verR $ 24 versN verRN 8 SYSloadedPackages $ 32767; ';
|
||||||
@@ -1086,14 +1101,21 @@ data _null_;
|
|||||||
put ' end; ';
|
put ' end; ';
|
||||||
put ' stop; ';
|
put ' stop; ';
|
||||||
put 'run; ';
|
put 'run; ';
|
||||||
|
put '%end; ';
|
||||||
|
put '%else %do; ';
|
||||||
|
put ' %put NOTE- ; ';
|
||||||
|
put ' %put NOTE- Cherry Picking in action!! Be advised that; ';
|
||||||
|
put ' %put NOTE- dependencies/required packages will not be loaded!; ';
|
||||||
|
put '%end; ';
|
||||||
|
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if (%bquote(&packageRequired.) ne )
|
%if (%superq(packageRequired) ne )
|
||||||
or (%bquote(&packageReqPackages.) ne )
|
or (%superq(packageReqPackages) ne )
|
||||||
%then
|
%then
|
||||||
%do;
|
%do;
|
||||||
put ' data _null_; ';
|
put ' data _null_; ';
|
||||||
put ' if symget("packageRequiredErrors") = "1" then ';
|
put ' if 1 = symgetn("packageRequiredErrors") then ';
|
||||||
put ' do; ';
|
put ' do; ';
|
||||||
put ' put "ERROR: Loading package &packageName. will be aborted!";';
|
put ' put "ERROR: Loading package &packageName. will be aborted!";';
|
||||||
put ' put "ERROR- Required components are missing."; ';
|
put ' put "ERROR- Required components are missing."; ';
|
||||||
@@ -1103,7 +1125,9 @@ data _null_;
|
|||||||
put ' run; ';
|
put ' run; ';
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
do until(eof);
|
|
||||||
|
do until(eof); /* loopOverTypes - start */
|
||||||
|
|
||||||
set &filesWithCodes. end = EOF nobs=NOBS;
|
set &filesWithCodes. end = EOF nobs=NOBS;
|
||||||
by TYPE notsorted;
|
by TYPE notsorted;
|
||||||
if (upcase(type) in: ('CLEAN' 'LAZYDATA' 'TEST')) then continue; /* cleaning files are only included in unload.sas */
|
if (upcase(type) in: ('CLEAN' 'LAZYDATA' 'TEST')) then continue; /* cleaning files are only included in unload.sas */
|
||||||
@@ -1119,12 +1143,64 @@ data _null_;
|
|||||||
putlog 'WARNING: Type ' type 'is not yet supported.';
|
putlog 'WARNING: Type ' type 'is not yet supported.';
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
isFunction + (upcase(type)=:'FUNCTION');
|
||||||
|
isFormat + (upcase(type)=:'FORMAT');
|
||||||
|
isProto + (upcase(type)=:'PROTO');
|
||||||
|
|
||||||
|
/* HEADERS for IML, FCMP, and PROTO - start */
|
||||||
|
if 1 = isFunction and upcase(type)=:'FUNCTION' then
|
||||||
|
do;
|
||||||
|
/* macro variable for test if cherry picking used FCMP */
|
||||||
|
put 'data _null_; ';
|
||||||
|
put ' call symputX("cherryPick_FCMP", 0, "L"); ';
|
||||||
|
put 'run; ';
|
||||||
|
end;
|
||||||
|
if 1 = FIRST.type and upcase(type)='FUNCTIONS' then
|
||||||
|
do;
|
||||||
|
/* header for multiple functions in one FCMP run */
|
||||||
|
put "proc fcmp outlib = work.%lowcase(&packageName.fcmp).package ; ";
|
||||||
|
end;
|
||||||
|
if 1 = FIRST.type and upcase(type)='PROTO' then
|
||||||
|
do;
|
||||||
|
/* macro variable for test if cherry picking used PROTO */
|
||||||
|
put 'data _null_; ';
|
||||||
|
put ' call symputX("cherryPick_PROTO", 0, "L"); ';
|
||||||
|
put 'run; ';
|
||||||
|
/* header for multiple functions in one PROTO run */
|
||||||
|
put "proc proto package = work.%lowcase(&packageName.proto).package ; ";
|
||||||
|
end;
|
||||||
|
if 1 = FIRST.type and upcase(type)='IMLMODULE' then
|
||||||
|
do;
|
||||||
|
/* macro variable for test if cherry picking used IML */
|
||||||
|
put 'data _null_; ';
|
||||||
|
put ' call symputX("cherryPick_IML", 0, "L"); ';
|
||||||
|
put 'run; ';
|
||||||
|
/* header, for IML modules */
|
||||||
|
put "proc iml ; ";
|
||||||
|
end;
|
||||||
|
if 1 = FIRST.type and upcase(type)='FORMATS' then
|
||||||
|
do;
|
||||||
|
/* header, for FORMATS */
|
||||||
|
put "proc format lib = work.%lowcase(&packageName.format) ; ";
|
||||||
|
end;
|
||||||
|
if 1 = isFormat and upcase(type)=:'FORMAT' then
|
||||||
|
do;
|
||||||
|
/* macro variable for test if cherry picking used FORMAT */
|
||||||
|
put 'data _null_; ';
|
||||||
|
put ' call symputX("cherryPick_FORMAT", 0, "L"); ';
|
||||||
|
put 'run; ';
|
||||||
|
end;
|
||||||
|
/* HEADERS for IML, FCMP, and PROTO - end */
|
||||||
|
|
||||||
|
put ' ' /
|
||||||
|
'%if (%str(*)=%superq(cherryPick)) or (' fileshort +(-1) ' in %superq(cherryPick)) %then %do; '; /* Cherry Pick test1 start */
|
||||||
put ' %put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
put '%put NOTE: Element of type ' type 'from the file "' file +(-1) '" will be included;';
|
put ' %put NOTE: >> Element of type ' type 'from the file "' file +(-1) '" will be included <<;';
|
||||||
|
|
||||||
if upcase(type)=:'MACRO' then
|
if upcase(type)=:'MACRO' then
|
||||||
put '%put %sysfunc(ifc(%SYSMACEXIST(' fileshort ')=1, NOTE# Macro ' fileshort
|
put ' %put %sysfunc(ifc(%SYSMACEXIST(' fileshort +(-1) ')=1, NOTE# Macro ' fileshort
|
||||||
"exist. It will be overwritten by the macro from the &packageName. package, ));";
|
"exist. It will be overwritten by the macro from the &packageName. package, ));";
|
||||||
put " ";
|
|
||||||
|
|
||||||
if upcase(type)=:'EXEC' then
|
if upcase(type)=:'EXEC' then
|
||||||
do;
|
do;
|
||||||
@@ -1135,74 +1211,114 @@ data _null_;
|
|||||||
put " infile &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') lrecl=32767;';
|
put " infile &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') lrecl=32767;';
|
||||||
put ' input;';
|
put ' input;';
|
||||||
put ' putlog "*> " _infile_;';
|
put ' putlog "*> " _infile_;';
|
||||||
put 'run;' /;
|
put ' run;';
|
||||||
put ' %put NOTE- *****************************;';
|
put ' %put NOTE- *****************************;';
|
||||||
put ' %put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
/* HEADERS for IML, FCMP, and PROTO */
|
|
||||||
if 1 = FIRST.type and upcase(type)='FUNCTIONS' then /* header, for multiple functions in one FCMP run */
|
|
||||||
do;
|
|
||||||
put "proc fcmp outlib = work.%lowcase(&packageName.fcmp).package ; ";
|
|
||||||
end;
|
|
||||||
if 1 = FIRST.type and upcase(type)='PROTO' then /* header, for multiple functions in one PROTO 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 */
|
|
||||||
do;
|
|
||||||
put "proc iml ; ";
|
|
||||||
end;
|
|
||||||
if 1 = FIRST.type and upcase(type)='FORMATS' then /* header, for FORMATS */
|
|
||||||
do;
|
|
||||||
put "proc format lib = work.%lowcase(&packageName.format) ; ";
|
|
||||||
end;
|
|
||||||
|
|
||||||
/* 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, FCMP, and PROTO */
|
if upcase(type)=:'IMLMODULE' then
|
||||||
|
put ' %let cherryPick_IML = %eval(&cherryPick_IML. + 1);';
|
||||||
|
|
||||||
|
if upcase(type)=:'FUNCTION' then
|
||||||
|
put ' %let cherryPick_FCMP = %eval(&cherryPick_FCMP. + 1);';
|
||||||
|
|
||||||
|
if upcase(type)=:'PROTO' then
|
||||||
|
put ' %let cherryPick_PROTO = %eval(&cherryPick_PROTO. + 1);';
|
||||||
|
|
||||||
|
if upcase(type)=:'FORMAT' then
|
||||||
|
put ' %let cherryPick_FORMAT = %eval(&cherryPick_FORMAT. + 1);';
|
||||||
|
|
||||||
|
put '%end; ' /; /* Cherry Pick test1 end */
|
||||||
|
|
||||||
|
|
||||||
|
/* FOOTERS for IML, FCMP, and PROTO - start */
|
||||||
if 1 = LAST.type and upcase(type) in ('FUNCTIONS' 'PROTO' 'FORMATS') then
|
if 1 = LAST.type and upcase(type) in ('FUNCTIONS' 'PROTO' 'FORMATS') then
|
||||||
do; /* footer, for multiple functions in one FCMP run, one PROTO run, or one FORMAT run */
|
do; /* footer, for multiple functions in one FCMP run, one PROTO run, or one FORMAT run */
|
||||||
put "run; ";
|
put "run; " / ;
|
||||||
end;
|
end;
|
||||||
if 1 = LAST.type and upcase(type)='IMLMODULE' then /* footer, for IML modules */
|
if 1 = LAST.type and upcase(type)='IMLMODULE' then /* footer, for IML modules */
|
||||||
do;
|
do;
|
||||||
put "reset storage = WORK.&packageName.IML; "; /* set the storage location for modules */
|
put '%if 0 < &cherryPick_IML. %then %do; ' /
|
||||||
put "store module = _ALL_; "; /* and store all created modules */
|
"reset storage = WORK.&packageName.IML; " / /* set the storage location for modules */
|
||||||
put "quit; ";
|
"store module = _ALL_; " / /* and store all created modules */
|
||||||
|
'%end; ' /
|
||||||
|
"quit; " / ;
|
||||||
end;
|
end;
|
||||||
|
/* FOOTERS for IML, FCMP, and PROTO - end */
|
||||||
isFunction + (upcase(type)=:'FUNCTION');
|
|
||||||
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));"/;
|
||||||
put '%put NOTE- ;';
|
|
||||||
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
/* add the link to the proto functions dataset, 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
|
if 1 = isProto and (upcase(type)=:'PROTO') then
|
||||||
do;
|
do;
|
||||||
put "options APPEND=(cmplib = work.%lowcase(&packageName.proto));";
|
put "options APPEND=(cmplib = work.%lowcase(&packageName.proto));"/;
|
||||||
put '%put NOTE- ;';
|
|
||||||
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 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));"/;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end; /* loopOverTypes - start */
|
||||||
|
|
||||||
|
|
||||||
|
/* cherry pick clean in cmplib for functions */
|
||||||
|
if isFunction then
|
||||||
|
do;
|
||||||
|
put '%if 0 = &cherryPick_FCMP. %then %do;';
|
||||||
|
put 'options cmplib = (%unquote(%sysfunc(tranwrd(' /
|
||||||
|
'%lowcase(%sysfunc(getoption(cmplib)))' /
|
||||||
|
',%str(' "work.%lowcase(&packageName.fcmp)" '), %str() ))));';
|
||||||
|
put 'options cmplib = (%unquote(%sysfunc(compress(' /
|
||||||
|
'%sysfunc(getoption(cmplib))' /
|
||||||
|
',%str(()) ))));';
|
||||||
|
put '%end;';
|
||||||
|
end;
|
||||||
|
/* cherry pick clean in cmplib for proto */
|
||||||
|
if isProto then
|
||||||
|
do;
|
||||||
|
put '%if 0 = &cherryPick_PROTO. %then %do;';
|
||||||
|
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 "proc delete data=work.%lowcase(&packageName.proto); run;";
|
||||||
|
put '%end;';
|
||||||
|
end;
|
||||||
|
/* list cmplib for functions */
|
||||||
|
if isFunction OR isProto then
|
||||||
|
do;
|
||||||
|
put '%put NOTE- ;';
|
||||||
|
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
|
||||||
|
end;
|
||||||
|
|
||||||
|
/* list fmtsearch for formats */
|
||||||
|
if isFormat then
|
||||||
|
do;
|
||||||
|
put '%if 0 = &cherryPick_FCMP. %then %do;';
|
||||||
|
put 'options fmtsearch = (%unquote(%sysfunc(tranwrd(' /
|
||||||
|
'%lowcase(%sysfunc(getoption(fmtsearch)))' /
|
||||||
|
',%str(' "work.%lowcase(&packageName.)format" '), %str() ))));';
|
||||||
|
put 'options fmtsearch = (%unquote(%sysfunc(compress(' /
|
||||||
|
'%sysfunc(getoption(fmtsearch))' /
|
||||||
|
', %str(()) ))));';
|
||||||
|
put '%end;';
|
||||||
put '%put NOTE- ;';
|
put '%put NOTE- ;';
|
||||||
put '%put NOTE:[FMTSEARCH] %sysfunc(getoption(fmtsearch));'/;
|
put '%put NOTE:[FMTSEARCH] %sysfunc(getoption(fmtsearch));'/;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
|
|
||||||
/* update SYSloadedPackages global macrovariable */
|
/* update SYSloadedPackages global macrovariable */
|
||||||
|
put '%if (%str(*)=%superq(cherryPick)) %then %do; '; /* Cherry Pick test3 start */
|
||||||
put ' data _null_ ; ';
|
put ' data _null_ ; ';
|
||||||
put ' length SYSloadedPackages stringPCKG $ 32767; ';
|
put ' length SYSloadedPackages stringPCKG $ 32767; ';
|
||||||
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
|
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
|
||||||
@@ -1237,7 +1353,8 @@ data _null_;
|
|||||||
put " put 'NOTE: SYSloadedPackages = &packageName.(&packageVersion.)'; ";
|
put " put 'NOTE: SYSloadedPackages = &packageName.(&packageVersion.)'; ";
|
||||||
put ' end; ';
|
put ' end; ';
|
||||||
put ' stop; ';
|
put ' stop; ';
|
||||||
put 'run; ' / ;
|
put ' run; ';
|
||||||
|
put '%end; ' / ; /* Cherry Pick test3 end */
|
||||||
|
|
||||||
put '%put NOTE- ;';
|
put '%put NOTE- ;';
|
||||||
put '%put NOTE: '"Loading package &packageName., version &packageVersion., license &packageLicense.;";
|
put '%put NOTE: '"Loading package &packageName., version &packageVersion., license &packageLicense.;";
|
||||||
@@ -1282,7 +1399,7 @@ data _null_;
|
|||||||
put 'do;';
|
put 'do;';
|
||||||
put ' put "NOTE- Dataset ' fileshort 'from the file ""' file +(-1) '"" will be loaded";';
|
put ' put "NOTE- Dataset ' fileshort 'from the file ""' file +(-1) '"" will be loaded";';
|
||||||
put ' call execute(''%nrstr(%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;)'');';
|
put ' call execute(''%nrstr(%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;)'');';
|
||||||
put 'end;';
|
put 'end;' /;
|
||||||
end;
|
end;
|
||||||
/* use lazyData to reload data type */
|
/* use lazyData to reload data type */
|
||||||
if ( upcase(type) =: 'DATA' ) then
|
if ( upcase(type) =: 'DATA' ) then
|
||||||
@@ -1291,7 +1408,7 @@ data _null_;
|
|||||||
put 'do;';
|
put 'do;';
|
||||||
put ' put "NOTE- Dataset ' fileshort 'from the file ""' file +(-1) '"" will be loaded";';
|
put ' put "NOTE- Dataset ' fileshort 'from the file ""' file +(-1) '"" will be loaded";';
|
||||||
put ' call execute(''%nrstr(%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;)'');';
|
put ' call execute(''%nrstr(%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;)'');';
|
||||||
put 'end;';
|
put 'end;' /;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -1335,7 +1452,7 @@ data _null_;
|
|||||||
put ' putlog "*> " _infile_;';
|
put ' putlog "*> " _infile_;';
|
||||||
put 'run;' /;
|
put 'run;' /;
|
||||||
put '%put NOTE- *****************************;';
|
put '%put NOTE- *****************************;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
|
|
||||||
put '%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;' /;
|
put '%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;' /;
|
||||||
end;
|
end;
|
||||||
@@ -1354,8 +1471,8 @@ data _null_;
|
|||||||
set &filesWithCodes. end = EOF nobs = NOBS;
|
set &filesWithCodes. end = EOF nobs = NOBS;
|
||||||
if not (upcase(type)=:'MACRO') then continue;
|
if not (upcase(type)=:'MACRO') then continue;
|
||||||
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
put ',"' fileshort upcase32. '"';
|
put ',"' fileshort upcase32. '"' /;
|
||||||
end;
|
end;
|
||||||
/**/
|
/**/
|
||||||
put ' )';
|
put ' )';
|
||||||
@@ -1372,8 +1489,8 @@ data _null_;
|
|||||||
set &filesWithCodes. end = EOF;
|
set &filesWithCodes. end = EOF;
|
||||||
if not (upcase(type)=:'FORMAT') then continue;
|
if not (upcase(type)=:'FORMAT') then continue;
|
||||||
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
put ',"' fileshort upcase32. '"';
|
put ',"' fileshort upcase32. '"' /;
|
||||||
isFormat + 1;
|
isFormat + 1;
|
||||||
end;
|
end;
|
||||||
put ' )';
|
put ' )';
|
||||||
@@ -1445,8 +1562,8 @@ data _null_;
|
|||||||
set &filesWithCodes. end = EOF;
|
set &filesWithCodes. end = EOF;
|
||||||
if not (upcase(type)=:'FUNCTION') then continue;
|
if not (upcase(type)=:'FUNCTION') then continue;
|
||||||
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
put 'deletefunc ' fileshort ';';
|
put 'deletefunc ' fileshort ';' /;
|
||||||
isFunction + 1;
|
isFunction + 1;
|
||||||
end;
|
end;
|
||||||
put "run;" /;
|
put "run;" /;
|
||||||
@@ -1486,8 +1603,8 @@ data _null_;
|
|||||||
set &filesWithCodes. end = EOF;
|
set &filesWithCodes. end = EOF;
|
||||||
if not (upcase(type)=:'DATA') then continue;
|
if not (upcase(type)=:'DATA') then continue;
|
||||||
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
put 'drop table ' fileshort ';';
|
put 'drop table ' fileshort ';' /;
|
||||||
end;
|
end;
|
||||||
put "quit;" /;
|
put "quit;" /;
|
||||||
|
|
||||||
@@ -1497,8 +1614,8 @@ data _null_;
|
|||||||
set &filesWithCodes. end = EOF;
|
set &filesWithCodes. end = EOF;
|
||||||
if not (upcase(type)=:'LIBNAME') then continue;
|
if not (upcase(type)=:'LIBNAME') then continue;
|
||||||
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be cleared;';
|
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be cleared;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
put 'libname ' fileshort ' clear;';
|
put 'libname ' fileshort ' clear;' /;
|
||||||
end;
|
end;
|
||||||
put "run;" /;
|
put "run;" /;
|
||||||
|
|
||||||
@@ -1515,7 +1632,7 @@ data _null_;
|
|||||||
put ' put '' %unloadPackage( '' name ")" ; ';
|
put ' put '' %unloadPackage( '' name ")" ; ';
|
||||||
put ' end ; ';
|
put ' end ; ';
|
||||||
put ' put "NOTE-" / "NOTE-"; stop; ';
|
put ' put "NOTE-" / "NOTE-"; stop; ';
|
||||||
put 'run; ';
|
put 'run; ' /;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
|
|
||||||
@@ -1544,7 +1661,7 @@ data _null_;
|
|||||||
|
|
||||||
put '%put NOTE: ' "Unloading package &packageName., version &packageVersion., license &packageLicense.;";
|
put '%put NOTE: ' "Unloading package &packageName., version &packageVersion., license &packageLicense.;";
|
||||||
put '%put NOTE- *** END ***;';
|
put '%put NOTE- *** END ***;';
|
||||||
put '%put NOTE- ;';
|
put '%put NOTE- ;' /;
|
||||||
|
|
||||||
put "/* unload.sas end */";
|
put "/* unload.sas end */";
|
||||||
stop;
|
stop;
|
||||||
@@ -1742,7 +1859,7 @@ data _null_;
|
|||||||
put ' end ; ';
|
put ' end ; ';
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
put 'put "***"; put "* SAS package generated by generatePackage, version 20221112 *"; put "***";';
|
put 'put "***"; put "* SAS package generated by generatePackage, version 20221121 *"; put "***";';
|
||||||
|
|
||||||
put 'run; ' /;
|
put 'run; ' /;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to get help about SAS package, version 20221112. Run %helpPackage() for help info.'
|
des = 'Macro to get help about SAS package, version 20221121. Run %helpPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -39,7 +39,7 @@ des = 'Macro to get help about SAS package, version 20221112. 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 `20221112` #;
|
%put # Macro to get help about SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -169,7 +169,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 20221112 */
|
/* Macros to install SAS packages, version 20221121 */
|
||||||
/* 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
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
/secure
|
/secure
|
||||||
minoperator
|
minoperator
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to install SAS package, version 20221112. Run %%installPackage() for help info.'
|
des = 'Macro to install SAS package, version 20221121. Run %%installPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -29,7 +29,7 @@ des = 'Macro to install SAS package, version 20221112. Run %%installPackage() fo
|
|||||||
%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 `20221112` #;
|
%put # Macro to install SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -458,7 +458,7 @@ des = 'Macro to install SAS package, version 20221112. Run %%installPackage() fo
|
|||||||
|
|
||||||
/* Macro to list SAS packages in packages folder.
|
/* Macro to list SAS packages in packages folder.
|
||||||
|
|
||||||
Version 20221112
|
Version 20221121
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*+listPackages+*/
|
/*+listPackages+*/
|
||||||
|
|
||||||
%macro listPackages()/secure PARMBUFF
|
%macro listPackages()/secure PARMBUFF
|
||||||
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20221112.'
|
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20221121.'
|
||||||
;
|
;
|
||||||
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
|
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
|
||||||
%do;
|
%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 ### This is short help information for the `listPackages` macro #;
|
||||||
%put #-----------------------------------------------------------------------------------------#;;
|
%put #-----------------------------------------------------------------------------------------#;;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to list available SAS packages, version `20221112` #;
|
%put # Macro to list available SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -166,7 +166,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
|||||||
|
|
||||||
/* Macro to generate SAS packages.
|
/* Macro to generate SAS packages.
|
||||||
|
|
||||||
Version 20221112
|
Version 20221121
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
@@ -25,9 +25,14 @@
|
|||||||
and use loadPackage in the form:
|
and use loadPackage in the form:
|
||||||
%loadPackage(PiPackage, zip=disk, options=)
|
%loadPackage(PiPackage, zip=disk, options=)
|
||||||
*/
|
*/
|
||||||
|
, cherryPick=* /* space separated list of selected elements of the package
|
||||||
|
to be loaded into the session, default value "*" means
|
||||||
|
"load all elements of the package"
|
||||||
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help info.'
|
des = 'Macro to load SAS package, version 20221121. Run %loadPackage() for help info.'
|
||||||
|
minoperator
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -42,7 +47,7 @@ des = 'Macro to load SAS package, version 20221112. 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 `20221112` #;
|
%put # Macro to *load* SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -74,24 +79,29 @@ des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help
|
|||||||
%put # package is provided in required version, #;
|
%put # package is provided in required version, #;
|
||||||
%put # default value: `.` #;
|
%put # default value: `.` #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # - `lazyData=` *Optional.* A list of names of lazy datasets to be #;
|
%put # - `lazyData=` *Optional.* A space separated list of names of lazy #;
|
||||||
%put # loaded. If not null datasets from the list are loaded #;
|
%put # datasets to be loaded. If not null datasets from the #;
|
||||||
%put # instead of the package. #;
|
%put # list are loaded instead of the package. #;
|
||||||
%put # An asterisk (*) means *load all lazy datasets*. #;
|
%put # An asterisk (*) means *load all lazy datasets*. #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # - `zip=` Standard package is zip (lowcase), #;
|
%put # - `zip=` *Optional.* Standard package is zip (lowcase), #;
|
||||||
%put # e.g. `%nrstr(%%loadPackage(PiPackage))`. #;
|
%put # e.g. `%nrstr(%%loadPackage(PiPackage))`. #;
|
||||||
%put # If the zip is not available use a folder. #;
|
%put # If the zip is not available use a folder. #;
|
||||||
%put # Unpack data to "pipackage.disk" folder #;
|
%put # Unpack data to "pipackage.disk" folder #;
|
||||||
%put # and use loadPackage in the following form: #;
|
%put # and use loadPackage in the following form: #;
|
||||||
%put # `%nrstr(%%loadPackage(PiPackage, zip=disk, options=))` #;
|
%put # `%nrstr(%%loadPackage(PiPackage, zip=disk, options=))` #;
|
||||||
%put # #;
|
%put # #;
|
||||||
|
%put # - `cherryPick=` *Optional.* A space separated list of selected elements #;
|
||||||
|
%put # of the package to be loaded into the SAS session. #;
|
||||||
|
%put # Default value of an asterisk (*) means: #;
|
||||||
|
%put # "load all elements of the package". #;
|
||||||
|
%put # #;
|
||||||
%put #-------------------------------------------------------------------------------#;
|
%put #-------------------------------------------------------------------------------#;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||||
%put # to learn more. #;
|
%put # to learn more. #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put ### Example #####################################################################;
|
%put ### Example 1 ###################################################################;
|
||||||
%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 #;
|
||||||
@@ -110,6 +120,25 @@ des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help
|
|||||||
%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 ### Example 2 ###################################################################;
|
||||||
|
%put # #;
|
||||||
|
%put # Enabling the SAS Package Framework #;
|
||||||
|
%put # from the local directory and installing & cherry picking #;
|
||||||
|
%put # elements of the BasePlus package. #;
|
||||||
|
%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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas;
|
||||||
|
%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(BasePlus) %%* install the package from the Internet; );
|
||||||
|
%put %nrstr( %%loadPackage(BasePlus, cherryPick=getVars) %%* cherry pick the content; );
|
||||||
|
%put ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
|
||||||
|
%put # #;
|
||||||
%put #################################################################################;
|
%put #################################################################################;
|
||||||
%put ;
|
%put ;
|
||||||
options &options_tmp.;
|
options &options_tmp.;
|
||||||
@@ -145,6 +174,19 @@ des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help
|
|||||||
if exists then call symputx("path", p, "L");
|
if exists then call symputx("path", p, "L");
|
||||||
run;
|
run;
|
||||||
|
|
||||||
|
/* convert cherryPick to lower case if needed */
|
||||||
|
%if NOT (%str(*) = %superq(cherryPick)) %then
|
||||||
|
%do;
|
||||||
|
data _null_;
|
||||||
|
call symputX("cherryPick",lowcase(compbl(compress(symget("cherryPick"),". _","KDA"))),"L");
|
||||||
|
run;
|
||||||
|
%end;
|
||||||
|
/* empty list is equivalent to "*" */
|
||||||
|
%if %superq(cherryPick)= %then
|
||||||
|
%do;
|
||||||
|
%let cherryPick=*;
|
||||||
|
%end;
|
||||||
|
|
||||||
filename &_PackageFileref_. &ZIP.
|
filename &_PackageFileref_. &ZIP.
|
||||||
/* put location of package myPackageFile.zip here */
|
/* put location of package myPackageFile.zip here */
|
||||||
"&path./%lowcase(&packageName.).&zip." %unquote(&options.)
|
"&path./%lowcase(&packageName.).&zip." %unquote(&options.)
|
||||||
@@ -184,7 +226,11 @@ des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help
|
|||||||
;
|
;
|
||||||
%if %bquote(&lazyData.) = %then
|
%if %bquote(&lazyData.) = %then
|
||||||
%do;
|
%do;
|
||||||
|
%local tempLoad_minoperator;
|
||||||
|
%let tempLoad_minoperator = %sysfunc(getoption(minoperator));
|
||||||
|
options minoperator; /* MinOperator option is required for cherryPicking to work */
|
||||||
%include &_PackageFileref_.(load.sas) / &source2.;
|
%include &_PackageFileref_.(load.sas) / &source2.;
|
||||||
|
options &tempLoad_minoperator.;
|
||||||
%end;
|
%end;
|
||||||
%else
|
%else
|
||||||
%do;
|
%do;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to load multiple SAS packages at one run, version 20221112. Run %loadPackages() for help info.'
|
des = 'Macro to load multiple SAS packages at one run, version 20221121. Run %loadPackages() for help info.'
|
||||||
parmbuff
|
parmbuff
|
||||||
;
|
;
|
||||||
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||||
@@ -27,7 +27,7 @@ parmbuff
|
|||||||
%put ### This is short help information for the `loadPackageS` macro #;
|
%put ### This is short help information for the `loadPackageS` macro #;
|
||||||
%put #-------------------------------------------------------------------------------#;
|
%put #-------------------------------------------------------------------------------#;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro wrapper for the loadPackage macro, version `20221112` #;
|
%put # Macro wrapper for the loadPackage macro, version `20221121` #;
|
||||||
%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 #;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to preview content of a SAS package, version 20221112. Run %previewPackage() for help info.'
|
des = 'Macro to preview content of a SAS package, version 20221121. Run %previewPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -38,7 +38,7 @@ des = 'Macro to preview content of a SAS package, version 20221112. Run %preview
|
|||||||
%put ### This is short help information for the `previewPackage` macro #;
|
%put ### This is short help information for the `previewPackage` macro #;
|
||||||
%put #-------------------------------------------------------------------------------#;
|
%put #-------------------------------------------------------------------------------#;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to get previwe of a SAS packages, version `20221112` #;
|
%put # Macro to get previwe of a SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to unload SAS package, version 20221112. Run %unloadPackage() for help info.'
|
des = 'Macro to unload SAS package, version 20221121. Run %unloadPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -35,7 +35,7 @@ des = 'Macro to unload SAS package, version 20221112. 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 `20221112` #;
|
%put # Macro to unload SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
hashing_file() function, SAS 9.4M6 */
|
hashing_file() function, SAS 9.4M6 */
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to verify SAS package with the hash digest, version 20221112. Run %verifyPackage() for help info.'
|
des = 'Macro to verify SAS package with the hash digest, version 20221121. Run %verifyPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -28,7 +28,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20221112. Run %
|
|||||||
%put ### This is short help information for the `verifyPackage` macro #;
|
%put ### This is short help information for the `verifyPackage` macro #;
|
||||||
%put #-------------------------------------------------------------------------------#;
|
%put #-------------------------------------------------------------------------------#;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to verify SAS package with it hash digest, version `20221112` #;
|
%put # Macro to verify SAS package with it hash digest, version `20221121` #;
|
||||||
%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 #;
|
||||||
|
|||||||
@@ -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.
|
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 **`20221112`**.
|
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20221121`**.
|
||||||
|
|
||||||
**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).
|
**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>
|
## This is short help information for the `installPackage` macro <a name="installpackage"></a>
|
||||||
--------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Macro to install SAS packages, version `20221112`
|
Macro to install SAS packages, version `20221121`
|
||||||
|
|
||||||
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
|
||||||
@@ -141,7 +141,7 @@ filename packages "C:/SAS_PACKAGES";
|
|||||||
## This is short help information for the `helpPackage` macro <a name="helppackage"></a>
|
## This is short help information for the `helpPackage` macro <a name="helppackage"></a>
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Macro to get help about SAS packages, version `20221112`
|
Macro to get help about SAS packages, version `20221121`
|
||||||
|
|
||||||
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
|
||||||
@@ -211,7 +211,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
|||||||
## This is short help information for the `loadPackage` macro <a name="loadpackage"></a>
|
## This is short help information for the `loadPackage` macro <a name="loadpackage"></a>
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Macro to *load* SAS packages, version `20221112`
|
Macro to *load* SAS packages, version `20221121`
|
||||||
|
|
||||||
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
|
||||||
@@ -243,24 +243,29 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
|||||||
package is provided in required version,
|
package is provided in required version,
|
||||||
default value: `.`
|
default value: `.`
|
||||||
|
|
||||||
- `lazyData=` *Optional.* A list of names of lazy datasets to be
|
- `lazyData=` *Optional.* A space separated list of names of lazy
|
||||||
loaded. If not null datasets from the list are loaded
|
datasets to be loaded. If not null datasets from the
|
||||||
instead of the package.
|
list are loaded instead of the package.
|
||||||
An asterisk (*) means *load all lazy datasets*.
|
An asterisk (*) means *load all lazy datasets*.
|
||||||
|
|
||||||
- `zip=` Standard package is zip (lowcase),
|
- `zip=` *Optional.* Standard package is zip (lowcase),
|
||||||
e.g. `%loadPackage(PiPackage)`.
|
e.g. `%loadPackage(PiPackage)`.
|
||||||
If the zip is not available use a folder.
|
If the zip is not available use a folder.
|
||||||
Unpack data to "pipackage.disk" folder
|
Unpack data to "pipackage.disk" folder
|
||||||
and use loadPackage in the following form:
|
and use loadPackage in the following form:
|
||||||
`%loadPackage(PiPackage, zip=disk, options=)`
|
`%loadPackage(PiPackage, zip=disk, options=)`
|
||||||
|
|
||||||
|
- `cherryPick=` *Optional.* A space separated list of selected elements
|
||||||
|
of the package to be loaded into the SAS session.
|
||||||
|
Default value of an asterisk (*) means:
|
||||||
|
"load all elements of the package".
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||||
to learn more.
|
to learn more.
|
||||||
|
|
||||||
## Example ####################################################################
|
## Example 1 ##################################################################
|
||||||
|
|
||||||
Enabling the SAS Package Framework
|
Enabling the SAS Package Framework
|
||||||
from the local directory and installing & loading
|
from the local directory and installing & loading
|
||||||
@@ -280,11 +285,30 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
|||||||
%unloadPackage(SQLinDS) %* unload the package content from the SAS session;
|
%unloadPackage(SQLinDS) %* unload the package content from the SAS session;
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
## Example 2 ##################################################################
|
||||||
|
|
||||||
|
Enabling the SAS Package Framework
|
||||||
|
from the local directory and installing & cherry picking
|
||||||
|
elements of the BasePlus package.
|
||||||
|
|
||||||
|
Assume that the `SPFinit.sas` file
|
||||||
|
is located in the "C:/SAS_PACKAGES/" folder.
|
||||||
|
|
||||||
|
Run the following code in your SAS session:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||||
|
%include packages(SPFinit.sas); %* enable the framework;
|
||||||
|
|
||||||
|
%installPackage(BasePlus) %* install the package from the Internet;
|
||||||
|
%loadPackage(BasePlus, cherryPick=getVars) %* cherry pick the content;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## This is short help information for the `loadPackageS` macro <a name="loadpackages"></a>
|
## This is short help information for the `loadPackageS` macro <a name="loadpackages"></a>
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Macro wrapper for the loadPackage macro, version `20221112`
|
Macro wrapper for the loadPackage macro, version `20221121`
|
||||||
|
|
||||||
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
|
||||||
@@ -333,7 +357,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
|||||||
## This is short help information for the `unloadPackage` macro <a name="unloadpackage"></a>
|
## This is short help information for the `unloadPackage` macro <a name="unloadpackage"></a>
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Macro to unload SAS packages, version `20221112`
|
Macro to unload SAS packages, version `20221121`
|
||||||
|
|
||||||
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
|
||||||
@@ -398,7 +422,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
|||||||
## This is short help information for the `listPackages` macro <a name="listpackages"></a>
|
## This is short help information for the `listPackages` macro <a name="listpackages"></a>
|
||||||
-----------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Macro to list available SAS packages, version `20221112`
|
Macro to list available SAS packages, version `20221121`
|
||||||
|
|
||||||
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
|
||||||
@@ -439,7 +463,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
|||||||
## This is short help information for the `verifyPackage` macro <a name="verifypackage"></a>
|
## This is short help information for the `verifyPackage` macro <a name="verifypackage"></a>
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Macro to verify SAS package with it hash digest, version `20221112`
|
Macro to verify SAS package with it hash digest, version `20221121`
|
||||||
|
|
||||||
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
|
||||||
@@ -493,7 +517,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>
|
## This is short help information for the `previewPackage` macro <a name="previewpackage"></a>
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Macro to get previwe of a SAS packages, version `20221112`
|
Macro to get previwe of a SAS packages, version `20221121`
|
||||||
|
|
||||||
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
|
||||||
@@ -560,7 +584,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
|||||||
## This is short help information for the `generatePackage` macro <a name="generatepackage"></a>
|
## This is short help information for the `generatePackage` macro <a name="generatepackage"></a>
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Macro to generate SAS packages, version `20221112`
|
Macro to generate SAS packages, version `20221121`
|
||||||
|
|
||||||
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
|
||||||
@@ -744,7 +768,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>
|
## This is short help information for the `extendPackagesFileref` macro <a name="extendpackagesfileref"></a>
|
||||||
-----------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Macro to list directories pointed by 'packages' fileref, version `20221112`
|
Macro to list directories pointed by 'packages' fileref, version `20221121`
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
365
SPF/SPFinit.sas
365
SPF/SPFinit.sas
@@ -42,7 +42,7 @@
|
|||||||
- to unload, or
|
- to unload, or
|
||||||
- to generate SAS packages.
|
- to generate SAS packages.
|
||||||
|
|
||||||
Version 20221112.
|
Version 20221121.
|
||||||
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
|
||||||
@@ -80,9 +80,14 @@
|
|||||||
and use loadPackage in the form:
|
and use loadPackage in the form:
|
||||||
%loadPackage(PiPackage, zip=disk, options=)
|
%loadPackage(PiPackage, zip=disk, options=)
|
||||||
*/
|
*/
|
||||||
|
, cherryPick=* /* space separated list of selected elements of the package
|
||||||
|
to be loaded into the session, default value "*" means
|
||||||
|
"load all elements of the package"
|
||||||
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help info.'
|
des = 'Macro to load SAS package, version 20221121. Run %loadPackage() for help info.'
|
||||||
|
minoperator
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -97,7 +102,7 @@ des = 'Macro to load SAS package, version 20221112. 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 `20221112` #;
|
%put # Macro to *load* SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -129,24 +134,29 @@ des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help
|
|||||||
%put # package is provided in required version, #;
|
%put # package is provided in required version, #;
|
||||||
%put # default value: `.` #;
|
%put # default value: `.` #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # - `lazyData=` *Optional.* A list of names of lazy datasets to be #;
|
%put # - `lazyData=` *Optional.* A space separated list of names of lazy #;
|
||||||
%put # loaded. If not null datasets from the list are loaded #;
|
%put # datasets to be loaded. If not null datasets from the #;
|
||||||
%put # instead of the package. #;
|
%put # list are loaded instead of the package. #;
|
||||||
%put # An asterisk (*) means *load all lazy datasets*. #;
|
%put # An asterisk (*) means *load all lazy datasets*. #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # - `zip=` Standard package is zip (lowcase), #;
|
%put # - `zip=` *Optional.* Standard package is zip (lowcase), #;
|
||||||
%put # e.g. `%nrstr(%%loadPackage(PiPackage))`. #;
|
%put # e.g. `%nrstr(%%loadPackage(PiPackage))`. #;
|
||||||
%put # If the zip is not available use a folder. #;
|
%put # If the zip is not available use a folder. #;
|
||||||
%put # Unpack data to "pipackage.disk" folder #;
|
%put # Unpack data to "pipackage.disk" folder #;
|
||||||
%put # and use loadPackage in the following form: #;
|
%put # and use loadPackage in the following form: #;
|
||||||
%put # `%nrstr(%%loadPackage(PiPackage, zip=disk, options=))` #;
|
%put # `%nrstr(%%loadPackage(PiPackage, zip=disk, options=))` #;
|
||||||
%put # #;
|
%put # #;
|
||||||
|
%put # - `cherryPick=` *Optional.* A space separated list of selected elements #;
|
||||||
|
%put # of the package to be loaded into the SAS session. #;
|
||||||
|
%put # Default value of an asterisk (*) means: #;
|
||||||
|
%put # "load all elements of the package". #;
|
||||||
|
%put # #;
|
||||||
%put #-------------------------------------------------------------------------------#;
|
%put #-------------------------------------------------------------------------------#;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||||
%put # to learn more. #;
|
%put # to learn more. #;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put ### Example #####################################################################;
|
%put ### Example 1 ###################################################################;
|
||||||
%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 #;
|
||||||
@@ -165,6 +175,25 @@ des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help
|
|||||||
%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 ### Example 2 ###################################################################;
|
||||||
|
%put # #;
|
||||||
|
%put # Enabling the SAS Package Framework #;
|
||||||
|
%put # from the local directory and installing & cherry picking #;
|
||||||
|
%put # elements of the BasePlus package. #;
|
||||||
|
%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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas;
|
||||||
|
%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(BasePlus) %%* install the package from the Internet; );
|
||||||
|
%put %nrstr( %%loadPackage(BasePlus, cherryPick=getVars) %%* cherry pick the content; );
|
||||||
|
%put ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
|
||||||
|
%put # #;
|
||||||
%put #################################################################################;
|
%put #################################################################################;
|
||||||
%put ;
|
%put ;
|
||||||
options &options_tmp.;
|
options &options_tmp.;
|
||||||
@@ -200,6 +229,19 @@ des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help
|
|||||||
if exists then call symputx("path", p, "L");
|
if exists then call symputx("path", p, "L");
|
||||||
run;
|
run;
|
||||||
|
|
||||||
|
/* convert cherryPick to lower case if needed */
|
||||||
|
%if NOT (%str(*) = %superq(cherryPick)) %then
|
||||||
|
%do;
|
||||||
|
data _null_;
|
||||||
|
call symputX("cherryPick",lowcase(compbl(compress(symget("cherryPick"),". _","KDA"))),"L");
|
||||||
|
run;
|
||||||
|
%end;
|
||||||
|
/* empty list is equivalent to "*" */
|
||||||
|
%if %superq(cherryPick)= %then
|
||||||
|
%do;
|
||||||
|
%let cherryPick=*;
|
||||||
|
%end;
|
||||||
|
|
||||||
filename &_PackageFileref_. &ZIP.
|
filename &_PackageFileref_. &ZIP.
|
||||||
/* put location of package myPackageFile.zip here */
|
/* put location of package myPackageFile.zip here */
|
||||||
"&path./%lowcase(&packageName.).&zip." %unquote(&options.)
|
"&path./%lowcase(&packageName.).&zip." %unquote(&options.)
|
||||||
@@ -239,7 +281,11 @@ des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help
|
|||||||
;
|
;
|
||||||
%if %bquote(&lazyData.) = %then
|
%if %bquote(&lazyData.) = %then
|
||||||
%do;
|
%do;
|
||||||
|
%local tempLoad_minoperator;
|
||||||
|
%let tempLoad_minoperator = %sysfunc(getoption(minoperator));
|
||||||
|
options minoperator; /* MinOperator option is required for cherryPicking to work */
|
||||||
%include &_PackageFileref_.(load.sas) / &source2.;
|
%include &_PackageFileref_.(load.sas) / &source2.;
|
||||||
|
options &tempLoad_minoperator.;
|
||||||
%end;
|
%end;
|
||||||
%else
|
%else
|
||||||
%do;
|
%do;
|
||||||
@@ -283,7 +329,7 @@ des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help
|
|||||||
*/
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to unload SAS package, version 20221112. Run %unloadPackage() for help info.'
|
des = 'Macro to unload SAS package, version 20221121. Run %unloadPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -298,7 +344,7 @@ des = 'Macro to unload SAS package, version 20221112. 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 `20221112` #;
|
%put # Macro to unload SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -443,7 +489,7 @@ des = 'Macro to unload SAS package, version 20221112. Run %unloadPackage() for h
|
|||||||
*/
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to get help about SAS package, version 20221112. Run %helpPackage() for help info.'
|
des = 'Macro to get help about SAS package, version 20221121. Run %helpPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -458,7 +504,7 @@ des = 'Macro to get help about SAS package, version 20221112. 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 `20221112` #;
|
%put # Macro to get help about SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -588,7 +634,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 20221112 */
|
/* Macros to install SAS packages, version 20221121 */
|
||||||
/* 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
|
||||||
@@ -611,7 +657,7 @@ TODO:
|
|||||||
/secure
|
/secure
|
||||||
minoperator
|
minoperator
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to install SAS package, version 20221112. Run %%installPackage() for help info.'
|
des = 'Macro to install SAS package, version 20221121. Run %%installPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -626,7 +672,7 @@ des = 'Macro to install SAS package, version 20221112. Run %%installPackage() fo
|
|||||||
%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 `20221112` #;
|
%put # Macro to install SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -1055,7 +1101,7 @@ des = 'Macro to install SAS package, version 20221112. Run %%installPackage() fo
|
|||||||
|
|
||||||
/* Macro to list SAS packages in packages folder.
|
/* Macro to list SAS packages in packages folder.
|
||||||
|
|
||||||
Version 20221112
|
Version 20221121
|
||||||
|
|
||||||
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
|
||||||
@@ -1076,7 +1122,7 @@ des = 'Macro to install SAS package, version 20221112. Run %%installPackage() fo
|
|||||||
/*+listPackages+*/
|
/*+listPackages+*/
|
||||||
|
|
||||||
%macro listPackages()/secure PARMBUFF
|
%macro listPackages()/secure PARMBUFF
|
||||||
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20221112.'
|
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20221121.'
|
||||||
;
|
;
|
||||||
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
|
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -1091,7 +1137,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 `20221112` #;
|
%put # Macro to list available SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -1241,7 +1287,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
|||||||
|
|
||||||
/* Macro to generate SAS packages.
|
/* Macro to generate SAS packages.
|
||||||
|
|
||||||
Version 20221112
|
Version 20221121
|
||||||
|
|
||||||
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
|
||||||
@@ -1278,7 +1324,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
|||||||
default value 1 means "delete tests work" */
|
default value 1 means "delete tests work" */
|
||||||
)/ secure minoperator
|
)/ secure minoperator
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to generate SAS packages, version 20221112. Run %generatePackage() for help info.'
|
des = 'Macro to generate SAS packages, version 20221121. Run %generatePackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
|
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -1293,7 +1339,7 @@ des = 'Macro to generate SAS packages, version 20221112. 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 `20221112` #;
|
%put # Macro to generate SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -1473,7 +1519,7 @@ filename &_LIC_. "&filesLocation./license.sas" lrecl = 1024;
|
|||||||
%abort;
|
%abort;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if %bquote(&packageRequired.) ne %then
|
%if %superq(packageRequired) ne %then
|
||||||
%do;
|
%do;
|
||||||
/* turn off the note about quoted string length */
|
/* turn off the note about quoted string length */
|
||||||
%local qlenmax_fstimer_tmp;
|
%local qlenmax_fstimer_tmp;
|
||||||
@@ -1522,7 +1568,7 @@ filename &_LIC_. "&filesLocation./license.sas" lrecl = 1024;
|
|||||||
%if &tryExcept. %then %abort;
|
%if &tryExcept. %then %abort;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if %bquote(&packageReqPackages.) ne %then
|
%if %superq(packageReqPackages) ne %then
|
||||||
%do;
|
%do;
|
||||||
/* turn off the note about quoted string length */
|
/* turn off the note about quoted string length */
|
||||||
%local qlenmax_fstimer_tmp;
|
%local qlenmax_fstimer_tmp;
|
||||||
@@ -1937,12 +1983,12 @@ title3 "Package encoding: '&packageEncoding.', session encoding: '&SYSENCODING.'
|
|||||||
title4 " ______________________________ ";
|
title4 " ______________________________ ";
|
||||||
title5 "List of files for package: &packageName. (version &packageVersion.), license: &packageLicense.";
|
title5 "List of files for package: &packageName. (version &packageVersion.), license: &packageLicense.";
|
||||||
title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
|
title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
|
||||||
%if (%bquote(&packageRequired.) ne )
|
%if (%superq(packageRequired) ne )
|
||||||
or (%bquote(&packageReqPackages.) ne )
|
or (%superq(packageReqPackages) ne )
|
||||||
%then
|
%then
|
||||||
%do;
|
%do;
|
||||||
title7 "Required SAS licences: %qsysfunc(compress(%bquote(&packageRequired.), %str(%'%")))" ; /* ' */
|
title7 "Required SAS licences: %qsysfunc(compress(%superq(packageRequired), %str(%'%")))" ; /* ' */
|
||||||
title8 "Required SAS packages: %qsysfunc(compress(%bquote(&packageReqPackages.),%str(%'%")))" ; /* " */
|
title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
|
|
||||||
@@ -2115,7 +2161,14 @@ data _null_;
|
|||||||
put ' %if %bquote(&packageEncoding.) NE %then &packageEncoding. ; ';
|
put ' %if %bquote(&packageEncoding.) NE %then &packageEncoding. ; ';
|
||||||
put ' %else utf8 ; ';
|
put ' %else utf8 ; ';
|
||||||
put ' ; ';
|
put ' ; ';
|
||||||
|
|
||||||
|
put ' %local cherryPick; %let cherryPick=*; ';
|
||||||
|
put ' %local tempLoad_minoperator; ';
|
||||||
|
put ' %let tempLoad_minoperator = %sysfunc(getoption(minoperator)); ';
|
||||||
|
put ' options minoperator; ';
|
||||||
put ' %include &_PackageFileref_.(load.sas) / &source2.; ';
|
put ' %include &_PackageFileref_.(load.sas) / &source2.; ';
|
||||||
|
put ' options &tempLoad_minoperator.; ';
|
||||||
|
|
||||||
put ' filename &_PackageFileref_. clear; ';
|
put ' filename &_PackageFileref_. clear; ';
|
||||||
put ' %WrongVersionOFPackage: ';
|
put ' %WrongVersionOFPackage: ';
|
||||||
|
|
||||||
@@ -2123,7 +2176,6 @@ data _null_;
|
|||||||
put " ";
|
put " ";
|
||||||
run;
|
run;
|
||||||
|
|
||||||
|
|
||||||
/* loading package files */
|
/* loading package files */
|
||||||
%put NOTE-;
|
%put NOTE-;
|
||||||
%put NOTE: Preparing load file.;
|
%put NOTE: Preparing load file.;
|
||||||
@@ -2147,12 +2199,19 @@ data _null_;
|
|||||||
put ' %put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
put ' %put NOTE- *** START ***; ' /;
|
put ' %put NOTE- *** START ***; ' /;
|
||||||
|
|
||||||
|
put '%if NOT (%str(*)=%superq(cherryPick)) %then %do; '; /* Cherry Pick test0 start */
|
||||||
|
put ' %put NOTE- ;' /
|
||||||
|
' %put NOTE- *** Cherry Picking in action. ***; ' /
|
||||||
|
' %put NOTE- ;' ;
|
||||||
|
put '%end; '; /* Cherry Pick test0 end */
|
||||||
|
|
||||||
put '%include ' " &_PackageFileref_.(packagemetadata.sas) / nosource2; " /; /* <- copied also to loadPackage macro */
|
put '%include ' " &_PackageFileref_.(packagemetadata.sas) / nosource2; " /; /* <- copied also to loadPackage macro */
|
||||||
|
|
||||||
isFunction = 0;
|
isFunction = 0;
|
||||||
isFormat = 0;
|
isFormat = 0;
|
||||||
|
|
||||||
%if (%bquote(&packageRequired.) ne )
|
%if (%superq(packageRequired) ne )
|
||||||
or (%bquote(&packageReqPackages.) ne )
|
or (%superq(packageReqPackages) ne )
|
||||||
%then
|
%then
|
||||||
%do;
|
%do;
|
||||||
put ' data _null_; ';
|
put ' data _null_; ';
|
||||||
@@ -2160,7 +2219,7 @@ data _null_;
|
|||||||
put ' run; ';
|
put ' run; ';
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if %bquote(&packageRequired.) ne %then
|
%if %superq(packageRequired) ne %then
|
||||||
%do;
|
%do;
|
||||||
put ' %put NOTE- *Testing required SAS components*%sysfunc(DoSubL( '; /* <- DoSubL() is here */
|
put ' %put NOTE- *Testing required SAS components*%sysfunc(DoSubL( '; /* <- DoSubL() is here */
|
||||||
put ' options nonotes nosource %str(;) ';
|
put ' options nonotes nosource %str(;) ';
|
||||||
@@ -2223,11 +2282,13 @@ data _null_;
|
|||||||
put ' ))*; ';
|
put ' ))*; ';
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if %bquote(&packageReqPackages.) ne %then
|
%if %superq(packageReqPackages) ne %then
|
||||||
%do;
|
%do;
|
||||||
|
|
||||||
length packageReqPackages $ 32767;
|
length packageReqPackages $ 32767;
|
||||||
packageReqPackages = lowcase(symget('packageReqPackages'));
|
packageReqPackages = lowcase(symget('packageReqPackages'));
|
||||||
|
|
||||||
|
put '%if (%str(*)=%superq(cherryPick)) %then %do; /* test for Cherry Picking */ ';
|
||||||
/* try to load required packages */
|
/* try to load required packages */
|
||||||
put 'data _null_ ; ';
|
put 'data _null_ ; ';
|
||||||
put ' length req name $ 64 vers verR $ 24 versN verRN 8 SYSloadedPackages $ 32767; ';
|
put ' length req name $ 64 vers verR $ 24 versN verRN 8 SYSloadedPackages $ 32767; ';
|
||||||
@@ -2341,14 +2402,21 @@ data _null_;
|
|||||||
put ' end; ';
|
put ' end; ';
|
||||||
put ' stop; ';
|
put ' stop; ';
|
||||||
put 'run; ';
|
put 'run; ';
|
||||||
|
put '%end; ';
|
||||||
|
put '%else %do; ';
|
||||||
|
put ' %put NOTE- ; ';
|
||||||
|
put ' %put NOTE- Cherry Picking in action!! Be advised that; ';
|
||||||
|
put ' %put NOTE- dependencies/required packages will not be loaded!; ';
|
||||||
|
put '%end; ';
|
||||||
|
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
%if (%bquote(&packageRequired.) ne )
|
%if (%superq(packageRequired) ne )
|
||||||
or (%bquote(&packageReqPackages.) ne )
|
or (%superq(packageReqPackages) ne )
|
||||||
%then
|
%then
|
||||||
%do;
|
%do;
|
||||||
put ' data _null_; ';
|
put ' data _null_; ';
|
||||||
put ' if symget("packageRequiredErrors") = "1" then ';
|
put ' if 1 = symgetn("packageRequiredErrors") then ';
|
||||||
put ' do; ';
|
put ' do; ';
|
||||||
put ' put "ERROR: Loading package &packageName. will be aborted!";';
|
put ' put "ERROR: Loading package &packageName. will be aborted!";';
|
||||||
put ' put "ERROR- Required components are missing."; ';
|
put ' put "ERROR- Required components are missing."; ';
|
||||||
@@ -2358,7 +2426,9 @@ data _null_;
|
|||||||
put ' run; ';
|
put ' run; ';
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
do until(eof);
|
|
||||||
|
do until(eof); /* loopOverTypes - start */
|
||||||
|
|
||||||
set &filesWithCodes. end = EOF nobs=NOBS;
|
set &filesWithCodes. end = EOF nobs=NOBS;
|
||||||
by TYPE notsorted;
|
by TYPE notsorted;
|
||||||
if (upcase(type) in: ('CLEAN' 'LAZYDATA' 'TEST')) then continue; /* cleaning files are only included in unload.sas */
|
if (upcase(type) in: ('CLEAN' 'LAZYDATA' 'TEST')) then continue; /* cleaning files are only included in unload.sas */
|
||||||
@@ -2374,12 +2444,64 @@ data _null_;
|
|||||||
putlog 'WARNING: Type ' type 'is not yet supported.';
|
putlog 'WARNING: Type ' type 'is not yet supported.';
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
isFunction + (upcase(type)=:'FUNCTION');
|
||||||
|
isFormat + (upcase(type)=:'FORMAT');
|
||||||
|
isProto + (upcase(type)=:'PROTO');
|
||||||
|
|
||||||
|
/* HEADERS for IML, FCMP, and PROTO - start */
|
||||||
|
if 1 = isFunction and upcase(type)=:'FUNCTION' then
|
||||||
|
do;
|
||||||
|
/* macro variable for test if cherry picking used FCMP */
|
||||||
|
put 'data _null_; ';
|
||||||
|
put ' call symputX("cherryPick_FCMP", 0, "L"); ';
|
||||||
|
put 'run; ';
|
||||||
|
end;
|
||||||
|
if 1 = FIRST.type and upcase(type)='FUNCTIONS' then
|
||||||
|
do;
|
||||||
|
/* header for multiple functions in one FCMP run */
|
||||||
|
put "proc fcmp outlib = work.%lowcase(&packageName.fcmp).package ; ";
|
||||||
|
end;
|
||||||
|
if 1 = FIRST.type and upcase(type)='PROTO' then
|
||||||
|
do;
|
||||||
|
/* macro variable for test if cherry picking used PROTO */
|
||||||
|
put 'data _null_; ';
|
||||||
|
put ' call symputX("cherryPick_PROTO", 0, "L"); ';
|
||||||
|
put 'run; ';
|
||||||
|
/* header for multiple functions in one PROTO run */
|
||||||
|
put "proc proto package = work.%lowcase(&packageName.proto).package ; ";
|
||||||
|
end;
|
||||||
|
if 1 = FIRST.type and upcase(type)='IMLMODULE' then
|
||||||
|
do;
|
||||||
|
/* macro variable for test if cherry picking used IML */
|
||||||
|
put 'data _null_; ';
|
||||||
|
put ' call symputX("cherryPick_IML", 0, "L"); ';
|
||||||
|
put 'run; ';
|
||||||
|
/* header, for IML modules */
|
||||||
|
put "proc iml ; ";
|
||||||
|
end;
|
||||||
|
if 1 = FIRST.type and upcase(type)='FORMATS' then
|
||||||
|
do;
|
||||||
|
/* header, for FORMATS */
|
||||||
|
put "proc format lib = work.%lowcase(&packageName.format) ; ";
|
||||||
|
end;
|
||||||
|
if 1 = isFormat and upcase(type)=:'FORMAT' then
|
||||||
|
do;
|
||||||
|
/* macro variable for test if cherry picking used FORMAT */
|
||||||
|
put 'data _null_; ';
|
||||||
|
put ' call symputX("cherryPick_FORMAT", 0, "L"); ';
|
||||||
|
put 'run; ';
|
||||||
|
end;
|
||||||
|
/* HEADERS for IML, FCMP, and PROTO - end */
|
||||||
|
|
||||||
|
put ' ' /
|
||||||
|
'%if (%str(*)=%superq(cherryPick)) or (' fileshort +(-1) ' in %superq(cherryPick)) %then %do; '; /* Cherry Pick test1 start */
|
||||||
put ' %put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
put '%put NOTE: Element of type ' type 'from the file "' file +(-1) '" will be included;';
|
put ' %put NOTE: >> Element of type ' type 'from the file "' file +(-1) '" will be included <<;';
|
||||||
|
|
||||||
if upcase(type)=:'MACRO' then
|
if upcase(type)=:'MACRO' then
|
||||||
put '%put %sysfunc(ifc(%SYSMACEXIST(' fileshort ')=1, NOTE# Macro ' fileshort
|
put ' %put %sysfunc(ifc(%SYSMACEXIST(' fileshort +(-1) ')=1, NOTE# Macro ' fileshort
|
||||||
"exist. It will be overwritten by the macro from the &packageName. package, ));";
|
"exist. It will be overwritten by the macro from the &packageName. package, ));";
|
||||||
put " ";
|
|
||||||
|
|
||||||
if upcase(type)=:'EXEC' then
|
if upcase(type)=:'EXEC' then
|
||||||
do;
|
do;
|
||||||
@@ -2390,74 +2512,114 @@ data _null_;
|
|||||||
put " infile &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') lrecl=32767;';
|
put " infile &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') lrecl=32767;';
|
||||||
put ' input;';
|
put ' input;';
|
||||||
put ' putlog "*> " _infile_;';
|
put ' putlog "*> " _infile_;';
|
||||||
put 'run;' /;
|
put ' run;';
|
||||||
put ' %put NOTE- *****************************;';
|
put ' %put NOTE- *****************************;';
|
||||||
put ' %put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
/* HEADERS for IML, FCMP, and PROTO */
|
|
||||||
if 1 = FIRST.type and upcase(type)='FUNCTIONS' then /* header, for multiple functions in one FCMP run */
|
|
||||||
do;
|
|
||||||
put "proc fcmp outlib = work.%lowcase(&packageName.fcmp).package ; ";
|
|
||||||
end;
|
|
||||||
if 1 = FIRST.type and upcase(type)='PROTO' then /* header, for multiple functions in one PROTO 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 */
|
|
||||||
do;
|
|
||||||
put "proc iml ; ";
|
|
||||||
end;
|
|
||||||
if 1 = FIRST.type and upcase(type)='FORMATS' then /* header, for FORMATS */
|
|
||||||
do;
|
|
||||||
put "proc format lib = work.%lowcase(&packageName.format) ; ";
|
|
||||||
end;
|
|
||||||
|
|
||||||
/* 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, FCMP, and PROTO */
|
if upcase(type)=:'IMLMODULE' then
|
||||||
|
put ' %let cherryPick_IML = %eval(&cherryPick_IML. + 1);';
|
||||||
|
|
||||||
|
if upcase(type)=:'FUNCTION' then
|
||||||
|
put ' %let cherryPick_FCMP = %eval(&cherryPick_FCMP. + 1);';
|
||||||
|
|
||||||
|
if upcase(type)=:'PROTO' then
|
||||||
|
put ' %let cherryPick_PROTO = %eval(&cherryPick_PROTO. + 1);';
|
||||||
|
|
||||||
|
if upcase(type)=:'FORMAT' then
|
||||||
|
put ' %let cherryPick_FORMAT = %eval(&cherryPick_FORMAT. + 1);';
|
||||||
|
|
||||||
|
put '%end; ' /; /* Cherry Pick test1 end */
|
||||||
|
|
||||||
|
|
||||||
|
/* FOOTERS for IML, FCMP, and PROTO - start */
|
||||||
if 1 = LAST.type and upcase(type) in ('FUNCTIONS' 'PROTO' 'FORMATS') then
|
if 1 = LAST.type and upcase(type) in ('FUNCTIONS' 'PROTO' 'FORMATS') then
|
||||||
do; /* footer, for multiple functions in one FCMP run, one PROTO run, or one FORMAT run */
|
do; /* footer, for multiple functions in one FCMP run, one PROTO run, or one FORMAT run */
|
||||||
put "run; ";
|
put "run; " / ;
|
||||||
end;
|
end;
|
||||||
if 1 = LAST.type and upcase(type)='IMLMODULE' then /* footer, for IML modules */
|
if 1 = LAST.type and upcase(type)='IMLMODULE' then /* footer, for IML modules */
|
||||||
do;
|
do;
|
||||||
put "reset storage = WORK.&packageName.IML; "; /* set the storage location for modules */
|
put '%if 0 < &cherryPick_IML. %then %do; ' /
|
||||||
put "store module = _ALL_; "; /* and store all created modules */
|
"reset storage = WORK.&packageName.IML; " / /* set the storage location for modules */
|
||||||
put "quit; ";
|
"store module = _ALL_; " / /* and store all created modules */
|
||||||
|
'%end; ' /
|
||||||
|
"quit; " / ;
|
||||||
end;
|
end;
|
||||||
|
/* FOOTERS for IML, FCMP, and PROTO - end */
|
||||||
isFunction + (upcase(type)=:'FUNCTION');
|
|
||||||
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));"/;
|
||||||
put '%put NOTE- ;';
|
|
||||||
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
/* add the link to the proto functions dataset, 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
|
if 1 = isProto and (upcase(type)=:'PROTO') then
|
||||||
do;
|
do;
|
||||||
put "options APPEND=(cmplib = work.%lowcase(&packageName.proto));";
|
put "options APPEND=(cmplib = work.%lowcase(&packageName.proto));"/;
|
||||||
put '%put NOTE- ;';
|
|
||||||
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 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));"/;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end; /* loopOverTypes - start */
|
||||||
|
|
||||||
|
|
||||||
|
/* cherry pick clean in cmplib for functions */
|
||||||
|
if isFunction then
|
||||||
|
do;
|
||||||
|
put '%if 0 = &cherryPick_FCMP. %then %do;';
|
||||||
|
put 'options cmplib = (%unquote(%sysfunc(tranwrd(' /
|
||||||
|
'%lowcase(%sysfunc(getoption(cmplib)))' /
|
||||||
|
',%str(' "work.%lowcase(&packageName.fcmp)" '), %str() ))));';
|
||||||
|
put 'options cmplib = (%unquote(%sysfunc(compress(' /
|
||||||
|
'%sysfunc(getoption(cmplib))' /
|
||||||
|
',%str(()) ))));';
|
||||||
|
put '%end;';
|
||||||
|
end;
|
||||||
|
/* cherry pick clean in cmplib for proto */
|
||||||
|
if isProto then
|
||||||
|
do;
|
||||||
|
put '%if 0 = &cherryPick_PROTO. %then %do;';
|
||||||
|
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 "proc delete data=work.%lowcase(&packageName.proto); run;";
|
||||||
|
put '%end;';
|
||||||
|
end;
|
||||||
|
/* list cmplib for functions */
|
||||||
|
if isFunction OR isProto then
|
||||||
|
do;
|
||||||
|
put '%put NOTE- ;';
|
||||||
|
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
|
||||||
|
end;
|
||||||
|
|
||||||
|
/* list fmtsearch for formats */
|
||||||
|
if isFormat then
|
||||||
|
do;
|
||||||
|
put '%if 0 = &cherryPick_FCMP. %then %do;';
|
||||||
|
put 'options fmtsearch = (%unquote(%sysfunc(tranwrd(' /
|
||||||
|
'%lowcase(%sysfunc(getoption(fmtsearch)))' /
|
||||||
|
',%str(' "work.%lowcase(&packageName.)format" '), %str() ))));';
|
||||||
|
put 'options fmtsearch = (%unquote(%sysfunc(compress(' /
|
||||||
|
'%sysfunc(getoption(fmtsearch))' /
|
||||||
|
', %str(()) ))));';
|
||||||
|
put '%end;';
|
||||||
put '%put NOTE- ;';
|
put '%put NOTE- ;';
|
||||||
put '%put NOTE:[FMTSEARCH] %sysfunc(getoption(fmtsearch));'/;
|
put '%put NOTE:[FMTSEARCH] %sysfunc(getoption(fmtsearch));'/;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
|
|
||||||
/* update SYSloadedPackages global macrovariable */
|
/* update SYSloadedPackages global macrovariable */
|
||||||
|
put '%if (%str(*)=%superq(cherryPick)) %then %do; '; /* Cherry Pick test3 start */
|
||||||
put ' data _null_ ; ';
|
put ' data _null_ ; ';
|
||||||
put ' length SYSloadedPackages stringPCKG $ 32767; ';
|
put ' length SYSloadedPackages stringPCKG $ 32767; ';
|
||||||
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
|
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
|
||||||
@@ -2492,7 +2654,8 @@ data _null_;
|
|||||||
put " put 'NOTE: SYSloadedPackages = &packageName.(&packageVersion.)'; ";
|
put " put 'NOTE: SYSloadedPackages = &packageName.(&packageVersion.)'; ";
|
||||||
put ' end; ';
|
put ' end; ';
|
||||||
put ' stop; ';
|
put ' stop; ';
|
||||||
put 'run; ' / ;
|
put ' run; ';
|
||||||
|
put '%end; ' / ; /* Cherry Pick test3 end */
|
||||||
|
|
||||||
put '%put NOTE- ;';
|
put '%put NOTE- ;';
|
||||||
put '%put NOTE: '"Loading package &packageName., version &packageVersion., license &packageLicense.;";
|
put '%put NOTE: '"Loading package &packageName., version &packageVersion., license &packageLicense.;";
|
||||||
@@ -2537,7 +2700,7 @@ data _null_;
|
|||||||
put 'do;';
|
put 'do;';
|
||||||
put ' put "NOTE- Dataset ' fileshort 'from the file ""' file +(-1) '"" will be loaded";';
|
put ' put "NOTE- Dataset ' fileshort 'from the file ""' file +(-1) '"" will be loaded";';
|
||||||
put ' call execute(''%nrstr(%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;)'');';
|
put ' call execute(''%nrstr(%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;)'');';
|
||||||
put 'end;';
|
put 'end;' /;
|
||||||
end;
|
end;
|
||||||
/* use lazyData to reload data type */
|
/* use lazyData to reload data type */
|
||||||
if ( upcase(type) =: 'DATA' ) then
|
if ( upcase(type) =: 'DATA' ) then
|
||||||
@@ -2546,7 +2709,7 @@ data _null_;
|
|||||||
put 'do;';
|
put 'do;';
|
||||||
put ' put "NOTE- Dataset ' fileshort 'from the file ""' file +(-1) '"" will be loaded";';
|
put ' put "NOTE- Dataset ' fileshort 'from the file ""' file +(-1) '"" will be loaded";';
|
||||||
put ' call execute(''%nrstr(%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;)'');';
|
put ' call execute(''%nrstr(%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;)'');';
|
||||||
put 'end;';
|
put 'end;' /;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -2590,7 +2753,7 @@ data _null_;
|
|||||||
put ' putlog "*> " _infile_;';
|
put ' putlog "*> " _infile_;';
|
||||||
put 'run;' /;
|
put 'run;' /;
|
||||||
put '%put NOTE- *****************************;';
|
put '%put NOTE- *****************************;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
|
|
||||||
put '%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;' /;
|
put '%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;' /;
|
||||||
end;
|
end;
|
||||||
@@ -2609,8 +2772,8 @@ data _null_;
|
|||||||
set &filesWithCodes. end = EOF nobs = NOBS;
|
set &filesWithCodes. end = EOF nobs = NOBS;
|
||||||
if not (upcase(type)=:'MACRO') then continue;
|
if not (upcase(type)=:'MACRO') then continue;
|
||||||
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
put ',"' fileshort upcase32. '"';
|
put ',"' fileshort upcase32. '"' /;
|
||||||
end;
|
end;
|
||||||
/**/
|
/**/
|
||||||
put ' )';
|
put ' )';
|
||||||
@@ -2627,8 +2790,8 @@ data _null_;
|
|||||||
set &filesWithCodes. end = EOF;
|
set &filesWithCodes. end = EOF;
|
||||||
if not (upcase(type)=:'FORMAT') then continue;
|
if not (upcase(type)=:'FORMAT') then continue;
|
||||||
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
put ',"' fileshort upcase32. '"';
|
put ',"' fileshort upcase32. '"' /;
|
||||||
isFormat + 1;
|
isFormat + 1;
|
||||||
end;
|
end;
|
||||||
put ' )';
|
put ' )';
|
||||||
@@ -2700,8 +2863,8 @@ data _null_;
|
|||||||
set &filesWithCodes. end = EOF;
|
set &filesWithCodes. end = EOF;
|
||||||
if not (upcase(type)=:'FUNCTION') then continue;
|
if not (upcase(type)=:'FUNCTION') then continue;
|
||||||
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
put 'deletefunc ' fileshort ';';
|
put 'deletefunc ' fileshort ';' /;
|
||||||
isFunction + 1;
|
isFunction + 1;
|
||||||
end;
|
end;
|
||||||
put "run;" /;
|
put "run;" /;
|
||||||
@@ -2741,8 +2904,8 @@ data _null_;
|
|||||||
set &filesWithCodes. end = EOF;
|
set &filesWithCodes. end = EOF;
|
||||||
if not (upcase(type)=:'DATA') then continue;
|
if not (upcase(type)=:'DATA') then continue;
|
||||||
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
put 'drop table ' fileshort ';';
|
put 'drop table ' fileshort ';' /;
|
||||||
end;
|
end;
|
||||||
put "quit;" /;
|
put "quit;" /;
|
||||||
|
|
||||||
@@ -2752,8 +2915,8 @@ data _null_;
|
|||||||
set &filesWithCodes. end = EOF;
|
set &filesWithCodes. end = EOF;
|
||||||
if not (upcase(type)=:'LIBNAME') then continue;
|
if not (upcase(type)=:'LIBNAME') then continue;
|
||||||
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be cleared;';
|
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be cleared;';
|
||||||
put '%put NOTE- ;' /;
|
put '%put NOTE- ;';
|
||||||
put 'libname ' fileshort ' clear;';
|
put 'libname ' fileshort ' clear;' /;
|
||||||
end;
|
end;
|
||||||
put "run;" /;
|
put "run;" /;
|
||||||
|
|
||||||
@@ -2770,7 +2933,7 @@ data _null_;
|
|||||||
put ' put '' %unloadPackage( '' name ")" ; ';
|
put ' put '' %unloadPackage( '' name ")" ; ';
|
||||||
put ' end ; ';
|
put ' end ; ';
|
||||||
put ' put "NOTE-" / "NOTE-"; stop; ';
|
put ' put "NOTE-" / "NOTE-"; stop; ';
|
||||||
put 'run; ';
|
put 'run; ' /;
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
|
|
||||||
@@ -2799,7 +2962,7 @@ data _null_;
|
|||||||
|
|
||||||
put '%put NOTE: ' "Unloading package &packageName., version &packageVersion., license &packageLicense.;";
|
put '%put NOTE: ' "Unloading package &packageName., version &packageVersion., license &packageLicense.;";
|
||||||
put '%put NOTE- *** END ***;';
|
put '%put NOTE- *** END ***;';
|
||||||
put '%put NOTE- ;';
|
put '%put NOTE- ;' /;
|
||||||
|
|
||||||
put "/* unload.sas end */";
|
put "/* unload.sas end */";
|
||||||
stop;
|
stop;
|
||||||
@@ -2997,7 +3160,7 @@ data _null_;
|
|||||||
put ' end ; ';
|
put ' end ; ';
|
||||||
%end;
|
%end;
|
||||||
|
|
||||||
put 'put "***"; put "* SAS package generated by generatePackage, version 20221112 *"; put "***";';
|
put 'put "***"; put "* SAS package generated by generatePackage, version 20221121 *"; put "***";';
|
||||||
|
|
||||||
put 'run; ' /;
|
put 'run; ' /;
|
||||||
|
|
||||||
@@ -3861,7 +4024,7 @@ TODO: (in Polish)
|
|||||||
*/
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to load multiple SAS packages at one run, version 20221112. Run %loadPackages() for help info.'
|
des = 'Macro to load multiple SAS packages at one run, version 20221121. Run %loadPackages() for help info.'
|
||||||
parmbuff
|
parmbuff
|
||||||
;
|
;
|
||||||
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||||
@@ -3877,7 +4040,7 @@ parmbuff
|
|||||||
%put ### This is short help information for the `loadPackageS` macro #;
|
%put ### This is short help information for the `loadPackageS` macro #;
|
||||||
%put #-------------------------------------------------------------------------------#;
|
%put #-------------------------------------------------------------------------------#;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro wrapper for the loadPackage macro, version `20221112` #;
|
%put # Macro wrapper for the loadPackage macro, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -3974,7 +4137,7 @@ parmbuff
|
|||||||
hashing_file() function, SAS 9.4M6 */
|
hashing_file() function, SAS 9.4M6 */
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to verify SAS package with the hash digest, version 20221112. Run %verifyPackage() for help info.'
|
des = 'Macro to verify SAS package with the hash digest, version 20221121. Run %verifyPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -3989,7 +4152,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20221112. Run %
|
|||||||
%put ### This is short help information for the `verifyPackage` macro #;
|
%put ### This is short help information for the `verifyPackage` macro #;
|
||||||
%put #-------------------------------------------------------------------------------#;
|
%put #-------------------------------------------------------------------------------#;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to verify SAS package with it hash digest, version `20221112` #;
|
%put # Macro to verify SAS package with it hash digest, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -4160,7 +4323,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20221112. Run %
|
|||||||
*/
|
*/
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to preview content of a SAS package, version 20221112. Run %previewPackage() for help info.'
|
des = 'Macro to preview content of a SAS package, version 20221121. Run %previewPackage() for help info.'
|
||||||
;
|
;
|
||||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||||
%do;
|
%do;
|
||||||
@@ -4175,7 +4338,7 @@ des = 'Macro to preview content of a SAS package, version 20221112. Run %preview
|
|||||||
%put ### This is short help information for the `previewPackage` macro #;
|
%put ### This is short help information for the `previewPackage` macro #;
|
||||||
%put #-------------------------------------------------------------------------------#;
|
%put #-------------------------------------------------------------------------------#;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to get previwe of a SAS packages, version `20221112` #;
|
%put # Macro to get previwe of a SAS packages, version `20221121` #;
|
||||||
%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 #;
|
||||||
@@ -4302,7 +4465,7 @@ des = 'Macro to preview content of a SAS package, version 20221112. Run %preview
|
|||||||
when empty the "packages" value is used */
|
when empty the "packages" value is used */
|
||||||
)/secure
|
)/secure
|
||||||
/*** HELP END ***/
|
/*** HELP END ***/
|
||||||
des = 'Macro to list directories pointed by "packages" fileref, version 20221112. Run %extendPackagesFileref(HELP) for help info.'
|
des = 'Macro to list directories pointed by "packages" fileref, version 20221121. Run %extendPackagesFileref(HELP) for help info.'
|
||||||
;
|
;
|
||||||
|
|
||||||
%if %QUPCASE(&packages.) = HELP %then
|
%if %QUPCASE(&packages.) = HELP %then
|
||||||
@@ -4318,7 +4481,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20221112
|
|||||||
%put ### This is short help information for the `extendPackagesFileref` macro #;
|
%put ### This is short help information for the `extendPackagesFileref` macro #;
|
||||||
%put #-----------------------------------------------------------------------------------------#;;
|
%put #-----------------------------------------------------------------------------------------#;;
|
||||||
%put # #;
|
%put # #;
|
||||||
%put # Macro to list directories pointed by 'packages' fileref, version `20221112` #;
|
%put # Macro to list directories pointed by 'packages' fileref, version `20221121` #;
|
||||||
%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 #;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Packages:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- **SQLinDS**\[2.2.1\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g.
|
- **SQLinDS**\[2.2.2\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g.
|
||||||
```sas
|
```sas
|
||||||
data class;
|
data class;
|
||||||
set %SQL(
|
set %SQL(
|
||||||
@@ -22,7 +22,7 @@ data class;
|
|||||||
WH = weight + height;
|
WH = weight + height;
|
||||||
run;
|
run;
|
||||||
```
|
```
|
||||||
SHA256 digest for SQLinDS: A070214517CC36590083FCF9D5F488AC6E746793E94B9AA55D09A419CF291B5B
|
SHA256 digest for SQLinDS: 085F0B8BD4A59343E2913FF9635EA6E551ADD54E9678C35F5096D4A0A895B9C5
|
||||||
|
|
||||||
[Documentation for SQLinDS](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/sqlinds.md "Documentation for SQLinDS")
|
[Documentation for SQLinDS](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/sqlinds.md "Documentation for SQLinDS")
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ SHA256 digest for MacroCore: A23C29529F3CE7D0C8BEE9545C5D22D5B5594907547374A5135
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- **DFA** (Dynamic Function Arrays)\[0.5.1\], 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.5.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.
|
||||||
```sas
|
```sas
|
||||||
%createDFArray(ArrDynamic, resizefactor=17);
|
%createDFArray(ArrDynamic, resizefactor=17);
|
||||||
|
|
||||||
@@ -63,13 +63,13 @@ data _null_;
|
|||||||
end;
|
end;
|
||||||
run;
|
run;
|
||||||
```
|
```
|
||||||
SHA256 digest for DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6
|
SHA256 digest for DFA: 3F618EDAC8B4F4BE6C19D606E6BCC58121A16BA1383D2EE64C680B4B7FA9C96A
|
||||||
|
|
||||||
[Documentation for DFA](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/dfa.md "Documentation for DFA")
|
[Documentation for DFA](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/dfa.md "Documentation for DFA")
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- **macroArray**\[1.0.1\], implementation of an array concept in a macro language, e.g.
|
- **macroArray**\[1.0.2\], implementation of an array concept in a macro language, e.g.
|
||||||
```sas
|
```sas
|
||||||
%array(ABC[17] (111:127), macarray=Y);
|
%array(ABC[17] (111:127), macarray=Y);
|
||||||
|
|
||||||
@@ -88,13 +88,13 @@ SHA256 digest for DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163B
|
|||||||
which = 1:H:2
|
which = 1:H:2
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
SHA256 digest for macroArray: 371B92A5ABBE82C53F7D63BC5C0D1EBD4695603D3894D8A9A5D5777D1AB59B30
|
SHA256 digest for macroArray: DA57FFE85F49201FD61A53411D19E97FB5A6AC3C34E34FDF4B913545699551FF
|
||||||
|
|
||||||
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")
|
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- **BasePlus**\[1.17.1\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
- **BasePlus**\[1.17.2\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
||||||
```sas
|
```sas
|
||||||
call arrMissToRight(myArray);
|
call arrMissToRight(myArray);
|
||||||
call arrFillMiss(17, myArray);
|
call arrFillMiss(17, myArray);
|
||||||
@@ -112,25 +112,25 @@ format x bool.;
|
|||||||
|
|
||||||
%zipLibrary(sashelp,libOut=work)
|
%zipLibrary(sashelp,libOut=work)
|
||||||
```
|
```
|
||||||
SHA256 digest for BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4
|
SHA256 digest for BasePlus: EBA9EDB3D50D854288970CC0E965DA6AD5B057F6E6433EEBEC4A02B9A25CF6E2
|
||||||
|
|
||||||
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
|
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- **GSM** (Generate Secure Macros)\[0.20.1\], package allows
|
- **GSM** (Generate Secure Macros)\[0.20.2\], package allows
|
||||||
to create secured macros stored in SAS Proc FCMP functions.
|
to create secured macros stored in SAS Proc FCMP functions.
|
||||||
The dataset with functions can be shared between different operating systems
|
The dataset with functions can be shared between different operating systems
|
||||||
and allows to generate macros on site without showing their code.
|
and allows to generate macros on site without showing their code.
|
||||||
|
|
||||||
SHA256 digest for GSM: 5D1925970C9590CD195C15B8641B01D7857E3B2546323DC77D09154BCCA40922
|
SHA256 digest for GSM: E47C94B536B661DEE390F5C3EA1684DD1A246106F4FBBDAFA57F5E34D4BB16D5
|
||||||
|
|
||||||
[Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM")
|
[Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM")
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- **dynMacroArray**\[0.2.1\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold.
|
- **dynMacroArray**\[0.2.2\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold.
|
||||||
|
|
||||||
SHA256 digest for dynMacroArray: C987C08615A53D7BD7AEC3911EADF436C676EAB3E233E7E422E42995B890E169
|
SHA256 digest for dynMacroArray: DD0BF1768DA05EBB5F8C6E7409A0929E28DF11CB499F75B433D9648855AACAE4
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
/* 20221121 */
|
||||||
|
BasePlus: EBA9EDB3D50D854288970CC0E965DA6AD5B057F6E6433EEBEC4A02B9A25CF6E2
|
||||||
|
DFA: 3F618EDAC8B4F4BE6C19D606E6BCC58121A16BA1383D2EE64C680B4B7FA9C96A
|
||||||
|
dynMacroArray: DD0BF1768DA05EBB5F8C6E7409A0929E28DF11CB499F75B433D9648855AACAE4
|
||||||
|
GSM: E47C94B536B661DEE390F5C3EA1684DD1A246106F4FBBDAFA57F5E34D4BB16D5
|
||||||
|
macroArray: DA57FFE85F49201FD61A53411D19E97FB5A6AC3C34E34FDF4B913545699551FF
|
||||||
|
SQLinDS: 085F0B8BD4A59343E2913FF9635EA6E551ADD54E9678C35F5096D4A0A895B9C5
|
||||||
|
|
||||||
/* 20221112 */
|
/* 20221112 */
|
||||||
BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4
|
BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4
|
||||||
DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6
|
DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# The BasePlus package [ver. 1.17.1] <a name="baseplus-package"></a> ###############################################
|
# The BasePlus package [ver. 1.17.2] <a name="baseplus-package"></a> ###############################################
|
||||||
|
|
||||||
The **BasePlus** package implements useful
|
The **BasePlus** package implements useful
|
||||||
functions and functionalities I miss in the BASE SAS.
|
functions and functionalities I miss in the BASE SAS.
|
||||||
@@ -273,10 +273,10 @@ Package contains:
|
|||||||
48. functions quicksorthashsddv
|
48. functions quicksorthashsddv
|
||||||
49. functions quicksortlight
|
49. functions quicksortlight
|
||||||
|
|
||||||
*SAS package generated by generatePackage, version 20221112*
|
*SAS package generated by generatePackage, version 20221121*
|
||||||
|
|
||||||
The SHA256 hash digest for package BasePlus:
|
The SHA256 hash digest for package BasePlus:
|
||||||
`A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4`
|
`EBA9EDB3D50D854288970CC0E965DA6AD5B057F6E6433EEBEC4A02B9A25CF6E2`
|
||||||
|
|
||||||
---
|
---
|
||||||
# Content description ############################################################################################
|
# Content description ############################################################################################
|
||||||
|
|||||||
Binary file not shown.
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# The DFA package [ver. 0.5.1] <a name="dfa-package"></a> ###############################################
|
# The DFA package [ver. 0.5.2] <a name="dfa-package"></a> ###############################################
|
||||||
|
|
||||||
The **DFA** (a.k.a. *Dynamic Function Array*) package implements:
|
The **DFA** (a.k.a. *Dynamic Function Array*) package implements:
|
||||||
- dynamic numeric and character arrays,
|
- dynamic numeric and character arrays,
|
||||||
@@ -52,10 +52,10 @@ Package contains:
|
|||||||
12. exec generatearrays
|
12. exec generatearrays
|
||||||
13. clean generatearrays
|
13. clean generatearrays
|
||||||
|
|
||||||
*SAS package generated by generatePackage, version 20221112*
|
*SAS package generated by generatePackage, version 20221121*
|
||||||
|
|
||||||
The SHA256 hash digest for package BasePlus:
|
The SHA256 hash digest for package BasePlus:
|
||||||
`5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6`
|
`3F618EDAC8B4F4BE6C19D606E6BCC58121A16BA1383D2EE64C680B4B7FA9C96A`
|
||||||
|
|
||||||
---
|
---
|
||||||
# Content description ############################################################################################
|
# Content description ############################################################################################
|
||||||
|
|||||||
BIN
packages/dfa.zip
BIN
packages/dfa.zip
Binary file not shown.
Binary file not shown.
@@ -8,7 +8,7 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
# The GSM package [ver. 0.20.1] <a name="gsm-package"></a> ###############################################
|
# The GSM package [ver. 0.20.2] <a name="gsm-package"></a> ###############################################
|
||||||
|
|
||||||
The **GSM** (a.k.a. *Generate Secure Macros*) package allows
|
The **GSM** (a.k.a. *Generate Secure Macros*) package allows
|
||||||
to create secured macros stored in SAS Proc FCMP functions.
|
to create secured macros stored in SAS Proc FCMP functions.
|
||||||
@@ -91,10 +91,10 @@ Package contains:
|
|||||||
Required SAS Components:
|
Required SAS Components:
|
||||||
`Base SAS Software`
|
`Base SAS Software`
|
||||||
|
|
||||||
* SAS package generated by generatePackage, version 20221112 *
|
* SAS package generated by generatePackage, version 20221121 *
|
||||||
|
|
||||||
The SHA256 hash digest for package GSM:
|
The SHA256 hash digest for package GSM:
|
||||||
`5D1925970C9590CD195C15B8641B01D7857E3B2546323DC77D09154BCCA40922`
|
`E47C94B536B661DEE390F5C3EA1684DD1A246106F4FBBDAFA57F5E34D4BB16D5`
|
||||||
|
|
||||||
|
|
||||||
## >>> `%GSM()` macro: <<< <a name="gsm-macro"></a> #######################
|
## >>> `%GSM()` macro: <<< <a name="gsm-macro"></a> #######################
|
||||||
|
|||||||
BIN
packages/gsm.zip
BIN
packages/gsm.zip
Binary file not shown.
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# The macroArray package [ver. 1.0.1] <a name="macroarray-package"></a> ###############################################
|
# The macroArray package [ver. 1.0.2] <a name="macroarray-package"></a> ###############################################
|
||||||
|
|
||||||
The **macroArray** package implements a macro array facility:
|
The **macroArray** package implements a macro array facility:
|
||||||
- `%array()`,
|
- `%array()`,
|
||||||
@@ -75,10 +75,10 @@ Package contains:
|
|||||||
Required SAS Components:
|
Required SAS Components:
|
||||||
*Base SAS Software*
|
*Base SAS Software*
|
||||||
|
|
||||||
*SAS package generated by generatePackage, version 20221112.*
|
*SAS package generated by generatePackage, version 20221121.*
|
||||||
|
|
||||||
The SHA256 hash digest for package macroArray:
|
The SHA256 hash digest for package macroArray:
|
||||||
`371B92A5ABBE82C53F7D63BC5C0D1EBD4695603D3894D8A9A5D5777D1AB59B30`
|
`DA57FFE85F49201FD61A53411D19E97FB5A6AC3C34E34FDF4B913545699551FF`
|
||||||
|
|
||||||
---
|
---
|
||||||
# Content description ############################################################################################
|
# Content description ############################################################################################
|
||||||
|
|||||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
- [The SQLinDS package [ver. 2.2.1]](#sqlinds-package)
|
- [The SQLinDS package [ver. 2.2.2]](#sqlinds-package)
|
||||||
- [Content description](#content-description)
|
- [Content description](#content-description)
|
||||||
* [library `dsSQL`](#library-dssql)
|
* [library `dsSQL`](#library-dssql)
|
||||||
* [`%dsSQL_inner()` macro](#dssql-inner-macro)
|
* [`%dsSQL_inner()` macro](#dssql-inner-macro)
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# The SQLinDS package [ver. 2.2.1] <a name="sqlinds-package"></a> ###############################################
|
# The SQLinDS package [ver. 2.2.2] <a name="sqlinds-package"></a> ###############################################
|
||||||
|
|
||||||
The **SQLinDS** package is an implementation of
|
The **SQLinDS** package is an implementation of
|
||||||
the *macro-function-sandwich* concept introduced in the
|
the *macro-function-sandwich* concept introduced in the
|
||||||
@@ -46,10 +46,10 @@ Package contains:
|
|||||||
Required SAS Components:
|
Required SAS Components:
|
||||||
*Base SAS Software*
|
*Base SAS Software*
|
||||||
|
|
||||||
*SAS package generated by generatePackage, version 20221112*
|
*SAS package generated by generatePackage, version 20221121*
|
||||||
|
|
||||||
The SHA256 hash digest for package SQLinDS:
|
The SHA256 hash digest for package SQLinDS:
|
||||||
`A070214517CC36590083FCF9D5F488AC6E746793E94B9AA55D09A419CF291B5B`
|
`085F0B8BD4A59343E2913FF9635EA6E551ADD54E9678C35F5096D4A0A895B9C5`
|
||||||
|
|
||||||
---
|
---
|
||||||
# Content description ############################################################################################
|
# Content description ############################################################################################
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user