mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2026-01-07 07:00:05 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bd2f6f2d8 | ||
|
|
e3c42e6441 | ||
|
|
8807a1560e | ||
|
|
a282349c86 | ||
|
|
6dc4f22103 | ||
|
|
2fd23f5b35 | ||
|
|
f3f4747df6 | ||
|
|
edca6a8a8c | ||
|
|
f59c2a4893 | ||
|
|
b4314c03e3 | ||
|
|
3a824b4d8b | ||
|
|
ba4b5f8c32 | ||
|
|
15e7d48adf | ||
|
|
a5b4f117cc | ||
|
|
b3ea02b7b0 | ||
|
|
e4dfc6a863 | ||
|
|
7d083e879c |
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2019 - 2022 Bartosz Jablonski
|
Copyright (c) 2019 - 2022 Bartosz Jablonski
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
58
README.md
58
README.md
@@ -1,4 +1,4 @@
|
|||||||
# SAS_PACKAGES - a SAS Packages Framework and Repository
|
# SAS_PACKAGES - a SAS Packages Framework
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -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 **`20230112`**.
|
||||||
|
|
||||||
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).
|
||||||
|
|
||||||
@@ -30,10 +30,10 @@ Videos presenting the SPF and packages, from various conferences and meetups (th
|
|||||||
- ["SAS Packages: The Way to Share" - SaSensei International Dojo No. 1](https://www.youtube.com/watch?v=BFhdUBQgjYQ&t=0s "SID no. 1") (April 2020, ~28 minutes, general overview but with a bit obsolete technical details)
|
- ["SAS Packages: The Way to Share" - SaSensei International Dojo No. 1](https://www.youtube.com/watch?v=BFhdUBQgjYQ&t=0s "SID no. 1") (April 2020, ~28 minutes, general overview but with a bit obsolete technical details)
|
||||||
- ["Co nowego z pakietami SAS?" - SAS dla Administratorów i Praktyków 2020](https://www.youtube.com/watch?v=mXuep2k48Z8&feature=youtu.be&t=0s "SASAiP2020") (October 2020, in Polish, ~41 minutes, general overview and technical details how to use SPF)
|
- ["Co nowego z pakietami SAS?" - SAS dla Administratorów i Praktyków 2020](https://www.youtube.com/watch?v=mXuep2k48Z8&feature=youtu.be&t=0s "SASAiP2020") (October 2020, in Polish, ~41 minutes, general overview and technical details how to use SPF)
|
||||||
- ["SAS Packages - The Way to Share" - Boston Area SAS Users Group webinar](https://www.basug.org/videos?wix-vod-video-id=78067e61413d43d3a6951974b3bc3014&wix-vod-comp-id=comp-klv807gt "BASUG") (November 2020, ~59 minutes, general overview and technical details how to use SPF)
|
- ["SAS Packages - The Way to Share" - Boston Area SAS Users Group webinar](https://www.basug.org/videos?wix-vod-video-id=78067e61413d43d3a6951974b3bc3014&wix-vod-comp-id=comp-klv807gt "BASUG") (November 2020, ~59 minutes, general overview and technical details how to use SPF)
|
||||||
- ["My First SAS Package: A How-To" - SAS Global Forum 2021 V.E.](https://www.youtube.com/watch?v=hqexaQtGw88 "SGF2021") (May 20th 2021, ~59 minutes, technical workshop on how to create a package)
|
- ["My First SAS Package: A How-To" - SAS Global Forum 2021 V.E.](https://www.youtube.com/watch?v=hqexaQtGw88 "SGF2021") (May 20th 2021, ~30 minutes, technical workshop on how to create a package)
|
||||||
- ["Kod SASowy ukryty na widoku" - SAS dla Administratorów i Praktyków 2021](https://www.youtube.com/watch?v=LtaWPe2sgRY&t=1s) (November 24th 2021, in Polish, ~34 minutes, technical presentation with details about the GSM package)
|
- ["Kod SASowy ukryty na widoku" - SAS dla Administratorów i Praktyków 2021](https://www.youtube.com/watch?v=LtaWPe2sgRY&t=1s) (November 24th 2021, in Polish, ~34 minutes, technical presentation with details about the GSM package)
|
||||||
- ["A BasePlus Package for SAS" - SAS Explore 2022](https://communities.sas.com/t5/SAS-Explore-Presentations/A-BasePlus-Package-for-SAS/ta-p/838246 "SASexplore2022") (September 27th-29th 2022, ~28 minutes, technical presentation with details about the BasePlus package)
|
- ["A BasePlus Package for SAS" - SAS Explore 2022](https://communities.sas.com/t5/SAS-Explore-Presentations/A-BasePlus-Package-for-SAS/ta-p/838246 "SASexplore2022 communities.sas.com") (September 27th-29th 2022, ~28 minutes, technical presentation with details about the BasePlus package), alternative video at YouTube is [here](https://www.youtube.com/watch?v=-Poxkx5WfOQ "SASexplore2022 TouTube")
|
||||||
- ["SAS Packages - State of the Union" - SaSensei International Dojo No. 13](https://www.youtube.com/watch?v=1GEldZYQjj0&t=0s "SID no. 13") (November 10th 2022, ~28 minutes, general overview but with a bit obsolete technical details)
|
- ["SAS Packages - State of the Union" - SaSensei International Dojo No. 13](https://www.youtube.com/watch?v=1GEldZYQjj0&t=0s "SID no. 13") (November 10th 2022, ~50 minutes, general overview with the latest technical details)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -107,8 +107,10 @@ filename packages "<directory/containing/packages/>";
|
|||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
The "Workshop video for the User" got outdated (in general). Newer version is comming soon, in the mean time see some of the vedeos from the "Recordings and Presentations" section above.
|
||||||
|
(You can watch the workshop if you wish, link is working and some parts are still valid source of information e.g., "`ICE` loading" or "`disk` loading")
|
||||||
|
|
||||||
[**Workshop video for the User**](https://youtu.be/qX_-HJ76g8Y) \[May 6th, 2020\] [~86 minutes, a bit outdated (installPackage macro was not there yet) but gives the idea how it works especially load, help, unload, ICEload, and other details]
|
<s>[**Workshop video for the User**](https://youtu.be/qX_-HJ76g8Y) \[May 6th, 2020\] [~86 minutes, outdated (installPackage macro was not there yet) but gives the idea how it works especially load, help, unload, ICEload, and other details]</s>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -124,6 +126,8 @@ To create your own package:
|
|||||||
|
|
||||||
- Read the **`My First SAS Package: A How-To - Paper 1079-2021`** article available at communities.sas.com [**`here`**](https://communities.sas.com/t5/SAS-Global-Forum-Proceedings/My-First-SAS-Package-A-How-To/ta-p/726319 "My First SAS Package: A How-To") or locally [**`here`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/Paper_1079-2021/My%20First%20SAS%20Package%20-%20a%20How%20To.pdf "My First SAS Package: A How-To")
|
- Read the **`My First SAS Package: A How-To - Paper 1079-2021`** article available at communities.sas.com [**`here`**](https://communities.sas.com/t5/SAS-Global-Forum-Proceedings/My-First-SAS-Package-A-How-To/ta-p/726319 "My First SAS Package: A How-To") or locally [**`here`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/Paper_1079-2021/My%20First%20SAS%20Package%20-%20a%20How%20To.pdf "My First SAS Package: A How-To")
|
||||||
|
|
||||||
|
The SAS Packages Framework [(short) documetation](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/SPFinit.md) to quickly see macros options and parametera.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### If you have any questions, suggestions, or ideas do not hesitate to contact me!
|
### If you have any questions, suggestions, or ideas do not hesitate to contact me!
|
||||||
@@ -132,6 +136,10 @@ To create your own package:
|
|||||||
|
|
||||||
### Updates worth mentioning:
|
### Updates worth mentioning:
|
||||||
|
|
||||||
|
**Update**\[December 12th, 2022\]**:** `CASLUDF` **typed for CASL user defined functions added to the framework. Utility macros for for loading content in proc IML and proc CAS added. (see [here](https://github.com/yabwon/SAS_PACKAGES/releases/tag/20221212 "New Type and Utility macros"))**.
|
||||||
|
|
||||||
|
**Update**\[November 21st, 2022\]**:** `%loadPackage()` **macro allows Cherry Picking of content (see [here](https://github.com/yabwon/SAS_PACKAGES/releases/tag/20221121 "Cherry Picking"))**.
|
||||||
|
|
||||||
**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**.
|
||||||
@@ -166,29 +174,28 @@ 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.4\], 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: 42677CEBB0778A6B72DE9C0071B66A345811EE470289E3847D7737F782E709E0
|
||||||
|
|
||||||
[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")
|
||||||
|
|
||||||
- **MacroCore**\[1\], a macro library for SAS application developers. Over 100 macros for Base SAS, metadata, and Viya. Provided by the [SASjs framework](https://sasjs.io "SASjs framework").
|
[SQLinDS in SASPAC](https://github.com/SASPAC/sqlinds "SQLinDS in SASPAC")
|
||||||
|
|
||||||
SHA256 digest for MacroCore: A23C29529F3CE7D0C8BEE9545C5D22D5B5594907547374A5135B8E5A48D7687B
|
|
||||||
|
|
||||||
[Documentation for MacroCore](https://core.sasjs.io "Documentation for MacroCore")
|
- **DFA** (Dynamic Function Arrays)\[0.5.4\], 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.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.
|
SHA256 digest for DFA: 6DEB02BE1C30453FBC688AF1F561709C7D6BF10B3B67988B238853A2A9D53034
|
||||||
|
|
||||||
SHA256 digest for DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6
|
|
||||||
|
|
||||||
[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.
|
[DFA in SASPAC](https://github.com/SASPAC/dfa "DFA in SASPAC")
|
||||||
|
|
||||||
|
- **macroArray**\[1.0.4\], 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);
|
||||||
|
|
||||||
@@ -207,12 +214,13 @@ SHA256 digest for DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163B
|
|||||||
which = 1:H:2
|
which = 1:H:2
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
SHA256 digest for macroArray: 371B92A5ABBE82C53F7D63BC5C0D1EBD4695603D3894D8A9A5D5777D1AB59B30
|
SHA256 digest for macroArray: 8584C249C308B5E8B620ED5F695BC58CD426172FB2EACD5FF9C6899F9DE2B470
|
||||||
|
|
||||||
[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")
|
||||||
|
|
||||||
|
[MacroArray in SASPAC](https://github.com/SASPAC/macroarray "MacroArray in SASPAC")
|
||||||
|
|
||||||
- **BasePlus**\[1.17.1\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
- **BasePlus**\[1.18.4\] 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);
|
||||||
@@ -229,22 +237,28 @@ format x bool.;
|
|||||||
%rainCloudPlot(sashelp.cars,DriveTrain,Invoice)
|
%rainCloudPlot(sashelp.cars,DriveTrain,Invoice)
|
||||||
|
|
||||||
%zipLibrary(sashelp,libOut=work)
|
%zipLibrary(sashelp,libOut=work)
|
||||||
|
|
||||||
|
%bpPIPE(ls -la ~/)
|
||||||
```
|
```
|
||||||
SHA256 digest for BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4
|
SHA256 digest for BasePlus: A6F1977DC4EC22A39DDC7BCE68CF562AF54351A3D385D488EC3067B5A7C0F3CB
|
||||||
|
|
||||||
[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
|
[BasePlus in SASPAC](https://github.com/SASPAC/baseplus "BasePlus in SASPAC")
|
||||||
|
|
||||||
|
- **GSM** (Generate Secure Macros)\[0.20.4\], 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: 83EC349DF97EFA71187536E8CC6CD62215CE675D20DA355E14D4ACE3FBC6D524
|
||||||
|
|
||||||
[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.
|
[GSM in SASPAC](https://github.com/SASPAC/gsm "GSM in SASPAC")
|
||||||
|
|
||||||
SHA256 digest for dynMacroArray: C987C08615A53D7BD7AEC3911EADF436C676EAB3E233E7E422E42995B890E169
|
- **dynMacroArray**\[0.2.4\], 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: 7800F36877DC0B9A94B1AC8FFDF8B43ADB216F11B5B26343E41165E7F5E32FC0
|
||||||
|
|
||||||
### ======
|
### ======
|
||||||
|
|||||||
Binary file not shown.
@@ -128,4 +128,20 @@ filename packages ("<put/folder/from/the/step/one/here>" "<put/folder/from/the/s
|
|||||||
%HelloWorldMacro(7)
|
%HelloWorldMacro(7)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Congratulations!! You created your first HelloWorld package.
|
---
|
||||||
|
|
||||||
|
### Congratulations!! You've just created your first HelloWorld package.
|
||||||
|
|
||||||
|
Now you are ready to do smome more advanced work.
|
||||||
|
|
||||||
|
- Read the **`My First SAS Package: A How-To - Paper 1079-2021`** article, available at communities.sas.com [**`here`**](https://communities.sas.com/t5/SAS-Global-Forum-Proceedings/My-First-SAS-Package-A-How-To/ta-p/726319 "My First SAS Package: A How-To + Video") (video included) or locally [**`here`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/Paper_1079-2021/My%20First%20SAS%20Package%20-%20a%20How%20To.pdf "My First SAS Package: A How-To"), describing the proces of a package creation with more advanced example and technical details.
|
||||||
|
|
||||||
|
- Go to "bare metal" and read the [**`SAS Packages - The Way to Share (a How-To) - Paper 4725-2020 - extended version`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/SAS(r)%20packages%20-%20the%20way%20to%20share%20(a%20how%20to)-%20Paper%204725-2020%20-%20extended.pdf "SAS packages - the way to share") - an article which contains all technical details on how the SAS Packages Framework works and how to use it (both as a develope and as a user).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
The SAS Packages Framework [(short) documetation](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/SPFinit.md) to quickly see macros options and parametera.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
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 20230112. 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 `20230112` #;
|
||||||
%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,9 +21,9 @@
|
|||||||
,delTestWork=1 /* indicates if `WORK` directories generated by user tests
|
,delTestWork=1 /* indicates if `WORK` directories generated by user tests
|
||||||
should be deleted, i.e. the (NO)WORKTERM option is set,
|
should be deleted, i.e. the (NO)WORKTERM option is set,
|
||||||
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 20230112. 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 `20230112` #;
|
||||||
%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 #;
|
||||||
@@ -152,6 +152,11 @@ filename &_LIC_. "&filesLocation./license.sas" lrecl = 1024;
|
|||||||
otherwise;
|
otherwise;
|
||||||
end;
|
end;
|
||||||
run;
|
run;
|
||||||
|
/* package generation timestamp, in iso8601 YYYY-MM-DDThh:mm:ss */
|
||||||
|
%local packageGenerated;
|
||||||
|
%let packageGenerated = %sysfunc(datetime(), E8601DT19.);
|
||||||
|
%put NOTE: &=packageGenerated.;
|
||||||
|
|
||||||
options &qlenmax_fstimer_tmp.;
|
options &qlenmax_fstimer_tmp.;
|
||||||
|
|
||||||
/* test for required descriptors */
|
/* test for required descriptors */
|
||||||
@@ -218,7 +223,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 +272,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;
|
||||||
@@ -545,7 +550,10 @@ data &filesWithCodes.;
|
|||||||
|
|
||||||
/* ignore unknown types for folders */
|
/* ignore unknown types for folders */
|
||||||
if fileId AND not (upcase(type) in:
|
if fileId AND not (upcase(type) in:
|
||||||
('LIBNAME' 'MACRO' /*'MACROS'*/ 'DATA' 'FUNCTION' /*'FUNCTIONS'*/ 'FORMAT' /*'FORMATS'*/ 'IMLMODULE' 'PROTO' 'EXEC' 'CLEAN' 'LAZYDATA' 'TEST'))
|
('LIBNAME' 'MACRO' /*'MACROS'*/ 'DATA'
|
||||||
|
'FUNCTION' /*'FUNCTIONS'*/ 'FORMAT' /*'FORMATS'*/
|
||||||
|
'IMLMODULE' 'PROTO' 'EXEC' 'CLEAN'
|
||||||
|
'LAZYDATA' 'TEST' 'CASLUDF'))
|
||||||
then
|
then
|
||||||
do;
|
do;
|
||||||
put "WARNING: Type " type 'is not yet supported.' /
|
put "WARNING: Type " type 'is not yet supported.' /
|
||||||
@@ -677,17 +685,17 @@ proc contents data = &filesWithCodes.;
|
|||||||
run;
|
run;
|
||||||
*/
|
*/
|
||||||
title1 "Package location is: &filesLocation.";
|
title1 "Package location is: &filesLocation.";
|
||||||
title2 "User: &SYSUSERID., datetime: %qsysfunc(datetime(), datetime21.), SAS version: &SYSVLONG4.";
|
title2 "User: &SYSUSERID., Datetime: &packageGenerated., SAS version: &SYSVLONG4.";
|
||||||
title3 "Package encoding: '&packageEncoding.', session encoding: '&SYSENCODING.'.";
|
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;
|
||||||
|
|
||||||
|
|
||||||
@@ -769,7 +777,7 @@ data _null_;
|
|||||||
end;
|
end;
|
||||||
file &zipReferrence.(packagemetadata.sas) encoding = &packageEncoding.;
|
file &zipReferrence.(packagemetadata.sas) encoding = &packageEncoding.;
|
||||||
|
|
||||||
length packageName $ 32 packageVersion $ 24
|
length packageName $ 32 packageVersion packageGenerated $ 24
|
||||||
packageTitle packageAuthor packageMaintainer $ 2048
|
packageTitle packageAuthor packageMaintainer $ 2048
|
||||||
packageEncoding $ 8 packageLicense $ 128;
|
packageEncoding $ 8 packageLicense $ 128;
|
||||||
packageName = quote(strip(symget('packageName')),'"');
|
packageName = quote(strip(symget('packageName')),'"');
|
||||||
@@ -779,6 +787,7 @@ data _null_;
|
|||||||
packageMaintainer = quote(strip(symget('packageMaintainer')),'"');
|
packageMaintainer = quote(strip(symget('packageMaintainer')),'"');
|
||||||
packageEncoding = quote(strip(symget('packageEncoding')),'"');
|
packageEncoding = quote(strip(symget('packageEncoding')),'"');
|
||||||
packageLicense = quote(strip(symget('packageLicense')),'"');
|
packageLicense = quote(strip(symget('packageLicense')),'"');
|
||||||
|
packageGenerated = quote(strip(symget('packageGenerated')),'"');
|
||||||
|
|
||||||
put ' data _null_; '; /* simple "%local" returns error while loading package */
|
put ' data _null_; '; /* simple "%local" returns error while loading package */
|
||||||
put ' call symputX("packageName", ' packageName ', "L");';
|
put ' call symputX("packageName", ' packageName ', "L");';
|
||||||
@@ -787,7 +796,8 @@ data _null_;
|
|||||||
put ' call symputX("packageAuthor", ' packageAuthor ', "L");';
|
put ' call symputX("packageAuthor", ' packageAuthor ', "L");';
|
||||||
put ' call symputX("packageMaintainer", ' packageMaintainer ', "L");';
|
put ' call symputX("packageMaintainer", ' packageMaintainer ', "L");';
|
||||||
put ' call symputX("packageEncoding", ' packageEncoding ', "L");';
|
put ' call symputX("packageEncoding", ' packageEncoding ', "L");';
|
||||||
put ' call symputX("packageLicense", ' packageLicense ', "L");';
|
put ' call symputX("packageLicense", ' packageLicense ', "L");';
|
||||||
|
put ' call symputX("packageGenerated", ' packageGenerated ', "L");';
|
||||||
put ' run; ';
|
put ' run; ';
|
||||||
|
|
||||||
stop;
|
stop;
|
||||||
@@ -860,7 +870,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 +885,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.;
|
||||||
@@ -884,20 +900,35 @@ data _null_;
|
|||||||
put ' %put NOTE: ' @; put "Loading package &packageName., version &packageVersion., license &packageLicense.; ";
|
put ' %put NOTE: ' @; put "Loading package &packageName., version &packageVersion., license &packageLicense.; ";
|
||||||
|
|
||||||
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
|
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
|
||||||
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
|
put ' %put NOTE- ' @; put "Generated: &packageGenerated.; ";
|
||||||
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
|
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
|
||||||
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
|
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
|
||||||
put ' %put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
put ' %put NOTE- Run %nrstr(%%)helpPackage(' "&packageName." ') for the description;';
|
put ' %put NOTE- Run %nrstr(%%)helpPackage(' "&packageName." ') for the description;';
|
||||||
put ' %put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
put ' %put NOTE- *** START ***; ' /;
|
put ' %put NOTE- *** START ***; ' /;
|
||||||
|
|
||||||
|
put 'data _null_; ';
|
||||||
|
put ' if NOT ("*"=symget("cherryPick")) then do; '; /* Cherry Pick test0 start */
|
||||||
|
put ' put "NOTE- "; ' /
|
||||||
|
' put "NOTE: *** Cherry Picking ***"; ' /
|
||||||
|
' put "NOTE- Cherry Picking in action!! Be advised that"; ' /
|
||||||
|
' put "NOTE- dependencies/required packages will not be loaded!"; ' /
|
||||||
|
' put "NOTE- "; ' ;
|
||||||
|
put ' end; ' ; /* Cherry Pick test0 end */
|
||||||
|
put 'run; ';
|
||||||
|
|
||||||
|
|
||||||
put '%include ' " &_PackageFileref_.(packagemetadata.sas) / nosource2; " /; /* <- copied also to loadPackage macro */
|
put '%include ' " &_PackageFileref_.(packagemetadata.sas) / nosource2; " /; /* <- copied also to loadPackage macro */
|
||||||
isFunction = 0;
|
|
||||||
isFormat = 0;
|
isFunction = 0;
|
||||||
|
isFormat = 0;
|
||||||
|
isProto = 0;
|
||||||
|
isIMLmodule = 0;
|
||||||
|
isCASLudf = 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 +936,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,13 +999,15 @@ 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'));
|
||||||
|
|
||||||
/* try to load required packages */
|
/* try to load required packages */
|
||||||
put 'data _null_ ; ';
|
put 'data _null_ ; ';
|
||||||
|
put ' if "*" NE symget("cherryPick") then do; put "NOTE: No required packages loading."; stop; end; ';
|
||||||
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; ';
|
||||||
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
|
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
|
||||||
put ' do; ';
|
put ' do; ';
|
||||||
@@ -1028,7 +1061,8 @@ data _null_;
|
|||||||
|
|
||||||
/* test if required packages are loaded */
|
/* test if required packages are loaded */
|
||||||
put 'data _null_ ; ';
|
put 'data _null_ ; ';
|
||||||
put ' length req name $ 64 vers verR $ 24 versN verRN 8 SYSloadedPackages $ 32767; ';
|
put ' if "*" NE symget("cherryPick") then do; put "NOTE: No required packages checking."; stop; end; ';
|
||||||
|
put ' length req name $ 64 vers verR $ 24 versN verRN 8 SYSloadedPackages $ 32767; ';
|
||||||
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
|
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
|
||||||
put ' do; ';
|
put ' do; ';
|
||||||
put ' do until(EOF); ';
|
put ' do until(EOF); ';
|
||||||
@@ -1067,8 +1101,10 @@ data _null_;
|
|||||||
put ' if (LP_find ne 0) or (LP_find = 0 and . < versN < verRN) then ';
|
put ' if (LP_find ne 0) or (LP_find = 0 and . < versN < verRN) then ';
|
||||||
put ' do; ';
|
put ' do; ';
|
||||||
put ' missingPackagr = 1; ';
|
put ' missingPackagr = 1; ';
|
||||||
put ' put "ERROR: SAS package: " req "is missing! Download it and" ; ';
|
put ' put "ERROR: SAS package: " req "is missing! Download it by hand or if the SAS session";';
|
||||||
put ' put ''ERROR- use %loadPackage('' name ", requiredVersion = " verR ") to load it." ;';
|
put ' put "ERROR- has access to the Internet and the package is available at SASPAC repository";';
|
||||||
|
put ' put ''ERROR- use %installPackage('' name +(-1) "(" verR +(-1) ")) to install it."/; ';
|
||||||
|
put ' put ''ERROR- Use %loadPackage('' name +(-1) ", requiredVersion=" verR +(-1) ") to load it."/;';
|
||||||
put ' end ; ';
|
put ' end ; ';
|
||||||
put ' end ; ';
|
put ' end ; ';
|
||||||
put ' if missingPackagr then call symputX("packageRequiredErrors", 1, "L"); ';
|
put ' if missingPackagr then call symputX("packageRequiredErrors", 1, "L"); ';
|
||||||
@@ -1080,20 +1116,22 @@ data _null_;
|
|||||||
put ' do req = ' / packageReqPackages / ' ; ';
|
put ' do req = ' / packageReqPackages / ' ; ';
|
||||||
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
|
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
|
||||||
put ' vers = compress(kscanx(req,-1, "("), ".", "KD"); ';
|
put ' vers = compress(kscanx(req,-1, "("), ".", "KD"); ';
|
||||||
put ' put "ERROR: SAS package " req "is missing! Download/install it and" ; ';
|
put ' put "ERROR: SAS package " req "is missing! Download it by hand or if the SAS session";';
|
||||||
put ' put ''ERROR- use %loadPackage('' name ", requiredVersion = " vers ") to load it." ; ';
|
put ' put "ERROR- has access to the Internet and the package is available at SASPAC repository";';
|
||||||
|
put ' put ''ERROR- use %installPackage('' name +(-1) "(" vers +(-1) ")) to install it."/; ';
|
||||||
|
put ' put ''ERROR- Use %loadPackage('' name +(-1)", requiredVersion=" vers +(-1) ") to load it."/;';
|
||||||
put ' end ; ';
|
put ' end ; ';
|
||||||
put ' end; ';
|
put ' end; ';
|
||||||
put ' stop; ';
|
put ' stop; ';
|
||||||
put 'run; ';
|
put 'run; ';
|
||||||
%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,106 +1141,447 @@ 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' 'CASLUDF'))
|
||||||
/* lazy data are only loaded on demand
|
then continue; /* CASLUDF type will go in the next loop */
|
||||||
%loadPackage(packagename, lazyData=set1 set2 set3)
|
/* cleaning files are only included in unload.sas */
|
||||||
test files are used only during package generation
|
/* lazy data are only loaded on demand
|
||||||
*/
|
%loadPackage(packagename, lazyData=set1 set2 set3)
|
||||||
|
test files are used only during package generation
|
||||||
|
*/
|
||||||
/* test for supported types */
|
/* test for supported types */
|
||||||
if not (upcase(type) in:
|
if not (upcase(type) in:
|
||||||
('LIBNAME' 'MACRO' /*'MACROS'*/ 'DATA' 'FUNCTION' /*'FUNCTIONS'*/ 'FORMAT' /*'FORMATS'*/ 'IMLMODULE' 'PROTO' 'EXEC' 'CLEAN' 'LAZYDATA' 'TEST'))
|
('LIBNAME' 'MACRO' /*'MACROS'*/ 'DATA'
|
||||||
|
'FUNCTION' /*'FUNCTIONS'*/ 'FORMAT' /*'FORMATS'*/
|
||||||
|
'IMLMODULE' 'PROTO' 'EXEC' 'CLEAN'
|
||||||
|
'LAZYDATA' 'TEST'))
|
||||||
then
|
then
|
||||||
do;
|
do;
|
||||||
putlog 'WARNING: Type ' type 'is not yet supported.';
|
putlog 'WARNING: Type ' type 'is not yet supported.';
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
put '%put NOTE- ;';
|
|
||||||
put '%put NOTE: Element of type ' type 'from the file "' file +(-1) '" will be included;';
|
isFunction + (upcase(type)=:'FUNCTION');
|
||||||
|
isFormat + (upcase(type)=:'FORMAT');
|
||||||
|
isProto + (upcase(type)=:'PROTO');
|
||||||
|
isIMLmodule + (upcase(type)=:'IMLMODULE');
|
||||||
|
|
||||||
|
/* 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 = isProto 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; ';
|
||||||
|
end;
|
||||||
|
if 1 = FIRST.type and upcase(type)='PROTO' then
|
||||||
|
do;
|
||||||
|
/* header for multiple functions in one PROTO run */
|
||||||
|
put "proc proto package = work.%lowcase(&packageName.proto).package ; ";
|
||||||
|
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;
|
||||||
|
if 1 = FIRST.type and upcase(type)='FORMATS' then
|
||||||
|
do;
|
||||||
|
/* header, for FORMATS */
|
||||||
|
put "proc format lib = work.%lowcase(&packageName.format) ; ";
|
||||||
|
end;
|
||||||
|
if 1 = isIMLmodule and upcase(type)='IMLMODULE' then
|
||||||
|
do;
|
||||||
|
/* macro variable for test if cherry picking used IML */
|
||||||
|
put 'data _null_; ';
|
||||||
|
put ' call symputX("cherryPick_IML_ALL", 0, "L"); ';
|
||||||
|
put 'run; ';
|
||||||
|
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;
|
||||||
|
/* 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: >> 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;
|
||||||
put '%put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
put '%put NOTE- Executing the following code: ;';
|
put ' %put NOTE- Executing the following code: ;';
|
||||||
put '%put NOTE- *****************************;';
|
put ' %put NOTE- *****************************;';
|
||||||
put 'data _null_;';
|
put ' 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 */
|
'%let cherryPick_IML_ALL = %eval(&cherryPick_IML_ALL. + &cherryPick_IML.);' /
|
||||||
put "quit; ";
|
"reset storage = WORK.&packageName.IML; " / /* set the storage location for modules */
|
||||||
|
"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));"/;
|
||||||
put '%put NOTE- ;';
|
|
||||||
put '%put NOTE:[FMTSEARCH] %sysfunc(getoption(fmtsearch));'/;
|
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
|
end; /* loopOverTypes - start */
|
||||||
|
|
||||||
|
/* this is a header for CASLudf macro */
|
||||||
|
put 'data _null_; ';
|
||||||
|
put ' call symputX("cherryPick_CASLUDF", 0, "L"); ';
|
||||||
|
put 'run; ';
|
||||||
|
put 'data _null_;';
|
||||||
|
put 'length CASLUDF $ 32767;';
|
||||||
|
put 'dtCASLudf = datetime();';
|
||||||
|
put 'CASLUDF = ';
|
||||||
|
put ' ''%macro ' "&packageName.CASLudf(' ";
|
||||||
|
put ' !! "list=1,depList=" ';
|
||||||
|
%if %superq(packageReqPackages) ne %then
|
||||||
|
%do;
|
||||||
|
length reqPackage $ 32;
|
||||||
|
do i = 1 to countw(packageReqPackages, ",", "Q");
|
||||||
|
reqPackage = compress(scan(scan(packageReqPackages, i, ",", "Q"), 1, "[{( )}]"),"_","KAD") ;
|
||||||
|
put ' !! " ' reqPackage ' " ';
|
||||||
|
end;
|
||||||
|
%end;
|
||||||
|
put " !! ')/ des = ''CASL User Defined Functions loader for &packageName. package'';'";
|
||||||
|
|
||||||
|
put ' !! '' %if HELP = %superq(list) %then ''' /
|
||||||
|
' !! '' %do; ''' /
|
||||||
|
' !! '' %put ****************************************************************************;''' /
|
||||||
|
' !! '' %put This is help for the `' "&packageName.CASLudf" '` macro;''' /
|
||||||
|
' !! '' %put Parameters (optional) are the following:;''' /
|
||||||
|
|
||||||
|
' !! '' %put - `list` indicates if the list of loaded CASL UDFs should be displayed,;''' /
|
||||||
|
' !! '' %put %str( )when set to the value of `1` (the default) runs `FUNCTIONLIST USER%str(;)`,;''' /
|
||||||
|
' !! '' %put %str( )when set to the value of `HELP` (upcase letters!) displays this help message.;''' /
|
||||||
|
|
||||||
|
' !! '' %put - `depList` [technical] contains the list of dependencies required by the package.;''' /
|
||||||
|
' !! '' %put %str( )for _this_ instance of the macro the default value is: `';
|
||||||
|
%if %superq(packageReqPackages) ne %then
|
||||||
|
%do;
|
||||||
|
do i = 1 to countw(packageReqPackages, ",", "Q");
|
||||||
|
reqPackage = compress(scan(scan(packageReqPackages, i, ",", "Q"), 1, "[{( )}]"),"_","KAD") ;
|
||||||
|
put reqPackage @;
|
||||||
|
end;
|
||||||
|
%end;
|
||||||
|
put +(-1) '`.;''' /
|
||||||
|
' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' /
|
||||||
|
' !! '' %put with the SAS Packages Framework version 20230112.;''' /
|
||||||
|
' !! '' %put ****************************************************************************;''' /
|
||||||
|
' !! '' %GOTO theEndOfTheMacro;''' /
|
||||||
|
' !! '' %end;''' ;
|
||||||
|
|
||||||
|
|
||||||
|
put ' !! '' %if %superq(depList) ne %then ''' /
|
||||||
|
' !! '' %do; ''' /
|
||||||
|
' !! '' %do i = 1 %to %sysfunc(countw(&depList.,%str( ))); ''' /
|
||||||
|
' !! '' %let depListNm = %scan(&depList.,&i.,%str( )); ''' /
|
||||||
|
' !! '' %if %SYSMACEXIST(&depListNm.CASLudf) %then ''' /
|
||||||
|
' !! '' %do; ''' /
|
||||||
|
' !! '' %&depListNm.CASLudf(list=0) ''' /
|
||||||
|
' !! '' %end; ''' /
|
||||||
|
' !! '' %end; ''' /
|
||||||
|
' !! '' %end; ''' ;
|
||||||
|
|
||||||
|
put ' !! '' %local tmp_NOTES;'' ';
|
||||||
|
put ' !! '' %let tmp_NOTES = %sysfunc(getoption(NOTES));'' ';
|
||||||
|
/* the PATH macrovariable will be resolved when the load.sas file is executed */
|
||||||
|
put ' !! " filename ' "&_PackageFileref_." ' &ZIP. ''&path./' "%lowcase(&packageName.)" '.&zip.'';"';
|
||||||
|
|
||||||
|
/* this loop lists includes for CASLUDFs in the macro definition */
|
||||||
|
do until(eof1); /* loopOverTypes1 - start */
|
||||||
|
set &filesWithCodes. end = EOF1;
|
||||||
|
by TYPE notsorted;
|
||||||
|
if not (upcase(type) = 'CASLUDF') then continue; /* only CASLUDF type in this loop */
|
||||||
|
isCASLudf + 1;
|
||||||
|
|
||||||
|
put ' ' /
|
||||||
|
'%if (%str(*)=%superq(cherryPick)) or (' fileshort +(-1) ' in %superq(cherryPick)) %then %do; '; /* Cherry Pick test2 start */
|
||||||
|
put ' %put NOTE- ;';
|
||||||
|
put ' %put NOTE: >> Element of type ' type 'from the file "' file +(-1) '" will be included <<;';
|
||||||
|
/* for CASLUDF we are building code of a macro to be run while loading */
|
||||||
|
put ' !! '' %include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;''';
|
||||||
|
put ' %let cherryPick_CASLUDF = %eval(&cherryPick_CASLUDF. + 1);';
|
||||||
|
put '%end; ' /; /* Cherry Pick test2 end */
|
||||||
|
|
||||||
|
end; /* loopOverTypes1 - start */
|
||||||
|
|
||||||
|
/* this is a footer for CASLudf macro */
|
||||||
|
put ' !! " options nonotes;" ' /
|
||||||
|
" !! ' filename &_PackageFileref_. clear;' " /
|
||||||
|
' !! '' options &tmp_NOTES.;'' ' /
|
||||||
|
' !! '' %if 1 = %superq(list) %then '' ' /
|
||||||
|
' !! '' %do; '' ' /
|
||||||
|
' !! " FUNCTIONLIST USER;" ' /
|
||||||
|
' !! " run;" ' /
|
||||||
|
' !! '' %end; '' ' ;
|
||||||
|
put ' !! ''%theEndOfTheMacro: %mend;''; ' ;
|
||||||
|
|
||||||
|
/* generate macro for CASL user defined functions */
|
||||||
|
if 0 < isCASLudf then
|
||||||
|
do;
|
||||||
|
put '%if 0 < &cherryPick_CASLUDF. %then %do; ';
|
||||||
|
/*put ' put / / CASLUDF / / ; ';*/
|
||||||
|
put " rc = resolve(CASLUDF); ";
|
||||||
|
put ' put "NOTE: Macro named:"; ';
|
||||||
|
put " put @7 '%' '&packageName.CASLudf()'; ";
|
||||||
|
put ' put "NOTE- will be generated. Its purpose";';
|
||||||
|
put ' put "NOTE- is to allow fast load of CASL"; ';
|
||||||
|
put ' put "NOTE- user defined functions into"; ';
|
||||||
|
put ' put "NOTE- the Proc CAS session."; ';
|
||||||
|
put ' put "NOTE-"; ';
|
||||||
|
put ' put "NOTE- Use it the following way:"; ';
|
||||||
|
put " put @7 'Proc CAS;'; ";
|
||||||
|
put " put @7 ' %' '&packageName.CASLudf()'; ";
|
||||||
|
put " put @7 ' <... your code ...>'; ";
|
||||||
|
put " put @7 'quit;'; ";
|
||||||
|
put ' put "NOTE-"; ';
|
||||||
|
put ' put "NOTE-To get help run:"; ';
|
||||||
|
put " put @7 ' %' '&packageName.CASLudf(list=HELP)';";
|
||||||
|
put ' put "NOTE-"; ';
|
||||||
|
put '%end; ';
|
||||||
|
end;
|
||||||
|
put 'run;'/;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 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(()) ))));';
|
||||||
|
/* proc delete is adde because "empty" PROTO creates dataset too */
|
||||||
|
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_FORMAT. %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:[FMTSEARCH] %sysfunc(getoption(fmtsearch));'/;
|
||||||
|
end;
|
||||||
|
|
||||||
|
/* create a macro loader for IML modules with dependencies */
|
||||||
|
if isIMLmodule then
|
||||||
|
do;
|
||||||
|
put '%if (%str(*)=%superq(cherryPick)) or 0 < &cherryPick_IML_ALL. %then %do;';
|
||||||
|
|
||||||
|
/* this "text wrapper" was added to get datetime generated when macro is compiled */
|
||||||
|
put "data _null_; dtIML=datetime(); IML='"; /* wrapper start */
|
||||||
|
|
||||||
|
put '%macro ' " &packageName.IML(list=1,err=ERROR,resetIMLstorage=1,depList=" ;
|
||||||
|
%if %superq(packageReqPackages) ne %then
|
||||||
|
%do;
|
||||||
|
length reqPackage $ 32;
|
||||||
|
do i = 1 to countw(packageReqPackages, ",", "Q");
|
||||||
|
reqPackage = compress(scan(scan(packageReqPackages, i, ",", "Q"), 1, "[{( )}]"),"_","KAD") ;
|
||||||
|
put " " reqPackage @;
|
||||||
|
end;
|
||||||
|
put ;
|
||||||
|
%end;
|
||||||
|
put ")/ des = ""IML Modules loader for &packageName. package""; " /
|
||||||
|
' %if HELP = %superq(list) %then ' /
|
||||||
|
' %do; ' /
|
||||||
|
' %put ****************************************************************************; ' /
|
||||||
|
' %put This is help for the `' "&packageName.IML" '` macro; ' /
|
||||||
|
' %put Parameters (optional) are the following:; ' /
|
||||||
|
|
||||||
|
' %put - `list` indicates if the list of loaded moduls should be displayed,; ' /
|
||||||
|
' %put %str( )when set to the value of `1` (the default) runs `SHOW MODULES%str(;)`,; ' /
|
||||||
|
' %put %str( )when set to the value of `HELP` (upcase letters!) displays this help message.;' /
|
||||||
|
|
||||||
|
' %put - `resetIMLstorage` indicates if to reset default moduls storage,; ' /
|
||||||
|
' %put %str( )when set to `1` (the default) runs `RESET STORAGE = WORK.IMLSTOR%str(;)`.; ' /
|
||||||
|
|
||||||
|
' %put - `err` [technical] indicates message type in case of missing modules catalog,; ' /
|
||||||
|
' %put %str( )when set to the value of `ERROR` (the default) prints Error message.; ' /
|
||||||
|
|
||||||
|
' %put - `depList` [technical] contains the list of dependencies required by the package.; ' /
|
||||||
|
' %put %str( )for _this_ instance of the macro the default value is: `';
|
||||||
|
%if %superq(packageReqPackages) ne %then
|
||||||
|
%do;
|
||||||
|
do i = 1 to countw(packageReqPackages, ",", "Q");
|
||||||
|
reqPackage = compress(scan(scan(packageReqPackages, i, ",", "Q"), 1, "[{( )}]"),"_","KAD") ;
|
||||||
|
put reqPackage @;
|
||||||
|
end;
|
||||||
|
%end;
|
||||||
|
put +(-1) '`.;' /
|
||||||
|
' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; ' /
|
||||||
|
' %put with the SAS Packages Framework version 20230112.; ' /
|
||||||
|
' %put ****************************************************************************; ' /
|
||||||
|
' %GOTO theEndOfTheMacro; ' /
|
||||||
|
' %end; ' /
|
||||||
|
|
||||||
|
' %local localSYSmacroName localPackageName i depListNm; ' /
|
||||||
|
' %let localSYSmacroName = &sysmacroname.; ' /
|
||||||
|
' %let localSYSmacroName = %LOWCASE(&localSYSmacroName.); ' /
|
||||||
|
' %let localPackageName = %substr(&localSYSmacroName.,1,%eval(%length(&localSYSmacroName.)-3));' /
|
||||||
|
' ' /
|
||||||
|
' %if %superq(depList) ne %then ' /
|
||||||
|
' %do; ' /
|
||||||
|
' %do i = 1 %to %sysfunc(countw(&depList.,%str( ))); ' /
|
||||||
|
' %let depListNm = %scan(&depList.,&i.,%str( )); ' /
|
||||||
|
' %if %SYSMACEXIST(&depListNm.IML) %then ' /
|
||||||
|
' %do; ' /
|
||||||
|
' %&depListNm.IML(list=0,err=&err.,resetIMLstorage=0) ' /
|
||||||
|
' %end; ' /
|
||||||
|
' %end; ' /
|
||||||
|
' %end; ' /
|
||||||
|
' %if %sysfunc(CEXIST(WORK.&localSYSmacroName.)) %then ' /
|
||||||
|
' %do; ' /
|
||||||
|
' %put NOTE: Loading IML Modules from package &localPackageName.; ' /
|
||||||
|
' RESET STORAGE = WORK.&localSYSmacroName.; ' /
|
||||||
|
' LOAD MODULE = _all_; ' /
|
||||||
|
' %end; ' /
|
||||||
|
' %else ' /
|
||||||
|
' %do; ' /
|
||||||
|
' %put %superq(err): IML Modules not provided; ' /
|
||||||
|
' %let list = 0; ' /
|
||||||
|
' %end; ' /
|
||||||
|
' %if 1 = %superq(list) %then ' /
|
||||||
|
' %do; ' /
|
||||||
|
' SHOW MODULES; ' /
|
||||||
|
' %end; ' /
|
||||||
|
' %if 1 = %superq(resetIMLstorage) %then ' /
|
||||||
|
' %do; ' /
|
||||||
|
' RESET STORAGE = WORK.IMLSTOR; ' /
|
||||||
|
' %end; ' /
|
||||||
|
'%theEndOfTheMacro: %mend; ' ;
|
||||||
|
|
||||||
|
put "'; rc = resolve(IML); run;"; /* wrapper end */
|
||||||
|
|
||||||
|
put '%put NOTE: Macro named:; ';
|
||||||
|
put '%put %nrstr( %%)' "&packageName." 'IML(); ';
|
||||||
|
put '%put NOTE- will be generated. Its purpose; ';
|
||||||
|
put '%put NOTE- is to allow fast load of IML; ';
|
||||||
|
put '%put NOTE- user defined modules into; ';
|
||||||
|
put '%put NOTE- the Proc IML session.; ';
|
||||||
|
put '%put NOTE-; ';
|
||||||
|
put '%put NOTE- Use it the following way:; ';
|
||||||
|
put '%put %nrstr( )Proc IML%str(;); ';
|
||||||
|
put '%put %nrstr( %%)' "&packageName." 'IML(); ';
|
||||||
|
put '%put %nrstr( )<... your code ...>; ';
|
||||||
|
put '%put %nrstr( )quit%str(;); ';
|
||||||
|
put '%put NOTE- ; ';
|
||||||
|
put '%put NOTE- To get help info run:; ';
|
||||||
|
put '%put %nrstr( %%)' "&packageName." 'IML(list=HELP);';
|
||||||
|
put '%put NOTE-; ';
|
||||||
|
|
||||||
|
put '%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,8 +1616,9 @@ 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.;";
|
||||||
put '%put NOTE- *** END ***;' /;
|
put '%put NOTE- *** END ***;' /;
|
||||||
@@ -1261,7 +1641,7 @@ data _null_;
|
|||||||
put ' %put NOTE: ' @; put "Data for package &packageName., version &packageVersion., license &packageLicense.; ";
|
put ' %put NOTE: ' @; put "Data for package &packageName., version &packageVersion., license &packageLicense.; ";
|
||||||
|
|
||||||
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
|
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
|
||||||
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
|
put ' %put NOTE- ' @; put "Generated: &packageGenerated.; ";
|
||||||
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
|
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
|
||||||
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
|
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
|
||||||
put ' %put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
@@ -1282,7 +1662,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 +1671,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 +1715,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;
|
||||||
@@ -1347,15 +1727,17 @@ data _null_;
|
|||||||
put ' from dictionary.catalogs';
|
put ' from dictionary.catalogs';
|
||||||
put ' where ';
|
put ' where ';
|
||||||
put ' (';
|
put ' (';
|
||||||
put ' objname in ("*"' /;
|
put ' objname in ("*"' ;
|
||||||
|
put " ,%UPCASE('&packageName.IML')" ;
|
||||||
|
put " ,%UPCASE('&packageName.CASLUDF')" /;
|
||||||
/* list of macros */
|
/* list of macros */
|
||||||
EOF = 0;
|
EOF = 0;
|
||||||
do until(EOF);
|
do until(EOF);
|
||||||
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 ' )';
|
||||||
@@ -1371,9 +1753,9 @@ data _null_;
|
|||||||
do until(EOF);
|
do until(EOF);
|
||||||
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 +1827,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 +1868,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 +1879,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,12 +1897,12 @@ 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;
|
||||||
|
|
||||||
|
|
||||||
/* update SYSloadedPackages global macrovariable */
|
/* update SYSloadedPackages global macrovariable */
|
||||||
put ' data _null_ ; ';
|
put 'data _null_ ; ';
|
||||||
put ' length SYSloadedPackages $ 32767; ';
|
put ' length SYSloadedPackages $ 32767; ';
|
||||||
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
|
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
|
||||||
put ' do; ';
|
put ' do; ';
|
||||||
@@ -1544,7 +1926,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;
|
||||||
@@ -1567,7 +1949,7 @@ data _null_;
|
|||||||
put ' %put NOTE: '"Preview of the &packageName. package, version &packageVersion., license &packageLicense.;";
|
put ' %put NOTE: '"Preview of the &packageName. package, version &packageVersion., license &packageLicense.;";
|
||||||
|
|
||||||
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
|
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
|
||||||
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
|
put ' %put NOTE- ' @; put "Generated: &packageGenerated.; ";
|
||||||
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
|
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
|
||||||
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
|
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
|
||||||
put ' %put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
@@ -1683,7 +2065,7 @@ data _null_;
|
|||||||
put ' %put NOTE: '"Help for package &packageName., version &packageVersion., license &packageLicense.;";
|
put ' %put NOTE: '"Help for package &packageName., version &packageVersion., license &packageLicense.;";
|
||||||
|
|
||||||
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
|
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
|
||||||
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
|
put ' %put NOTE- ' @; put "Generated: &packageGenerated.; ";
|
||||||
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
|
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
|
||||||
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
|
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
|
||||||
put ' %put NOTE- ;';
|
put ' %put NOTE- ;';
|
||||||
@@ -1742,7 +2124,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 20230112 *"; put "***";';
|
||||||
|
|
||||||
put 'run; ' /;
|
put 'run; ' /;
|
||||||
|
|
||||||
@@ -1961,6 +2343,7 @@ filename &zipReferrence. clear;
|
|||||||
%put NOTE: Calculating SHA256 check sum.;
|
%put NOTE: Calculating SHA256 check sum.;
|
||||||
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^;
|
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^;
|
||||||
%put NOTE-;
|
%put NOTE-;
|
||||||
|
|
||||||
filename &zipReferrence. "&filesLocation./%lowcase(&packageName.).zip";
|
filename &zipReferrence. "&filesLocation./%lowcase(&packageName.).zip";
|
||||||
filename &zipReferrence. list;
|
filename &zipReferrence. list;
|
||||||
%local notesSourceOptions;
|
%local notesSourceOptions;
|
||||||
@@ -1970,12 +2353,20 @@ filename &zipReferrence. clear;
|
|||||||
set sashelp.vfunc(keep=fncname);
|
set sashelp.vfunc(keep=fncname);
|
||||||
where fncname = "HASHING_FILE";
|
where fncname = "HASHING_FILE";
|
||||||
call execute('
|
call execute('
|
||||||
data the_SHA256_hash_id;
|
data the_SHA256_hash_id;' !!
|
||||||
SHA256 = HASHING_FILE("SHA256", "&zipReferrence.", 4);
|
/* F - file */
|
||||||
label SHA256 = "The SHA256 hash digest for package &packageName.:";
|
" SHA256 = 'F*' !! HASHING_FILE('SHA256', pathname('&zipReferrence.','F'), 0); " !!
|
||||||
put / @7 SHA256= / " ";
|
' TYPE="F"; ' !!
|
||||||
run;');
|
' put / @7 SHA256= / " "; output; ' !!
|
||||||
call execute('proc print data = the_SHA256_hash_id noobs label; run;');
|
/* C - content */
|
||||||
|
" SHA256 = 'C*' !! HASHING_FILE('SHA256', '&zipReferrence.', 4); " !!
|
||||||
|
' TYPE="C"; ' !!
|
||||||
|
' put / @7 SHA256= / " "; output; ' !!
|
||||||
|
' label ' !!
|
||||||
|
' SHA256 = "The SHA256 hash digest for package &packageName.:" ' !!
|
||||||
|
' TYPE= "Type of hash digest / F = file / C = content"; ' !!
|
||||||
|
'run;');
|
||||||
|
call execute('proc print data = the_SHA256_hash_id noobs label split="/"; run;');
|
||||||
stop;
|
stop;
|
||||||
run;
|
run;
|
||||||
options ¬esSourceOptions.;
|
options ¬esSourceOptions.;
|
||||||
|
|||||||
@@ -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 20230112. 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 `20230112` #;
|
||||||
%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 20230112 */
|
||||||
/* 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 20230112. 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 `20230112` #;
|
||||||
%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 20230112
|
||||||
|
|
||||||
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 20230112.'
|
||||||
;
|
;
|
||||||
%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 `20230112` #;
|
||||||
%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 20230112
|
||||||
|
|
||||||
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 20230112. 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 `20230112` #;
|
||||||
%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.;
|
||||||
@@ -144,6 +173,19 @@ des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help
|
|||||||
end;
|
end;
|
||||||
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 */
|
||||||
@@ -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 20230112. 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 `20230112` #;
|
||||||
%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 20230112. 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 `20230112` #;
|
||||||
%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 20230112. 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 `20230112` #;
|
||||||
%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 20230112. 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 `20230112` #;
|
||||||
%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 #;
|
||||||
@@ -138,13 +138,21 @@ des = 'Macro to verify SAS package with the hash digest, version 20221112. Run %
|
|||||||
filename &_PackageFileref_. list;
|
filename &_PackageFileref_. list;
|
||||||
|
|
||||||
data _null_;
|
data _null_;
|
||||||
SHA256 = HASHING_FILE("SHA256", "&_PackageFileref_.", 4);
|
length providedHash $ 100;
|
||||||
providedHash = "&hash.";
|
providedHash = strip(symget("hash"));
|
||||||
|
select;
|
||||||
|
when ( 'F*' = upcase(substr(providedHash,1,2)) ) /* F = file digest */
|
||||||
|
SHA256 = 'F*' !! HASHING_FILE("SHA256", pathname("&_PackageFileref_.",'F'), 0);
|
||||||
|
when ( 'C*' = upcase(substr(providedHash,1,2)) ) /* C = content digest */
|
||||||
|
SHA256 = 'C*' !! HASHING_FILE("SHA256", "&_PackageFileref_.", 4);
|
||||||
|
otherwise /* legacy approach, without C or F, digest value equivalent to C */
|
||||||
|
SHA256 = HASHING_FILE("SHA256", "&_PackageFileref_.", 4);
|
||||||
|
end;
|
||||||
put "Provided Hash: " providedHash;
|
put "Provided Hash: " providedHash;
|
||||||
put "SHA256 digest: " SHA256;
|
put "SHA256 digest: " SHA256;
|
||||||
put " ";
|
put " ";
|
||||||
|
|
||||||
if SHA256 = providedHash then
|
if upcase(SHA256) = upcase(providedHash) then
|
||||||
do;
|
do;
|
||||||
put "NOTE: Package verification SUCCESSFUL.";
|
put "NOTE: Package verification SUCCESSFUL.";
|
||||||
put "NOTE- Generated hash is EQUAL to the provided one.";
|
put "NOTE- Generated hash is EQUAL to the provided one.";
|
||||||
|
|||||||
103
SPF/SPFinit.md
103
SPF/SPFinit.md
@@ -15,13 +15,13 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## This is short SAS PAckages Framework help information <a name="helpinfo"></a>
|
## This is short SAS Packages Framework help information <a name="helpinfo"></a>
|
||||||
|
|
||||||
A **SAS package** is an automatically generated, single, stand alone *zip* file containing organised and ordered code structures, created by the developer and extended with additional automatically generated "driving" files (i.e. description, metadata, load, unload, and help files).
|
A **SAS package** is an automatically generated, single, stand alone *zip* file containing organised and ordered code structures, created by the developer and extended with additional automatically generated "driving" files (i.e. description, metadata, load, unload, and help files).
|
||||||
|
|
||||||
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 **`20230112`**.
|
||||||
|
|
||||||
**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 `20230112`
|
||||||
|
|
||||||
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 `20230112`
|
||||||
|
|
||||||
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
|
||||||
@@ -207,11 +207,12 @@ 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;
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 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 `20230112`
|
||||||
|
|
||||||
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 +244,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 +286,74 @@ 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;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
## Utility macros generated during loading a package ###########################
|
||||||
|
|
||||||
|
If a package contains IML modules or CASL user defined functions additional
|
||||||
|
utility macros for IML Modules and CASL UDFs are generated when package is loaded.
|
||||||
|
|
||||||
|
Macros are generated with the following names: `%<packageName>IML()` and `%<packageName>CASLudf()`.
|
||||||
|
|
||||||
|
Their purpose is to make loading of Modules or UDFs (with potentially multiple
|
||||||
|
dependencies) easy in Proc IML and Proc CAS.
|
||||||
|
|
||||||
|
Run them, accordingly, as the first line in the Proc IML or Proc CAS to access the package content.
|
||||||
|
For Proc IML the use is as follows:
|
||||||
|
~~~~~~sas
|
||||||
|
proc IML;
|
||||||
|
%<packageName>IML()
|
||||||
|
|
||||||
|
<... your code using IML modules from the package ...>
|
||||||
|
quit;
|
||||||
|
~~~~~~
|
||||||
|
For Proc CAS the use is as follows:
|
||||||
|
~~~~~~sas
|
||||||
|
proc CAS;
|
||||||
|
%<packageName>CASLudf()
|
||||||
|
|
||||||
|
<... your code using CASL UDFs from the package ...>
|
||||||
|
quit;
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
If a utility macro is generated appropriate note and a code snippet
|
||||||
|
is printed in the log of the package loading process.
|
||||||
|
|
||||||
|
In 99% cases macros are used with default parameters values but,
|
||||||
|
in case when deeper insight about macros parameters is needed,
|
||||||
|
help info is printed in the log when the following code is run:
|
||||||
|
~~~~~~sas
|
||||||
|
%<packageName>IML(list=HELP)
|
||||||
|
~~~~~~
|
||||||
|
or
|
||||||
|
~~~~~~sas
|
||||||
|
%<packageName>CASLudf(list=HELP)
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
If created, those macros are automatically deleted when the `%unloadPackage()` macro is run.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 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 `20230112`
|
||||||
|
|
||||||
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 +402,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 `20230112`
|
||||||
|
|
||||||
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 +467,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 `20230112`
|
||||||
|
|
||||||
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 +508,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 `20230112`
|
||||||
|
|
||||||
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 +562,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 `20230112`
|
||||||
|
|
||||||
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 +629,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 `20230112`
|
||||||
|
|
||||||
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 +813,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 `20230112`
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
745
SPF/SPFinit.sas
745
SPF/SPFinit.sas
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2019 - 2022 Bartosz Jablonski
|
Copyright (c) 2019 - 2022 Bartosz Jablonski
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -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.4\], 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,21 +22,13 @@ data class;
|
|||||||
WH = weight + height;
|
WH = weight + height;
|
||||||
run;
|
run;
|
||||||
```
|
```
|
||||||
SHA256 digest for SQLinDS: A070214517CC36590083FCF9D5F488AC6E746793E94B9AA55D09A419CF291B5B
|
SHA256 digest for SQLinDS: 42677CEBB0778A6B72DE9C0071B66A345811EE470289E3847D7737F782E709E0
|
||||||
|
|
||||||
[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")
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- **MacroCore**\[1\], a macro library for SAS application developers. Over 100 macros for Base SAS, metadata, and Viya. Provided by the [SASjs framework](https://sasjs.io "SASjs framework").
|
- **DFA** (Dynamic Function Arrays)\[0.5.4\], 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 MacroCore: A23C29529F3CE7D0C8BEE9545C5D22D5B5594907547374A5135B8E5A48D7687B
|
|
||||||
|
|
||||||
[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.
|
|
||||||
```sas
|
```sas
|
||||||
%createDFArray(ArrDynamic, resizefactor=17);
|
%createDFArray(ArrDynamic, resizefactor=17);
|
||||||
|
|
||||||
@@ -63,13 +55,13 @@ data _null_;
|
|||||||
end;
|
end;
|
||||||
run;
|
run;
|
||||||
```
|
```
|
||||||
SHA256 digest for DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6
|
SHA256 digest for DFA: 6DEB02BE1C30453FBC688AF1F561709C7D6BF10B3B67988B238853A2A9D53034
|
||||||
|
|
||||||
[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.4\], 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 +80,13 @@ SHA256 digest for DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163B
|
|||||||
which = 1:H:2
|
which = 1:H:2
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
SHA256 digest for macroArray: 371B92A5ABBE82C53F7D63BC5C0D1EBD4695603D3894D8A9A5D5777D1AB59B30
|
SHA256 digest for macroArray: 8584C249C308B5E8B620ED5F695BC58CD426172FB2EACD5FF9C6899F9DE2B470
|
||||||
|
|
||||||
[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.18.4\] 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 +104,25 @@ format x bool.;
|
|||||||
|
|
||||||
%zipLibrary(sashelp,libOut=work)
|
%zipLibrary(sashelp,libOut=work)
|
||||||
```
|
```
|
||||||
SHA256 digest for BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4
|
SHA256 digest for BasePlus: A6F1977DC4EC22A39DDC7BCE68CF562AF54351A3D385D488EC3067B5A7C0F3CB
|
||||||
|
|
||||||
[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.4\], 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: 83EC349DF97EFA71187536E8CC6CD62215CE675D20DA355E14D4ACE3FBC6D524
|
||||||
|
|
||||||
[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.4\], 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: 7800F36877DC0B9A94B1AC8FFDF8B43ADB216F11B5B26343E41165E7F5E32FC0
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,3 +1,29 @@
|
|||||||
|
/* 20221215 */
|
||||||
|
BasePlus: A6F1977DC4EC22A39DDC7BCE68CF562AF54351A3D385D488EC3067B5A7C0F3CB
|
||||||
|
DFA: 6DEB02BE1C30453FBC688AF1F561709C7D6BF10B3B67988B238853A2A9D53034
|
||||||
|
dynMacroArray: 7800F36877DC0B9A94B1AC8FFDF8B43ADB216F11B5B26343E41165E7F5E32FC0
|
||||||
|
GSM: 83EC349DF97EFA71187536E8CC6CD62215CE675D20DA355E14D4ACE3FBC6D524
|
||||||
|
macroArray: 8584C249C308B5E8B620ED5F695BC58CD426172FB2EACD5FF9C6899F9DE2B470
|
||||||
|
SQLinDS: 42677CEBB0778A6B72DE9C0071B66A345811EE470289E3847D7737F782E709E0
|
||||||
|
|
||||||
|
|
||||||
|
/* 20221125 */
|
||||||
|
BasePlus: D8DBB7CC5952331FA59FEBBBDD15BC543FE3C89A8BA9150FE6AF5E412868EBE7
|
||||||
|
DFA: 7520CF21CBF1FD4AD2BC05C5DD343E508FCEA507575EBC060B4AD322FB80AB04
|
||||||
|
dynMacroArray: 440920272D1838505EA5C033B1C448C612DE2FCCFD57F157BB90ED980E4001CC
|
||||||
|
GSM: 50D8340E080BEA459E68BE315146AD3B809930DB8DC7B23C7A492C3815ACD83F
|
||||||
|
macroArray: 244B88C82AD7E6E93B8B85BC701ECDDB20B68F38B16C500EE9B49E1167ADC298
|
||||||
|
SQLinDS: D5A66E60602270E5FB1E592FA3E0C2F2C640BC077FE799A2223CB9BA275F6F47
|
||||||
|
|
||||||
|
|
||||||
|
/* 20221121 */
|
||||||
|
BasePlus: EBA9EDB3D50D854288970CC0E965DA6AD5B057F6E6433EEBEC4A02B9A25CF6E2
|
||||||
|
DFA: 3F618EDAC8B4F4BE6C19D606E6BCC58121A16BA1383D2EE64C680B4B7FA9C96A
|
||||||
|
dynMacroArray: DD0BF1768DA05EBB5F8C6E7409A0929E28DF11CB499F75B433D9648855AACAE4
|
||||||
|
GSM: E47C94B536B661DEE390F5C3EA1684DD1A246106F4FBBDAFA57F5E34D4BB16D5
|
||||||
|
macroArray: DA57FFE85F49201FD61A53411D19E97FB5A6AC3C34E34FDF4B913545699551FF
|
||||||
|
SQLinDS: 085F0B8BD4A59343E2913FF9635EA6E551ADD54E9678C35F5096D4A0A895B9C5
|
||||||
|
|
||||||
/* 20221112 */
|
/* 20221112 */
|
||||||
BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4
|
BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4
|
||||||
DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6
|
DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6
|
||||||
|
|||||||
@@ -49,14 +49,14 @@
|
|||||||
* [`%LDsNm()` macro](#ldsnm-macro)
|
* [`%LDsNm()` macro](#ldsnm-macro)
|
||||||
* [`%LVarNm()` macro](#lvarnm-macro)
|
* [`%LVarNm()` macro](#lvarnm-macro)
|
||||||
* [`%LVarNmLab()` macro](#lvarnmlab-macro)
|
* [`%LVarNmLab()` macro](#lvarnmlab-macro)
|
||||||
|
* [`%bpPIPE()` macro](#bppipe-macro)
|
||||||
|
|
||||||
|
|
||||||
* [License](#license)
|
* [License](#license)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# The BasePlus package [ver. 1.17.1] <a name="baseplus-package"></a> ###############################################
|
# The BasePlus package [ver. 1.18.4] <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.
|
||||||
@@ -220,63 +220,69 @@ data MyNextDataset;
|
|||||||
run;
|
run;
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Example 12**: List, to the log, content of `home` directory.
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%bpPIPE(ls -la ~/)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Package contains:
|
Package contains:
|
||||||
1. macro deduplistc
|
1. macro bppipe
|
||||||
2. macro deduplistp
|
2. macro deduplistc
|
||||||
3. macro deduplists
|
3. macro deduplistp
|
||||||
4. macro deduplistx
|
4. macro deduplists
|
||||||
5. macro functionexists
|
5. macro deduplistx
|
||||||
6. macro getvars
|
6. macro functionexists
|
||||||
7. macro ldsn
|
7. macro getvars
|
||||||
8. macro ldsnm
|
8. macro ldsn
|
||||||
9. macro lvarnm
|
9. macro ldsnm
|
||||||
10. macro lvarnmlab
|
10. macro lvarnm
|
||||||
11. macro qdeduplistx
|
11. macro lvarnmlab
|
||||||
12. macro qgetvars
|
12. macro qdeduplistx
|
||||||
13. macro qzipevalf
|
13. macro qgetvars
|
||||||
14. macro raincloudplot
|
14. macro qzipevalf
|
||||||
15. macro symdelglobal
|
15. macro raincloudplot
|
||||||
16. macro unziplibrary
|
16. macro symdelglobal
|
||||||
17. macro zipevalf
|
17. macro unziplibrary
|
||||||
18. macro ziplibrary
|
18. macro zipevalf
|
||||||
19. format bool
|
19. macro ziplibrary
|
||||||
20. format boolz
|
20. format bool
|
||||||
21. format ceil
|
21. format boolz
|
||||||
22. format floor
|
22. format ceil
|
||||||
23. format int
|
23. format floor
|
||||||
24. functions arrfill
|
24. format int
|
||||||
25. functions arrfillc
|
25. functions arrfill
|
||||||
26. functions arrmissfill
|
26. functions arrfillc
|
||||||
27. functions arrmissfillc
|
27. functions arrmissfill
|
||||||
28. functions arrmisstoleft
|
28. functions arrmissfillc
|
||||||
29. functions arrmisstoleftc
|
29. functions arrmisstoleft
|
||||||
30. functions arrmisstoright
|
30. functions arrmisstoleftc
|
||||||
31. functions arrmisstorightc
|
31. functions arrmisstoright
|
||||||
32. functions bracketsc
|
32. functions arrmisstorightc
|
||||||
33. functions bracketsn
|
33. functions bracketsc
|
||||||
34. functions catxfc
|
34. functions bracketsn
|
||||||
35. functions catxfi
|
35. functions catxfc
|
||||||
36. functions catxfj
|
36. functions catxfi
|
||||||
37. functions catxfn
|
37. functions catxfj
|
||||||
38. functions deldataset
|
38. functions catxfn
|
||||||
39. functions semicolonc
|
39. functions deldataset
|
||||||
40. functions semicolonn
|
40. functions semicolonc
|
||||||
41. format brackets
|
41. functions semicolonn
|
||||||
42. format semicolon
|
42. format brackets
|
||||||
43. proto qsortincbyprocproto
|
43. format semicolon
|
||||||
44. functions frommissingtonumberbs
|
44. proto qsortincbyprocproto
|
||||||
45. functions fromnumbertomissing
|
45. functions frommissingtonumberbs
|
||||||
46. functions quicksort4notmiss
|
46. functions fromnumbertomissing
|
||||||
47. functions quicksorthash
|
47. functions quicksort4notmiss
|
||||||
48. functions quicksorthashsddv
|
48. functions quicksorthash
|
||||||
49. functions quicksortlight
|
49. functions quicksorthashsddv
|
||||||
|
50. functions quicksortlight
|
||||||
|
|
||||||
*SAS package generated by generatePackage, version 20221112*
|
*SAS package generated by generatePackage, version 20221215*
|
||||||
|
|
||||||
The SHA256 hash digest for package BasePlus:
|
The SHA256 hash digest for package BasePlus:
|
||||||
`A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4`
|
`A6F1977DC4EC22A39DDC7BCE68CF562AF54351A3D385D488EC3067B5A7C0F3CB`
|
||||||
|
|
||||||
---
|
---
|
||||||
# Content description ############################################################################################
|
# Content description ############################################################################################
|
||||||
@@ -3934,6 +3940,42 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## >>> `%bpPIPE()` macro: <<< <a name="bppipe-macro"></a> #######################
|
||||||
|
|
||||||
|
The bpPIPE() [Base Plus PIPE] macro executes OS command
|
||||||
|
and print to the log output of the execution.
|
||||||
|
|
||||||
|
Under the hood it uses `_` filename reference to PIPE device.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%bpPIPE( <OS command goes here> )
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
* **NO Arguments** - Everything inside brackets is treated as an OS command.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 1.** List, to the log, content of D and C drives:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%bpPIPE(D: & dir & dir "C:\")
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 2.** List, to the log, content of `home` directory:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%bpPIPE(ls -halt ~/)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
## License ####################################################################
|
## License ####################################################################
|
||||||
|
|
||||||
Copyright (c) since 2020 Bartosz Jablonski
|
Copyright (c) since 2020 Bartosz Jablonski
|
||||||
|
|||||||
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.4] <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 20221215*
|
||||||
|
|
||||||
The SHA256 hash digest for package BasePlus:
|
The SHA256 hash digest for package BasePlus:
|
||||||
`5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6`
|
`6DEB02BE1C30453FBC688AF1F561709C7D6BF10B3B67988B238853A2A9D53034`
|
||||||
|
|
||||||
---
|
---
|
||||||
# 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.4] <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 20221215*
|
||||||
|
|
||||||
The SHA256 hash digest for package GSM:
|
The SHA256 hash digest for package GSM:
|
||||||
`5D1925970C9590CD195C15B8641B01D7857E3B2546323DC77D09154BCCA40922`
|
`83EC349DF97EFA71187536E8CC6CD62215CE675D20DA355E14D4ACE3FBC6D524`
|
||||||
|
|
||||||
|
|
||||||
## >>> `%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.4] <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 20221215*
|
||||||
|
|
||||||
The SHA256 hash digest for package macroArray:
|
The SHA256 hash digest for package macroArray:
|
||||||
`371B92A5ABBE82C53F7D63BC5C0D1EBD4695603D3894D8A9A5D5777D1AB59B30`
|
`8584C249C308B5E8B620ED5F695BC58CD426172FB2EACD5FF9C6899F9DE2B470`
|
||||||
|
|
||||||
---
|
---
|
||||||
# Content description ############################################################################################
|
# Content description ############################################################################################
|
||||||
|
|||||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
- [The SQLinDS package [ver. 2.2.1]](#sqlinds-package)
|
- [The SQLinDS package](#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.4] <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 20221215*
|
||||||
|
|
||||||
The SHA256 hash digest for package SQLinDS:
|
The SHA256 hash digest for package SQLinDS:
|
||||||
`A070214517CC36590083FCF9D5F488AC6E746793E94B9AA55D09A419CF291B5B`
|
`42677CEBB0778A6B72DE9C0071B66A345811EE470289E3847D7737F782E709E0`
|
||||||
|
|
||||||
---
|
---
|
||||||
# Content description ############################################################################################
|
# Content description ############################################################################################
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user