mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2025-12-11 11:14:35 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4b319a2e0 | ||
|
|
9cf3332e60 | ||
|
|
998a23c980 | ||
|
|
3701986fab | ||
|
|
31a29b3528 | ||
|
|
fab9fb7166 | ||
|
|
71503379bf | ||
|
|
79bd3d0c0a | ||
|
|
f01ac518a6 | ||
|
|
62b7c64063 | ||
|
|
ef3afe837d | ||
|
|
f63ff497ee | ||
|
|
030a0932a8 |
26
README.md
26
README.md
@@ -1,4 +1,6 @@
|
||||
# SAS_PACKAGES - a SAS Packages Framework
|
||||
# SAS Packages Framework
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
@@ -6,27 +8,28 @@ 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.
|
||||
In this repository we are presenting the **SAS Packages Framework** - a tool that allows to develop and use SAS packages.
|
||||
|
||||
Don't forget to give the repository a **STAR** and become [stargazer](https://github.com/yabwon/SAS_PACKAGES/stargazers)! :-)
|
||||
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
### Current version:
|
||||
|
||||
**The latest version** of the **SAS Packages Framework** is **`20250710`**.
|
||||
**The latest version** of the **SAS Packages Framework** is **`20251017`**.
|
||||
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
## Intro:
|
||||
|
||||
To get started with SAS Packages try this [**`Getting Started with SAS Packages`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/Getting_Started_with_SAS_Packages.pdf "Getting Started with SAS Packages") presentation (see the `./SPF/Documentation` directory).
|
||||
To get started with SAS Packages try: [**`Introduction to SAS Packages`**](https://youtube.com/playlist?list=PLeMzGEImIT5eV13IGXQIgWmTFCJt_cLZG&si=ElQm0_ifq76mvUbq "Introduction to SAS Packages video series") video series or [**`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).
|
||||
The documentation and more advance reading can be found in 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).
|
||||
|
||||
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")
|
||||
Short description of the SAS Packages Framework macros and their parameters can be found [here](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/SPFinit.md "Short description of the SAS Packages Framework macros")
|
||||
|
||||
### Recordings and Presentations:
|
||||
|
||||
@@ -41,6 +44,7 @@ Videos presenting the SPF and packages, from various conferences and meetups (th
|
||||
- ["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)
|
||||
- ["SAS Packages Framework - an easy code sharing medium for SAS" - Warsaw IT Days 2023](https://youtu.be/T52Omisi0dk&t=0s "Warsaw IT Days 2023") (March 31st 2023, ~60 minutes, general overview with technical details for user and developer)
|
||||
- ["SAS Package ー その共有、もっとスマートに" - SASユーザー総会 2025](https://youtu.be/4QRr7sUhO9E "SASユーザー総会2025") (September 25th 2025, ~22 minutes, general overview with the list of reasons: why is it worth to use SAS packages?)
|
||||
|
||||
|
||||
### Tutorials:
|
||||
@@ -49,7 +53,7 @@ Here are links to some tutorials which may help you to start with the framework.
|
||||
Order is dictated by the amount of details presented.
|
||||
Letter "D" indicates tutorial dedicated for developers and "U" materials for users.
|
||||
|
||||
1) (DU) The latest [video](https://youtu.be/T52Omisi0dk&t=0s) explaining the idea.
|
||||
1) (DU) A [video](https://youtu.be/T52Omisi0dk&t=0s) explaining the idea in more details.
|
||||
|
||||
2) (D) Very simple ["Hello World" example](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/HelloWorldPackage.md) tutorial for developers. As a support a [walk-through video](https://youtu.be/T52Omisi0dk&t=2160s)
|
||||
|
||||
@@ -64,7 +68,7 @@ Letter "D" indicates tutorial dedicated for developers and "U" materials for use
|
||||
|
||||
### Initiative to add SAS Packages Framework to SAS Base/Viya:
|
||||
|
||||
A **SASware Ballot Idea** for adding *SAS Packages Framework* macros into Base SAS and Viya was submitted Friday, May 27th 2022. If you would like to support the idea visit this [**communities.sas.com post**](https://communities.sas.com/t5/SASware-Ballot-Ideas/Add-SAS-Packages-Framework-to-the-SAS-Base-Viya/idi-p/815508) and up vote the idea! We have 46 likes from 44 supporters up to today (as of April 22, 2025)!
|
||||
A **SASware Ballot Idea** for adding *SAS Packages Framework* macros into Base SAS and Viya was submitted Friday, May 27th 2022. If you would like to support the idea visit this [**communities.sas.com post**](https://communities.sas.com/t5/SASware-Ballot-Ideas/Add-SAS-Packages-Framework-to-the-SAS-Base-Viya/idi-p/815508) and up vote the idea! We have 48 likes from 46 supporters up to today (as of September 30, 2025)!
|
||||
|
||||
---
|
||||
|
||||
@@ -218,13 +222,15 @@ The SAS Packages Framework [(short) documentation](https://github.com/yabwon/SAS
|
||||
---
|
||||
|
||||
## Where the SAS Packages Framework is used:
|
||||
|
||||
This is a list of locations where the SAS Packages Framework is used:
|
||||
- Warsaw (Poland)
|
||||
- Osaka (Japan)
|
||||
- Kyoto (Japan)
|
||||
|
||||
If you want to share that you are using the SPF let me know and I'll update the list.
|
||||
|
||||
If you find the SPF useful **share info** about it or **give it a [star (:star:)](https://github.com/yabwon/SAS_PACKAGES/stargazers)** so more people will know.
|
||||
If you find the SPF useful **share info** about it or **give it a [star ( ⭐ )](https://github.com/yabwon/SAS_PACKAGES/stargazers)** so more people will know.
|
||||
|
||||
---
|
||||
|
||||
|
||||
BIN
SPF/Documentation/Paper_012-SESUG2025.pdf
Normal file
BIN
SPF/Documentation/Paper_012-SESUG2025.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
SPF/Logo/SPFlogo.pdf
Normal file
BIN
SPF/Logo/SPFlogo.pdf
Normal file
Binary file not shown.
BIN
SPF/Logo/SPFlogo.png
Normal file
BIN
SPF/Logo/SPFlogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 475 KiB |
BIN
SPF/Logo/SPFlogo1200x770.png
Normal file
BIN
SPF/Logo/SPFlogo1200x770.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 132 KiB |
@@ -6,7 +6,7 @@
|
||||
when empty the "packages" value is used */
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to list directories pointed by "packages" fileref, version 20250710. Run %extendPackagesFileref(HELP) for help info.'
|
||||
des = 'Macro to list directories pointed by "packages" fileref, version 20251017. 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 20250710
|
||||
%put ### This is short help information for the `extendPackagesFileref` macro #;
|
||||
%put #-----------------------------------------------------------------------------------------#;;
|
||||
%put # #;
|
||||
%put # Macro to list directories pointed by 'packages' fileref, version `20250710` #;
|
||||
%put # Macro to list directories pointed by 'packages' fileref, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -43,6 +43,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20250710
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to learn more. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put #### Example ##############################################################################;
|
||||
%put # #;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
Macro to generate SAS packages.
|
||||
|
||||
Version 20250710
|
||||
Version 20251017
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -20,30 +20,36 @@
|
||||
filesLocation /* location of package files
|
||||
e.g. /path/to/package/files/locatiion or C:\my\package\files */
|
||||
/* testing options: */
|
||||
,testPackage=Y /* indicator if tests should be executed,
|
||||
default value Y means "execute tests" */
|
||||
,packages= /* location of other packages if there are
|
||||
dependencies in loading, must be a single directory
|
||||
if more than one are provided only the first is used */
|
||||
,testResults= /* location where tests results should be stored,
|
||||
if null (the default) the WORK is used */
|
||||
,sasexe= /* a DIRECTORY where the SAS binary is located,
|
||||
if null (the default) then the !SASROOT is used */
|
||||
,sascfgFile= /* a FILE with testing session configuration parameters
|
||||
if null (the default) then no config file is pointed
|
||||
during the SAS invocation,
|
||||
if set to DEF then the !SASROOT/sasv9.cfg is used */
|
||||
,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" */
|
||||
,markdownDoc=0 /* indicates if a markdown file with documentation
|
||||
be generated from help info blocks */
|
||||
,easyArch=0 /* when creating documentation file indicates if a copy of
|
||||
the zip and markdown files with the version number in the
|
||||
file name be created */
|
||||
,testPackage=Y /* indicator if tests should be executed,
|
||||
default value Y means "execute tests" */
|
||||
,packages= /* location of other packages if there are
|
||||
dependencies in loading, must be a single directory
|
||||
if more than one are provided only the first is used */
|
||||
,testResults= /* location where tests results should be stored,
|
||||
if null (the default) the WORK is used */
|
||||
,workInTestResults=0 /* indicates if WORK directories for tests should located
|
||||
in the same place as results */
|
||||
,testWorkPath= /* location where tests SAS sessions' work directories
|
||||
should be stored, if null (the default) the main SAS
|
||||
session WORK is used. Takes precedence over workInTestResults= */
|
||||
,sasexe= /* a DIRECTORY where the SAS binary is located,
|
||||
if null (the default) then the !SASROOT is used */
|
||||
,sascfgFile= /* a FILE with testing session configuration parameters
|
||||
if null (the default) then no config file is pointed
|
||||
during the SAS invocation,
|
||||
if set to DEF then the !SASROOT/sasv9.cfg is used */
|
||||
,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" */
|
||||
/* documentation options: */
|
||||
,markdownDoc=0 /* indicates if a markdown file with documentation
|
||||
be generated from help info blocks */
|
||||
,easyArch=0 /* when creating documentation file indicates if a copy of
|
||||
the zip and markdown files with the version number in the
|
||||
file name be created */
|
||||
)/ secure minoperator
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to generate SAS packages, version 20250710. Run %generatePackage() for help info.'
|
||||
des = 'Macro to generate SAS packages, version 20251017. Run %generatePackage() for help info.'
|
||||
;
|
||||
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
|
||||
%do;
|
||||
@@ -54,74 +60,87 @@ des = 'Macro to generate SAS packages, version 20250710. Run %generatePackage()
|
||||
;
|
||||
options NOnotes NOsource ls=MAX ps=MAX msglevel=N;
|
||||
%put ;
|
||||
%put #################################################################################;
|
||||
%put ### This is short help information for the `generatePackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to generate SAS packages, version `20250710` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
%put # data, etc.) wrapped up together and embedded inside the zip. #;
|
||||
%put # #;
|
||||
%put # The `%nrstr(%%generatePackage())` macro generates SAS packages. #;
|
||||
%put # It wraps-up the package content, i.e. macros, functions, formats, etc., #;
|
||||
%put # into the zip file and generate all metadata content required by other #;
|
||||
%put # macros from the SAS Packages Framework. #;
|
||||
%put # #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to read about the details of package generation process. #;
|
||||
%put # #;
|
||||
%put #### Parameters: #;
|
||||
%put # #;
|
||||
%put # 1. `filesLocation=` Location of package files, example value: #;
|
||||
%put # `%nrstr(%%sysfunc(pathname(work))/packagename)`. #;
|
||||
%put # Default use case: #;
|
||||
%put # `%nrstr(%%generatePackage(filesLocation=/path/to/packagename))` #;
|
||||
%put # If empty displays this help information. #;
|
||||
%put # #;
|
||||
%put # Testing parameters: #;
|
||||
%put # #;
|
||||
%put # - `testPackage=` Indicator if tests should be executed. #;
|
||||
%put # Default value: `Y`, means "execute tests" #;
|
||||
%put # #;
|
||||
%put # - `packages=` Location of other packages for testing #;
|
||||
%put # if there are dependencies in loading the package. #;
|
||||
%put # Has to be a single directory, if more than one are #;
|
||||
%put # provided than only the first is used. #;
|
||||
%put # If path to location contains spaces it should be quoted! #;
|
||||
%put # #;
|
||||
%put # - `testResults=` Location where tests results should be stored, #;
|
||||
%put # if null (the default) then the session WORK is used. #;
|
||||
%put # #;
|
||||
%put # - `sasexe=` Location of a DIRECTORY where the SAS binary is located, #;
|
||||
%put # if null (the default) then the `!SASROOT` is used. #;
|
||||
%put # #;
|
||||
%put # - `sascfgFile=` Location of a FILE with testing session configuration #;
|
||||
%put # parameters, if null (the default) then no config file #;
|
||||
%put # is pointed during the SAS invocation, #;
|
||||
%put # if set to `DEF` then the `!SASROOT/sasv9.cfg` is used. #;
|
||||
%put # #;
|
||||
%put # - `delTestWork=` Indicates if `WORK` directories generated by user tests #;
|
||||
%put # should be deleted, i.e. the (NO)WORKTERM option is set. #;
|
||||
%put # The default value: `1` means "delete tests work". #;
|
||||
%put # Available values are `0` and `1`. #;
|
||||
%put # #;
|
||||
%put # - `markdownDoc=` Indicates if a markdown file with documentation #;
|
||||
%put # be generated from help information blocks. #;
|
||||
%put # The default value: `0` means "do not generate the file". #;
|
||||
%put # Available values are `0` and `1`. #;
|
||||
%put # #;
|
||||
%put # - `easyArch=` When creating documentation file (`markdownDoc=1`) #;
|
||||
%put # indicates if a copy of the zip and markdown files #;
|
||||
%put # with the version number in the file name be created #;
|
||||
%put # The default value: `0` means "do not create files". #;
|
||||
%put # Available values are `0` and `1`. #;
|
||||
%put # #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put #################################################################################;
|
||||
%put ######################################################################################;
|
||||
%put ### This is short help information for the `generatePackage` macro #;
|
||||
%put #------------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to generate SAS packages, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
%put # data, etc.) wrapped up together and embedded inside the zip. #;
|
||||
%put # #;
|
||||
%put # The `%nrstr(%%generatePackage())` macro generates SAS packages. #;
|
||||
%put # It wraps-up the package content, i.e. macros, functions, formats, etc., #;
|
||||
%put # into the zip file and generate all metadata content required by other #;
|
||||
%put # macros from the SAS Packages Framework. #;
|
||||
%put # #;
|
||||
%put #------------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to read about the details of package generation process. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put #### Parameters: #;
|
||||
%put # #;
|
||||
%put # 1. `filesLocation=` Location of package files, example value: #;
|
||||
%put # `%nrstr(%%sysfunc(pathname(work))/packagename)`. #;
|
||||
%put # Default use case: #;
|
||||
%put # `%nrstr(%%generatePackage(filesLocation=/path/to/packagename))` #;
|
||||
%put # If empty displays this help information. #;
|
||||
%put # #;
|
||||
%put # Testing parameters: #;
|
||||
%put # #;
|
||||
%put # - `testPackage=` Indicator if tests should be executed. #;
|
||||
%put # Default value: `Y`, means "execute tests" #;
|
||||
%put # #;
|
||||
%put # - `packages=` Location of other packages for testing #;
|
||||
%put # if there are dependencies in loading the package. #;
|
||||
%put # Has to be a single directory, if more than one are #;
|
||||
%put # provided than only the first is used. #;
|
||||
%put # If path to location contains spaces it should be quoted! #;
|
||||
%put # #;
|
||||
%put # - `testResults=` Location where tests results should be stored, #;
|
||||
%put # if null (the default) then the session WORK is used. #;
|
||||
%put # #;
|
||||
%put # - `workInTestResults=` Indicates if WORK directories for test sessions should #;
|
||||
%put # be located in the same place as results. #;
|
||||
%put # The default value: `0` means "do not do this". #;
|
||||
%put # Available values are `0` and `1`. #;
|
||||
%put # #;
|
||||
%put # - `testWorkPath=` Points a location where tests sessions work directories #;
|
||||
%put # should be stored. By default it is null what means that #;
|
||||
%put # a sub-directory of the main SAS session WORK is used. #;
|
||||
%put # Takes precedence over `workInTestResults=`. #;
|
||||
%put # #;
|
||||
%put # - `sasexe=` Location of a DIRECTORY where the SAS binary is located, #;
|
||||
%put # if null (the default) then the `!SASROOT` is used. #;
|
||||
%put # #;
|
||||
%put # - `sascfgFile=` Location of a FILE with testing session configuration #;
|
||||
%put # parameters, if null (the default) then no config file #;
|
||||
%put # is pointed during the SAS invocation, #;
|
||||
%put # if set to `DEF` then the `!SASROOT/sasv9.cfg` is used. #;
|
||||
%put # #;
|
||||
%put # - `delTestWork=` Indicates if `WORK` directories generated by user tests #;
|
||||
%put # should be deleted, i.e. the (NO)WORKTERM option is set. #;
|
||||
%put # The default value: `1` means "delete tests work". #;
|
||||
%put # Available values are `0` and `1`. #;
|
||||
%put # #;
|
||||
%put # Documentation parameters: #;
|
||||
%put # #;
|
||||
%put # - `markdownDoc=` Indicates if a markdown file with documentation #;
|
||||
%put # be generated from help information blocks. #;
|
||||
%put # The default value: `0` means "do not generate the file". #;
|
||||
%put # Available values are `0` and `1`. #;
|
||||
%put # #;
|
||||
%put # - `easyArch=` When creating documentation file (`markdownDoc=1`) #;
|
||||
%put # indicates if a copy of the zip and markdown files #;
|
||||
%put # with the version number in the file name be created #;
|
||||
%put # The default value: `0` means "do not create files". #;
|
||||
%put # Available values are `0` and `1`. #;
|
||||
%put # #;
|
||||
%put #------------------------------------------------------------------------------------#;
|
||||
%put ######################################################################################;
|
||||
%put ;
|
||||
options &options_tmp.;
|
||||
%GOTO ENDofgeneratePackage;
|
||||
@@ -872,7 +891,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
|
||||
title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */
|
||||
%end;
|
||||
|
||||
footnote1 "SAS Packages Framework, version 20250710";
|
||||
footnote1 "SAS Packages Framework, version 20251017";
|
||||
|
||||
proc print
|
||||
data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent)
|
||||
@@ -940,27 +959,27 @@ run;
|
||||
file &zipReferrence.(license.sas) encoding = &packageEncoding.;
|
||||
length packageAuthor $ 1024;
|
||||
packageAuthor = symget('packageAuthor');
|
||||
put " ";
|
||||
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 ';
|
||||
put "in the Software without restriction, including without limitation the rights ";
|
||||
put "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ";
|
||||
put "copies of the Software, and to permit persons to whom the Software is ";
|
||||
put "furnished to do so, subject to the following conditions: ";
|
||||
put " ";
|
||||
put "The above copyright notice and this permission notice shall be included ";
|
||||
put "in all copies or substantial portions of the Software. ";
|
||||
put " ";
|
||||
put 'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ';
|
||||
put "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ";
|
||||
put "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ";
|
||||
put "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ";
|
||||
put "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ";
|
||||
put "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ";
|
||||
put "SOFTWARE. ";
|
||||
put " ";
|
||||
put " ";
|
||||
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';
|
||||
put "in the Software without restriction, including without limitation the rights";
|
||||
put "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell";
|
||||
put "copies of the Software, and to permit persons to whom the Software is";
|
||||
put "furnished to do so, subject to the following conditions:";
|
||||
put " ";
|
||||
put "The above copyright notice and this permission notice shall be included";
|
||||
put "in all copies or substantial portions of the Software.";
|
||||
put " ";
|
||||
put 'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR';
|
||||
put "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,";
|
||||
put "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE";
|
||||
put "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER";
|
||||
put "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,";
|
||||
put "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE";
|
||||
put "SOFTWARE.";
|
||||
put " ";
|
||||
run;
|
||||
%end;
|
||||
|
||||
@@ -1696,7 +1715,7 @@ data _null_;
|
||||
%end;
|
||||
put +(-1) '`.;''' /
|
||||
' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' /
|
||||
' !! '' %put with the SAS Packages Framework version 20250710.;''' /
|
||||
' !! '' %put with the SAS Packages Framework version 20251017.;''' /
|
||||
' !! '' %put ****************************************************************************;''' /
|
||||
' !! '' %GOTO theEndOfTheMacro;''' /
|
||||
' !! '' %end;''' ;
|
||||
@@ -1861,7 +1880,7 @@ data _null_;
|
||||
%end;
|
||||
put +(-1) '`.; '' !!' /
|
||||
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' /
|
||||
''' %put with the SAS Packages Framework version 20250710.; '' !! ' /
|
||||
''' %put with the SAS Packages Framework version 20251017.; '' !! ' /
|
||||
''' %put ****************************************************************************; '' !! ' /
|
||||
''' %GOTO theEndOfTheMacro; '' !! ' /
|
||||
''' %end; '' !! ' /
|
||||
@@ -2668,7 +2687,7 @@ data _null_;
|
||||
%end;
|
||||
|
||||
put 'put " " / @3 "--------------------------------------------------------------------" / " ";'
|
||||
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20250710`*";'
|
||||
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20251017`*";'
|
||||
/ 'put " " / @3 "--------------------------------------------------------------------";';
|
||||
|
||||
put 'run; ' /;
|
||||
@@ -3223,16 +3242,57 @@ options DLCREATEDIR; /* turns-on creation of subdirectories by libname */
|
||||
/* temporary location for tests results is WORK unless developer provide &testResults. */
|
||||
%local testPackageTimesamp;
|
||||
%let testPackageTimesamp = %sysfunc(lowcase(&packageName._%sysfunc(datetime(),b8601dt15.)));
|
||||
%if %qsysfunc(fileexist(%bquote(&testResults.))) %then
|
||||
%if %qsysfunc(fileexist(%superq(testResults))) %then
|
||||
%do;
|
||||
libname TEST "&testResults./test_&testPackageTimesamp.";
|
||||
%end;
|
||||
%else
|
||||
%do;
|
||||
%if NOT %sysevalf(%superq(testResults)=,boolean) %then
|
||||
%do;
|
||||
%put WARNING: The testResults path:;
|
||||
%put WARNING- %superq(testResults);
|
||||
%put WARNING- does not exist. WORK will be used.;
|
||||
%put WARNING- ;
|
||||
%end;
|
||||
libname TEST "&SASWORK./test_&testPackageTimesamp.";
|
||||
%end;
|
||||
/* test work points to the SAS session work */
|
||||
libname TESTWORK "&SASWORK./testwork_&testPackageTimesamp.";
|
||||
|
||||
/* test WORK points to the SAS session WORK or to directory pointed by the developer */
|
||||
%if %qsysfunc(fileexist(%superq(testWorkPath))) %then
|
||||
%do;
|
||||
libname TESTWORK "&testWorkPath./testwork_&testPackageTimesamp.";
|
||||
%put NOTE- ;
|
||||
%PUT NOTE: WORK libname directories from test SAS sessions will not be deleted.;
|
||||
%if %sysevalf(1=%superq(workInTestResults),boolean) %then
|
||||
%do;
|
||||
%put NOTE- Parameter workInTestResults is ignored;
|
||||
%end;
|
||||
%put NOTE- ;
|
||||
|
||||
%let delTestWork=0;
|
||||
%end;
|
||||
%else %if %sysevalf(1=%superq(workInTestResults),boolean) %then
|
||||
%do;
|
||||
libname TESTWORK "%sysfunc(pathname(TEST))";
|
||||
%put NOTE- ;
|
||||
%PUT NOTE: WORK libname directories from test SAS sessions will be located in the;
|
||||
%PUT NOTE- same directory where test resulrs are stored, and will not be deleted.;
|
||||
%put NOTE- ;
|
||||
%let delTestWork=0;
|
||||
%end;
|
||||
%else
|
||||
%do;
|
||||
%if NOT %sysevalf(%superq(testWorkPath)=,boolean) %then
|
||||
%do;
|
||||
%put WARNING: The testWorkPath path:;
|
||||
%put WARNING- %superq(testWorkPath);
|
||||
%put WARNING- does not exist. WORK will be used.;
|
||||
%put WARNING- ;
|
||||
%end;
|
||||
libname TESTWORK "&SASWORK./testwork_&testPackageTimesamp.";
|
||||
%end;
|
||||
|
||||
%local dirForTest dirForTestWork;
|
||||
%let dirForTest = %sysfunc(pathname(TEST));
|
||||
%let dirForTestWork = %sysfunc(pathname(TESTWORK));
|
||||
@@ -3246,7 +3306,7 @@ filename currdir ".";
|
||||
filename currdir list;
|
||||
|
||||
/* if your package uses any other packages this points to their location */
|
||||
/* test if packages fileref exists and, if do, use it */
|
||||
/* test if packages fileref exists and, if it does, use it */
|
||||
/* if no one is provided the filesLocation is used as a replacement */
|
||||
%if %bquote(&packages.)= %then %let packages=%sysfunc(pathname(packages));
|
||||
%if %bquote(&packages.)= %then %let packages=&filesLocation.;
|
||||
@@ -3272,9 +3332,9 @@ options NOquotelenmax;
|
||||
data _null_;
|
||||
file "./loading.sas";
|
||||
|
||||
put "proc printto";
|
||||
put "log = '&dirForTest./loading.log0'";
|
||||
put "; run;";
|
||||
put "proc printto"
|
||||
/ "log = '&dirForTest./loading.log0'"
|
||||
/ "; run;";
|
||||
|
||||
put "filename packages '&packages.';" /;
|
||||
|
||||
@@ -3284,18 +3344,18 @@ data _null_;
|
||||
put '%include packages(loadpackage.sas);' / ; /* for older versions when the SPFinit.sas did not exist */
|
||||
|
||||
/* load */
|
||||
put '%loadpackage'"(&packageName.,";
|
||||
put " path=&filesLocation.)" /;
|
||||
put '%loadpackage'"(&packageName.,";
|
||||
put " path=&filesLocation., lazyData=*)" /;
|
||||
put '%loadpackage'"(&packageName.,"
|
||||
/ " path=&filesLocation.)" /;
|
||||
put '%loadpackage'"(&packageName.,"
|
||||
/ " path=&filesLocation., lazyData=*)" /;
|
||||
|
||||
/* help */
|
||||
put '%helpPackage'"(&packageName.,";
|
||||
put " path=&filesLocation.)" /;
|
||||
put '%helpPackage'"(&packageName.,*,";
|
||||
put " path=&filesLocation.)" /;
|
||||
put '%helpPackage'"(&packageName.,License,";
|
||||
put " path=&filesLocation.)" /;
|
||||
put '%helpPackage'"(&packageName.,"
|
||||
/ " path=&filesLocation.)" /;
|
||||
put '%helpPackage'"(&packageName.,*,"
|
||||
/ " path=&filesLocation.)" /;
|
||||
put '%helpPackage'"(&packageName.,License,"
|
||||
/ " path=&filesLocation.)" /;
|
||||
|
||||
/* preview */
|
||||
put '%previewPackage'"(&packageName.,";
|
||||
@@ -3315,10 +3375,9 @@ data _null_;
|
||||
when (upcase(type) in ("LAZYDATA")) /* the "DATA" type will pop-up during deletion */
|
||||
do;
|
||||
if 1 = FIRST.type then
|
||||
put "data _null_; " ;
|
||||
put " if not exist('" fileshortUP "') then " /
|
||||
" put 'WARNING: Dataset " fileshortUP "does not exist!'; "
|
||||
;
|
||||
put "data _null_; "
|
||||
/ " if not exist('" fileshortUP "') then "
|
||||
/ " put 'WARNING: Dataset " fileshortUP "does not exist!'; " ;
|
||||
if 1 = LAST.type then
|
||||
put "run; ";
|
||||
end;
|
||||
@@ -3326,10 +3385,9 @@ data _null_;
|
||||
when (upcase(type) =: "MACRO")
|
||||
do;
|
||||
if 1 = FIRST.type then
|
||||
put "data _null_; " ;
|
||||
put ' if not input(resolve(''%SYSMACEXIST(' fileshortUP ')''), best.) then ' /
|
||||
" put 'WARNING: Macro " fileshortUP "does not exist!'; "
|
||||
;
|
||||
put "data _null_; "
|
||||
/ ' if not input(resolve(''%SYSMACEXIST(' fileshortUP ')''), best.) then '
|
||||
/ " put 'WARNING: Macro " fileshortUP "does not exist!'; " ;
|
||||
if 1 = LAST.type then
|
||||
put "run; ";
|
||||
|
||||
@@ -3347,19 +3405,23 @@ data _null_;
|
||||
end;
|
||||
|
||||
/* unload */
|
||||
put '%unloadPackage'"(&packageName.,";
|
||||
put " path=&filesLocation.) " /;
|
||||
put '%unloadPackage'"(&packageName.,"
|
||||
/ " path=&filesLocation.) " /;
|
||||
|
||||
/* additional content */
|
||||
put '%loadPackageAddCnt'"(&packageName.,";
|
||||
put " path=&filesLocation.) " /;
|
||||
put '%loadPackageAddCnt'"(&packageName.,"
|
||||
/ " path=&filesLocation.) " /;
|
||||
|
||||
put "filename packages '&filesLocation.';" /
|
||||
'%listPackages() ' /;
|
||||
put "filename packages '&filesLocation.';"
|
||||
/ '%listPackages() ' /;
|
||||
|
||||
/* check if work should be deleted after test is done */
|
||||
delTestWork = input(symget('delTestWork'), ?? best32.);
|
||||
if 0 = delTestWork then
|
||||
put "options NOWORKTERM;"/;
|
||||
|
||||
put "proc printto";
|
||||
put "; run;";
|
||||
put "proc printto"
|
||||
/ "; run;";
|
||||
|
||||
stop;
|
||||
run;
|
||||
@@ -3470,6 +3532,28 @@ data _null_;
|
||||
|
||||
file "./autoexec.sas";
|
||||
|
||||
/* check if work should be deleted after test is done */
|
||||
delTestWork = input(symget('delTestWork'), ?? best32.);
|
||||
if not(delTestWork in (0 1)) then
|
||||
do;
|
||||
putlog "WARNING: [&sysmacroname.] The `delTestWork` parameter is invalid.";
|
||||
putlog "WARNING- [&sysmacroname.] Default value (1) is set.";
|
||||
delTestWork = 1;
|
||||
end;
|
||||
|
||||
if 0 = delTestWork then
|
||||
do;
|
||||
put "libname _ '&dirForTest.';" /
|
||||
"data TESTWORK_&t.;" /
|
||||
" length testName $ 128 testWork $ 2048;" /
|
||||
" testNumber=&t.; testName='&&TEST_&t..';" /
|
||||
" testWork = pathname('WORK');" /
|
||||
"run;" /
|
||||
"proc append base=_.TESTWORK data=TESTWORK_&t.; run;" /
|
||||
"proc delete data=TESTWORK_&t.; run;" /
|
||||
"libname _ clear;" ;
|
||||
end;
|
||||
|
||||
put "proc printto";
|
||||
put "log = '&dirForTest./&&TEST_&t...log0'";
|
||||
put "; run;";
|
||||
@@ -3486,15 +3570,6 @@ data _null_;
|
||||
put '%loadpackage'"(&packageName.,";
|
||||
put " path=&filesLocation., lazyData=*)" /;
|
||||
|
||||
/* check if work should be deleted after test is done */
|
||||
delTestWork = input(symget('delTestWork'), ?? best32.);
|
||||
if not(delTestWork in (0 1)) then
|
||||
do;
|
||||
putlog "WARNING: [&sysmacroname.] The `delTestWork` parameter is invalid.";
|
||||
putlog "WARNING- [&sysmacroname.] Default value (1) is set.";
|
||||
delTestWork = 1;
|
||||
end;
|
||||
|
||||
if 0 = delTestWork then
|
||||
put "options NOWORKTERM;"/;
|
||||
|
||||
@@ -3571,12 +3646,13 @@ options ¬esSourceOptions.;
|
||||
|
||||
data test.tests_summary;
|
||||
length testName $ 128;
|
||||
do _N_ = 0 to &numberOfTests.;
|
||||
testName = symget(cats("TEST_", _N_));
|
||||
systask = coalesce(input(symget(cats("SASSTAT", _N_)), ?? best32.), -1);
|
||||
sysrc = coalesce(input(symget(cats("TESTRC_", _N_)), ?? best32.), -1);
|
||||
error = coalesce(input(symget(cats("TESTE_", _N_)), ?? best32.), -1);
|
||||
warning = coalesce(input(symget(cats("TESTW_", _N_)), ?? best32.), -1);
|
||||
do testNumber = 0 to &numberOfTests.;
|
||||
testName = symget(cats("TEST_", testNumber));
|
||||
systask = coalesce(input(symget(cats("SASSTAT", testNumber)), ?? best32.), -1);
|
||||
sysrc = coalesce(input(symget(cats("TESTRC_", testNumber)), ?? best32.), -1);
|
||||
error = coalesce(input(symget(cats("TESTE_", testNumber)), ?? best32.), -1);
|
||||
warning = coalesce(input(symget(cats("TESTW_", testNumber)), ?? best32.), -1);
|
||||
|
||||
output;
|
||||
end;
|
||||
run;
|
||||
@@ -3584,10 +3660,29 @@ title1 "Summary of tests.";
|
||||
title2 "details can be found in:";
|
||||
title3 "%sysfunc(pathname(TEST))";
|
||||
footnote;
|
||||
proc print data = test.tests_summary;
|
||||
proc print data = test.tests_summary(drop=testNumber);
|
||||
run;
|
||||
title;
|
||||
|
||||
%if 0=&delTestWork. %then
|
||||
%do;
|
||||
data test.tests_summary;
|
||||
merge
|
||||
test.tests_summary
|
||||
%if %sysfunc(EXIST(test.testwork)) %then
|
||||
%do; test.testwork %end;
|
||||
%else
|
||||
%do; %PUT INFO: Cannot add work path location info.; %end;
|
||||
;
|
||||
by testNumber;
|
||||
run;
|
||||
%if %sysfunc(EXIST(test.testwork)) %then
|
||||
%do;
|
||||
proc delete data=test.testwork;
|
||||
run;
|
||||
%end;
|
||||
%end;
|
||||
|
||||
/*%put _local_;*/
|
||||
|
||||
%put NOTE: Changing current folder to:;
|
||||
@@ -3706,7 +3801,7 @@ data &filesWithCodes.markdown;
|
||||
%end;
|
||||
|
||||
put " " / "--------------------------------------------------------------------" / " "
|
||||
/ "*SAS package generated by SAS Package Framework, version `20250710`*"
|
||||
/ "*SAS package generated by SAS Package Framework, version `20251017`*"
|
||||
/ " " / "--------------------------------------------------------------------" / " ";
|
||||
|
||||
put "# The `&packageName.` package content";
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to get help about SAS package, version 20250710. Run %helpPackage() for help info.'
|
||||
des = 'Macro to get help about SAS package, version 20251017. Run %helpPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -43,7 +43,7 @@ des = 'Macro to get help about SAS package, version 20250710. Run %helpPackage()
|
||||
%put ### This is short help information for the `helpPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to get help about SAS packages, version `20250710` #;
|
||||
%put # Macro to get help about SAS packages, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -93,6 +93,7 @@ des = 'Macro to get help about SAS package, version 20250710. Run %helpPackage()
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to learn more. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put #### Example ####################################################################;
|
||||
%put # #;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*+installPackage+*/
|
||||
/* Macros to install SAS packages, version 20250710 */
|
||||
/* Macros to install SAS packages, version 20251017 */
|
||||
/* 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
|
||||
@@ -21,11 +21,12 @@
|
||||
, instDoc=0 /* should the markdown file with documentation be installed?
|
||||
default is 0 - means No, 1 means Yes */
|
||||
, SFRCVN = /* name of a macro variable to store success-failure return code value */
|
||||
, github = /* name of a user or an organization in GitHub, all characters except [A-z0-9_.-] are compressed */
|
||||
)
|
||||
/secure
|
||||
minoperator
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to install SAS package, version 20250710. Run %%installPackage() for help info.'
|
||||
des = 'Macro to install SAS package, version 20251017. Run %%installPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||
%do;
|
||||
@@ -40,7 +41,7 @@ des = 'Macro to install SAS package, version 20250710. Run %%installPackage() fo
|
||||
%put ### This is short help information for the `installPackage` macro #;
|
||||
%put #--------------------------------------------------------------------------------------------#;;
|
||||
%put # #;
|
||||
%put # Macro to install SAS packages, version `20250710` #;
|
||||
%put # Macro to install SAS packages, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -73,21 +74,23 @@ des = 'Macro to install SAS package, version 20250710. Run %%installPackage() fo
|
||||
%put # `https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/` #;
|
||||
%put # #;
|
||||
%put # - `mirror=` Indicates which web location for packages installation is used. #;
|
||||
%put # Value `0` indicates: #;
|
||||
%put # `https://github.com/SASPAC/` #;
|
||||
%put # Value `0` or `SASPAC` indicates: #;
|
||||
%put # `https://github.com/SASPAC/` #;
|
||||
%put # Value `1` indicates: #;
|
||||
%put # `https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main` #;
|
||||
%put # `https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main` #;
|
||||
%put # Value `2` indicates: #;
|
||||
%put # `https://pages.mini.pw.edu.pl/~jablonskib/SASpublic/SAS_PACKAGES` #;
|
||||
%put # `https://pages.mini.pw.edu.pl/~jablonskib/SASpublic/SAS_PACKAGES` #;
|
||||
%put # Value `3` or `PharmaForest` indicates: #;
|
||||
%put # `https://github.com/PharmaForest/` #;
|
||||
%put # Default value is `0`. #;
|
||||
%put # #;
|
||||
%put # - `version=` Indicates which historical version of a package to install. #;
|
||||
%put # Historical version are available only if `mirror=0` is set. #;
|
||||
%put # Historical version are currently available only if `mirror=0` is set. #;
|
||||
%put # Default value is null which means "install the latest". #;
|
||||
%put # When there are multiple packages to install version variable #;
|
||||
%put # When there are multiple packages to install the `version` variable #;
|
||||
%put # is scan sequentially. #;
|
||||
%put # #;
|
||||
%put # - `replace=` With default value of `1` it causes existing package file #;
|
||||
%put # - `replace=` With default value of `1`, it causes existing package file 0 #;
|
||||
%put # to be replaced by new downloaded file. #;
|
||||
%put # #;
|
||||
%put # - `URLuser=` A user name for the password protected URLs, no quotes needed. #;
|
||||
@@ -109,15 +112,21 @@ des = 'Macro to install SAS package, version 20250710. Run %%installPackage() fo
|
||||
%put # indicates if the `.md` file should be also downloaded. #;
|
||||
%put # Default value of zero (`0`) means "No", one (`1`) means "Yes". #;
|
||||
%put # #;
|
||||
%put # - `SFRCVN=` *Optional.* Provides a NAME for a macro variable to store value of the #;
|
||||
%put # *success-failure return code* of the installation process. Return value #;
|
||||
%put # has the following form: `<number of successes>.<number of failures>` #;
|
||||
%put # The macro variable is created as a *global* macro variable. #;
|
||||
%put # - `SFRCVN=` *Optional.* Provides a NAME for a macro variable to store value of the #;
|
||||
%put # *success-failure return code* of the installation process. Return value #;
|
||||
%put # has the following form: `<number of successes>.<number of failures>` #;
|
||||
%put # The macro variable is created as a *global* macro variable. #;
|
||||
%put # #;
|
||||
%put # - `github=` *Optional.* A name of a user or an organization in GitHub. #;
|
||||
%put # Allows an easy set of the search path for packages available on GitHub: #;
|
||||
%put # `https://github.com/<github>/<packagename>/raw/.../` #;
|
||||
%put # All characters except `[A-z0-9_.-]` are compressed. #;
|
||||
%put # #;
|
||||
%put #--------------------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to learn more. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put #### Example #################################################################################;
|
||||
%put # #;
|
||||
@@ -142,7 +151,7 @@ des = 'Macro to install SAS package, version 20250710. Run %%installPackage() fo
|
||||
%put # #;
|
||||
%put # Enabling the SAS Package Framework #;
|
||||
%put # from the local directory and installing & loading #;
|
||||
%put # the multiple packages from the Internet. #;
|
||||
%put # multiple packages with versions from the Internet. #;
|
||||
%put # #;
|
||||
%put # Assume that the `SPFinit.sas` file #;
|
||||
%put # is located in the "C:/SAS_PACKAGES/" folder. #;
|
||||
@@ -202,11 +211,22 @@ des = 'Macro to install SAS package, version 20250710. Run %%installPackage() fo
|
||||
%let SPFinitMirrorMD = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.md;
|
||||
%let sourcePath = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/packages/;
|
||||
|
||||
%if %qupcase(%superq(mirror))=SASPAC %then %let mirror = 0;
|
||||
%if %qupcase(%superq(mirror))=PHARMAFOREST %then %let mirror = 3;
|
||||
%if %superq(github) NE %then %let mirror = 4;
|
||||
|
||||
%if NOT (%superq(mirror) IN (0 1 2 3 4)) %then
|
||||
%do;
|
||||
%put WARNING: Unknown mirror: %superq(mirror)!;
|
||||
%put WARNING- Default will be used.;
|
||||
%let mirror = 0;
|
||||
%end;
|
||||
|
||||
%if 0 = %superq(mirror) %then
|
||||
%do;
|
||||
%let SPFinitMirror = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.sas;
|
||||
%let SPFinitMirrorMD = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.md;
|
||||
%let sourcePath = https://github.com/SASPAC/; /*usercontent*/
|
||||
%let sourcePath = https://github.com/SASPAC/; /*users content*/
|
||||
%goto mirrorEnd;
|
||||
%end;
|
||||
|
||||
@@ -225,6 +245,27 @@ des = 'Macro to install SAS package, version 20250710. Run %%installPackage() fo
|
||||
%let sourcePath = https://pages.mini.pw.edu.pl/~jablonskib/SASpublic/SAS_PACKAGES/packages/;
|
||||
%goto mirrorEnd;
|
||||
%end;
|
||||
|
||||
%if 3 = %superq(mirror) %then
|
||||
%do;
|
||||
%let SPFinitMirror = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.sas;
|
||||
%let SPFinitMirrorMD = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.md;
|
||||
/* ingnore version support for pharmaForest for now */
|
||||
%let sourcePath = https://github.com/PharmaForest/; /*users content*/
|
||||
%goto mirrorEnd;
|
||||
%end;
|
||||
|
||||
%if 4 = %superq(mirror) %then
|
||||
%do;
|
||||
%let SPFinitMirror = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.sas;
|
||||
%let SPFinitMirrorMD = https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.md;
|
||||
/* ingnore version support for pharmaForest for now */
|
||||
%let github = %sysfunc(compress(%superq(github),%str(,.-),KAD));
|
||||
%put INFO: GitHub location used is: %superq(github).;
|
||||
%let sourcePath = https://github.com/&github./; /*users content*/
|
||||
%goto mirrorEnd;
|
||||
%end;
|
||||
|
||||
%mirrorEnd:
|
||||
%put INFO: Source path is &sourcePath.;
|
||||
%end;
|
||||
@@ -273,7 +314,7 @@ des = 'Macro to install SAS package, version 20250710. Run %%installPackage() fo
|
||||
%let vers=;
|
||||
%if %superq(versB) ne %then %let vers = &versB.;
|
||||
%if %superq(versA) ne %then %let vers = &versA.;
|
||||
%if -1 = &mirror %then /* ignore version when direct path is provided */
|
||||
%if %eval(-1 = &mirror) OR %eval(3 = &mirror) %then /* ignore version when direct path or PharmaForest is provided */
|
||||
%do;
|
||||
%let vers=;
|
||||
%end;
|
||||
@@ -320,7 +361,7 @@ des = 'Macro to install SAS package, version 20250710. Run %%installPackage() fo
|
||||
%end;
|
||||
%else
|
||||
%do;
|
||||
%if 0 = %superq(mirror) %then
|
||||
%if %superq(mirror) IN (0 3 4) %then /* SASPAC or PharmaForest or an arbitrary GitHub repo */
|
||||
%do;
|
||||
%let packageSubDir = %sysfunc(lowcase(&packageName.))/raw/main/;
|
||||
|
||||
@@ -332,7 +373,7 @@ des = 'Macro to install SAS package, version 20250710. Run %%installPackage() fo
|
||||
%end;
|
||||
%else
|
||||
%do;
|
||||
%if %superq(mirror) > 0 %then
|
||||
%if %superq(mirror) NE 0 %then
|
||||
%put %str( )Mirror %superq(mirror) does not support versioning.;
|
||||
%end;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
Macro to list SAS packages in packages folder.
|
||||
|
||||
Version 20250710
|
||||
Version 20251017
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
%macro listPackages()
|
||||
/secure PARMBUFF
|
||||
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20250710.'
|
||||
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20251017.'
|
||||
;
|
||||
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
|
||||
%do;
|
||||
@@ -38,7 +38,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 `20250710` #;
|
||||
%put # Macro to list available SAS packages, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -57,6 +57,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to learn more. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put #### Example ##############################################################################;
|
||||
%put # #;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to load SAS package, version 20250710. Run %loadPackage() for help info.'
|
||||
des = 'Macro to load SAS package, version 20251017. Run %loadPackage() for help info.'
|
||||
minoperator
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
@@ -52,7 +52,7 @@ minoperator
|
||||
%put ### This is short help information for the `loadPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to *load* SAS packages, version `20250710` #;
|
||||
%put # Macro to *load* SAS packages, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -120,6 +120,7 @@ minoperator
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to learn more. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put ### Example 1 ###################################################################;
|
||||
%put # #;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
is provided in required version */
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to load additional content for a SAS package, version 20250710. Run %loadPackageAddCnt() for help info.'
|
||||
des = 'Macro to load additional content for a SAS package, version 20251017. Run %loadPackageAddCnt() for help info.'
|
||||
minoperator
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
@@ -35,7 +35,7 @@ minoperator
|
||||
%put ### This is short help information for the `loadPackageAddCnt` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to *load* additional content for a SAS package, version `20250710` #;
|
||||
%put # Macro to *load* additional content for a SAS package, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -75,6 +75,7 @@ minoperator
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to learn more. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put ### Example 1 ###################################################################;
|
||||
%put # #;
|
||||
@@ -290,6 +291,8 @@ minoperator
|
||||
set WORK.__&_TargetFileref_._zip___ end = EOF;
|
||||
wc = countw(file,"/\");
|
||||
|
||||
put wc= file=;
|
||||
|
||||
length libText pathname_f $ 8192;
|
||||
libText = pathname("outData", "L");
|
||||
|
||||
@@ -308,15 +311,24 @@ minoperator
|
||||
end;
|
||||
|
||||
pathname_f = pathname("f");
|
||||
rc1 = filename("in", strip(pathname_f), "zip", "member='" !! strip(file) !! "' lrecl=1 recfm=n");
|
||||
|
||||
length rc1msg $ 8192;
|
||||
rc1 = filename("in", strip(pathname_f), "zip", "member='" !! strip(file) !! "' lrecl=1 recfm=n");
|
||||
rc1msg = sysmsg();
|
||||
rc2 = filename("out", catx("/", libText, scan(file, j , "/\")), "disk", "lrecl=1 recfm=n");
|
||||
|
||||
length fileNameOutPath $ 8192;
|
||||
fileNameOutPath = catx("/", libText, scan(file, j , "/\"));
|
||||
/* check for Windows */
|
||||
if lengthn(fileNameOutPath)>260 then
|
||||
if symget('SYSSCP')='WIN' then
|
||||
put "INFO: Pathname plus filename length exceeds 260. Under Windows family OS it may cause problems.";
|
||||
|
||||
length rc2msg $ 8192;
|
||||
rc2 = filename("out", fileNameOutPath, "disk", "lrecl=1 recfm=n");
|
||||
rc2msg = sysmsg();
|
||||
|
||||
rc3 = fcopy("in", "out");
|
||||
length rc3msg $ 8192;
|
||||
rc3 = fcopy("in", "out");
|
||||
rc3msg = sysmsg();
|
||||
|
||||
loadingProblem + (rc3 & 1);
|
||||
@@ -324,7 +336,7 @@ minoperator
|
||||
if rc3 then
|
||||
do;
|
||||
put "ERROR: Cannot extract: " file;
|
||||
put (rc1 rc2 rc3) (=);
|
||||
put "ERROR-" (rc1 rc2 rc3) (=);
|
||||
put (rc1msg rc2msg rc3msg) (/);
|
||||
put "ERROR-";
|
||||
end;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to load multiple SAS packages at one run, version 20250710. Run %loadPackages() for help info.'
|
||||
des = 'Macro to load multiple SAS packages at one run, version 20251017. 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 `20250710` #;
|
||||
%put # Macro wrapper for the loadPackage macro, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -52,6 +52,7 @@ parmbuff
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to learn more. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put #### Example ####################################################################;
|
||||
%put # #;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to preview content of a SAS package, version 20250710. Run %previewPackage() for help info.'
|
||||
des = 'Macro to preview content of a SAS package, version 20251017. 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 20250710. Run %preview
|
||||
%put ### This is short help information for the `previewPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to get preview of a SAS packages, version `20250710` #;
|
||||
%put # Macro to get preview of a SAS packages, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -82,6 +82,7 @@ des = 'Macro to preview content of a SAS package, version 20250710. Run %preview
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to learn more. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put #### Example ####################################################################;
|
||||
%put # #;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
,nobs=0 /* technical parameter */
|
||||
)
|
||||
/*** HELP START ***/
|
||||
/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20250710. Run %splitCodeForPackage() for help info.'
|
||||
/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20251017. Run %splitCodeForPackage() for help info.'
|
||||
;
|
||||
/*%macro _();%mend _;*/
|
||||
%if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then
|
||||
@@ -25,7 +25,7 @@
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Utility macro to *split* single file with SAS package code into multiple #;
|
||||
%put # files with separate snippets, version `20250710` #;
|
||||
%put # files with separate snippets, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -60,6 +60,7 @@
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to learn more. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put ### Example 1 ###################################################################;
|
||||
%put # #;
|
||||
@@ -106,7 +107,6 @@
|
||||
%GOTO ENDofsplitCodeForPackage;
|
||||
%end;
|
||||
|
||||
|
||||
%local options_tmp2 ;
|
||||
%let options_tmp2 = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps))
|
||||
%sysfunc(getoption(notes)) %sysfunc(getoption(source))
|
||||
@@ -172,7 +172,6 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ;
|
||||
call symputX('packagePath',packagePath,"L");
|
||||
run;
|
||||
|
||||
|
||||
data w.files;
|
||||
stop;
|
||||
run;
|
||||
@@ -198,7 +197,7 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ;
|
||||
line = left(lowcase(_infile_));
|
||||
block=scan(line,1," ");
|
||||
|
||||
if block in (
|
||||
if block in (
|
||||
'/*##$##-code-block-start-##$##'
|
||||
'/*##$##-code-block-end-##$##'
|
||||
);
|
||||
@@ -402,7 +401,7 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ;
|
||||
*/
|
||||
if firstLine[j] then
|
||||
do;
|
||||
put '/* File generated with help of SAS Packages Framework, version 20250710. */';
|
||||
put '/* File generated with help of SAS Packages Framework, version 20251017. */';
|
||||
firstLine[j]=0;
|
||||
end;
|
||||
put _infile_;
|
||||
@@ -418,5 +417,4 @@ options &options_tmp2.;
|
||||
%ENDofsplitCodeForPackage:
|
||||
%mend splitCodeForPackage;
|
||||
|
||||
|
||||
/**/
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to unload SAS package, version 20250710. Run %unloadPackage() for help info.'
|
||||
des = 'Macro to unload SAS package, version 20251017. 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 20250710. Run %unloadPackage() for h
|
||||
%put ### This is short help information for the `unloadPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to unload SAS packages, version `20250710` #;
|
||||
%put # Macro to unload SAS packages, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -75,6 +75,7 @@ des = 'Macro to unload SAS package, version 20250710. Run %unloadPackage() for h
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to learn more. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put ### Example #####################################################################;
|
||||
%put # #;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
hashing_file() function, SAS 9.4M6 */
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to verify SAS package with the hash digest, version 20250710. Run %verifyPackage() for help info.'
|
||||
des = 'Macro to verify SAS package with the hash digest, version 20251017. 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 20250710. Run %
|
||||
%put ### This is short help information for the `verifyPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to verify SAS package with it hash digest, version `20250710` #;
|
||||
%put # Macro to verify SAS package with it hash digest, version `20251017` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -58,6 +58,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20250710. Run %
|
||||
%put # #;
|
||||
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
||||
%put # to learn more. #;
|
||||
%put # Tutorials available at: `https://github.com/yabwon/HoW-SASPackages` #;
|
||||
%put # #;
|
||||
%put #### Example ####################################################################;
|
||||
%put # #;
|
||||
|
||||
147
SPF/SPFinit.md
147
SPF/SPFinit.md
@@ -1,7 +1,7 @@
|
||||
|
||||
---
|
||||
|
||||
# SAS Packages Framework, version `20250710`
|
||||
# SAS Packages Framework, version `20251017`
|
||||
|
||||
---
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
|
||||
## This is short SAS Packages Framework help information <a name="helpinfo"></a>
|
||||
|
||||
A **SAS package** is an automatically generated, single, stand alone *zip* file containing organised and ordered code structures, created by the developer and extended with additional automatically generated "driving" files (i.e. description, metadata, load, unload, and help files).
|
||||
A **SAS package** is an automatically generated, single, stand alone *zip* file containing organized 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 **`20250710`**.
|
||||
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20251017`**.
|
||||
|
||||
**To get started with SAS Packages** try this [**`Getting Started with SAS Packages`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/Getting_Started_with_SAS_Packages.pdf "Getting Started with SAS Packages") presentation (see the `./SPF/Documentation` directory).
|
||||
**To get started with SAS Packages** try this [**`Introduction to SAS Packages`**](https://youtube.com/playlist?list=PLeMzGEImIT5eV13IGXQIgWmTFCJt_cLZG&si=ElQm0_ifq76mvUbq "Introduction to SAS Packages video series") video series or [**`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).
|
||||
|
||||
@@ -43,7 +43,7 @@ After assigning the directory do not change them when using the SPF since it may
|
||||
|
||||
## Tutorial on SAS Packages and SAS Packages Framework
|
||||
|
||||
"From 0 to hero" tutorial explaining what are SAS Packages, and how to work with
|
||||
"From 0 to hero" tutorial explaining what are SAS Packages, and how to work with
|
||||
them using the SPF can be found [**HERE**](https://github.com/yabwon/HoW-SASPackages).
|
||||
|
||||
--------------------------------------------------------------------------------------------
|
||||
@@ -52,7 +52,7 @@ them using the SPF can be found [**HERE**](https://github.com/yabwon/HoW-SASPack
|
||||
## This is short help information for the `installPackage` macro <a name="installpackage"></a>
|
||||
--------------------------------------------------------------------------------------------
|
||||
|
||||
Macro to install SAS packages, version `20250710`
|
||||
Macro to install SAS packages, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -84,18 +84,20 @@ them using the SPF can be found [**HERE**](https://github.com/yabwon/HoW-SASPack
|
||||
`https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/`
|
||||
|
||||
- `mirror=` Indicates which web location for packages installation is used.
|
||||
Value `0` indicates:
|
||||
Value `0` or `SASPAC` indicates:
|
||||
`https://github.com/SASPAC/`
|
||||
Value `1` indicates:
|
||||
`https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main`
|
||||
Value `2` indicates:
|
||||
`https://pages.mini.pw.edu.pl/~jablonskib/SASpublic/SAS_PACKAGES`
|
||||
Value `3` or `PharmaForest` indicates:
|
||||
`https://github.com/PharmaForest/`
|
||||
Default value is `0`.
|
||||
|
||||
- `version=` Indicates which historical version of a package to install.
|
||||
Historical version are available only if `mirror=0` is set.
|
||||
Historical version are currently available only if `mirror=0` is set.
|
||||
Default value is null which means "install the latest".
|
||||
When there are multiple packages to install version
|
||||
When there are multiple packages to install version variable
|
||||
is scan sequentially.
|
||||
|
||||
- `replace=` With default value of `1` it causes existing package file
|
||||
@@ -125,10 +127,17 @@ them using the SPF can be found [**HERE**](https://github.com/yabwon/HoW-SASPack
|
||||
has the following form: `<number of successes>.<number of failures>`
|
||||
The macro variable is created as a *global* macro variable.
|
||||
|
||||
- `github=` *Optional.* A name of a user or an organization in GitHub.
|
||||
Allows an easy set of the search path for packages available on GitHub:
|
||||
`https://github.com/<github>/<packagename>/raw/.../`
|
||||
All characters except `[A-z0-9_.-]` are compressed.
|
||||
|
||||
--------------------------------------------------------------------------------------------
|
||||
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` to learn more.
|
||||
|
||||
Tutorials available at: `https://github.com/yabwon/HoW-SASPackages`
|
||||
|
||||
### Example ################################################################################
|
||||
|
||||
Enabling the SAS Package Framework
|
||||
@@ -153,7 +162,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
|
||||
Enabling the SAS Package Framework
|
||||
from the local directory and installing & loading
|
||||
the multiple packages from the Internet.
|
||||
multiple packages with versions from the Internet.
|
||||
|
||||
Assume that the `SPFinit.sas` file
|
||||
is located in the "C:/SAS_PACKAGES/" folder.
|
||||
@@ -171,7 +180,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 `20250710`
|
||||
Macro to get help about SAS packages, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -222,6 +231,8 @@ filename packages "C:/SAS_PACKAGES";
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||
to learn more.
|
||||
|
||||
Tutorials available at: `https://github.com/yabwon/HoW-SASPackages`
|
||||
|
||||
## Example ####################################################################
|
||||
|
||||
Enabling the SAS Package Framework
|
||||
@@ -247,7 +258,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 `20250710`
|
||||
Macro to *load* SAS packages, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -316,6 +327,8 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||
to learn more.
|
||||
|
||||
Tutorials available at: `https://github.com/yabwon/HoW-SASPackages`
|
||||
|
||||
## Example 1 ##################################################################
|
||||
|
||||
Enabling the SAS Package Framework
|
||||
@@ -403,7 +416,7 @@ If created, those macros are automatically deleted when the `%unloadPackage()` m
|
||||
## This is short help information for the `loadPackageS` macro <a name="loadpackages"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro wrapper for the loadPackage macro, version `20250710`
|
||||
Macro wrapper for the loadPackage macro, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -429,6 +442,8 @@ If created, those macros are automatically deleted when the `%unloadPackage()` m
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||
to learn more.
|
||||
|
||||
Tutorials available at: `https://github.com/yabwon/HoW-SASPackages`
|
||||
|
||||
### Example ###################################################################
|
||||
|
||||
Enabling the SAS Package Framework
|
||||
@@ -452,7 +467,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 `20250710`
|
||||
Macro to unload SAS packages, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -493,6 +508,8 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||
to learn more.
|
||||
|
||||
Tutorials available at: `https://github.com/yabwon/HoW-SASPackages`
|
||||
|
||||
### Example ###################################################################
|
||||
|
||||
Enabling the SAS Package Framework
|
||||
@@ -517,7 +534,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 `20250710`
|
||||
Macro to list available SAS packages, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -537,6 +554,8 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||
to learn more.
|
||||
|
||||
Tutorials available at: `https://github.com/yabwon/HoW-SASPackages`
|
||||
|
||||
### Example #############################################################################
|
||||
|
||||
Enabling the SAS Package Framework
|
||||
@@ -558,7 +577,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 `20250710`
|
||||
Macro to verify SAS package with it hash digest, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -612,7 +631,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 preview of a SAS packages, version `20250710`
|
||||
Macro to get preview of a SAS packages, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -658,6 +677,8 @@ filename packages "C:/SAS_PACKAGES"; %* set-up a directory for packages;
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||
to learn more.
|
||||
|
||||
Tutorials available at: `https://github.com/yabwon/HoW-SASPackages`
|
||||
|
||||
### Example ###################################################################
|
||||
|
||||
Enabling the SAS Package Framework
|
||||
@@ -679,7 +700,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 `20250710`
|
||||
Macro to generate SAS packages, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -697,49 +718,61 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
|
||||
### Parameters:
|
||||
|
||||
1. `filesLocation=` Location of package files, example value:
|
||||
`%sysfunc(pathname(work))/packagename`.
|
||||
Default use case:
|
||||
`%generatePackage(filesLocation=/path/to/packagename)`
|
||||
If empty displays this help information.
|
||||
1. `filesLocation=` Location of package files, example value:
|
||||
`%sysfunc(pathname(work))/packagename`.
|
||||
Default use case:
|
||||
`%generatePackage(filesLocation=/path/to/packagename)`
|
||||
If empty displays this help information.
|
||||
|
||||
Testing parameters:
|
||||
|
||||
- `testPackage=` Indicator if tests should be executed.
|
||||
Default value: `Y`, means "execute tests"
|
||||
- `testPackage=` Indicator if tests should be executed.
|
||||
Default value: `Y`, means "execute tests"
|
||||
|
||||
- `packages=` Location of other packages for testing
|
||||
if there are dependencies in loading the package.
|
||||
Has to be a single directory, if more than one are
|
||||
provided than only the first is used.
|
||||
If path to location contains spaces it should be quoted!
|
||||
- `packages=` Location of other packages for testing
|
||||
if there are dependencies in loading the package.
|
||||
Has to be a single directory, if more than one are
|
||||
provided than only the first is used.
|
||||
If path to location contains spaces it should be quoted!
|
||||
|
||||
- `testResults=` Location where tests results should be stored,
|
||||
if null (the default) then the session WORK is used.
|
||||
- `testResults=` Location where tests results should be stored,
|
||||
if null (the default) then the session WORK is used.
|
||||
|
||||
- `sasexe=` Location of a DIRECTORY where the SAS binary is located,
|
||||
if null (the default) then the `!SASROOT` is used.
|
||||
- `workInTestResults=` Indicates if WORK directories for test sessions should
|
||||
be located in the same place as results.
|
||||
The default value: `0` means "do not do this".
|
||||
Available values are `0` and `1`.
|
||||
|
||||
- `sascfgFile=` Location of a FILE with testing session configuration
|
||||
parameters, if null (the default) then no config file
|
||||
is pointed during the SAS invocation,
|
||||
if set to `DEF` then the `!SASROOT/sasv9.cfg` is used.
|
||||
- `testWorkPath=` Points a location where tests sessions work directories
|
||||
should be stored. By default it is null what means that
|
||||
a sub-directory of the main SAS session WORK is used.
|
||||
Takes precedence over `workInTestResults=`.
|
||||
|
||||
- `delTestWork=` Indicates if `WORK` directories generated by user tests
|
||||
should be deleted, i.e. the (NO)WORKTERM option is set.
|
||||
The default value: `1` means "delete tests work".
|
||||
Available values are `0` and `1`.
|
||||
- `sasexe=` Location of a DIRECTORY where the SAS binary is located,
|
||||
if null (the default) then the `!SASROOT` is used.
|
||||
|
||||
- `markdownDoc=` Indicates if a markdown file with documentation
|
||||
be generated from help information blocks.
|
||||
The default value: `0` means "do not generate the file".
|
||||
Available values are `0` and `1`.
|
||||
- `sascfgFile=` Location of a FILE with testing session configuration
|
||||
parameters, if null (the default) then no config file
|
||||
is pointed during the SAS invocation,
|
||||
if set to `DEF` then the `!SASROOT/sasv9.cfg` is used.
|
||||
|
||||
- `easyArch=` When creating documentation file (`markdownDoc=1`)
|
||||
indicates if a copy of the zip and markdown files
|
||||
with the version number in the file name be created
|
||||
The default value: `0` means "do not create files".
|
||||
Available values are `0` and `1`.
|
||||
- `delTestWork=` Indicates if `WORK` directories generated by user tests
|
||||
should be deleted, i.e. the (NO)WORKTERM option is set.
|
||||
The default value: `1` means "delete tests work".
|
||||
Available values are `0` and `1`.
|
||||
|
||||
Documentation parameters:
|
||||
|
||||
- `markdownDoc=` Indicates if a markdown file with documentation
|
||||
be generated from help information blocks.
|
||||
The default value: `0` means "do not generate the file".
|
||||
Available values are `0` and `1`.
|
||||
|
||||
- `easyArch=` When creating documentation file (`markdownDoc=1`)
|
||||
indicates if a copy of the zip and markdown files
|
||||
with the version number in the file name be created
|
||||
The default value: `0` means "do not create files".
|
||||
Available values are `0` and `1`.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -894,7 +927,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 `20250710`
|
||||
Macro to list directories pointed by 'packages' fileref, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -913,6 +946,8 @@ All files have to have `.sas` extension. Other files are ignored.
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||
to learn more.
|
||||
|
||||
Tutorials available at: `https://github.com/yabwon/HoW-SASPackages`
|
||||
|
||||
### Example ###################################################################
|
||||
|
||||
Enabling the SAS Package Framework
|
||||
@@ -934,7 +969,7 @@ filename packages ("D:/NEW_DIR" %extendPackagesFileref()); %* add new directory;
|
||||
## This is short help information for the `loadPackageAddCnt` macro <a name="loadpackageaddcnt"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to load *additional content* for a SAS package, version `20250710`
|
||||
Macro to load *additional content* for a SAS package, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -975,6 +1010,8 @@ filename packages ("D:/NEW_DIR" %extendPackagesFileref()); %* add new directory;
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||
to learn more.
|
||||
|
||||
Tutorials available at: `https://github.com/yabwon/HoW-SASPackages`
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
By *default* additional content is not deployed automatically e.g.,
|
||||
@@ -1026,7 +1063,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Utility macro to *split* single file with SAS package code into multiple
|
||||
files with separate snippets, version `20250710`
|
||||
files with separate snippets, version `20251017`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -1062,6 +1099,8 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||
to learn more.
|
||||
|
||||
Tutorials available at: `https://github.com/yabwon/HoW-SASPackages`
|
||||
|
||||
### Example 1 ##################################################################
|
||||
|
||||
Assume that the `myPackageCode.sas` file
|
||||
|
||||
586
SPF/SPFinit.sas
586
SPF/SPFinit.sas
File diff suppressed because it is too large
Load Diff
@@ -86,7 +86,7 @@ SHA256 digest for macroArray: F*3F3893F1FCD78719543703E4353F4CC19811D247C016F220
|
||||
|
||||
---
|
||||
|
||||
- **BasePlus**\[2.1.0\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
||||
- **BasePlus**\[3.0.0\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
||||
```sas
|
||||
call arrMissToRight(myArray);
|
||||
call arrFillMiss(17, myArray);
|
||||
@@ -117,8 +117,10 @@ format x bool.;
|
||||
%put %monthShift(2023,1,-5);
|
||||
|
||||
%put #%expandDataSetsList(lib=sashelp,datasets=_all_)#;
|
||||
|
||||
%workLib(ABC)
|
||||
```
|
||||
SHA256 digest for BasePlus: F*DFA83F8E0D7424DEB63D49620392068BC68D766552E2804CB6B01DE8E5A87769
|
||||
SHA256 digest for BasePlus: F*B9F6D8F1EDD1ECDA89F4BE327C4F4202649475D1D9DFB476279B633D9F14125D
|
||||
|
||||
[Documentation for BasePlus](https://github.com/SASPAC/blob/main/baseplus.md "Documentation for BasePlus")
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/* 20251015 */
|
||||
BasePlus: F*B9F6D8F1EDD1ECDA89F4BE327C4F4202649475D1D9DFB476279B633D9F14125D
|
||||
|
||||
/* 20250905 */
|
||||
BasePlus: F*DB0811D8F207641BD45FCE30CB75D03CDF8D06849EBEA268BB575358FAA4E76C
|
||||
|
||||
/* 20250807 */
|
||||
BasePlus: F*19FE220C82DE4B9990B4AC352A9D9DEF5FAF2FD601BE756B2F3A2AC39CDAF381
|
||||
|
||||
/* 20250805 */
|
||||
BasePlus: F*B2D318DD9708D74E5A7C419F7CAE1BF46D662B7F6AEE7E6B1B9D9B6858A5C41A
|
||||
|
||||
/* 20250804 */
|
||||
BasePlus: F*71DC1AFA709B2977E8AEA452721776F62EEC8240ABD658AC83AA6D4310FC49B6
|
||||
|
||||
/* 20240909 */
|
||||
BasePlus: F*DFA83F8E0D7424DEB63D49620392068BC68D766552E2804CB6B01DE8E5A87769
|
||||
|
||||
|
||||
@@ -9,22 +9,22 @@
|
||||
### Version information:
|
||||
|
||||
- Package: BasePlus
|
||||
- Version: 2.1.0
|
||||
- Generated: 2024-09-09T12:55:04
|
||||
- Author(s): Bartosz Jablonski (yabwon@gmail.com), Quentin McMullen (qmcmullen@gmail.com)
|
||||
- Version: 3.0.0
|
||||
- Generated: 2025-10-15T10:13:04
|
||||
- Author(s): Bartosz Jablonski (yabwon@gmail.com), Quentin McMullen (qmcmullen@gmail.com), Ryo Nakaya (nakaya.ryou@gmail.com)
|
||||
- Maintainer(s): Bartosz Jablonski (yabwon@gmail.com)
|
||||
- License: MIT
|
||||
- File SHA256: `F*DFA83F8E0D7424DEB63D49620392068BC68D766552E2804CB6B01DE8E5A87769` for this version
|
||||
- Content SHA256: `C*AB16F5B6538515607C3C254E401DC1ACA7293AB36990227F6E7792145CEEAB87` for this version
|
||||
- File SHA256: `F*B9F6D8F1EDD1ECDA89F4BE327C4F4202649475D1D9DFB476279B633D9F14125D` for this version
|
||||
- Content SHA256: `C*680412F6B403870A3A8975FC17300F7C92AEDECA48D3F242B5BC4E545DC6D313` for this version
|
||||
|
||||
---
|
||||
|
||||
# The `BasePlus` package, version: `2.1.0`;
|
||||
# The `BasePlus` package, version: `3.0.0`;
|
||||
|
||||
---
|
||||
|
||||
|
||||
# The BasePlus package [ver. 2.1.0] <a name="baseplus-package"></a> ###############################################
|
||||
# The BasePlus package [ver. 3.0.0] <a name="baseplus-package"></a> ###############################################
|
||||
|
||||
The **BasePlus** package implements useful
|
||||
functions and functionalities I miss in the BASE SAS.
|
||||
@@ -47,7 +47,8 @@ Kudos to all who inspired me to generate this package:
|
||||
*Quentin McMullen*,
|
||||
*Kurt Bremser*,
|
||||
*Leonid Batkhan*,
|
||||
*Louise Hadden*.
|
||||
*Louise Hadden*,
|
||||
*Ryo Nakaya*.
|
||||
|
||||
---
|
||||
|
||||
@@ -387,6 +388,11 @@ proc print data=b_x;
|
||||
run;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
**EXAMPLE 29** Create library ABC assigned to `<WORK>/ABC` directory:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%workLib(abc)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
---
|
||||
|
||||
---
|
||||
@@ -403,7 +409,7 @@ localization (only if additional content was deployed during the installation pr
|
||||
|
||||
--------------------------------------------------------------------
|
||||
|
||||
*SAS package generated by SAS Package Framework, version `20240711`*
|
||||
*SAS package generated by SAS Package Framework, version `20250729`*
|
||||
|
||||
--------------------------------------------------------------------
|
||||
|
||||
@@ -490,10 +496,11 @@ The `BasePlus` package consists of the following content:
|
||||
78. [`%translate()` macro ](#translate-macro-78 )
|
||||
79. [`%tranwrd()` macro ](#tranwrd-macro-79 )
|
||||
80. [`%unifyvarscasesize()` macro ](#unifyvarscasesize-macro-80 )
|
||||
81. [`%workpath()` macro ](#workpath-macro-81 )
|
||||
81. [`%worklib()` macro ](#worklib-macro-81 )
|
||||
82. [`%workpath()` macro ](#workpath-macro-82 )
|
||||
|
||||
|
||||
82. [License note](#license)
|
||||
83. [License note](#license)
|
||||
|
||||
---
|
||||
|
||||
@@ -838,6 +845,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
<,longFormat=>
|
||||
<,fileExt=>
|
||||
<,maxDepth=>
|
||||
<,backslashSens=>
|
||||
)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -868,6 +876,11 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
* `maxDepth=0` - *Optional*, if not zero then indicates
|
||||
maximum depth of search in the root path.
|
||||
|
||||
* `backslashSens=0` - *Optional*, if not zero then it indicates
|
||||
that backslash(`\`) symbol in files and dirs
|
||||
names is detectable under Linux. Accepted
|
||||
values: `0` and `1`. Ignored under Windows.
|
||||
|
||||
|
||||
### EXAMPLES AND USECASES: ####################################################
|
||||
|
||||
@@ -989,7 +1002,12 @@ The QgetVars() returns quoted value [by %superq()].
|
||||
|
||||
See examples below for the details.
|
||||
|
||||
The `%getVars()` macro executes like a pure macro code.
|
||||
When `mcArray=` is not used the `%getVars()` macro executes like
|
||||
a pure macro code. When `mcArray=` is not null (creation of a
|
||||
macro variable array is requested) them a single semicolon is returned.
|
||||
|
||||
When `validvarname=ANY` in set special care should be kept.
|
||||
See dedicated examples below.
|
||||
|
||||
### SYNTAX: ###################################################################
|
||||
|
||||
@@ -1003,6 +1021,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
<,quote=>
|
||||
<,mcArray=>
|
||||
<,ignoreCases>
|
||||
<,nlit=>
|
||||
)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1025,23 +1044,32 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
|
||||
* `mcArray=` - *Optional*, default value is blank.
|
||||
1) When *null* - the macro behaves like a macro function
|
||||
and returns a text string with variables list.
|
||||
2) When *not null* - behaviour of the macro is altered.
|
||||
and ban be used in the `%put` or `%let=` statements.
|
||||
The returned text is a string with variables list.
|
||||
2) When *not null* - behavior of the macro is altered.
|
||||
In such case a macro array of selected variables, named
|
||||
with `mcArray` value as a prefix, is created.
|
||||
Furthermore a macro named as `mcArray` value is generated.
|
||||
(see the macroArray package for the details).
|
||||
When `mcArray=` parameter is active the `getVars` macro
|
||||
cannot be called within the `%put` statement. Execution like:
|
||||
`%put %getVars(..., mcArray=XXX);` will result with
|
||||
an Explicit & Radical Refuse Of Run (aka ERROR).
|
||||
should not be called within the `%put` or `%let=` statements.
|
||||
A single semicolon is produced as the macro result, hence
|
||||
execution like: `%put %getVars(..., mcArray=XXX) some text;`
|
||||
will result with an Explicit & Radical Refuse Of Run (aka ERROR).
|
||||
|
||||
* `ignoreCases=` - *Optional*, default value is 1.
|
||||
* `ignoreCases=` - *Optional*, default value is 1.
|
||||
Indicates if search should be case insensitive.
|
||||
|
||||
* `nlit=` - *Optional*, default value is 0.
|
||||
Introduced to improve `validvarname=ANY` handling.
|
||||
Indicates if the `NLITERAL()` function should be
|
||||
executed to cover spacial characters.
|
||||
|
||||
|
||||
### EXAMPLES AND USECASES: ####################################################
|
||||
|
||||
**When `validvarname=` option is _not_ `ANY`.**
|
||||
|
||||
**EXAMPLE 1.** A list of all variables from the
|
||||
sashelp.class dataset:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
@@ -1267,6 +1295,44 @@ run;
|
||||
%put %do_over(XYZ);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
**When the `validvarname=ANY` option is set.**
|
||||
|
||||
**EXAMPLE 12.** Get all variables and handle special characters.
|
||||
Without `nlit=1` the code will fail.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
options validvarname = any;
|
||||
data varnameANY;
|
||||
set sashelp.class(obs=3);
|
||||
|
||||
'A&B'n=42;
|
||||
'space name'n=101;
|
||||
'2025-08'n=234;
|
||||
'2025%09'n=235;
|
||||
"2025'10"n=236;
|
||||
'2025"11'n=237;
|
||||
run;
|
||||
|
||||
%put %getVars(varnameANY, nlit=1);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
**EXAMPLE 13.** Create macro variable array ABC for all variables.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%getVars(varnameANY, mcArray=ABC, nlit=1);
|
||||
%put %ABC(1) %ABC(6) %ABC(7) %ABC(11);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
**EXAMPLE 14.** Get only variables with illegal characters in names.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%let notV7compliant = %getVars(varnameANY, pattern=[^a-z0-9_], nlit=1);
|
||||
%put ¬V7compliant.;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
**EXAMPLE 14.** Print variables starting with a digit.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%put %getVars(varnameANY, pattern=^\d, nlit=1);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1929,6 +1995,11 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
* `ignoreCases=` - *Optional*, default value is 1.
|
||||
Indicates if search should be case insensitive.
|
||||
|
||||
* `nlit=` - *Optional*, default value is 0.
|
||||
Introduced to improve `validvarname=ANY` handling.
|
||||
Indicates if the `NLITERAL()` function should be
|
||||
executed to cover spacial characters.
|
||||
|
||||
|
||||
### EXAMPLES AND USECASES: ####################################################
|
||||
|
||||
@@ -6395,7 +6466,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
|
||||
3. `false` - *Required*, value returned when condition is false.
|
||||
|
||||
4 `v=` - *Optional*, v for verbose. If set to `1` extra notes
|
||||
* `v=` - *Optional*, v for verbose. If set to `1` extra notes
|
||||
are printed.
|
||||
---
|
||||
|
||||
@@ -7555,7 +7626,71 @@ run;
|
||||
|
||||
---
|
||||
|
||||
## `%workpath()` macro <a name="workpath-macro-81"></a> ######
|
||||
## `%worklib()` macro <a name="worklib-macro-81"></a> ######
|
||||
|
||||
## >>> `%workLib()` macro: <<< <a name="worklib-macro"></a> #######################
|
||||
|
||||
The `%workLib()` macro creates and assigns a WORK-scoped sub-library.
|
||||
|
||||
Purpose:
|
||||
|
||||
The macro creates (if needed) and assigns a SAS library as a sub-directory
|
||||
under the current `WORK` location. This is useful for isolating temporary
|
||||
outputs per task while ensuring automatic cleanup at the end of the SAS session.
|
||||
Basic engines libraries, like `BASE`, `V*`, and simple `SPDE`, can be set.
|
||||
|
||||
### SYNTAX: ###################################################################
|
||||
|
||||
The basic syntax is the following, the `<...>` means optional parameters:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%workLib(lib,<engine>)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
**Arguments description**:
|
||||
|
||||
- `lib` - *Required*: Name of a library (and sub-folder)
|
||||
to create under WORK. The value must be a valid
|
||||
nonempty SAS libref (8 characters max, starting
|
||||
with a letter or underscore).
|
||||
|
||||
- `engine` - *Optional*, Name of a basic, directory level,
|
||||
SAS engine, e.g. `BASE`. When empty the default
|
||||
engine is used.
|
||||
---
|
||||
|
||||
### Details
|
||||
|
||||
- Builds a target path: `<WORK>/<lib>`.
|
||||
- All data written to this libref are temporary and will be removed
|
||||
when the WORK library is cleared at session end.
|
||||
- If a directory with the same name already exists under WORK,
|
||||
the macro prints a note and simply assigns the LIBNAME to
|
||||
that location.
|
||||
- The `dcreate()` function is used to create sub-directory.
|
||||
|
||||
|
||||
### EXAMPLES AND USECASES: ####################################################
|
||||
|
||||
**EXAMPLE 1.** Create basic library ABC:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%workLib(abc)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
**EXAMPLE 2.** Create libraries with different engines:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%workLib(b,BASE)
|
||||
|
||||
%workLib(v,V6) %* for Windows only.;
|
||||
|
||||
%workLib(s,SPDE)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
---
|
||||
|
||||
|
||||
---
|
||||
|
||||
## `%workpath()` macro <a name="workpath-macro-82"></a> ######
|
||||
|
||||
## >>> `%workPath()` macro: <<< <a name="workpath-macro"></a> #######################
|
||||
|
||||
@@ -7598,7 +7733,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
|
||||
# License <a name="license"></a> ######
|
||||
|
||||
Copyright (c) 2020 - 2024 Bartosz Jablonski
|
||||
Copyright (c) 2020 - 2025 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
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user