Compare commits

...

13 Commits

Author SHA1 Message Date
Bart Jablonski
edca6a8a8c SAS Packages Framework, version 20221125 2022-11-26 23:50:13 +01:00
Bartosz Jablonski
f59c2a4893 SAS Packages Framework, version 20221125
## SAS Packages Framework, version 20221125

---

### Changes in `%generatePackage()` macro:
- Bug fix on the edge between cherry picking feature and loading required packages.
- Documentation updated.

---

### The following packages were regenerated with the latest version of the SAS Packages Framework:
- BasePlus [1.17.3]
- DFA [0.5.3]
- dynMacroArray [0.2.3]
- GSM [0.20.3]
- macroArray [1.0.3]
- SQLinDS [2.2.3]
2022-11-26 23:49:20 +01:00
Bart Jablonski
b4314c03e3 SAS Packages Framework, version 20221121
## SAS Packages Framework, version 20221121

---

### New feature of "Cherry picking" added to the SAS Packages Framework.
Sometimes a package offers so many features that the number may be "overwhelming".
In such case only some of them may be selected for loading. Such process
is called a "cherry picking". The feature is provided by the `%loadPackage()` macro 
which uses a `cherryPick=` parameter (see description below).

For example, execution of the following code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
 %loadPackage(BasePlus, cherryPick=rainCloudPlot getVars)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
results with loading only the `rainCloudPlot` and the `getVars` elements.
If several object types (e.g., a macro and a format) share the same name 
all will be loaded.


What is the trade-off?
- Since the cherry picking selects only a part of the package the `SYSloadedPackages` 
macrovariable is not updated with the package name.
- Dependencies i.e., packages from the `ReqPackages` list, are not loaded automatically, 
so they have to be loaded manually.
- The `%unloadPackage()` macro executed on such partially loaded package may issue 
some (irrelevant) warnings.

---

### Changes in `%loadPackage()` macro:
- New `cherryPick=` parameter added to the macro.
  As a value a *space separated* list of selected elements 
  of the package to be loaded into the SAS session is expected.
  Default value of an asterisk (`*`) means: "load all elements of the package".
  Empty list is equivalent to default.
- Documentation updated.

### Changes in `%generatePackage()` macro:
- Code adjustment for the cherry picking feature.
- Minor additional code refactoring.
- The `%ICEloadPackage()` macro does not support cherry picking.

---

### The following packages were regenerated with the latest version of the framework:
- BasePlus [1.17.2]
- DFA [0.5.2]
- dynMacroArray [0.2.2]
- GSM [0.20.2]
- macroArray [1.0.2]
- SQLinDS [2.2.2]
2022-11-21 14:30:47 +01:00
Bartosz Jablonski
3a824b4d8b SAS Packages Framework, version 20221121
## SAS Packages Framework, version 20221121

---

### New feature of "Cherry picking" added to the SAS Packages Framework.
Sometimes a package offers so many features that the number may be "overwhelming".
In such case only some of them may be selected for loading. Such process
is called a "cherry picking". The feature is provided by the `%loadPackage()` macro
which uses a `cherryPick=` parameter (see description below).

For example, execution of the following code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
 %loadPackage(BasePlus, cherryPick=rainCloudPlot getVars)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
results with loading only the `rainCloudPlot` and the `getVars` elements.
If several object types (e.g., a macro and a format) share the same name
all will be loaded.

What is the trade-off?
- Since the cherry picking selects only a part of the package the `SYSloadedPackages`
macrovariable is not updated with the package name.
- Dependencies i.e., packages from the `ReqPackages` list, are not loaded automatically,
so they have to be loaded manually.
- The `%unloadPackage()` macro executed on such partially loaded package may issue
some (irrelevant) warnings.

---

### Changes in `%loadPackage()` macro:
- New `cherryPick=` parameter added to the macro.
  As a value a *space separated* list of selected elements
  of the package to be loaded into the SAS session is expected.
  Default value of an asterisk (`*`) means: "load all elements of the package".
  Empty list is equivalent to default.
- Documentation updated.

### Changes in `%generatePackage()` macro:
- Code adjustment for the cherry picking feature.
- Minor additional code refactoring.
- The `%ICEloadPackage()` macro does not support cherry picking.

---

### The following packages were regenerated with the latest version of the framework:
- BasePlus [1.17.2]
- DFA [0.5.2]
- dynMacroArray [0.2.2]
- GSM [0.20.2]
- macroArray [1.0.2]
- SQLinDS [2.2.2]
2022-11-21 14:25:56 +01:00
Bart Jablonski
ba4b5f8c32 Update README.md 2022-11-16 11:57:15 +01:00
Bart Jablonski
15e7d48adf Update README.md 2022-11-13 20:19:06 +01:00
Bart Jablonski
a5b4f117cc Update SPFinit.md 2022-11-13 20:17:43 +01:00
Bart Jablonski
b3ea02b7b0 Update HelloWorldPackage.md 2022-11-13 20:17:09 +01:00
Bart Jablonski
e4dfc6a863 SAS Packages Framework, ver. 20221112 2022-11-12 18:45:08 +01:00
Bart Jablonski
7d083e879c SAS Packages Framework, ver. 20221112 2022-11-12 18:29:29 +01:00
Bartosz Jablonski
35e6ff8d5e SAS Packages Framework, ver. 20221112
SAS Packages Framework, ver. 20221112

Changes in `%generatePackage()` macro:
- refactoring of package metadata extraction and metadata file preparation,
- in a package folder all subfolders which name starts with `!` are ignored in the package generation process,
- in a package folder all subfolders with unknown code types are ignored in the package generation process,
- bug fix in package version extraction for required package list,
- new test added to loading test,
- documentation updated.

---

The following packages were regenerated:
- BasePlus [1.17.1]
- DFA [0.5.1]
- dynMacroArray [0.2.1]
- GSM [0.20.1]
- macroArray [1.0.1]
- SQLinDS [2.2.1]
2022-11-12 17:27:00 +01:00
Bart Jablonski
5bd013c925 "Hello World" example tutorial
"Hello World" example tutorial.
2022-11-12 00:43:12 +01:00
Bart Jablonski
2ad317db01 Create HelloWorldPackage.md 2022-11-12 00:39:23 +01:00
31 changed files with 1191 additions and 471 deletions

View File

@@ -1,6 +1,6 @@
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
of this software and associated documentation files (the "Software"), to deal

129
README.md
View File

@@ -1,4 +1,4 @@
# SAS_PACKAGES - a SAS Packages Framework and Repository
# SAS_PACKAGES - a SAS Packages Framework
---
@@ -8,7 +8,13 @@ A **SAS package** is an automatically generated, single, stand alone *zip* file
The *purpose of a package* is to be a simple, and easy to access, code sharing medium, which will allow: on the one hand, to separate the code complex dependencies created by the developer from the user experience with the final product and, on the other hand, reduce developer's and user's unnecessary frustration related to a remote deployment process.
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. **The latest version** of SPF is **`20221107`**.
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages.
---
### Current version:
**The latest version** of SPF is **`20221125`**.
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).
@@ -16,14 +22,18 @@ The documentation and more advance reading would be the [**`SAS(r) packages - th
Short description of the SAS Packages Framework macros can be found [here](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/SPFinit.md "Short description of the SAS Packages Framework macros")
**Videos** (the newer the better):
### Recordings and Presentations:
- [SAS Global Forum 2020 V.E.](https://www.youtube.com/watch?v=qCkb-bx0Dv8&t=0s "SGF2020") (April 2020)
- [Sasensei International Dojo](https://www.youtube.com/watch?v=BFhdUBQgjYQ&t=0s "SID no. 1") (April 2020)
- [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)
- [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)
- [SAS Global Forum 2021 V.E.](https://www.youtube.com/watch?v=hqexaQtGw88 "SGF2021") (May 20th, 2021)
- [SAS Explore 2022](https://communities.sas.com/t5/SAS-Explore-Presentations/A-BasePlus-Package-for-SAS/ta-p/838246 "SASexplore") (September 27th-29th, 2022)
Videos presenting the SPF and packages, from various conferences and meetups (the newer the better):
- ["SAS Packages: The Way to Share" - SAS Global Forum 2020 V.E.](https://www.youtube.com/watch?v=qCkb-bx0Dv8&t=0s "SGF2020") (April 2020, ~20 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)
- ["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)
- ["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 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, ~50 minutes, general overview with the latest technical details)
---
@@ -34,53 +44,98 @@ A **SASware Ballot Idea** for adding *SAS Packages Framework* macros into Base S
---
### The User:
To use a package:
- Create a folder for your packages, under Windows OS family, e.g. `C:/SAS_PACKAGES` or under Linux/UNIX OS family, e.g. `/home/<username>/SAS_PACKAGES`.
The first step to use a package with the SAS Packages Framework:
- Create a folder for your packages, under Windows OS family e.g., `C:/SAS_PACKAGES` or under Linux/UNIX OS family e.g., `/home/<username>/SAS_PACKAGES`.
and then either:
- Download the `SPFinit.sas` file (the SAS Packages Framework) into the local packages folder.
- Manually download the `SPFinit.sas` file (the SAS Packages Framework) into the local packages folder.
- \[Optional\] Manually download the `<packageName>.zip` file into the local packages folder.
- and Execute:
```sas
filename packages "<directory/containing/packages/>"; /* setup directory for packages */
%include packages(SPFinit.sas); /* enable the framework */
filename packages "<directory/containing/packages/>"; /* setup directory for packages */
%include packages(SPFinit.sas); /* enable the framework */
/* %installPackage(packageName) */ /* install the package, unless you downloaded it manually */
/* %installPackage(packageName) */ /* install the package, unless you downloaded it manually */
%helpPackage(packageName) /* get help about the package */
%loadPackage(packageName) /* load the package content into the SAS session */
%helpPackage(packageName) /* get help about the package */
%loadPackage(packageName) /* load the package content into the SAS session */
```
or if you need it just for "one time" only Execute:
or if you need it just for "one time" only:
- Execute:
```sas
filename packages "%sysfunc(pathname(work))"; /* setup temporary directory for packages in the WORK */
filename packages "%sysfunc(pathname(work))"; /* setup WORK as temporary directory for packages */
filename SPFinit url "https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.sas";
%include SPFinit; /* enable the framework */
%installPackage(packageName) /* install the package */
%installPackage(packageName) /* install a package */
%helpPackage(packageName) /* get help about the package */
%loadPackage(packageName) /* load the package content into the SAS session */
```
[**Workshop video for the User**](https://youtu.be/qX_-HJ76g8Y) \[May 6th, 2020\] [a bit outdated but gives the idea how it works]
or do it pragmatically:
- Enable the framework [first time only]:
```sas
filename SPFinit url "https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.sas";
%include SPFinit; /* enable the framework */
```
- Install the framework on your machine in the folder you created:
```sas
filename packages "<directory/containing/packages/>";
%installPackage(SPFinit) /* install the framework */
```
- And from now on run it like this:
```sas
filename packages "<directory/containing/packages/>";
%include packages(SPFinit.sas);
%installPackage(packageName) /* install a package */
%helpPackage(packageName) /* get help about the package */
%loadPackage(packageName) /* load the package content into the SAS session */
```
---
[**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]
---
### The Developer:
To create your own package:
- Download (and use) the `SPFinit.sas` file (the SAS Packages Framework), the part of the framework required for *testing* is there too.
- See this ["Hello World" example tutorial.](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/HelloWorldPackage.md "Hello World")
- 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") article to learn more details.
- 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")
- Download and use the `SPFinit.sas` file (the SAS Packages Framework), the part of the framework required for *testing* is there too.
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!
---
### Updates worth mentioning:
**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**\[November 11th, 2021\]**:** `%extendPackagesFileref()` **macro is available**.
@@ -109,19 +164,19 @@ If you find the SPF useful **share info** about it or **give it a [star](https:/
## Available packages:
For "backward compatibility"/historical point of view the following packages are available under the `./packages` directory.
**(!)** For "backward compatibility"/historical point of view the following packages are available under the `./packages` directory.
Since *September 2022* the default location for packages is **SASPAC - the SAS Packages Archive** located under: [`https://github.com/SASPAC`](https://github.com/SASPAC) where each package is stored as a separate repository with historical versions too.
**(!)** Since *September 2022* the default location for packages is **SASPAC - the SAS Packages Archive** located under: [`https://github.com/SASPAC`](https://github.com/SASPAC) where each package is stored as a separate repository with historical versions too.
Packages:
- **SQLinDS**\[2.2\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g.
- **SQLinDS**\[2.2.3\], 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
data class;
set %SQL(select * from sashelp.class order by age);
run;
```
SHA256 digest for SQLinDS: 96D0EFE02DF1AE0D7D875A10CAF7EF63CDEF85DD0CF9418934BEFAF0C067D453
SHA256 digest for SQLinDS: D5A66E60602270E5FB1E592FA3E0C2F2C640BC077FE799A2223CB9BA275F6F47
[Documentation for SQLinDS](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/sqlinds.md "Documentation for SQLinDS")
@@ -131,13 +186,13 @@ SHA256 digest for MacroCore: A23C29529F3CE7D0C8BEE9545C5D22D5B5594907547374A5135
[Documentation for MacroCore](https://core.sasjs.io "Documentation for MacroCore")
- **DFA** (Dynamic Function Arrays)\[0.5\], 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.3\], 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: 5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC3535B4F491
SHA256 digest for DFA: 7520CF21CBF1FD4AD2BC05C5DD343E508FCEA507575EBC060B4AD322FB80AB04
[Documentation for DFA](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/dfa.md "Documentation for DFA")
- **macroArray**\[1.0\], implementation of an array concept in a macrolanguage, e.g.
- **macroArray**\[1.0.3\], implementation of an array concept in a macrolanguage, e.g.
```sas
%array(ABC[17] (111:127), macarray=Y);
@@ -156,12 +211,12 @@ SHA256 digest for DFA: 5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC353
which = 1:H:2
);
```
SHA256 digest for macroArray: ED12BC96F8A4E9E7C4D651EC1E15479DB9B55D98B274B63C507ED842081F7AB7
SHA256 digest for macroArray: 440920272D1838505EA5C033B1C448C612DE2FCCFD57F157BB90ED980E4001CC
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")
- **BasePlus**\[1.17\] adds a bunch of functionalities I am missing in BASE SAS, such as:
- **BasePlus**\[1.17.3\] adds a bunch of functionalities I am missing in BASE SAS, such as:
```sas
call arrMissToRight(myArray);
call arrFillMiss(17, myArray);
@@ -179,21 +234,21 @@ format x bool.;
%zipLibrary(sashelp,libOut=work)
```
SHA256 digest for BasePlus: 56B260350FEB7D5118F581B9EFD1B9CE1F0298DCB9A4C000A7654E2FF3F0298C
SHA256 digest for BasePlus: D8DBB7CC5952331FA59FEBBBDD15BC543FE3C89A8BA9150FE6AF5E412868EBE7
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
- **GSM** (Generate Secure Macros)\[0.20\], package allows
- **GSM** (Generate Secure Macros)\[0.20.3\], package allows
to create secured macros stored in SAS Proc FCMP functions.
The dataset with functions can be shared between different operating systems
and allows to generate macros on site without showing their code.
SHA256 digest for GSM: 2AEBC150FBA99A4AAB0265A21C57E89200BFD96B633B898F32743D1C8831A159
SHA256 digest for GSM: 50D8340E080BEA459E68BE315146AD3B809930DB8DC7B23C7A492C3815ACD83F
[Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM")
- **dynMacroArray**\[0.2\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold.
- **dynMacroArray**\[0.2.3\], 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: D7E0B8F85C05EBF8622204E0D2F3E990D48D0A9B3911051C3AD44DC98954DDCF
SHA256 digest for dynMacroArray: 440920272D1838505EA5C033B1C448C612DE2FCCFD57F157BB90ED980E4001CC
### ======

View File

@@ -0,0 +1,147 @@
## The "Hello World" Package
---
This is a "Hello World" example on how to build your first package with help of the SAS Packages Framework.
We will generate a `HelloWorld` package.
Follow the step by step instruction below.
---
`Step 1.` Create a folder for the framework e.g.,
`/home/<myUserName>/SASpackages` or `C:/SASpackages`
`Step 2.` Run the following code to install The SAS Packages Framework
in the folder you created in the `Step 1.`
```sas
filename packages "<put/folder/from/the/step/one/here>";
filename SPFinit url "https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.sas";
%include SPFinit;
%installPackage(SPFinit)
```
Check out the *log* to verify if the `Step 2.` was successful.
If it was - then continue.
`Step 3.` Create a folder for the content of the package we will generate e.g.,
`/home/<myUserName>/HelloWorldPackage` or `C:/HelloWorldPackage`
`Step 4.` Inside the directory from the `Step 3.` create two sub-folders: `01_formats`
and `02_macros`. Remember to use *lower case letters* only!
`Step 5.` Inside the `01_formats` folder create a `helloworldformat.sas` file.
Remember to use lower case letters in the file name. Copy-paste below code
into that file:
```sas
/*** HELP START ***//*
This is a help info for the HelloWorldFormat. format
*//*** HELP END ***/
value HelloWorldFormat
1 = " Hello"
2 = " SAS"
3 = " Packages"
4 = " World"
other = "!"
;
```
`Step 6.` Inside the `02_macros` folder create a `helloworldmacro.sas` file.
Remember to use lower case letters in the file name. Copy-paste below code
into that file:
```sas
/*** HELP START ***//*
This is a help info for the helloWorldMacro() macro
*//*** HELP END ***/
%macro HelloWorldMacro(n);
data _null_;
do i = 1 to &n.;
put i HelloWorldFormat. @;
end;
run;
%mend HelloWorldMacro;
```
`Step 7.` Inside the directory from the `Step 3.` create a `description.sas` file.
Remember to use lower case letters in the file name. Copy-paste below text
into that file, adjust lines 5 and 6:
```txt
Type: Package
Package: helloWorld
Title: My Hello World SAS package.
Version: 1.0
Author: <myFirstname> <myLastname> (my@mail.com)
Maintainer: <myFirstname> <myLastname> (my@mail.com)
License: MIT
Encoding: UTF8
Required: "Base SAS Software"
DESCRIPTION START:
## My "Hello World" SAS package ##
The "Hello World" is my first SAS package and
for sure it will not be the last package one!
DESCRIPTION END:
```
`Step 8.` Execute the following code and check the log
to read the `%generatePackage()` macro help info.
```sas
%generatePackage()
```
`Step 9.` Execute the following code using the folder
from the `Step 3.` and check the log to see how
the process of package generation went.
```sas
%generatePackage(
filesLocation=<put/folder/from/the/step/three/here>
)
```
`Step 10.` See the information in the output window and in the log.
The `WARNING:[License] No license.sas file provided, default (MIT) licence file will be generated.` can be ignored.
`Step 11.` Check the directory from the `Step 3.` and look for the `helloworld.zip` package file.
---
`Step 12.` Start a new SAS session, run the following code, and investigate the log:
```sas
filename packages ("<put/folder/from/the/step/one/here>" "<put/folder/from/the/step/three/here>");
%include packages(SPFinit.sas);
%loadPackage(HelloWorld)
%HelloWorldMacro(7)
```
---
### 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.
---

View File

@@ -6,7 +6,7 @@
when empty the "packages" value is used */
)/secure
/*** HELP END ***/
des = 'Macro to list directories pointed by "packages" fileref, version 20221107. Run %extendPackagesFileref(HELP) for help info.'
des = 'Macro to list directories pointed by "packages" fileref, version 20221125. Run %extendPackagesFileref(HELP) for help info.'
;
%if %QUPCASE(&packages.) = HELP %then
@@ -22,7 +22,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20221107
%put ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to list directories pointed by 'packages' fileref, version `20221107` #;
%put # Macro to list directories pointed by 'packages' fileref, version `20221125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -21,9 +21,9 @@
,delTestWork=1 /* indicates if `WORK` directories generated by user tests
should be deleted, i.e. the (NO)WORKTERM option is set,
default value 1 means "delete tests work" */
)/secure minoperator
)/ secure minoperator
/*** HELP END ***/
des = 'Macro to generate SAS packages, version 20221107. Run %generatePackage() for help info.'
des = 'Macro to generate SAS packages, version 20221125. Run %generatePackage() for help info.'
;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do;
@@ -38,7 +38,7 @@ des = 'Macro to generate SAS packages, version 20221107. Run %generatePackage()
%put ### This is short help information for the `generatePackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to generate SAS packages, version `20221107` #;
%put # Macro to generate SAS packages, version `20221125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -133,16 +133,19 @@ filename &_LIC_. "&filesLocation./license.sas" lrecl = 1024;
infile &_DESCR_.;
input;
%local metaExtStr; /* metadata Extraction String; */
%let metaExtStr=kscanx(_INFILE_, 2, ":");
select( strip(upcase(kscanx(_INFILE_, 1, ":"))) );
when("PACKAGE") call symputX("packageName", kscanx(_INFILE_, 2, ":"),"L");
when("VERSION") call symputX("packageVersion", kscanx(_INFILE_, 2, ":"),"L");
when("AUTHOR") call symputX("packageAuthor", kscanx(_INFILE_, 2, ":"),"L");
when("MAINTAINER") call symputX("packageMaintainer", kscanx(_INFILE_, 2, ":"),"L");
when("TITLE") call symputX("packageTitle", kscanx(_INFILE_, 2, ":"),"L");
when("ENCODING") call symputX("packageEncoding", kscanx(_INFILE_, 2, ":"),"L");
when("LICENSE") call symputX("packageLicense", kscanx(_INFILE_, 2, ":"),"L");
when("REQUIRED") call symputX("packageRequired", kscanx(_INFILE_, 2, ":"),"L");
when("REQPACKAGES") call symputX("packageReqPackages", kscanx(_INFILE_, 2, ":"),"L");
when("PACKAGE") call symputX("packageName", &metaExtStr., "L");
when("VERSION") call symputX("packageVersion", &metaExtStr., "L");
when("AUTHOR") call symputX("packageAuthor", &metaExtStr., "L");
when("MAINTAINER") call symputX("packageMaintainer", &metaExtStr., "L");
when("TITLE") call symputX("packageTitle", &metaExtStr., "L");
when("ENCODING") call symputX("packageEncoding", &metaExtStr., "L");
when("LICENSE") call symputX("packageLicense", &metaExtStr., "L");
when("REQUIRED") call symputX("packageRequired", &metaExtStr., "L");
when("REQPACKAGES") call symputX("packageReqPackages", &metaExtStr., "L");
/* stop at the beginning of description */
when("DESCRIPTION START") stop;
@@ -163,13 +166,13 @@ filename &_LIC_. "&filesLocation./license.sas" lrecl = 1024;
%do;
%put ERROR: At least one of descriptors is missing!;
%put ERROR- They are required to create a package.;
%put ERROR- &=packageName.;
%put ERROR- &=packageTitle.;
%put ERROR- &=packageVersion.;
%put ERROR- &=packageAuthor.;
%put ERROR- &=packageMaintainer.;
%put ERROR- &=packageEncoding.;
%put ERROR- &=packageLicense.;
%put ERROR- packageName=%superq(packageName);
%put ERROR- packageTitle=%superq(packageTitle);
%put ERROR- packageVersion=%superq(packageVersion);
%put ERROR- packageAuthor=%superq(packageAuthor);
%put ERROR- packageMaintainer=%superq(packageMaintainer);
%put ERROR- packageEncoding=%superq(packageEncoding);
%put ERROR- packageLicense=%superq(packageLicense);
%put ERROR- ;
%put ERROR- Aborting.;
%abort;
@@ -215,7 +218,7 @@ filename &_LIC_. "&filesLocation./license.sas" lrecl = 1024;
%abort;
%end;
%if %bquote(&packageRequired.) ne %then
%if %superq(packageRequired) ne %then
%do;
/* turn off the note about quoted string length */
%local qlenmax_fstimer_tmp;
@@ -264,7 +267,7 @@ filename &_LIC_. "&filesLocation./license.sas" lrecl = 1024;
%if &tryExcept. %then %abort;
%end;
%if %bquote(&packageReqPackages.) ne %then
%if %superq(packageReqPackages) ne %then
%do;
/* turn off the note about quoted string length */
%local qlenmax_fstimer_tmp;
@@ -498,6 +501,7 @@ DESCRIPTION END:
/* collect the data */
data &filesWithCodes.;
putlog "NOTE- ";
putlog "NOTE: Generating content dataset: &filesWithCodes..";
putlog "NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
putlog "NOTE- ";
@@ -511,7 +515,8 @@ data &filesWithCodes.;
folderid=dopen(folderRef);
do i=1 to dnum(folderId); drop i;
folder = dread(folderId, i);
folder = dread(folderId, i);
if folder NE lowcase(folder) then
do;
put 'ERROR: Folder should be named ONLY with low case letters.';
@@ -529,6 +534,27 @@ data &filesWithCodes.;
fileId = dopen(fileRef);
file = ' ';
/* ignore folders which name starts with ! */
if fileId AND "!" =: folder then
do;
put "INFO: Folder " folder "name starts with ! and will be ignored. " /
" No content from it will be used to generate the package." / " ";
goto ignoreFolder;
end;
/* ignore unknown types for folders */
if fileId AND not (upcase(type) in:
('LIBNAME' 'MACRO' /*'MACROS'*/ 'DATA' 'FUNCTION' /*'FUNCTIONS'*/ 'FORMAT' /*'FORMATS'*/ 'IMLMODULE' 'PROTO' 'EXEC' 'CLEAN' 'LAZYDATA' 'TEST'))
then
do;
put "WARNING: Type " type 'is not yet supported.' /
"WARNING- Folder " folder " will be ignored. " /
"WARNING- No content from it will be used to generate the package." / " ";
goto ignoreFolder;
end;
/* if it is a directory then read its content */
if fileId then
do j = 1 to dnum(fileId); drop j;
file = dread(fileId, j);
@@ -551,6 +577,8 @@ data &filesWithCodes.;
"WARNING- ";
end;
end;
ignoreFolder: ;
rc = dclose(fileId);
rc = filename(fileRef);
end;
@@ -563,6 +591,7 @@ data &filesWithCodes.;
put 'ERROR: Aborting due to previous errors.';
abort;
end;
put " ";
stop;
run;
@@ -637,7 +666,7 @@ data _null_;
put "ERROR: There are " e "EXECs files and " c "CLEANs files!" /
"ERROR- Each EXEC file should have CLEAN file counterpart and vice versa." /
'ERROR- Please create appropriate files and make your package a "role model".' /
'ERROR: Aborting package generation!' ;
'ERROR: [&sysmacroname.] Aborting package generation!' ;
abort;
end;
end;
@@ -653,12 +682,12 @@ title3 "Package encoding: '&packageEncoding.', session encoding: '&SYSENCODING.'
title4 " ______________________________ ";
title5 "List of files for package: &packageName. (version &packageVersion.), license: &packageLicense.";
title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
%if (%bquote(&packageRequired.) ne )
or (%bquote(&packageReqPackages.) ne )
%if (%superq(packageRequired) ne )
or (%superq(packageReqPackages) ne )
%then
%do;
title7 "Required SAS licences: %qsysfunc(compress(%bquote(&packageRequired.), %str(%'%")))" ; /* ' */
title8 "Required SAS packages: %qsysfunc(compress(%bquote(&packageReqPackages.),%str(%'%")))" ; /* " */
title7 "Required SAS licences: %qsysfunc(compress(%superq(packageRequired), %str(%'%")))" ; /* ' */
title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */
%end;
@@ -669,6 +698,7 @@ options &notesSourceOptions.;
/* packages description */
%put NOTE-;
%put NOTE: Preparing description file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -680,6 +710,7 @@ data _null_;
run;
/* package license */
%put NOTE-;
%put NOTE: Preparing license file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -698,8 +729,10 @@ run;
%let packageLicense = MIT;
data _null_;
file &zipReferrence.(license.sas) encoding = &packageEncoding.;
length packageAuthor $ 1024;
packageAuthor = symget('packageAuthor');
put " ";
put " Copyright (c) %sysfunc(today(),year4.) &packageAuthor. ";
put " Copyright (c) since %sysfunc(today(),year4.) " packageAuthor ;
put " ";
put " Permission is hereby granted, free of charge, to any person obtaining a copy ";
put ' of this software and associated documentation files (the "Software"), to deal ';
@@ -723,6 +756,7 @@ run;
%end;
/* package metadata */
%put NOTE-;
%put NOTE: Preparing metadata file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -735,24 +769,26 @@ data _null_;
end;
file &zipReferrence.(packagemetadata.sas) encoding = &packageEncoding.;
put ' data _null_; '; /* simple "%local" returns error while loading package */
put ' call symputX("packageName", " ", "L");';
put ' call symputX("packageVersion", " ", "L");';
put ' call symputX("packageTitle", " ", "L");';
put ' call symputX("packageAuthor", " ", "L");';
put ' call symputX("packageMaintainer", " ", "L");';
put ' call symputX("packageEncoding", " ", "L");';
put ' call symputX("packageLicense", " ", "L");';
put ' run; ';
length packageName $ 32 packageVersion $ 24
packageTitle packageAuthor packageMaintainer $ 2048
packageEncoding $ 8 packageLicense $ 128;
packageName = quote(strip(symget('packageName')),'"');
packageVersion = quote(strip(symget('packageVersion')),'"');
packageTitle = quote(strip(symget('packageTitle')),'"');
packageAuthor = quote(strip(symget('packageAuthor')),'"');
packageMaintainer = quote(strip(symget('packageMaintainer')),'"');
packageEncoding = quote(strip(symget('packageEncoding')),'"');
packageLicense = quote(strip(symget('packageLicense')),'"');
put ' %let packageName =' "&packageName.;";
put ' %let packageVersion =' "&packageVersion.;";
put ' %let packageTitle =' "&packageTitle.;";
put ' %let packageAuthor =' "&packageAuthor.;";
put ' %let packageMaintainer =' "&packageMaintainer.;";
put ' %let packageEncoding =' "&packageEncoding.;";
put ' %let packageLicense =' "&packageLicense.;";
put ' ; ';
put ' data _null_; '; /* simple "%local" returns error while loading package */
put ' call symputX("packageName", ' packageName ', "L");';
put ' call symputX("packageVersion", ' packageVersion ', "L");';
put ' call symputX("packageTitle", ' packageTitle ', "L");';
put ' call symputX("packageAuthor", ' packageAuthor ', "L");';
put ' call symputX("packageMaintainer", ' packageMaintainer ', "L");';
put ' call symputX("packageEncoding", ' packageEncoding ', "L");';
put ' call symputX("packageLicense", ' packageLicense ', "L");';
put ' run; ';
stop;
run;
@@ -771,6 +807,7 @@ run;
%ICEloadpackage(sqlinds)
*/
%put NOTE-;
%put NOTE: Preparing iceloadpackage file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -823,7 +860,14 @@ data _null_;
put ' %if %bquote(&packageEncoding.) NE %then &packageEncoding. ; ';
put ' %else utf8 ; ';
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 ' options &tempLoad_minoperator.; ';
put ' filename &_PackageFileref_. clear; ';
put ' %WrongVersionOFPackage: ';
@@ -831,8 +875,8 @@ data _null_;
put " ";
run;
/* loading package files */
%put NOTE-;
%put NOTE: Preparing load file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -844,21 +888,34 @@ data _null_;
put "filename &_PackageFileref_. list;" /;
put ' %put NOTE- ;';
put ' %put NOTE: ' @; put "Loading package &packageName., version &packageVersion., license &packageLicense.; ";
put ' %put NOTE: ' @; put "*** &packageTitle. ***; ";
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
put ' %put NOTE- ' @; put "Author(s): &packageAuthor.; ";
put ' %put NOTE- ' @; put "Maintainer(s): &packageMaintainer.; ";
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
put ' %put NOTE- ;';
put ' %put NOTE- Run %nrstr(%%)helpPackage(' "&packageName." ') for the description;';
put ' %put NOTE- ;';
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 */
isFunction = 0;
isFormat = 0;
%if (%bquote(&packageRequired.) ne )
or (%bquote(&packageReqPackages.) ne )
%if (%superq(packageRequired) ne )
or (%superq(packageReqPackages) ne )
%then
%do;
put ' data _null_; ';
@@ -866,7 +923,7 @@ data _null_;
put ' run; ';
%end;
%if %bquote(&packageRequired.) ne %then
%if %superq(packageRequired) ne %then
%do;
put ' %put NOTE- *Testing required SAS components*%sysfunc(DoSubL( '; /* <- DoSubL() is here */
put ' options nonotes nosource %str(;) ';
@@ -929,14 +986,16 @@ data _null_;
put ' ))*; ';
%end;
%if %bquote(&packageReqPackages.) ne %then
%if %superq(packageReqPackages) ne %then
%do;
length packageReqPackages $ 32767;
packageReqPackages = lowcase(symget('packageReqPackages'));
/* try to load required packages */
put 'data _null_ ; ';
put ' length req name $ 64 vers verR 8 SYSloadedPackages $ 32767; ';
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 ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
put ' do; ';
put ' do until(EOF); ';
@@ -953,7 +1012,7 @@ data _null_;
put ' do _N_ = 1 to countw(SYSloadedPackages); ';
put ' req = kscanx(SYSloadedPackages, _N_, " "); ';
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
put ' vers = input(compress(kscanx(req,-1, "("), ".", "KD"),best32.); ';
put ' vers = compress(kscanx(req,-1, "("), ".", "KD"); ';
put ' _RC_ = LP.add(); ';
put ' end; ';
/* check if elements of the framework are available */
@@ -963,11 +1022,21 @@ data _null_;
put ' do req = ' / packageReqPackages / ' ; ';
/* put ' req = compress(req, "(.)", "KDF"); ';*/
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
put ' verR = input(compress(kscanx(req,-1, "("), ".", "KD"),best32.); vers = .; ';
put ' verR = compress(kscanx(req,-1, "("), ".", "KD"); vers = ""; ';
put ' LP_find = LP.find(); ';
put ' if (LP_find ne 0) or (LP_find = 0 and . < vers < verR) then ';
/* convert major.minor.patch to number*/
put ' array V verR vers ; ';
put ' array VN verRN versN; ';
put ' do over V; ';
put ' VN = input("0"!!scan(V,1,".","M"),?? best.)*1e8 ';
put ' + input("0"!!scan(V,2,".","M"),?? best.)*1e4 ';
put ' + input("0"!!scan(V,3,".","M"),?? best.)*1e0; ';
put ' end; ';
put ' if (LP_find ne 0) or (LP_find = 0 and . < versN < verRN) then ';
put ' do; ';
put ' put "NOTE: Trying to load required SAS package " req; ';
put ' put "NOTE: Trying to load required SAS package: " req; ';
put ' if LoadPackageExist then ';
put ' call execute(cats(''%nrstr(%loadPackage('', name, ", requiredVersion = ", verR, "))")); ';
put ' else if ICELoadPackageExist then ';
@@ -979,7 +1048,8 @@ data _null_;
/* test if required packages are loaded */
put 'data _null_ ; ';
put ' length req name $ 64 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 ' do; ';
put ' do until(EOF); ';
@@ -995,7 +1065,7 @@ data _null_;
put ' do _N_ = 1 to countw(SYSloadedPackages); ';
put ' req = kscanx(SYSloadedPackages, _N_, " "); ';
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
put ' vers = input(compress(kscanx(req,-1, "("), ".", "KD"), best32.); ';
put ' vers = compress(kscanx(req,-1, "("), ".", "KD"); ';
put ' _RC_ = LP.add(); ';
put ' end; ';
@@ -1003,12 +1073,22 @@ data _null_;
put ' do req = ' / packageReqPackages / ' ; ';
/* put ' req = compress(req, "(.)", "KDF"); ';*/
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
put ' verR = input(compress(kscanx(req,-1, "("), ".", "KD"),best32.); vers = .; ';
put ' verR = compress(kscanx(req,-1, "("), ".", "KD"); vers = " "; ';
put ' LP_find = LP.find(); ';
put ' if (LP_find ne 0) or (LP_find = 0 and . < vers < verR) then ';
/* convert major.minor.patch to number*/
put ' array V verR vers ; ';
put ' array VN verRN versN; ';
put ' do over V; ';
put ' VN = input("0"!!scan(V,1,".","M"),?? best.)*1e8 ';
put ' + input("0"!!scan(V,2,".","M"),?? best.)*1e4 ';
put ' + input("0"!!scan(V,3,".","M"),?? best.)*1e0; ';
put ' end; ';
put ' if (LP_find ne 0) or (LP_find = 0 and . < versN < verRN) then ';
put ' do; ';
put ' missingPackagr = 1; ';
put ' put "ERROR: SAS package " req "is missing! Download it and" ; ';
put ' put "ERROR: SAS package: " req "is missing! Download it and" ; ';
put ' put ''ERROR- use %loadPackage('' name ", requiredVersion = " verR ") to load it." ;';
put ' end ; ';
put ' end ; ';
@@ -1020,7 +1100,7 @@ data _null_;
put ' call symputX("packageRequiredErrors", 1, "L"); ';
put ' do req = ' / packageReqPackages / ' ; ';
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
put ' vers = input(compress(kscanx(req,-1, "("), ".", "KD"), best32.); ';
put ' vers = compress(kscanx(req,-1, "("), ".", "KD"); ';
put ' put "ERROR: SAS package " req "is missing! Download/install it and" ; ';
put ' put ''ERROR- use %loadPackage('' name ", requiredVersion = " vers ") to load it." ; ';
put ' end ; ';
@@ -1029,12 +1109,12 @@ data _null_;
put 'run; ';
%end;
%if (%bquote(&packageRequired.) ne )
or (%bquote(&packageReqPackages.) ne )
%if (%superq(packageRequired) ne )
or (%superq(packageReqPackages) ne )
%then
%do;
put ' data _null_; ';
put ' if symget("packageRequiredErrors") = "1" then ';
put ' if 1 = symgetn("packageRequiredErrors") then ';
put ' do; ';
put ' put "ERROR: Loading package &packageName. will be aborted!";';
put ' put "ERROR- Required components are missing."; ';
@@ -1044,7 +1124,9 @@ data _null_;
put ' run; ';
%end;
do until(eof);
do until(eof); /* loopOverTypes - start */
set &filesWithCodes. end = EOF nobs=NOBS;
by TYPE notsorted;
if (upcase(type) in: ('CLEAN' 'LAZYDATA' 'TEST')) then continue; /* cleaning files are only included in unload.sas */
@@ -1060,90 +1142,182 @@ data _null_;
putlog 'WARNING: Type ' type 'is not yet supported.';
continue;
end;
put '%put NOTE- ;';
put '%put NOTE: Element of type ' type 'from the file "' file +(-1) '" will be included;';
if upcase(type)=:'MACRO' then
put '%put %sysfunc(ifc(%SYSMACEXIST(' fileshort ')=1, NOTE# Macro ' fileshort
"exist. It will be overwritten by the macro from the &packageName. package, ));";
put " ";
if upcase(type)=:'EXEC' then
do;
put '%put NOTE- ;';
put '%put NOTE- Executing the following code: ;';
put '%put NOTE- *****************************;';
put 'data _null_;';
put " infile &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') lrecl=32767;';
put ' input;';
put ' putlog "*> " _infile_;';
put 'run;' /;
put '%put NOTE- *****************************;';
put '%put NOTE- ;';
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 */
put '%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;' /;
/* FOOTERS for IML, FCMP, and PROTO */
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 */
put "run; ";
end;
if 1 = LAST.type and upcase(type)='IMLMODULE' then /* footer, for IML modules */
do;
put "reset storage = WORK.&packageName.IML; "; /* set the storage location for modules */
put "store module = _ALL_; "; /* and store all created modules */
put "quit; ";
end;
isFunction + (upcase(type)=:'FUNCTION');
isFormat + (upcase(type)=:'FORMAT');
isProto + (upcase(type)=:'PROTO');
/* HEADERS for IML, FCMP, and PROTO - start */
if 1 = isFunction and upcase(type)=:'FUNCTION' then
do;
/* macro variable for test if cherry picking used FCMP */
put 'data _null_; ';
put ' call symputX("cherryPick_FCMP", 0, "L"); ';
put 'run; ';
end;
if 1 = FIRST.type and upcase(type)='FUNCTIONS' then
do;
/* header for multiple functions in one FCMP run */
put "proc fcmp outlib = work.%lowcase(&packageName.fcmp).package ; ";
end;
if 1 = FIRST.type and upcase(type)='PROTO' then
do;
/* macro variable for test if cherry picking used PROTO */
put 'data _null_; ';
put ' call symputX("cherryPick_PROTO", 0, "L"); ';
put 'run; ';
/* header for multiple functions in one PROTO run */
put "proc proto package = work.%lowcase(&packageName.proto).package ; ";
end;
if 1 = FIRST.type and upcase(type)='IMLMODULE' then
do;
/* macro variable for test if cherry picking used IML */
put 'data _null_; ';
put ' call symputX("cherryPick_IML", 0, "L"); ';
put 'run; ';
/* header, for IML modules */
put "proc iml ; ";
end;
if 1 = FIRST.type and upcase(type)='FORMATS' then
do;
/* header, for FORMATS */
put "proc format lib = work.%lowcase(&packageName.format) ; ";
end;
if 1 = isFormat and upcase(type)=:'FORMAT' then
do;
/* macro variable for test if cherry picking used FORMAT */
put 'data _null_; ';
put ' call symputX("cherryPick_FORMAT", 0, "L"); ';
put 'run; ';
end;
/* HEADERS for IML, FCMP, and PROTO - end */
put ' ' /
'%if (%str(*)=%superq(cherryPick)) or (' fileshort +(-1) ' in %superq(cherryPick)) %then %do; '; /* Cherry Pick test1 start */
put ' %put NOTE- ;';
put ' %put NOTE: >> Element of type ' type 'from the file "' file +(-1) '" will be included <<;';
if upcase(type)=:'MACRO' then
put ' %put %sysfunc(ifc(%SYSMACEXIST(' fileshort +(-1) ')=1, NOTE# Macro ' fileshort
"exist. It will be overwritten by the macro from the &packageName. package, ));";
if upcase(type)=:'EXEC' then
do;
put ' %put NOTE- ;';
put ' %put NOTE- Executing the following code: ;';
put ' %put NOTE- *****************************;';
put ' data _null_;';
put " infile &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') lrecl=32767;';
put ' input;';
put ' putlog "*> " _infile_;';
put ' run;';
put ' %put NOTE- *****************************;';
put ' %put NOTE- ;';
end;
/* include the file with the code of the element */
put ' %include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;';
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
do; /* footer, for multiple functions in one FCMP run, one PROTO run, or one FORMAT run */
put "run; " / ;
end;
if 1 = LAST.type and upcase(type)='IMLMODULE' then /* footer, for IML modules */
do;
put '%if 0 < &cherryPick_IML. %then %do; ' /
"reset storage = WORK.&packageName.IML; " / /* set the storage location for modules */
"store module = _ALL_; " / /* and store all created modules */
'%end; ' /
"quit; " / ;
end;
/* FOOTERS for IML, FCMP, and PROTO - end */
/* add the link to the functions dataset, only for the first occurrence */
if 1 = isFunction and (upcase(type)=:'FUNCTION') then
do;
put "options APPEND=(cmplib = work.%lowcase(&packageName.fcmp));";
put '%put NOTE- ;';
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
put "options APPEND=(cmplib = work.%lowcase(&packageName.fcmp));"/;
end;
/* add the link to the proto functions dataset, only for the first occurrence */
if 1 = isProto and (upcase(type)=:'PROTO') then
do;
put "options APPEND=(cmplib = work.%lowcase(&packageName.proto));";
put '%put NOTE- ;';
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
put "options APPEND=(cmplib = work.%lowcase(&packageName.proto));"/;
end;
/* add the link to the formats catalog, only for the first occurrence */
if 1 = isFormat and (upcase(type)=:'FORMAT') then
do;
put "options INSERT=( fmtsearch = work.%lowcase(&packageName.format) );";
put '%put NOTE- ;';
put '%put NOTE:[FMTSEARCH] %sysfunc(getoption(fmtsearch));'/;
put "options INSERT=(fmtsearch = work.%lowcase(&packageName.format));"/;
end;
end;
end; /* loopOverTypes - start */
/* cherry pick clean in cmplib for functions */
if isFunction then
do;
put '%if 0 = &cherryPick_FCMP. %then %do;';
put 'options cmplib = (%unquote(%sysfunc(tranwrd(' /
'%lowcase(%sysfunc(getoption(cmplib)))' /
',%str(' "work.%lowcase(&packageName.fcmp)" '), %str() ))));';
put 'options cmplib = (%unquote(%sysfunc(compress(' /
'%sysfunc(getoption(cmplib))' /
',%str(()) ))));';
put '%end;';
end;
/* cherry pick clean in cmplib for proto */
if isProto then
do;
put '%if 0 = &cherryPick_PROTO. %then %do;';
put 'options cmplib = (%unquote(%sysfunc(tranwrd(' /
'%lowcase(%sysfunc(getoption(cmplib)))' /
',%str(' "work.%lowcase(&packageName.proto)" '), %str() ))));';
put 'options cmplib = (%unquote(%sysfunc(compress(' /
'%sysfunc(getoption(cmplib))' /
',%str(()) ))));';
put "proc delete data=work.%lowcase(&packageName.proto); run;";
put '%end;';
end;
/* list cmplib for functions */
if isFunction OR isProto then
do;
put '%put NOTE- ;';
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
end;
/* list fmtsearch for formats */
if isFormat then
do;
put '%if 0 = &cherryPick_FCMP. %then %do;';
put 'options fmtsearch = (%unquote(%sysfunc(tranwrd(' /
'%lowcase(%sysfunc(getoption(fmtsearch)))' /
',%str(' "work.%lowcase(&packageName.)format" '), %str() ))));';
put 'options fmtsearch = (%unquote(%sysfunc(compress(' /
'%sysfunc(getoption(fmtsearch))' /
', %str(()) ))));';
put '%end;';
put '%put NOTE- ;';
put '%put NOTE:[FMTSEARCH] %sysfunc(getoption(fmtsearch));'/;
end;
/* update SYSloadedPackages global macrovariable */
put '%if (%str(*)=%superq(cherryPick)) %then %do; '; /* Cherry Pick test3 start */
put ' data _null_ ; ';
put ' length SYSloadedPackages stringPCKG $ 32767; ';
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
@@ -1178,8 +1352,9 @@ data _null_;
put " put 'NOTE: SYSloadedPackages = &packageName.(&packageVersion.)'; ";
put ' end; ';
put ' stop; ';
put 'run; ' / ;
put ' run; ';
put '%end; ' / ; /* Cherry Pick test3 end */
put '%put NOTE- ;';
put '%put NOTE: '"Loading package &packageName., version &packageVersion., license &packageLicense.;";
put '%put NOTE- *** END ***;' /;
@@ -1188,6 +1363,7 @@ data _null_;
run;
/* to load lazydata */
%put NOTE-;
%put NOTE: Preparing "lazydata" file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -1199,10 +1375,11 @@ data _null_;
put "filename &_PackageFileref_. list;" /;
put ' %put NOTE- ;';
put ' %put NOTE: ' @; put "Data for package &packageName., version &packageVersion., license &packageLicense.; ";
put ' %put NOTE: ' @; put "*** &packageTitle. ***; ";
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
put ' %put NOTE- ' @; put "Author(s): &packageAuthor.; ";
put ' %put NOTE- ' @; put "Maintainer(s): &packageMaintainer.; ";
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
put ' %put NOTE- ;';
put ' %put NOTE- Write %nrstr(%%)helpPackage(' "&packageName." ') for the description;';
put ' %put NOTE- ;';
@@ -1221,7 +1398,7 @@ data _null_;
put 'do;';
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 'end;';
put 'end;' /;
end;
/* use lazyData to reload data type */
if ( upcase(type) =: 'DATA' ) then
@@ -1230,7 +1407,7 @@ data _null_;
put 'do;';
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 'end;';
put 'end;' /;
end;
end;
@@ -1245,6 +1422,7 @@ run;
/* unloading package objects */
%put NOTE-;
%put NOTE: Preparing unload file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -1273,7 +1451,7 @@ data _null_;
put ' putlog "*> " _infile_;';
put 'run;' /;
put '%put NOTE- *****************************;';
put '%put NOTE- ;' /;
put '%put NOTE- ;';
put '%include' " &_PackageFileref_.(_" folder +(-1) "." file +(-1) ') / nosource2;' /;
end;
@@ -1292,8 +1470,8 @@ data _null_;
set &filesWithCodes. end = EOF nobs = NOBS;
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- ;' /;
put ',"' fileshort upcase32. '"';
put '%put NOTE- ;';
put ',"' fileshort upcase32. '"' /;
end;
/**/
put ' )';
@@ -1310,8 +1488,8 @@ data _null_;
set &filesWithCodes. end = EOF;
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- ;' /;
put ',"' fileshort upcase32. '"';
put '%put NOTE- ;';
put ',"' fileshort upcase32. '"' /;
isFormat + 1;
end;
put ' )';
@@ -1383,8 +1561,8 @@ data _null_;
set &filesWithCodes. end = EOF;
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- ;' /;
put 'deletefunc ' fileshort ';';
put '%put NOTE- ;';
put 'deletefunc ' fileshort ';' /;
isFunction + 1;
end;
put "run;" /;
@@ -1424,8 +1602,8 @@ data _null_;
set &filesWithCodes. end = EOF;
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- ;' /;
put 'drop table ' fileshort ';';
put '%put NOTE- ;';
put 'drop table ' fileshort ';' /;
end;
put "quit;" /;
@@ -1435,8 +1613,8 @@ data _null_;
set &filesWithCodes. end = EOF;
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- ;' /;
put 'libname ' fileshort ' clear;';
put '%put NOTE- ;';
put 'libname ' fileshort ' clear;' /;
end;
put "run;" /;
@@ -1453,12 +1631,12 @@ data _null_;
put ' put '' %unloadPackage( '' name ")" ; ';
put ' end ; ';
put ' put "NOTE-" / "NOTE-"; stop; ';
put 'run; ';
put 'run; ' /;
%end;
/* update SYSloadedPackages global macrovariable */
put ' data _null_ ; ';
put 'data _null_ ; ';
put ' length SYSloadedPackages $ 32767; ';
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
put ' do; ';
@@ -1482,13 +1660,14 @@ data _null_;
put '%put NOTE: ' "Unloading package &packageName., version &packageVersion., license &packageLicense.;";
put '%put NOTE- *** END ***;';
put '%put NOTE- ;';
put '%put NOTE- ;' /;
put "/* unload.sas end */";
stop;
run;
/* package preview, i.e. print out all content of the package files into the log */
%put NOTE-;
%put NOTE: Preparing preview file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -1502,10 +1681,11 @@ data _null_;
put "filename &_PackageFileref_. list;" /;
put ' %put NOTE- ;';
put ' %put NOTE: '"Preview of the &packageName. package, version &packageVersion., license &packageLicense.;";
put ' %put NOTE: ' @; put "*** &packageTitle. ***; ";
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
put ' %put NOTE- ' @; put "Author(s): &packageAuthor.; ";
put ' %put NOTE- ' @; put "Maintainer(s): &packageMaintainer.; ";
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
put ' %put NOTE- ;';
put ' %put NOTE- *** START ***;' /;
@@ -1603,6 +1783,7 @@ data _null_;
run;
/* package help */
%put NOTE-;
%put NOTE: Preparing help file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -1616,10 +1797,11 @@ data _null_;
put "filename &_PackageFileref_. list;" /;
put ' %put NOTE- ;';
put ' %put NOTE: '"Help for package &packageName., version &packageVersion., license &packageLicense.;";
put ' %put NOTE: ' @; put "*** &packageTitle. ***; ";
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
put ' %put NOTE- ' @; put "Author(s): &packageAuthor.; ";
put ' %put NOTE- ' @; put "Maintainer(s): &packageMaintainer.; ";
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
put ' %put NOTE- ;';
put ' %put NOTE- *** START ***;' /;
@@ -1676,7 +1858,7 @@ data _null_;
put ' end ; ';
%end;
put 'put "***"; put "* SAS package generated by generatePackage, version 20221107 *"; put "***";';
put 'put "***"; put "* SAS package generated by generatePackage, version 20221125 *"; put "***";';
put 'run; ' /;
@@ -1817,7 +1999,7 @@ data _null_;
call execute(' if ex then put "File " pathname "copied into the package with return code: " rc "(0 = success)";');
call execute(' else do;');
call execute(' put "ERROR: File " pathname "NOT copied into the package!" ;');
call execute(' put "ERROR: [&sysmacroname.] File " pathname "NOT copied into the package!" ;');
call execute(' call symputX("createPackageContentStatus",1,"L");');
call execute(' end;');
@@ -1833,7 +2015,7 @@ data _null_;
call execute(' if 18 <= lengthn(_endhelpline_) AND _endhelpline_ =: "/*** DNE PLEH ***/" then test + (-1); '); /* *** HELP END *** */
call execute(' if (test not in (.,0,1)) or (EOF and test) then ');
call execute(' do; ');
call execute(' put "ERROR: Unmatched or nested HELP tags in ' !! catx('/', folder, file) !! '! Line: " _N_; ');
call execute(' put "ERROR: [&sysmacroname.] Unmatched or nested HELP tags in ' !! catx('/', folder, file) !! '! Line: " _N_; ');
call execute(' put "ERROR- Aborting! "; ');
call execute(' call symputX("createPackageContentStatus",1,"L"); ');
call execute(' abort; ');
@@ -1863,7 +2045,7 @@ data _null_;
call execute(' ex = fexist("_SPFOUT_");');
call execute(' if not ex then do;');
call execute(' put "ERROR: File ' !! strip(drivFile) !! '.sas DOES NOT EXIST in the package!" ;');
call execute(' put "ERROR: [&sysmacroname.] File ' !! strip(drivFile) !! '.sas DOES NOT EXIST in the package!" ;');
call execute(' call symputX("createPackageContentStatus",1,"L"); ');
call execute(' end;');
@@ -1920,6 +2102,7 @@ filename &zipReferrence. clear;
/* verify if there were errors while package content creation */
%if %bquote(&createPackageContentStatus.) ne 0 %then
%do;
%put ERROR- ** [&sysmacroname.] **;
%put ERROR: ** ERRORS IN PACKAGE CONTENT CREATION! **;
%put ERROR- ** NO TESTING WILL BE EXECUTED. **;
%GOTO NOTESTING;
@@ -2017,7 +2200,7 @@ run;
%end;
%else
%do;
%put ERROR: Provided location of the SAS binary file does not exist!;
%put ERROR: [&sysmacroname.] Provided location of the SAS binary file does not exist!;
%put ERROR- The directory was: &SASEXE.;
%put ERROR- Testing would not be executed.;
filename sasroot;
@@ -2030,7 +2213,7 @@ run;
0 = %sysfunc(fileexist(&SASEXE..exe)) /* WINDOWS */
%then
%do;
%put ERROR: Provided location of the SAS binary file does not contain SAS file!;
%put ERROR: [&sysmacroname.] Provided location of the SAS binary file does not contain SAS file!;
%put ERROR- The file searched was: &SASEXE.;
%put ERROR- Testing would not be executed.;
%GOTO NOTESTING;
@@ -2064,7 +2247,7 @@ run;
%end;
%else
%do;
%put ERROR: Provided SAS config file does not exist!;
%put ERROR: [&sysmacroname.] Provided SAS config file does not exist!;
%put ERROR- The file was: &SASCFGFILE.;
%put ERROR- Testing would not be executed.;
%GOTO NOTESTING;
@@ -2203,6 +2386,10 @@ data _null_;
put '%unloadPackage'"(&packageName.,";
put " path=&filesLocation.) " /;
put "filename packages '&filesLocation.';" /
'%listPackages() ' /;
put "proc printto";
put "; run;";

View File

@@ -24,7 +24,7 @@
*/
)/secure
/*** HELP END ***/
des = 'Macro to get help about SAS package, version 20221107. Run %helpPackage() for help info.'
des = 'Macro to get help about SAS package, version 20221125. Run %helpPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -39,7 +39,7 @@ des = 'Macro to get help about SAS package, version 20221107. Run %helpPackage()
%put ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to get help about SAS packages, version `20221107` #;
%put # Macro to get help about SAS packages, version `20221125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -169,7 +169,7 @@ TODO:
- add MD5(&packageName.) value hash instead "package" word in filenames [DONE]
*/
/* Macros to install SAS packages, version 20221107 */
/* Macros to install SAS packages, version 20221125 */
/* A SAS package is a zip file containing a group of files
with SAS code (macros, functions, data steps generating
data, etc.) wrapped up together and %INCLUDEed by

View File

@@ -14,7 +14,7 @@
/secure
minoperator
/*** HELP END ***/
des = 'Macro to install SAS package, version 20221107. Run %%installPackage() for help info.'
des = 'Macro to install SAS package, version 20221125. Run %%installPackage() for help info.'
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do;
@@ -29,7 +29,7 @@ des = 'Macro to install SAS package, version 20221107. Run %%installPackage() fo
%put ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to install SAS packages, version `20221107` #;
%put # Macro to install SAS packages, version `20221125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -458,7 +458,7 @@ des = 'Macro to install SAS package, version 20221107. Run %%installPackage() fo
/* Macro to list SAS packages in packages folder.
Version 20221107
Version 20221125
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating

View File

@@ -1,7 +1,7 @@
/*+listPackages+*/
%macro listPackages()/secure PARMBUFF
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20221107.'
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20221125.'
;
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
%do;
@@ -16,7 +16,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%put ### This is short help information for the `listPackages` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to list available SAS packages, version `20221107` #;
%put # Macro to list available SAS packages, version `20221125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -166,7 +166,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
/* Macro to generate SAS packages.
Version 20221107
Version 20221125
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating

View File

@@ -25,9 +25,14 @@
and use loadPackage in the form:
%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
/*** HELP END ***/
des = 'Macro to load SAS package, version 20221107. Run %loadPackage() for help info.'
des = 'Macro to load SAS package, version 20221125. Run %loadPackage() for help info.'
minoperator
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -42,7 +47,7 @@ des = 'Macro to load SAS package, version 20221107. Run %loadPackage() for help
%put ### This is short help information for the `loadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to *load* SAS packages, version `20221107` #;
%put # Macro to *load* SAS packages, version `20221125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -74,24 +79,29 @@ des = 'Macro to load SAS package, version 20221107. Run %loadPackage() for help
%put # package is provided in required version, #;
%put # default value: `.` #;
%put # #;
%put # - `lazyData=` *Optional.* A list of names of lazy datasets to be #;
%put # loaded. If not null datasets from the list are loaded #;
%put # instead of the package. #;
%put # - `lazyData=` *Optional.* A space separated list of names of lazy #;
%put # datasets to be loaded. If not null datasets from the #;
%put # list are loaded instead of the package. #;
%put # An asterisk (*) means *load all lazy datasets*. #;
%put # #;
%put # - `zip=` Standard package is zip (lowcase), #;
%put # - `zip=` *Optional.* Standard package is zip (lowcase), #;
%put # e.g. `%nrstr(%%loadPackage(PiPackage))`. #;
%put # If the zip is not available use a folder. #;
%put # Unpack data to "pipackage.disk" folder #;
%put # and use loadPackage in the following form: #;
%put # `%nrstr(%%loadPackage(PiPackage, zip=disk, options=))` #;
%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 # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
%put # to learn more. #;
%put # #;
%put ### Example #####################################################################;
%put ### Example 1 ###################################################################;
%put # #;
%put # Enabling the SAS Package Framework #;
%put # from the local directory and installing & loading #;
@@ -110,6 +120,25 @@ des = 'Macro to load SAS package, version 20221107. Run %loadPackage() for help
%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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
%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 ;
options &options_tmp.;
@@ -144,6 +173,19 @@ des = 'Macro to load SAS package, version 20221107. Run %loadPackage() for help
end;
if exists then call symputx("path", p, "L");
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.
/* put location of package myPackageFile.zip here */
@@ -184,7 +226,11 @@ des = 'Macro to load SAS package, version 20221107. Run %loadPackage() for help
;
%if %bquote(&lazyData.) = %then
%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.;
options &tempLoad_minoperator.;
%end;
%else
%do;

View File

@@ -11,7 +11,7 @@
*/
)/secure
/*** HELP END ***/
des = 'Macro to load multiple SAS packages at one run, version 20221107. Run %loadPackages() for help info.'
des = 'Macro to load multiple SAS packages at one run, version 20221125. Run %loadPackages() for help info.'
parmbuff
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -27,7 +27,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro wrapper for the loadPackage macro, version `20221107` #;
%put # Macro wrapper for the loadPackage macro, version `20221125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -23,7 +23,7 @@
*/
)/secure
/*** HELP END ***/
des = 'Macro to preview content of a SAS package, version 20221107. Run %previewPackage() for help info.'
des = 'Macro to preview content of a SAS package, version 20221125. Run %previewPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -38,7 +38,7 @@ des = 'Macro to preview content of a SAS package, version 20221107. Run %preview
%put ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to get previwe of a SAS packages, version `20221107` #;
%put # Macro to get previwe of a SAS packages, version `20221125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -20,7 +20,7 @@
*/
)/secure
/*** HELP END ***/
des = 'Macro to unload SAS package, version 20221107. Run %unloadPackage() for help info.'
des = 'Macro to unload SAS package, version 20221125. Run %unloadPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -35,7 +35,7 @@ des = 'Macro to unload SAS package, version 20221107. Run %unloadPackage() for h
%put ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to unload SAS packages, version `20221107` #;
%put # Macro to unload SAS packages, version `20221125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -13,7 +13,7 @@
hashing_file() function, SAS 9.4M6 */
)/secure
/*** HELP END ***/
des = 'Macro to verify SAS package with the hash digest, version 20221107. Run %verifyPackage() for help info.'
des = 'Macro to verify SAS package with the hash digest, version 20221125. Run %verifyPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -28,7 +28,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20221107. Run %
%put ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to verify SAS package with it hash digest, version `20221107` #;
%put # Macro to verify SAS package with it hash digest, version `20221125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -15,20 +15,20 @@
---
## 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).
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 **`20221107`**.
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20221125`**.
**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).
**The documentation and more advance reading** would be the [**`SAS(r) packages - the way to share (a how to)- Paper 4725-2020 - extended.pdf`**](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") article (see the `./SPF/Documentation` directory).
*Note:* Filenames references `packages` and `package` are reserved keywords.
*Note:* Filenames references `packages` and `package` are **reserved keywords.**
The first one should be used to point local folder with packages and the framework.
The second is used internally by macros.
After assigning the directory do not change them when using the SPF since it may affect stability of the framework.
@@ -39,7 +39,7 @@ After assigning the directory do not change them when using the SPF since it may
## This is short help information for the `installPackage` macro <a name="installpackage"></a>
--------------------------------------------------------------------------------------------
Macro to install SAS packages, version `20221107`
Macro to install SAS packages, version `20221125`
A SAS package is a zip file containing a group
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>
-------------------------------------------------------------------------------
Macro to get help about SAS packages, version `20221107`
Macro to get help about SAS packages, version `20221125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -211,7 +211,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `loadPackage` macro <a name="loadpackage"></a>
-------------------------------------------------------------------------------
Macro to *load* SAS packages, version `20221107`
Macro to *load* SAS packages, version `20221125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -243,24 +243,29 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
package is provided in required version,
default value: `.`
- `lazyData=` *Optional.* A list of names of lazy datasets to be
loaded. If not null datasets from the list are loaded
instead of the package.
- `lazyData=` *Optional.* A space separated list of names of lazy
datasets to be loaded. If not null datasets from the
list are loaded instead of the package.
An asterisk (*) means *load all lazy datasets*.
- `zip=` Standard package is zip (lowcase),
- `zip=` *Optional.* Standard package is zip (lowcase),
e.g. `%loadPackage(PiPackage)`.
If the zip is not available use a folder.
Unpack data to "pipackage.disk" folder
and use loadPackage in the following form:
`%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`
to learn more.
## Example ####################################################################
## Example 1 ##################################################################
Enabling the SAS Package Framework
from the local directory and installing & loading
@@ -280,11 +285,30 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
%unloadPackage(SQLinDS) %* unload the package content from the SAS session;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Example 2 ##################################################################
Enabling the SAS Package Framework
from the local directory and installing & cherry picking
elements of the BasePlus package.
Assume that the `SPFinit.sas` file
is located in the "C:/SAS_PACKAGES/" folder.
Run the following code in your SAS session:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
%include packages(SPFinit.sas); %* enable the framework;
%installPackage(BasePlus) %* install the package from the Internet;
%loadPackage(BasePlus, cherryPick=getVars) %* cherry pick the content;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## This is short help information for the `loadPackageS` macro <a name="loadpackages"></a>
-------------------------------------------------------------------------------
Macro wrapper for the loadPackage macro, version `20221107`
Macro wrapper for the loadPackage macro, version `20221125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -333,7 +357,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `unloadPackage` macro <a name="unloadpackage"></a>
-------------------------------------------------------------------------------
Macro to unload SAS packages, version `20221107`
Macro to unload SAS packages, version `20221125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -398,7 +422,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `listPackages` macro <a name="listpackages"></a>
-----------------------------------------------------------------------------------------
Macro to list available SAS packages, version `20221107`
Macro to list available SAS packages, version `20221125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -439,7 +463,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `verifyPackage` macro <a name="verifypackage"></a>
-------------------------------------------------------------------------------
Macro to verify SAS package with it hash digest, version `20221107`
Macro to verify SAS package with it hash digest, version `20221125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -493,7 +517,7 @@ filename packages "C:/SAS_PACKAGES"; %* set-up a directory for packages;
## This is short help information for the `previewPackage` macro <a name="previewpackage"></a>
-------------------------------------------------------------------------------
Macro to get previwe of a SAS packages, version `20221107`
Macro to get previwe of a SAS packages, version `20221125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -560,7 +584,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `generatePackage` macro <a name="generatepackage"></a>
-------------------------------------------------------------------------------
Macro to generate SAS packages, version `20221107`
Macro to generate SAS packages, version `20221125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -626,7 +650,7 @@ The file should contain the following obligatory information:
Type: Package
Package: PackageName
Title: A title/brief info for log note about your package.
Version: X.Y
Version: X.Y.Z
Author: Firstname1 Lastname1 (xxxxxx1@yyyyy.com), Firstname2 Lastname2 (xxxxxx2@yyyyy.com)
Maintainer: Firstname Lastname (xxxxxx@yyyyy.com)
License: MIT
@@ -650,6 +674,9 @@ Name of the `type` of folder and `files.sas` inside must be in the _low_ case le
If order of loading is important, the sequential number
can be used to order multiple types in the way you wish.
If folder name starts with `!` (e.g., `!ignore_me`) or *type* of the folder is "unknown" (e.g., not supported one)
the content of such folder is ignored during package generation process.
The "tree structure" of the folder could be for example as follows:
All files have to have `.sas` extension. Other files are ignored.
@@ -741,7 +768,7 @@ All files have to have `.sas` extension. Other files are ignored.
## This is short help information for the `extendPackagesFileref` macro <a name="extendpackagesfileref"></a>
-----------------------------------------------------------------------------------------
Macro to list directories pointed by 'packages' fileref, version `20221107`
Macro to list directories pointed by 'packages' fileref, version `20221125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating

File diff suppressed because it is too large Load Diff

View File

@@ -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
of this software and associated documentation files (the "Software"), to deal

View File

@@ -10,7 +10,7 @@ Packages:
---
- **SQLinDS**\[2.2\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g.
- **SQLinDS**\[2.2.3\], 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
data class;
set %SQL(
@@ -22,7 +22,7 @@ data class;
WH = weight + height;
run;
```
SHA256 digest for SQLinDS: 96D0EFE02DF1AE0D7D875A10CAF7EF63CDEF85DD0CF9418934BEFAF0C067D453
SHA256 digest for SQLinDS: D5A66E60602270E5FB1E592FA3E0C2F2C640BC077FE799A2223CB9BA275F6F47
[Documentation for SQLinDS](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/sqlinds.md "Documentation for SQLinDS")
@@ -36,7 +36,7 @@ SHA256 digest for MacroCore: A23C29529F3CE7D0C8BEE9545C5D22D5B5594907547374A5135
---
- **DFA** (Dynamic Function Arrays)\[0.5\], 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.3\], 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
%createDFArray(ArrDynamic, resizefactor=17);
@@ -63,13 +63,13 @@ data _null_;
end;
run;
```
SHA256 digest for DFA: 5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC3535B4F491
SHA256 digest for DFA: 7520CF21CBF1FD4AD2BC05C5DD343E508FCEA507575EBC060B4AD322FB80AB04
[Documentation for DFA](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/dfa.md "Documentation for DFA")
---
- **macroArray**\[1.0\], implementation of an array concept in a macro language, e.g.
- **macroArray**\[1.0.3\], implementation of an array concept in a macro language, e.g.
```sas
%array(ABC[17] (111:127), macarray=Y);
@@ -88,13 +88,13 @@ SHA256 digest for DFA: 5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC353
which = 1:H:2
);
```
SHA256 digest for macroArray: ED12BC96F8A4E9E7C4D651EC1E15479DB9B55D98B274B63C507ED842081F7AB7
SHA256 digest for macroArray: 244B88C82AD7E6E93B8B85BC701ECDDB20B68F38B16C500EE9B49E1167ADC298
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")
---
- **BasePlus**\[1.17\] adds a bunch of functionalities I am missing in BASE SAS, such as:
- **BasePlus**\[1.17.3\] adds a bunch of functionalities I am missing in BASE SAS, such as:
```sas
call arrMissToRight(myArray);
call arrFillMiss(17, myArray);
@@ -112,25 +112,25 @@ format x bool.;
%zipLibrary(sashelp,libOut=work)
```
SHA256 digest for BasePlus: 56B260350FEB7D5118F581B9EFD1B9CE1F0298DCB9A4C000A7654E2FF3F0298C
SHA256 digest for BasePlus: D8DBB7CC5952331FA59FEBBBDD15BC543FE3C89A8BA9150FE6AF5E412868EBE7
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
---
- **GSM** (Generate Secure Macros)\[0.20\], package allows
- **GSM** (Generate Secure Macros)\[0.20.3\], package allows
to create secured macros stored in SAS Proc FCMP functions.
The dataset with functions can be shared between different operating systems
and allows to generate macros on site without showing their code.
SHA256 digest for GSM: 2AEBC150FBA99A4AAB0265A21C57E89200BFD96B633B898F32743D1C8831A159
SHA256 digest for GSM: 50D8340E080BEA459E68BE315146AD3B809930DB8DC7B23C7A492C3815ACD83F
[Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM")
---
- **dynMacroArray**\[0.2\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold.
- **dynMacroArray**\[0.2.3\], 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: D7E0B8F85C05EBF8622204E0D2F3E990D48D0A9B3911051C3AD44DC98954DDCF
SHA256 digest for dynMacroArray: 440920272D1838505EA5C033B1C448C612DE2FCCFD57F157BB90ED980E4001CC
---

View File

@@ -1,3 +1,28 @@
/* 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 */
BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4
DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6
dynMacroArray: C987C08615A53D7BD7AEC3911EADF436C676EAB3E233E7E422E42995B890E169
GSM: 5D1925970C9590CD195C15B8641B01D7857E3B2546323DC77D09154BCCA40922
macroArray: 371B92A5ABBE82C53F7D63BC5C0D1EBD4695603D3894D8A9A5D5777D1AB59B30
SQLinDS: A070214517CC36590083FCF9D5F488AC6E746793E94B9AA55D09A419CF291B5B
/* 20220830 */
BasePlus: 56B260350FEB7D5118F581B9EFD1B9CE1F0298DCB9A4C000A7654E2FF3F0298C
DFA: 5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC3535B4F491

View File

@@ -56,7 +56,7 @@
---
# The BasePlus package [ver. 1.17] <a name="baseplus-package"></a> ###############################################
# The BasePlus package [ver. 1.17.3] <a name="baseplus-package"></a> ###############################################
The **BasePlus** package implements useful
functions and functionalities I miss in the BASE SAS.
@@ -273,10 +273,10 @@ Package contains:
48. functions quicksorthashsddv
49. functions quicksortlight
*SAS package generated by generatePackage, version 20220830*
*SAS package generated by generatePackage, version 20221125*
The SHA256 hash digest for package BasePlus:
`56B260350FEB7D5118F581B9EFD1B9CE1F0298DCB9A4C000A7654E2FF3F0298C`
`D8DBB7CC5952331FA59FEBBBDD15BC543FE3C89A8BA9150FE6AF5E412868EBE7`
---
# Content description ############################################################################################

Binary file not shown.

View File

@@ -18,7 +18,7 @@
---
# The DFA package [ver. 0.5] <a name="dfa-package"></a> ###############################################
# The DFA package [ver. 0.5.3] <a name="dfa-package"></a> ###############################################
The **DFA** (a.k.a. *Dynamic Function Array*) package implements:
- dynamic numeric and character arrays,
@@ -52,10 +52,10 @@ Package contains:
12. exec generatearrays
13. clean generatearrays
*SAS package generated by generatePackage, version 20220830*
*SAS package generated by generatePackage, version 20221125*
The SHA256 hash digest for package BasePlus:
`5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC3535B4F491`
`7520CF21CBF1FD4AD2BC05C5DD343E508FCEA507575EBC060B4AD322FB80AB04`
---
# Content description ############################################################################################

Binary file not shown.

Binary file not shown.

View File

@@ -8,7 +8,7 @@
---
# The GSM package [ver. 0.20] <a name="gsm-package"></a> ###############################################
# The GSM package [ver. 0.20.3] <a name="gsm-package"></a> ###############################################
The **GSM** (a.k.a. *Generate Secure Macros*) package allows
to create secured macros stored in SAS Proc FCMP functions.
@@ -91,10 +91,10 @@ Package contains:
Required SAS Components:
`Base SAS Software`
* SAS package generated by generatePackage, version 20220830 *
*SAS package generated by generatePackage, version 20221125*
The SHA256 hash digest for package GSM:
`2AEBC150FBA99A4AAB0265A21C57E89200BFD96B633B898F32743D1C8831A159`
`50D8340E080BEA459E68BE315146AD3B809930DB8DC7B23C7A492C3815ACD83F`
## >>> `%GSM()` macro: <<< <a name="gsm-macro"></a> #######################

Binary file not shown.

View File

@@ -19,7 +19,7 @@
---
# The macroArray package [ver. 1.0] <a name="macroarray-package"></a> ###############################################
# The macroArray package [ver. 1.0.3] <a name="macroarray-package"></a> ###############################################
The **macroArray** package implements a macro array facility:
- `%array()`,
@@ -75,10 +75,10 @@ Package contains:
Required SAS Components:
*Base SAS Software*
*SAS package generated by generatePackage, version 20220830.*
*SAS package generated by generatePackage, version 20221125*
The SHA256 hash digest for package macroArray:
`ED12BC96F8A4E9E7C4D651EC1E15479DB9B55D98B274B63C507ED842081F7AB7`
`440920272D1838505EA5C033B1C448C612DE2FCCFD57F157BB90ED980E4001CC`
---
# Content description ############################################################################################

Binary file not shown.

View File

@@ -1,4 +1,4 @@
- [The SQLinDS package [ver. 2.2]](#sqlinds-package)
- [The SQLinDS package](#sqlinds-package)
- [Content description](#content-description)
* [library `dsSQL`](#library-dssql)
* [`%dsSQL_inner()` macro](#dssql-inner-macro)
@@ -8,7 +8,7 @@
---
# The SQLinDS package [ver. 2.2] <a name="sqlinds-package"></a> ###############################################
# The SQLinDS package [ver. 2.2.3] <a name="sqlinds-package"></a> ###############################################
The **SQLinDS** package is an implementation of
the *macro-function-sandwich* concept introduced in the
@@ -46,10 +46,10 @@ Package contains:
Required SAS Components:
*Base SAS Software*
*SAS package generated by generatePackage, version 20220830*
*SAS package generated by generatePackage, version 20221125*
The SHA256 hash digest for package SQLinDS:
`96D0EFE02DF1AE0D7D875A10CAF7EF63CDEF85DD0CF9418934BEFAF0C067D453`
`D5A66E60602270E5FB1E592FA3E0C2F2C640BC077FE799A2223CB9BA275F6F47`
---
# Content description ############################################################################################

Binary file not shown.