Hey SAS-C,
Just FYI.
Bart
20251228As usual available at: https://github.com/yabwon/SAS_PACKAGES
This release introduces two new parameters to the %generatePackage() macro.
By default, package's ZIP file is generated into the same location where the filesLocation value is pointing, those new parameters allow to alter the default behavior.
Those two new parameters give the developer flexibility in setting up package repository the way the developer finds it the most convenient.
For example, one approach is to use a single location (repository), with multiple sub-directories: one for source code, second for the latest zip file, and third for historical versions (see Example 1 below).
The other approach is to create two separate repositories, on repository for source code and the second repository for generated zip and historical versions (see Example 2 below).
Now the developer has options.
Parameters were added as a result of collaboration and discussion with Ken Nakamatsu (k-nkmt). Thanks Ken!
Code cleaning was also Ken's idea.
(This is not the last idea proposed by this gentleman, stay tuned!)
A) Two new parameters were added to the %generatePackage() macro:
buildLocation= parameter allows to alter the location where the ZIP file with the package is generated.archLocation= parameter (only if easyArch= is set to 1) alters the location where the "versioned" package ZIP file is stored.B) The easyArch= option is now independent form the markdownDoc=, i.e., the "versioned" copy of the package can be created even when automated markdown is not generated.
C) Three technical sub-macros were extracted from the %generatePackage() macro. These macros are:SPFint_gnPckg_tests, SPFint_gnPckg_markdown, and SPFint_gnPckg_arch. They encapsulate testing part of the package generation process, generation of (optional) markdown documentation, and (also optional) archiving process. Those macros are internal macros, are executable only inside %generatePackage(), do not accept any parameters, and use %generatePackage() macro's local macrovariables.
D) Minor "end-of-the-year" code housekeeping.
E) Documentation updated.
F) Article refreshed.
Example 1. Redirect results of package generation to separate directories in a single location (repository):
%let path=/home/bart/mypackage;
%generatePackage(
filesLocation=&path./source /* take source files from here, */
,buildLocation=&path./latestVersion /* put mypackage.zip to there, and */
,archLocation=&path./history /* copy mypackage_1.2.3_.zip to here */
,easyArch=1
)
Example 2. Redirect results of package generation to separate directories in multiple locations (repositories):
%generatePackage(
filesLocation=/home/bart/myPackageCode/source /* take source files from here, */
,buildLocation=/repositories/forGitHub/myPackage/ /* put mypackage.zip to there, and */
,archLocation=/repositories/forGitHub/myPackage/history /* copy mypackage_1.2.3_.zip to here */
,easyArch=1
)
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.