Compare commits

..
7 Commits
Author SHA1 Message Date
Bart Jablonski 914ad08157 SAS Packages Framework, version 20260721
SAS Packages Framework, version `20260721`

Changes:

- Small errors fixed
- Code cleanup
2026-07-22 10:14:11 +02:00
Bart Jablonski 8102ab5513 SAS Packages Framework, version 20260710
SAS Packages Framework, version `20260710`

Changes:

- Code cleanup
2026-07-10 11:05:38 +02:00
Bart JablonskiandK.Nakamatsu 3ca1cae526 SAS Packages Framework, version 20260617
SAS Packages Framework, version `20260617`

Changes:

- Documentation update. Answer to issue: #136

Co-Authored-By: K.Nakamatsu <ken-nakamatsu@knworx.com>
2026-06-17 19:20:26 +02:00
Bart JablonskiandGitHub dd4132d2ea Rename unbundlePackages.sas to unbundlepackages.sas 2026-06-15 23:53:57 +02:00
Bart JablonskiandGitHub b43d0dbf8a Rename bundlePackages.sas to bundlepackages.sas 2026-06-15 23:53:33 +02:00
Bart JablonskiandGitHub f7ca5af492 Rename requestPackage.sas to requestpackage.sas 2026-06-15 23:53:09 +02:00
Bart Jablonski 75a8b77406 SAS Packages Framework, version 20260615
SAS Packages Framework, version `20260615`

Changes:

- Documentation update. Answer to issue: https://github.com/yabwon/SAS_PACKAGES/issues/136
2026-06-15 23:08:16 +02:00
26 changed files with 1778 additions and 372 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ Don't forget to give the repository a **STAR** and become [stargazer](https://gi
### Current version: ### Current version:
**The latest version** of the **SAS Packages Framework** is **`20260602**. **The latest version** of the **SAS Packages Framework** is **`20260721**.
--- ---
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+bundlePackages+*/ /*+bundlePackages+*/
%macro bundlePackages( %macro bundlePackages(
bundleName bundleName
@@ -8,7 +72,7 @@
,packagesRef=packages ,packagesRef=packages
,ods= /* data set for report file */ ,ods= /* data set for report file */
)/ )/
des='Macro to create a bundle of SAS packages, version 20260602. Run %bundlePackages(HELP) for help info.' des='Macro to create a bundle of SAS packages, version 20260721. Run %bundlePackages(HELP) for help info.'
secure minoperator secure minoperator
; ;
@@ -25,7 +89,7 @@ secure minoperator
%put ### This is short help information for the `bundlePackages` macro #; %put ### This is short help information for the `bundlePackages` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *create bundles* of SAS packages, version `20260602` #; %put # Macro to *create bundles* of SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -426,7 +490,7 @@ run;
/*===================================================================================================*/ /*===================================================================================================*/
/* restore optionos */ /* restore options */
options ls = &ls_tmp. ps = &ps_tmp. options ls = &ls_tmp. ps = &ps_tmp.
&notes_tmp. &source_tmp. &notes_tmp. &source_tmp.
&stimer_tmp. &fullstimer_tmp. &stimer_tmp. &fullstimer_tmp.
+66 -2
View File
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+extendPackagesFileref+*/ /*+extendPackagesFileref+*/
/*** HELP START ***/ /*** HELP START ***/
@@ -6,7 +70,7 @@
when empty the "packages" value is used */ when empty the "packages" value is used */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to list directories pointed by "packages" fileref, version 20260602. Run %extendPackagesFileref(HELP) for help info.' des = 'Macro to list directories pointed by "packages" fileref, version 20260721. Run %extendPackagesFileref(HELP) for help info.'
; ;
%if %QUPCASE(&packages.) = HELP %then %if %QUPCASE(&packages.) = HELP %then
@@ -22,7 +86,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20260602
%put ### This is short help information for the `extendPackagesFileref` macro #; %put ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list directories pointed by 'packages' fileref, version `20260602` #; %put # Macro to list directories pointed by 'packages' fileref, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
+143 -78
View File
@@ -1,9 +1,73 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+generatePackage+*/ /*+generatePackage+*/
/*** HELP START ***//* /*** HELP START ***//*
Macro to generate SAS packages. Macro to generate SAS packages.
Version 20260602 Version 20260721
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -31,7 +95,7 @@
if null (the default) the WORK is used */ if null (the default) the WORK is used */
,workInTestResults=0 /* indicates if WORK directories for tests should be located ,workInTestResults=0 /* indicates if WORK directories for tests should be located
in the same place as results */ in the same place as results */
,testWorkPath= /* location where tests SAS sessions' work directories ,testWorkPath= /* location where tests SAS session work directories
should be stored, if null (the default) the main SAS should be stored, if null (the default) the main SAS
session WORK is used. Takes precedence over workInTestResults= */ session WORK is used. Takes precedence over workInTestResults= */
,sasexe= /* a DIRECTORY where the SAS binary is located, ,sasexe= /* a DIRECTORY where the SAS binary is located,
@@ -53,7 +117,7 @@
when empty takes buildLocation */ when empty takes buildLocation */
)/ secure minoperator )/ secure minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to generate SAS packages, version 20260602. Run %generatePackage(HELP) for help info.' des = 'Macro to generate SAS packages, version 20260721. Run %generatePackage(HELP) for help info.'
; ;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then %if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do; %do;
@@ -68,7 +132,7 @@ des = 'Macro to generate SAS packages, version 20260602. Run %generatePackage(HE
%put ### This is short help information for the `generatePackage` macro #; %put ### This is short help information for the `generatePackage` macro #;
%put #------------------------------------------------------------------------------------#; %put #------------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to generate SAS packages, version `20260602` #; %put # Macro to generate SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -125,8 +189,8 @@ des = 'Macro to generate SAS packages, version 20260602. Run %generatePackage(HE
%put # if null (the default) then the `!SASROOT` is used. #; %put # if null (the default) then the `!SASROOT` is used. #;
%put # #; %put # #;
%put # - `sascfgFile=` Location of a FILE with testing session configuration #; %put # - `sascfgFile=` Location of a FILE with testing session configuration #;
%put # parameters, if null (the default) then no config file #; %put # parameters, if null (the default) then no configuration #;
%put # is pointed during the SAS invocation, #; %put # file is pointed during the SAS invocation, #;
%put # if set to `DEF` then the `!SASROOT/sasv9.cfg` is used. #; %put # if set to `DEF` then the `!SASROOT/sasv9.cfg` is used. #;
%put # #; %put # #;
%put # - `delTestWork=` Indicates if `WORK` directories generated by user tests #; %put # - `delTestWork=` Indicates if `WORK` directories generated by user tests #;
@@ -448,7 +512,8 @@ data _null_;
/* test if version is a number */ /* test if version is a number */
/*data _null_;*/ /* <- comment out, because it can be 1 data step, not 2 */ /*data _null_;*/ /* <- comment out, because it can be 1 data step, not 2 */
v = "&packageVersion."; length v $ 64;
v = symget("packageVersion");
version = coalesce(input(scan(v,1,".","M"), ?? best32.),0)*1e8 version = coalesce(input(scan(v,1,".","M"), ?? best32.),0)*1e8
+ coalesce(input(scan(v,2,".","M"), ?? best32.),0)*1e4 + coalesce(input(scan(v,2,".","M"), ?? best32.),0)*1e4
+ coalesce(input(scan(v,3,".","M"), ?? best32.),0)*1e0 + coalesce(input(scan(v,3,".","M"), ?? best32.),0)*1e0
@@ -456,7 +521,7 @@ data _null_;
if not (version > 0) then if not (version > 0) then
do; do;
put 'ERROR: Package version should be a positive NUMBER.' put 'ERROR: Package version should be a positive NUMBER.'
/ 'ERROR- Current value is: ' "&packageVersion." / 'ERROR- Current value is: ' v
/ 'ERROR- Try something small, e.g. 0.1' / 'ERROR- Try something small, e.g. 0.1'
/ 'ERROR- Aborting.'; / 'ERROR- Aborting.';
put; put;
@@ -950,7 +1015,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
title&_titleNumber_. "Package ZIP file location is: &buildLocation."; title&_titleNumber_. "Package ZIP file location is: &buildLocation.";
%end; %end;
footnote1 "SAS Packages Framework, version 20260602"; footnote1 "SAS Packages Framework, version 20260721";
proc print proc print
data = &filesWithCodes.(drop=base build folderRef fileRef rc folderid _abort_ fileId additionalContent) data = &filesWithCodes.(drop=base build folderRef fileRef rc folderid _abort_ fileId additionalContent)
@@ -1131,20 +1196,20 @@ data _null_;
/ ' %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 ' / ' %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 '
/ ' + (%scan(&pV0.,2,.,M)+0)*1e4 ' / ' + (%scan(&pV0.,2,.,M)+0)*1e4 '
/ ' + (%scan(&pV0.,3,.,M)+0)*1e0); ' / ' + (%scan(&pV0.,3,.,M)+0)*1e0); '
/ ' '
/ ' %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); ' / ' %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); '
/ ' %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); ' / ' %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); '
/ ' %if %superq(rVsign)= %then %let rVsign=<=; ' / ' %if %superq(rVsign)= %then %let rVsign=<=; '
/ ' %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then ' / ' %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then '
/ ' %do; ' / ' %do; '
/ ' %put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; ' / ' %put WARNING: Illegal operator "%superq(rVsign)"! Default(<=) will be used.; '
/ ' %put WARNING- Supported operators are: %str(= <= =< => >= < >); ' / ' %put WARNING- Supported operators are: %str(= <= =< => >= < >); '
/ ' %let rVsign=<=; ' / ' %let rVsign=<=; '
/ ' %end; ' / ' %end; '
/ ' %let rV = %sysevalf((%scan(&rV0.,1,.,M)+0)*1e8 ' / ' %let rV = %sysevalf((%scan(&rV0.,1,.,M)+0)*1e8 '
/ ' + (%scan(&rV0.,2,.,M)+0)*1e4 ' / ' + (%scan(&rV0.,2,.,M)+0)*1e4 '
/ ' + (%scan(&rV0.,3,.,M)+0)*1e0); ' / ' + (%scan(&rV0.,3,.,M)+0)*1e0); '
/ ' '
/ ' %if NOT %sysevalf(&rV. &rVsign. &pV.) %then ' / ' %if NOT %sysevalf(&rV. &rVsign. &pV.) %then '
/ ' %do; ' / ' %do; '
/ ' %put ERROR: Package &packageName. will not be loaded!; ' / ' %put ERROR: Package &packageName. will not be loaded!; '
@@ -1164,8 +1229,8 @@ data _null_;
/ ' %local cherryPick; %let cherryPick=*; ' / ' %local cherryPick; %let cherryPick=*; '
/ ' %local tempLoad_minoperator; ' / ' %local tempLoad_minoperator; '
/ ' %let tempLoad_minoperator = %sysfunc(getoption(minoperator)); ' / ' %let tempLoad_minoperator = %sysfunc(getoption(minoperator)); '
/ " "
/ ' %if %superq(suppressExec) NE 1 %then %let suppressExec = 0; ' / ' %if %sysevalf(%superq(suppressExec) NE 1,boolean) %then %let suppressExec = 0; '
/ ' %include &_PackageFileref_.(load.sas) / &source2.; ' / ' %include &_PackageFileref_.(load.sas) / &source2.; '
/ ' options &tempLoad_minoperator.; ' / ' options &tempLoad_minoperator.; '
/ ' filename &_PackageFileref_. clear; ' / ' filename &_PackageFileref_. clear; '
@@ -1223,72 +1288,71 @@ data _null_;
or (%superq(packageReqPackages) ne ) or (%superq(packageReqPackages) ne )
%then %then
%do; %do;
put ' data _null_; ' put ' data _null_; '
/ ' call symputX("packageRequiredErrors", 0, "L"); ' / ' call symputX("packageRequiredErrors", 0, "L"); '
/ ' run; '; / ' run; ';
%end; %end;
%if %sysevalf(%superq(packageRequired) ne,boolean) %then
%if %superq(packageRequired) ne %then
%do; %do;
put ' %put NOTE- *Testing required SAS components*%sysfunc(DoSubL(' /* <- DoSubL() is here */ put ' %put NOTE- *Testing required SAS components*%sysfunc(DoSubL(%str(' /* <- DoSubL() is here */
/ ' options nonotes nosource %str(;) ' / ' options nonotes nosource ; '
/ ' options ls=max ps=max locale=en_US %str(;) ' / ' options ls=max ps=max locale=en_US ; '
/ ' /* temporary redirect log */ ' / ' /* temporary redirect log */ '
/ ' filename _stinit_ TEMP %str(;) ' / ' filename _stinit_ TEMP ; '
/ ' proc printto log = _stinit_ %str(;) run %str(;) ' / ' proc printto log = _stinit_ ; run ; '
/ ' /* print out setinit */ ' / ' /* print out setinit */ '
/ ' proc setinit %str(;) run %str(;) ' / ' proc setinit ; run ; '
/ ' proc printto %str(;) run %str(;) ' / ' proc printto ; run ; '
/ ' options ps=min %str(;) ' / ' options ps=min ; '
/ ' data _null_ %str(;) ' / ' data _null_ ; '
/ ' /* loadup checklist of required SAS components */ ' / ' /* loadup checklist of required SAS components */ '
/ ' if _n_ = 1 then ' / ' if _n_ = 1 then '
/ ' do %str(;) ' / ' do ; '
/ ' length req $ 256 %str(;) ' / ' length req $ 256 ; '
/ ' declare hash R() %str(;) ' / ' declare hash R() ; '
/ ' _N_ = R.defineKey("req") %str(;) ' / ' _N_ = R.defineKey("req") ; '
/ ' _N_ = R.defineDone() %str(;) ' / ' _N_ = R.defineDone() ; '
/ ' declare hiter iR("R") %str(;) '; / ' declare hiter iR("R") ; ';
length packageRequired $ 32767; length packageRequired $ 32767;
packageRequired = upcase(symget('packageRequired')); packageRequired = upcase(symget('packageRequired'));
put ' do req = %bquote(' / packageRequired / ') %str(;) ' put ' do req = %bquote(' / packageRequired / ') ; '
/ ' _N_ = R.add(key:req,data:req) %str(;) ' / ' _N_ = R.add(key:req,data:req) ; '
/ ' end %str(;) ' / ' end ; '
/ ' end %str(;) ' / ' end ; '
/ ' ' / ' '
/ ' /* read in output from proc setinit */ ' / ' /* read in output from proc setinit */ '
/ ' infile _stinit_ end=eof %str(;) ' / ' infile _stinit_ end=eof ; '
/ ' input %str(;) ' / ' input ; '
/* / ' put "*> " _infile_ %str(;) ' */ /* for testing */ /* / ' put "*> " _infile_ ; ' */ /* for testing */
/ ' ' / ' '
/ ' /* if component is in setinit remove it from checklist */ ' / ' /* if component is in setinit remove it from checklist */ '
/ ' if _infile_ =: "---" then ' / ' if _infile_ =: "---" then '
/ ' do %str(;) ' / ' do ; '
/ ' req = upcase(substr(_infile_, 4, 64)) %str(;) ' / ' req = upcase(substr(_infile_, 4, 64)) ; '
/ ' if R.find(key:req) = 0 then ' / ' if R.find(key:req) = 0 then '
/ ' do %str(;) ' / ' do ; '
/ ' _N_ = R.remove() %str(;) ' / ' _N_ = R.remove() ; '
/ ' end %str(;) ' / ' end ; '
/ ' end %str(;) ' / ' end ; '
/ ' ' / ' '
/ ' /* if checklist is not null rise error */ ' / ' /* if checklist is not null rise error */ '
/ ' if eof and R.num_items > 0 then ' / ' if eof and R.num_items > 0 then '
/ ' do %str(;) ' / ' do ; '
/ ' put "WARNING- ###########################################" %str(;) ' / ' put "WARNING- ###########################################" ; '
/ ' put "WARNING: The following SAS components are missing! " %str(;) ' / ' put "WARNING: The following SAS components are missing! " ; '
/ ' call symputX("packageRequiredErrors", 0, "L") %str(;) ' / ' call symputX("packageRequiredErrors", 0, "L") ; '
/ ' do while(iR.next() = 0) %str(;) ' / ' do while(iR.next() = 0) ; '
/ ' put "WARNING- " req %str(;) ' / ' put "WARNING- " req ; '
/ ' end %str(;) ' / ' end ; '
/ ' put "WARNING: The package may NOT WORK as expected " %str(;) ' / ' put "WARNING: The package may NOT WORK as expected " ; '
/ ' put "WARNING: or even result with ERRORS! " %str(;) ' / ' put "WARNING: or even result with ERRORS! " ; '
/ ' put "WARNING- ###########################################" %str(;) ' / ' put "WARNING- ###########################################" ; '
/ ' put %str(;) ' / ' put ; '
/ ' end %str(;) ' / ' end ; '
/ ' run %str(;) ' / ' run ; '
/ ' filename _stinit_ clear %str(;) ' / ' filename _stinit_ clear ; '
/ ' options notes source %str(;) ' / ' options notes source ; '
/ ' ))*; '; / ' )))*; ';
%end; %end;
%if %superq(packageReqPackages) ne %then %if %superq(packageReqPackages) ne %then
@@ -1775,7 +1839,7 @@ data _null_;
%end; %end;
put +(-1) '`.;''' put +(-1) '`.;'''
/ ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' / ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"'
/ ' !! '' %put with the SAS Packages Framework version 20260602.;''' / ' !! '' %put with the SAS Packages Framework version 20260721.;'''
/ ' !! '' %put ****************************************************************************;''' / ' !! '' %put ****************************************************************************;'''
/ ' !! '' %GOTO theEndOfTheMacro;''' / ' !! '' %GOTO theEndOfTheMacro;'''
/ ' !! '' %end;''' ; / ' !! '' %end;''' ;
@@ -1939,7 +2003,7 @@ data _null_;
%end; %end;
put +(-1) '`.; '' !!' / put +(-1) '`.; '' !!' /
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !! ' / ''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !! ' /
''' %put with the SAS Packages Framework version 20260602.; '' !! ' / ''' %put with the SAS Packages Framework version 20260721.; '' !! ' /
''' %put ****************************************************************************; '' !! ' / ''' %put ****************************************************************************; '' !! ' /
''' %GOTO theEndOfTheMacro; '' !! ' / ''' %GOTO theEndOfTheMacro; '' !! ' /
''' %end; '' !! ' / ''' %end; '' !! ' /
@@ -2811,7 +2875,7 @@ data _null_;
%end; %end;
put 'put " " / @3 "---------------------------------------------------------------------" / " ";' put 'put " " / @3 "---------------------------------------------------------------------" / " ";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20260602`*";' / 'put @3 "*SAS package generated by SAS Package Framework, version `20260721`*";'
/ "put @3 '*under `&sysscp.`(`&sysscpl.`) operating system,*';" / "put @3 '*under `&sysscp.`(`&sysscpl.`) operating system,*';"
/ "put @3 '*using SAS release: `&sysvlong4.`.*';" / "put @3 '*using SAS release: `&sysvlong4.`.*';"
/ 'put " " / @3 "---------------------------------------------------------------------";'; / 'put " " / @3 "---------------------------------------------------------------------";';
@@ -2975,6 +3039,7 @@ data _null_;
call execute(' rc = fcopy("_SPFIN_", "_SPFOUT_");'); call execute(' rc = fcopy("_SPFIN_", "_SPFOUT_");');
call execute(' ex = fexist("_SPFOUT_"); Try + 1;'); call execute(' ex = fexist("_SPFOUT_"); Try + 1;');
call execute(' put Try= " File existence in ZIP verified as: " ex;'); call execute(' put Try= " File existence in ZIP verified as: " ex;');
call execute(' rc = sleep(^ex, 0.25);'); /* wait 0.25 sec if not copied successfully */
call execute(' end ;'); call execute(' end ;');
call execute(' if ex then put "File " pathname "copied into the package with return code: " rc "(0 = success)";'); call execute(' if ex then put "File " pathname "copied into the package with return code: " rc "(0 = success)";');
+66 -2
View File
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+helpPackage+*/ /*+helpPackage+*/
/*** HELP START ***/ /*** HELP START ***/
@@ -28,7 +92,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to get help about SAS package, version 20260602. Run %helpPackage(HELP) for help info.' des = 'Macro to get help about SAS package, version 20260721. Run %helpPackage(HELP) for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -43,7 +107,7 @@ des = 'Macro to get help about SAS package, version 20260602. Run %helpPackage(H
%put ### This is short help information for the `helpPackage` macro #; %put ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get help about SAS packages, version `20260602` #; %put # Macro to get help about SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
+71 -7
View File
@@ -1,5 +1,69 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+installPackage+*/ /*+installPackage+*/
/* Macros to install SAS packages, version 20260602 */ /* Macros to install SAS packages, version 20260721 */
/* A SAS package is a zip file containing a group of files /* A SAS package is a zip file containing a group of files
with SAS code (macros, functions, data steps generating with SAS code (macros, functions, data steps generating
data, etc.) wrapped up together and %INCLUDEed by data, etc.) wrapped up together and %INCLUDEed by
@@ -24,13 +88,13 @@
, SFRCVN = /* name of a macro variable to store success-failure return code value */ , 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 */ , github = /* name of a user or an organization in GitHub, all characters except [A-z0-9_.-] are compressed */
, githubRepo = /* repo name to be used, by default it is the package name, but can be altered */ , githubRepo = /* repo name to be used, by default it is the package name, but can be altered */
, githubToken = /* user's github fine-grained personal access token */ , githubToken = /* user github fine-grained personal access token */
, githubTokenDebug = 0 /* debug values: 0,1,2,3 */ , githubTokenDebug = 0 /* debug values: 0,1,2,3 */
) )
/secure /secure
minoperator minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP) for help info.' des = 'Macro to install SAS package, version 20260721. Run %installPackage(HELP) for help info.'
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do; %do;
@@ -45,7 +109,7 @@ des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP)
%put ### This is short help information for the `installPackage` macro #; %put ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;; %put #--------------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to install SAS packages, version `20260602` #; %put # Macro to install SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -148,7 +212,7 @@ des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP)
%put # managing-your-personal-access-tokens #; %put # managing-your-personal-access-tokens #;
%put # #creating-a-fine-grained-personal-access-token` #; %put # #creating-a-fine-grained-personal-access-token` #;
%put # (lines break added for easier reading) #; %put # (lines break added for easier reading) #;
%put # Public repos do not need authentication. #; %put # Public repositories do not need authentication. #;
%put # [NOTE!] This feature is experimental in this release. #; %put # [NOTE!] This feature is experimental in this release. #;
%put # #; %put # #;
%put #--------------------------------------------------------------------------------------------#; %put #--------------------------------------------------------------------------------------------#;
@@ -428,7 +492,7 @@ des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP)
%if (%superq(URLuser) ne ) %then %if (%superq(URLuser) ne ) %then
%do; %do;
user = "&URLuser." user = "&URLuser."
pass = "&URLuser." pass = "&URLpass."
%end; %end;
&URLoptions. &URLoptions.
recfm=N lrecl=1; recfm=N lrecl=1;
@@ -438,7 +502,7 @@ des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP)
%if (%superq(URLuser) ne ) %then %if (%superq(URLuser) ne ) %then
%do; %do;
user = "&URLuser." user = "&URLuser."
pass = "&URLuser." pass = "&URLpass."
%end; %end;
&URLoptions. &URLoptions.
recfm=N lrecl=1; recfm=N lrecl=1;
+67 -3
View File
@@ -1,10 +1,74 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+isPackagesFilerefOK+*/ /*+isPackagesFilerefOK+*/
/*** HELP START ***/ /*** HELP START ***/
%macro isPackagesFilerefOK( %macro isPackagesFilerefOK(
vERRb /* indicates if macro should be verbose and report errors */ vERRb /* indicates if macro should be verbose and report errors */
) )
/ minoperator PARMBUFF / minoperator PARMBUFF
des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20260602.' des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20260721.'
; ;
/*** HELP END ***/ /*** HELP END ***/
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then %if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
@@ -20,7 +84,7 @@ des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFile
%put ### This is short help information for the `isPackagesFilerefOK` macro #; %put ### This is short help information for the `isPackagesFilerefOK` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to check if the `packages` fileref is "correct", version `20260602` #; %put # Macro to check if the `packages` fileref is "correct", version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -85,7 +149,7 @@ des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFile
%if &nobs. AND 1=&vERRb. %then %put INFO: PACKAGES fileref is: %sysfunc(pathname(PACKAGES)); %if &nobs. AND 1=&vERRb. %then %put INFO: PACKAGES fileref is: %sysfunc(pathname(PACKAGES));
%let isPackagesFilerefOK=%sysevalf(&nobs. AND 1, boolean); %let isPackagesFilerefOK=%sysevalf(&nobs. AND 1, boolean);
%do i = 1 %to &nobs.; %do i = 1 %to &nobs.;
%let rc=%sysfunc(FETCHOBS(&dsid., &i.)); %let rc=%sysfunc(FETCHOBS(&dsid., &i.));
+67 -3
View File
@@ -1,9 +1,73 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+listPackages+*/ /*+listPackages+*/
/*** HELP START ***//* /*** HELP START ***//*
Macro to list SAS packages in packages folder. Macro to list SAS packages in packages folder.
Version 20260602 Version 20260721
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -25,7 +89,7 @@
listDataSet /* Name of a data set to save results */ listDataSet /* Name of a data set to save results */
, quiet = 0 /* Indicate if results should be printed in log */ , quiet = 0 /* Indicate if results should be printed in log */
)/secure parmbuff )/secure parmbuff
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20260602.' des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20260721.'
; ;
%if (%QUPCASE(&listDataSet.) = HELP) %then %if (%QUPCASE(&listDataSet.) = HELP) %then
%do; %do;
@@ -40,7 +104,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%put ### This is short help information for the `listPackages` macro #; %put ### This is short help information for the `listPackages` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list available SAS packages, version `20260602` #; %put # Macro to list available SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
+78 -14
View File
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+loadPackage+*/ /*+loadPackage+*/
/*** HELP START ***/ /*** HELP START ***/
@@ -37,23 +101,23 @@
, force=0 /* force loading even if given version is already loaded */ , force=0 /* force loading even if given version is already loaded */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load SAS package, version 20260602. Run %loadPackage(HELP) for help info.' des = 'Macro to load SAS package, version 20260721. Run %loadPackage(HELP) for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
%local options_tmp ; %local options_tmp ;
%let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps)) %let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps))
%sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(source2))
msglevel=%sysfunc(getoption(msglevel)) msglevel=%sysfunc(getoption(msglevel))
; ;
options NOnotes NOsource ls=MAX ps=MAX msglevel=N; options NOnotes NOsource NOsource2 ls=MAX ps=MAX msglevel=N;
%put ; %put ;
%put #################################################################################; %put #################################################################################;
%put ### This is short help information for the `loadPackage` macro #; %put ### This is short help information for the `loadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *load* SAS packages, version `20260602` #; %put # Macro to *load* SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -175,13 +239,13 @@ minoperator
%let ls_tmp = %sysfunc(getoption(ls)); %let ls_tmp = %sysfunc(getoption(ls));
%let ps_tmp = %sysfunc(getoption(ps)); %let ps_tmp = %sysfunc(getoption(ps));
%let notes_tmp = %sysfunc(getoption(notes)); %let notes_tmp = %sysfunc(getoption(notes));
%let source_tmp = %sysfunc(getoption(source)); %let source_tmp = %sysfunc(getoption(source)) %sysfunc(getoption(source2));
%let stimer_tmp = %sysfunc(getoption(stimer)); %let stimer_tmp = %sysfunc(getoption(stimer));
%let fullstimer_tmp = %sysfunc(getoption(fullstimer)); %let fullstimer_tmp = %sysfunc(getoption(fullstimer));
%let msglevel_tmp = %sysfunc(getoption(msglevel)); %let msglevel_tmp = %sysfunc(getoption(msglevel));
%let mautocomploc_tmp = %sysfunc(getoption(mautocomploc)); %let mautocomploc_tmp = %sysfunc(getoption(mautocomploc));
options NOnotes NOsource ls=MAX ps=MAX NOfullstimer NOstimer msglevel=N NOmautocomploc; options NOnotes NOsource NOsource2 ls=MAX ps=MAX NOfullstimer NOstimer msglevel=N NOmautocomploc;
%local _PackageFileref_; %local _PackageFileref_;
data _null_; data _null_;
@@ -249,7 +313,7 @@ minoperator
%if %superq(rVsign)= %then %let rVsign=<=; %if %superq(rVsign)= %then %let rVsign=<=;
%else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then
%do; %do;
%put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; %put WARNING: Illegal operator "%superq(rVsign)"! Default(<=) will be used.;
%put WARNING- Supported operators are: %str(= <= =< => >= < >); %put WARNING- Supported operators are: %str(= <= =< => >= < >);
%let rVsign=<=; %let rVsign=<=;
%end; %end;
@@ -260,8 +324,8 @@ minoperator
/* check if the package is already loaded */ /* check if the package is already loaded */
/* conditions 1) cherrypick=* 2) sysloadedpackages exists and is global, */ /* conditions 1) cherrypick=* 2) sysloadedpackages exists and is global, */
%local aleradyLoaded pLV pLV0; /* flag for already laded package check */ %local alreadyLoaded pLV pLV0; /* flag for already laded package check */
%let aleradyLoaded = 0; %let alreadyLoaded = 0;
%if 0=&force. AND %SYMEXIST(sysloadedpackages) AND (%superq(cherrypick)=%str(*)) %then %if 0=&force. AND %SYMEXIST(sysloadedpackages) AND (%superq(cherrypick)=%str(*)) %then
%do; %do;
%if %SYMGLOBL(sysloadedpackages) %then %if %SYMGLOBL(sysloadedpackages) %then
@@ -277,12 +341,12 @@ minoperator
+ (%scan(&pLV0.,2,.,M)+0)*1e4 + (%scan(&pLV0.,2,.,M)+0)*1e4
+ (%scan(&pLV0.,3,.,M)+0)*1e0); + (%scan(&pLV0.,3,.,M)+0)*1e0);
/* if package name was found and version is ok set aleradyLoaded flag to 1 */ /* if package name was found and version is ok set alreadyLoaded flag to 1 */
%let aleradyLoaded=%sysevalf(&findInLoaded. AND (&rV. &rVsign. &pLV.),boolean); %let alreadyLoaded=%sysevalf(&findInLoaded. AND (&rV. &rVsign. &pLV.),boolean);
%end; %end;
%end; %end;
%if (NOT &aleradyLoaded.) AND (NOT %sysevalf(&rV. &rVsign. &pV.)) %then %if (NOT &alreadyLoaded.) AND (NOT %sysevalf(&rV. &rVsign. &pV.)) %then
%do; %do;
%put ERROR: Package &packageName. will not be loaded!; %put ERROR: Package &packageName. will not be loaded!;
%put ERROR- Required version is &rV0.; %put ERROR- Required version is &rV0.;
@@ -302,7 +366,7 @@ minoperator
; ;
%if %sysevalf(%superq(lazyData)=,boolean) %then %if %sysevalf(%superq(lazyData)=,boolean) %then
%do; %do;
%if NOT &aleradyLoaded. %then %if NOT &alreadyLoaded. %then
%do; %do;
%local tempLoad_minoperator temp_noNotes_etc /* for hiding notes */ ; %local tempLoad_minoperator temp_noNotes_etc /* for hiding notes */ ;
%let tempLoad_minoperator = %sysfunc(getoption(minoperator)); %let tempLoad_minoperator = %sysfunc(getoption(minoperator));
@@ -320,7 +384,7 @@ minoperator
%else %else
%do; %do;
%put NOTE- %str( ); %put NOTE- %str( );
%put NOTE: It looks like the &packageName.(&pLV0.) package already loaded! Nothing to do.; %put NOTE: It looks like the &packageName.(&pLV0.) package is already loaded! Nothing to do.;
%put NOTE- To force reloading use the force=1; %put NOTE- To force reloading use the force=1;
/* if package is already loaded with req version. */ /* if package is already loaded with req version. */
%put NOTE- %str( ); %put NOTE- %str( );
+68 -4
View File
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+loadPackageAddCnt+*/ /*+loadPackageAddCnt+*/
/*** HELP START ***/ /*** HELP START ***/
@@ -19,7 +83,7 @@
is provided in required version */ is provided in required version */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load additional content for a SAS package, version 20260602. Run %loadPackageAddCnt(HELP) for help info.' des = 'Macro to load additional content for a SAS package, version 20260721. Run %loadPackageAddCnt(HELP) for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -35,7 +99,7 @@ minoperator
%put ### This is short help information for the `loadPackageAddCnt` macro #; %put ### This is short help information for the `loadPackageAddCnt` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *load* additional content for a SAS package, version `20260602` #; %put # Macro to *load* additional content for a SAS package, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -172,7 +236,7 @@ minoperator
%if %superq(rVsign)= %then %let rVsign=<=; %if %superq(rVsign)= %then %let rVsign=<=;
%else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then
%do; %do;
%put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; %put WARNING: Illegal operator "%superq(rVsign)"! Default(<=) will be used.;
%put WARNING- Supported operators are: %str(= <= =< => >= < >); %put WARNING- Supported operators are: %str(= <= =< => >= < >);
%let rVsign=<=; %let rVsign=<=;
%end; %end;
@@ -385,7 +449,7 @@ minoperator
%WrongVersionOFPackageAddCnt: %WrongVersionOFPackageAddCnt:
/* restore optionos */ /* restore options */
options ls = &ls_tmp. ps = &ps_tmp. options ls = &ls_tmp. ps = &ps_tmp.
&notes_tmp. &source_tmp. &notes_tmp. &source_tmp.
&stimer_tmp. &fullstimer_tmp. &stimer_tmp. &fullstimer_tmp.
+66 -2
View File
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+loadPackageS+*/ /*+loadPackageS+*/
/*** HELP START ***/ /*** HELP START ***/
@@ -11,7 +75,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load multiple SAS packages at one run, version 20260602. Run %loadPackages(HELP) for help info.' des = 'Macro to load multiple SAS packages at one run, version 20260721. Run %loadPackages(HELP) for help info.'
parmbuff parmbuff
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -27,7 +91,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #; %put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro wrapper for the loadPackage macro, version `20260602` #; %put # Macro wrapper for the loadPackage macro, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
+66 -2
View File
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+previewPackage+*/ /*+previewPackage+*/
/*** HELP START ***/ /*** HELP START ***/
@@ -23,7 +87,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to preview content of a SAS package, version 20260602. Run %previewPackage(HELP) for help info.' des = 'Macro to preview content of a SAS package, version 20260721. Run %previewPackage(HELP) for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -38,7 +102,7 @@ des = 'Macro to preview content of a SAS package, version 20260602. Run %preview
%put ### This is short help information for the `previewPackage` macro #; %put ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get preview of a SAS packages, version `20260602` #; %put # Macro to get preview of a SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
+68 -4
View File
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+relocatePackage+*/ /*+relocatePackage+*/
/*** HELP START ***/ /*** HELP START ***/
@@ -15,7 +79,7 @@
,psMAX=MAX /* pageSise in case executed inside DoSubL() */ ,psMAX=MAX /* pageSise in case executed inside DoSubL() */
,ods= /* a data set for results, e.g., work.relocatePackageReport */ ,ods= /* a data set for results, e.g., work.relocatePackageReport */
) )
/ des = 'Utility macro that locally Copies or Moves Packages, version 20260602. Run %relocatePackage(HELP) for help info.' / des = 'Utility macro that locally Copies or Moves Packages, version 20260721. Run %relocatePackage(HELP) for help info.'
secure secure
minoperator minoperator
; ;
@@ -33,7 +97,7 @@
%put ### This is short help information for the `relocatePackage` macro #; %put ### This is short help information for the `relocatePackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *locally copy or move* (relocate) SAS packages, version `20260602` #; %put # Macro to *locally copy or move* (relocate) SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -231,7 +295,7 @@
%do; %do;
if NOT (input(resolve('%isPackagesFilerefOK(&debug.)'), best.)=1) then /* if debug=1 the isPackagesFilerefOK in verbose mode */ if NOT (input(resolve('%isPackagesFilerefOK(&debug.)'), best.)=1) then /* if debug=1 the isPackagesFilerefOK in verbose mode */
do; do;
putlog "WARNING: The PACKAGES fileres is not OK! Exiting!"; putlog "WARNING: The PACKAGES fileref is not OK! Exiting!";
LINK stopProcessing; LINK stopProcessing;
end; end;
%end; %end;
@@ -617,7 +681,7 @@
run; run;
/* restore optionos */ /* restore options */
options ls = &ls_tmp. ps = &ps_tmp. options ls = &ls_tmp. ps = &ps_tmp.
&notes_tmp. &source_tmp. &notes_tmp. &source_tmp.
&stimer_tmp. &fullstimer_tmp. &stimer_tmp. &fullstimer_tmp.
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+requestPackage+*/ /*+requestPackage+*/
%macro requestPackage( %macro requestPackage(
packageName packageName
@@ -17,31 +81,32 @@
, github = /* name of a user or an organization in GitHub, all characters except [A-z0-9_.-] are compressed */ , github = /* name of a user or an organization in GitHub, all characters except [A-z0-9_.-] are compressed */
, githubRepo = /* repo name to be used, by default it is the package name, but can be altered */ , githubRepo = /* repo name to be used, by default it is the package name, but can be altered */
, githubToken = /* user's github fine-grained personal access token */ , githubToken = /* user github fine-grained personal access token */
, githubTokenDebug = 0 /* debug values: 0,1,2,3 */ , githubTokenDebug = 0 /* debug values: 0,1,2,3 */
, loadPackage=1 /* should the packages be installed after installing */ , loadPackage=1 /* should the packages be loaded after installing */
, force=0 /* force reloading even if already loaded */ , force=0 /* force reloading even if already loaded */
, ignoreDepVer=0 /* should dependencies version be ignore so that only the latest could be installed */ , ignoreDepVer=0 /* should dependencies version be ignore so that only the latest could be installed */
, successDS= /* technical */ , successDS= /* technical */
) )
/secure /secure
des = 'Macro to request SAS package installation and loading, version 20260602. Run %requestPackage(HELP) for help info.'; des = 'Macro to request SAS package installation and loading, version 20260721. Run %requestPackage(HELP) for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
%local options_tmp ; %local options_tmp ;
%let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps)) %let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps))
%sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(source2))
msglevel=%sysfunc(getoption(msglevel)) msglevel=%sysfunc(getoption(msglevel))
; ;
options NOnotes NOsource ls=MAX ps=MAX msglevel=N; options NOnotes NOsource NOsource2 ls=MAX ps=MAX msglevel=N;
%put ; %put ;
%put ##############################################################################################; %put ##############################################################################################;
%put ### This is short help information for the `requestPackage` macro #; %put ### This is short help information for the `requestPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;; %put #--------------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to request (install and load) SAS packages, version `20260602` #; %put # Macro to request (install and load) SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -65,8 +130,11 @@ des = 'Macro to request SAS package installation and loading, version 20260602.
%put # #; %put # #;
%put # **Installation options:** #; %put # **Installation options:** #;
%put # #; %put # #;
%put # - `requiredVersion=` *Optional.* Indicates which package version we want #; %put # - `requiredVersion=` *Optional.* Indicates which (at least) package version we want #;
%put # to be requested, default value: `.` means "the latest". #; %put # to be requested. Empty value by default means: %str(%")load currently #;
%put # installed version or install and load the latest available one.%str(%") #;
%put # When loaded (installed) package version is greater or equal #;
%put # than requested, lower requested version is not loaded (installed). #;
%put # #; %put # #;
%put # - `sourcePath=` Location of the package, e.g. "www.some.web.page/" #; %put # - `sourcePath=` Location of the package, e.g. "www.some.web.page/" #;
%put # Mind the "/" at the end of the path! #; %put # Mind the "/" at the end of the path! #;
@@ -86,12 +154,6 @@ des = 'Macro to request SAS package installation and loading, version 20260602.
%put # `https://github.com/PharmaForest/` #; %put # `https://github.com/PharmaForest/` #;
%put # Default value is `0`. #; %put # Default value is `0`. #;
%put # #; %put # #;
%put # - `version=` Indicates which historical version of a package to install. #;
%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 the `version` variable #;
%put # is scan sequentially. #;
%put # #;
%put # - `replace=` When set to `1` and a package file exists, it forces the package #; %put # - `replace=` When set to `1` and a package file exists, it forces the package #;
%put # file replacement by the new downloaded file. #; %put # file replacement by the new downloaded file. #;
%put # It is a binary indicator ('0' or '1'). Default value is `1`. #; %put # It is a binary indicator ('0' or '1'). Default value is `1`. #;
@@ -141,7 +203,7 @@ des = 'Macro to request SAS package installation and loading, version 20260602.
%put # managing-your-personal-access-tokens #; %put # managing-your-personal-access-tokens #;
%put # #creating-a-fine-grained-personal-access-token` #; %put # #creating-a-fine-grained-personal-access-token` #;
%put # (lines break added for easier reading) #; %put # (lines break added for easier reading) #;
%put # Public repos do not need authentication. #; %put # Public repositories do not need authentication. #;
%put # [NOTE!] This feature is experimental in this release. #; %put # [NOTE!] This feature is experimental in this release. #;
%put # #; %put # #;
%put # **Loading options:** #; %put # **Loading options:** #;
@@ -206,11 +268,11 @@ des = 'Macro to request SAS package installation and loading, version 20260602.
%let _rname_ = _requestPckg_%sysfunc(sleep(1,0.042),best1.)%sysfunc(datetime(),hex16.)_; %let _rname_ = _requestPckg_%sysfunc(sleep(1,0.042),best1.)%sysfunc(datetime(),hex16.)_;
%let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps)) %let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps))
%sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(source2))
msglevel=%sysfunc(getoption(msglevel)) msglevel=%sysfunc(getoption(msglevel))
; ;
options NOnotes NOsource ls=MAX ps=MAX msglevel=N; options NOnotes NOsource NOsource2 ls=MAX ps=MAX msglevel=N;
options source source2; /*options source source2;*/
%let loadPackage = %sysevalf((1=%superq(loadPackage)),boolean); %let loadPackage = %sysevalf((1=%superq(loadPackage)),boolean);
%let replace = %sysevalf(1=%superq(replace),boolean); %let replace = %sysevalf(1=%superq(replace),boolean);
@@ -250,7 +312,8 @@ data _null_;
/*put (_ALL_) (=/);*/ /*put (_ALL_) (=/);*/
if (. <= verRN <= versN) then if (. <= verRN <= versN) then
do; do;
put / "INFO: It looks like the " packageName "package is already loaded. Enjoy!"; put / "INFO: It looks like the " packageName "package is already loaded. Enjoy!"
/ @7 "The loaded version is: " vers;
call symputX('_alreadyLoaded_', 1, "L"); call symputX('_alreadyLoaded_', 1, "L");
end; end;
else else
+67 -2
View File
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+SasPackagesFrameworkNotes+*/ /*+SasPackagesFrameworkNotes+*/
%macro SasPackagesFrameworkNotes( %macro SasPackagesFrameworkNotes(
SPFmacroName /* space separated list of names */ SPFmacroName /* space separated list of names */
@@ -5,7 +69,7 @@ SPFmacroName /* space separated list of names */
/ /
minoperator minoperator
secure secure
des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260602. Run %SasPackagesFrameworkNotes(HELP) for help info.' des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260721. Run %SasPackagesFrameworkNotes(HELP) for help info.'
; ;
%local list N i element; %local list N i element;
%let list= %let list=
@@ -30,6 +94,7 @@ relocatePackage
isPackagesFilerefOK isPackagesFilerefOK
bundlePackages bundlePackages
unbundlePackages unbundlePackages
requestPackage
/**/ /**/
SasPackagesFrameworkNotes SasPackagesFrameworkNotes
; ;
@@ -51,7 +116,7 @@ SasPackagesFrameworkNotes
%put ### This is short help information for the `SasPackagesFrameworkNotes` macro #; %put ### This is short help information for the `SasPackagesFrameworkNotes` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro prints help notes for SAS Packages Framework macros, version `20260602` #; %put # Macro prints help notes for SAS Packages Framework macros, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
+66 -2
View File
@@ -1,8 +1,72 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+SPFinit_intrnl_forceV7DSname+*/ /*+SPFinit_intrnl_forceV7DSname+*/
%macro SPFinit_intrnl_forceV7DSname( %macro SPFinit_intrnl_forceV7DSname(
mcParam /* name of a macro parameter holding user provided data set name */ mcParam /* name of a macro parameter holding user provided data set name */
)/secure minoperator )/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside selected SPF macros. Macro generates 4GL code that forces V7 compatybility for user provided data set names. Version 20260602.'; des='SAS Packages Framework internal macro. Executable only inside selected SPF macros. Macro generates 4GL code that forces V7 compatibility for user provided data set names. Version 20260721.';
/* The macro can be called only inside a data step. */ /* The macro can be called only inside a data step. */
/**************************************************************************** /****************************************************************************
### Parameters: ### Parameters:
@@ -39,7 +103,7 @@ des='SAS Packages Framework internal macro. Executable only inside selected SPF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%macro A(ods); %macro A(ods);
data _null_; data _null_;
%SPDinit_intrnl_forceV7DSname(ods); %SPFinit_intrnl_forceV7DSname(ods);
call symputX("ods",ods,"L"); call symputX("ods",ods,"L");
run; run;
+65 -1
View File
@@ -1,6 +1,70 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+SPFint_gnPckg_arch+*/ /*+SPFint_gnPckg_arch+*/
%macro SPFint_gnPckg_arch()/secure minoperator %macro SPFint_gnPckg_arch()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the archive version generation part of the process. Version 20260602.'; des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the archive version generation part of the process. Version 20260721.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */ /* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then %if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do; %do;
+66 -2
View File
@@ -1,6 +1,70 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+SPFint_gnPckg_markdown+*/ /*+SPFint_gnPckg_markdown+*/
%macro SPFint_gnPckg_markdown()/secure minoperator %macro SPFint_gnPckg_markdown()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the markdown documentation part of the process. Version 20260602.'; des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the markdown documentation part of the process. Version 20260721.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */ /* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then %if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do; %do;
@@ -112,7 +176,7 @@ data &filesWithCodes.markdown;
%end; %end;
put " " / "---------------------------------------------------------------------" / " " put " " / "---------------------------------------------------------------------" / " "
/ "*SAS package generated by SAS Package Framework, version `20260602`,*" / "*SAS package generated by SAS Package Framework, version `20260721`,*"
/ "*under `&sysscp.`(`&sysscpl.`) operating system,*" / "*under `&sysscp.`(`&sysscpl.`) operating system,*"
/ "*using SAS release: `&sysvlong4.`.*" / "*using SAS release: `&sysvlong4.`.*"
/ " " / "---------------------------------------------------------------------" / " "; / " " / "---------------------------------------------------------------------" / " ";
+65 -1
View File
@@ -1,6 +1,70 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+SPFint_gnPckg_tests+*/ /*+SPFint_gnPckg_tests+*/
%macro SPFint_gnPckg_tests()/secure minoperator %macro SPFint_gnPckg_tests()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the test part of the process. Version 20260602.'; des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the test part of the process. Version 20260721.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */ /* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then %if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do; %do;
+67 -3
View File
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+splitCodeForPackage+*/ /*+splitCodeForPackage+*/
/*** HELP START ***/ /*** HELP START ***/
@@ -8,7 +72,7 @@
,nobs=0 /* technical parameter */ ,nobs=0 /* technical parameter */
) )
/*** HELP END ***/ /*** HELP END ***/
/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260602. Run %splitCodeForPackage(HELP) for help info.' / des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260721. Run %splitCodeForPackage(HELP) for help info.'
; ;
%if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then %if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then
%do; %do;
@@ -24,7 +88,7 @@
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Utility macro to *split* single file with SAS package code into multiple #; %put # Utility macro to *split* single file with SAS package code into multiple #;
%put # files with separate snippets, version `20260602` #; %put # files with separate snippets, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -400,7 +464,7 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ;
*/ */
if firstLine[j] then if firstLine[j] then
do; do;
put '/* File generated with help of SAS Packages Framework, version 20260602. */'; put '/* File generated with help of SAS Packages Framework, version 20260721. */';
firstLine[j]=0; firstLine[j]=0;
end; end;
put _infile_; put _infile_;
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+unbundlePackages+*/ /*+unbundlePackages+*/
%macro unbundlePackages( %macro unbundlePackages(
bundleName bundleName
@@ -10,7 +74,7 @@
,verify=0 ,verify=0
,quiet=0 ,quiet=0
)/ )/
des='Macro to extract a bundle of SAS packages, version 20260602. Run %unbundlePackages(HELP) for help info.' des='Macro to extract a bundle of SAS packages, version 20260721. Run %unbundlePackages(HELP) for help info.'
secure secure
minoperator minoperator
; ;
@@ -28,7 +92,7 @@ minoperator
%put ### This is short help information for the `unbundlePackages` macro #; %put ### This is short help information for the `unbundlePackages` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *extract* SAS packages from a bundle, version `20260602` #; %put # Macro to *extract* SAS packages from a bundle, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -318,7 +382,7 @@ else
end; end;
rc = Q.output(dataset: /* create propper tag */ rc = Q.output(dataset: /* create proper tag */
%if %superq(ods) NE %then %do; "&ods.(label='Bundle: " !! strip(bundleName) !! "')" %end; %if %superq(ods) NE %then %do; "&ods.(label='Bundle: " !! strip(bundleName) !! "')" %end;
%else %do; "&reportFile.1" %end; %else %do; "&reportFile.1" %end;
); );
@@ -375,7 +439,7 @@ rc = doSubL(
stop; stop;
run; run;
/*===================================================================================================*/ /*===================================================================================================*/
/* restore optionos */ /* restore options */
options ls = &ls_tmp. ps = &ps_tmp. options ls = &ls_tmp. ps = &ps_tmp.
&notes_tmp. &source_tmp. &notes_tmp. &source_tmp.
&stimer_tmp. &fullstimer_tmp. &stimer_tmp. &fullstimer_tmp.
+66 -2
View File
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+unloadPackage+*/ /*+unloadPackage+*/
/*** HELP START ***/ /*** HELP START ***/
@@ -20,7 +84,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to unload SAS package, version 20260602. Run %unloadPackage(HELP) for help info.' des = 'Macro to unload SAS package, version 20260721. Run %unloadPackage(HELP) for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -35,7 +99,7 @@ des = 'Macro to unload SAS package, version 20260602. Run %unloadPackage(HELP) f
%put ### This is short help information for the `unloadPackage` macro #; %put ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to unload SAS packages, version `20260602` #; %put # Macro to unload SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
+71 -7
View File
@@ -1,3 +1,67 @@
/*+headerPackage+*/
/**############################################################################**/
/* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */
/* */
/* Code is free and open source. If you want - you can use it. */
/* I tested it the best I could */
/* but it comes with absolutely no warranty whatsoever. */
/* If you cause any damage or something - it will be your own fault. */
/* You have been warned! You are using it on your own risk. */
/* However, if you decide to use it do not forget to mention author: */
/* Bartosz Jablonski (yabwon@gmail.com) */
/* */
/* Here is the official version: */
/*
Copyright (c) 2019 - 2026 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**############################################################################**/
/*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros:
- to install,
- to load,
- to get help,
- to unload, or
- to generate SAS packages.
SAS Packages Framework, version 20260721.
See examples below.
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
a single load.sas file (also embedded inside the zip).
Contributors:
- Stu Sztukowski
LinkedIn: https://www.linkedin.com/in/statsguy/
GitHub: https://github.com/stu-code
- Ken Nakamatsu
LinkedIn: https://www.linkedin.com/in/k-nkmt
GitHub: https://github.com/k-nkmt
*/
/*** HELP END ***/
/*+verifyPackage+*/ /*+verifyPackage+*/
/*** HELP START ***/ /*** HELP START ***/
@@ -13,7 +77,7 @@
hashing_file() function, SAS 9.4M6 */ hashing_file() function, SAS 9.4M6 */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to verify SAS package with the hash digest, version 20260602. Run %verifyPackage(HELP) for help info.' des = 'Macro to verify SAS package with the hash digest, version 20260721. Run %verifyPackage(HELP) for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -28,7 +92,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20260602. Run %
%put ### This is short help information for the `verifyPackage` macro #; %put ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to verify SAS package with it hash digest, version `20260602` #; %put # Macro to verify SAS package with it hash digest, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -159,10 +223,10 @@ des = 'Macro to verify SAS package with the hash digest, version 20260602. Run %
length method $ 8 digest $ 128; length method $ 8 digest $ 128;
/* calculate SHA256 */ /* calculate SHA256 */
method="SHA256"; method="SHA256";
LINK CalcualteHashDigest; /* go to Link 1 */ LINK CalculateHashDigest; /* go to Link 1 */
if NOT emptyHash then if NOT emptyHash then
do; /* step for veryfication */ do; /* step for verification */
if upcase(digest) = upcase(providedHash) then if upcase(digest) = upcase(providedHash) then
do; do;
put "NOTE: Verification SUCCESSFUL." put "NOTE: Verification SUCCESSFUL."
@@ -181,13 +245,13 @@ des = 'Macro to verify SAS package with the hash digest, version 20260602. Run %
end; end;
end; end;
else else
do method = "SHA1", "MD5"; /* step for digest display, calcualte also SHA1 and MD5 */ do method = "SHA1", "MD5"; /* step for digest display, calculate also SHA1 and MD5 */
LINK CalcualteHashDigest; /* go to Link 1 */ LINK CalculateHashDigest; /* go to Link 1 */
end; end;
put 82*"-" /; put 82*"-" /;
stop; stop;
return; return;
CalcualteHashDigest: /* Link 1 */ CalculateHashDigest: /* Link 1 */
select; select;
when ( 'F*' = upcase(substr(providedHash,1,2)) ) /* F = file digest */ when ( 'F*' = upcase(substr(providedHash,1,2)) ) /* F = file digest */
+29 -32
View File
@@ -1,7 +1,7 @@
--- ---
# SAS Packages Framework, version `20260602` # SAS Packages Framework, version `20260721`
--- ---
@@ -35,7 +35,7 @@ A **SAS package** is an automatically generated, single, stand alone *zip* file
The *purpose of a package* is to be a simple, and easy to access, code sharing medium, which will allow: on the one hand, to separate the code complex dependencies created by the developer from the user experience with the final product and, on the other hand, reduce developer's and user's unnecessary frustration related to a remote deployment process. The *purpose of a package* is to be a simple, and easy to access, code sharing medium, which will allow: on the one hand, to separate the code complex dependencies created by the developer from the user experience with the final product and, on the other hand, reduce developer's and user's unnecessary frustration related to a remote deployment process.
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20260602`**. In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20260721`**.
**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). **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).
@@ -58,7 +58,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> ## This is short help information for the `installPackage` macro <a name="installpackage"></a>
-------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------
Macro to install SAS packages, version `20260602` Macro to install SAS packages, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -160,7 +160,7 @@ them using the SPF can be found [**HERE**](https://github.com/yabwon/HoW-SASPack
`managing-your-personal-access-tokens` `managing-your-personal-access-tokens`
`#creating-a-fine-grained-personal-access-token` `#creating-a-fine-grained-personal-access-token`
(lines break added for easier reading) (lines break added for easier reading)
Public repos do not need authentication. Public repositories do not need authentication.
[NOTE!] This feature is experimental in this release. [NOTE!] This feature is experimental in this release.
-------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------
@@ -211,7 +211,7 @@ filename packages "C:/SAS_PACKAGES";
## This is short help information for the `helpPackage` macro <a name="helppackage"></a> ## This is short help information for the `helpPackage` macro <a name="helppackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to get help about SAS packages, version `20260602` Macro to get help about SAS packages, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -289,7 +289,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `loadPackage` macro <a name="loadpackage"></a> ## This is short help information for the `loadPackage` macro <a name="loadpackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to *load* SAS packages, version `20260602` Macro to *load* SAS packages, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -447,7 +447,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> ## This is short help information for the `loadPackageS` macro <a name="loadpackages"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro wrapper for the loadPackage macro, version `20260602` Macro wrapper for the loadPackage macro, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -499,7 +499,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `unloadPackage` macro <a name="unloadpackage"></a> ## This is short help information for the `unloadPackage` macro <a name="unloadpackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to unload SAS packages, version `20260602` Macro to unload SAS packages, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -566,7 +566,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `listPackages` macro <a name="listpackages"></a> ## This is short help information for the `listPackages` macro <a name="listpackages"></a>
----------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------
Macro to list available SAS packages, version `20260602` Macro to list available SAS packages, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -615,7 +615,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `verifyPackage` macro <a name="verifypackage"></a> ## This is short help information for the `verifyPackage` macro <a name="verifypackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to verify SAS package with it hash digest, version `20260602` Macro to verify SAS package with it hash digest, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -671,7 +671,7 @@ filename packages "C:/SAS_PACKAGES"; %* set-up a directory for packages;
## This is short help information for the `previewPackage` macro <a name="previewpackage"></a> ## This is short help information for the `previewPackage` macro <a name="previewpackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to get preview of a SAS packages, version `20260602` Macro to get preview of a SAS packages, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -740,7 +740,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `generatePackage` macro <a name="generatepackage"></a> ## This is short help information for the `generatePackage` macro <a name="generatepackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to generate SAS packages, version `20260602` Macro to generate SAS packages, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -796,8 +796,8 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
if null (the default) then the `!SASROOT` is used. if null (the default) then the `!SASROOT` is used.
- `sascfgFile=` Location of a FILE with testing session configuration - `sascfgFile=` Location of a FILE with testing session configuration
parameters, if null (the default) then no config file parameters, if null (the default) then no configuration
is pointed during the SAS invocation, file is pointed during the SAS invocation,
if set to `DEF` then the `!SASROOT/sasv9.cfg` is used. if set to `DEF` then the `!SASROOT/sasv9.cfg` is used.
- `delTestWork=` Indicates if `WORK` directories generated by user tests - `delTestWork=` Indicates if `WORK` directories generated by user tests
@@ -973,7 +973,7 @@ All files have to have `.sas` extension. Other files are ignored.
## This is short help information for the `extendPackagesFileref` macro <a name="extendpackagesfileref"></a> ## This is short help information for the `extendPackagesFileref` macro <a name="extendpackagesfileref"></a>
----------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------
Macro to list directories pointed by 'packages' fileref, version `20260602` Macro to list directories pointed by 'packages' fileref, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1015,7 +1015,7 @@ filename packages ("D:/NEW_DIR" %extendPackagesFileref()); %* add new directory;
## This is short help information for the `loadPackageAddCnt` macro <a name="loadpackageaddcnt"></a> ## This is short help information for the `loadPackageAddCnt` macro <a name="loadpackageaddcnt"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to load *additional content* for a SAS package, version `20260602` Macro to load *additional content* for a SAS package, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1111,7 +1111,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
-------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------
Macro to request (install and load) SAS packages, version `20260602` Macro to request (install and load) SAS packages, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1135,8 +1135,11 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
**Installation options:** **Installation options:**
- `requiredVersion=` *Optional.* Indicates which package version we want - `requiredVersion=` *Optional.* Indicates which (at least) package version we want
to be requested, default value: `.` means "the latest". to be requested. Empty value by default means: "load currently
installed version or install and load the latest available one."
When loaded (installed) package version is greater or equal
than requested, lower requested version is not loaded (installed).
- `sourcePath=` Location of the package, e.g. "www.some.web.page/" - `sourcePath=` Location of the package, e.g. "www.some.web.page/"
Mind the "/" at the end of the path! Mind the "/" at the end of the path!
@@ -1156,12 +1159,6 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
`https://github.com/PharmaForest/` `https://github.com/PharmaForest/`
Default value is `0`. Default value is `0`.
- `version=` Indicates which historical version of a package to install.
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 the `version` variable
is scan sequentially.
- `replace=` When set to `1` and a package file exists, it forces the package - `replace=` When set to `1` and a package file exists, it forces the package
file replacement by the new downloaded file. file replacement by the new downloaded file.
It is a binary indicator ('0' or '1'). Default value is `1`. It is a binary indicator ('0' or '1'). Default value is `1`.
@@ -1211,7 +1208,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
managing-your-personal-access-tokens managing-your-personal-access-tokens
#creating-a-fine-grained-personal-access-token` #creating-a-fine-grained-personal-access-token`
(lines break added for easier reading) (lines break added for easier reading)
Public repos do not need authentication. Public repositories do not need authentication.
[NOTE!] This feature is experimental in this release. [NOTE!] This feature is experimental in this release.
**Loading options:** **Loading options:**
@@ -1274,7 +1271,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Utility macro to *split* single file with SAS package code into multiple Utility macro to *split* single file with SAS package code into multiple
files with separate snippets, version `20260602` files with separate snippets, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1355,7 +1352,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `relocatePackage` macro <a name="relocatepackage"></a> ## This is short help information for the `relocatePackage` macro <a name="relocatepackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to *locally copy or move* (relocate) SAS packages, version `20260602` Macro to *locally copy or move* (relocate) SAS packages, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1467,7 +1464,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `isPackagesFilerefOK` macro <a name="ispackagesfilerefok"></a> ## This is short help information for the `isPackagesFilerefOK` macro <a name="ispackagesfilerefok"></a>
----------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------
Macro to check if the `packages` fileref is "correct", version `20260602` Macro to check if the `packages` fileref is "correct", version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1518,7 +1515,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `SasPackagesFrameworkNotes` macro <a name="saspackagesframeworknotes"></a> ## This is short help information for the `SasPackagesFrameworkNotes` macro <a name="saspackagesframeworknotes"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro prints help notes for SAS Packages Framework macros, version `20260602` Macro prints help notes for SAS Packages Framework macros, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1568,7 +1565,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `bundlePackages` macro <a name="bundlepackages"></a> ## This is short help information for the `bundlePackages` macro <a name="bundlepackages"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to *create bundles* of SAS packages, version `20260602` Macro to *create bundles* of SAS packages, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1637,7 +1634,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `unbundlePackages` macro <a name="unbundlepackages"></a> ## This is short help information for the `unbundlePackages` macro <a name="unbundlepackages"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to *extract* SAS packages from a bundle, version `20260602` Macro to *extract* SAS packages from a bundle, version `20260721`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
+172 -172
View File
@@ -1,4 +1,4 @@
/*+headerPackage+*/
/**############################################################################**/ /**############################################################################**/
/* */ /* */
/* Copyright Bartosz Jablonski, since July 2019 onward. */ /* Copyright Bartosz Jablonski, since July 2019 onward. */
@@ -32,8 +32,8 @@
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
/**#############################################################################**/ /**############################################################################**/
/*** HELP START ***/ /*** HELP START ***/
/* SPF (SAS Packages Framework) is a set of macros: /* SPF (SAS Packages Framework) is a set of macros:
@@ -43,7 +43,7 @@
- to unload, or - to unload, or
- to generate SAS packages. - to generate SAS packages.
SAS Packages Framework, version 20260602. SAS Packages Framework, version 20260721.
See examples below. See examples below.
A SAS package is a zip file containing a group of files A SAS package is a zip file containing a group of files
@@ -60,7 +60,6 @@ Contributors:
GitHub: https://github.com/k-nkmt GitHub: https://github.com/k-nkmt
*/ */
/*** HELP END ***/ /*** HELP END ***/
/*+loadPackage+*/ /*+loadPackage+*/
@@ -102,23 +101,23 @@ Contributors:
, force=0 /* force loading even if given version is already loaded */ , force=0 /* force loading even if given version is already loaded */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load SAS package, version 20260602. Run %loadPackage(HELP) for help info.' des = 'Macro to load SAS package, version 20260721. Run %loadPackage(HELP) for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
%local options_tmp ; %local options_tmp ;
%let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps)) %let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps))
%sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(source2))
msglevel=%sysfunc(getoption(msglevel)) msglevel=%sysfunc(getoption(msglevel))
; ;
options NOnotes NOsource ls=MAX ps=MAX msglevel=N; options NOnotes NOsource NOsource2 ls=MAX ps=MAX msglevel=N;
%put ; %put ;
%put #################################################################################; %put #################################################################################;
%put ### This is short help information for the `loadPackage` macro #; %put ### This is short help information for the `loadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *load* SAS packages, version `20260602` #; %put # Macro to *load* SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -240,13 +239,13 @@ minoperator
%let ls_tmp = %sysfunc(getoption(ls)); %let ls_tmp = %sysfunc(getoption(ls));
%let ps_tmp = %sysfunc(getoption(ps)); %let ps_tmp = %sysfunc(getoption(ps));
%let notes_tmp = %sysfunc(getoption(notes)); %let notes_tmp = %sysfunc(getoption(notes));
%let source_tmp = %sysfunc(getoption(source)); %let source_tmp = %sysfunc(getoption(source)) %sysfunc(getoption(source2));
%let stimer_tmp = %sysfunc(getoption(stimer)); %let stimer_tmp = %sysfunc(getoption(stimer));
%let fullstimer_tmp = %sysfunc(getoption(fullstimer)); %let fullstimer_tmp = %sysfunc(getoption(fullstimer));
%let msglevel_tmp = %sysfunc(getoption(msglevel)); %let msglevel_tmp = %sysfunc(getoption(msglevel));
%let mautocomploc_tmp = %sysfunc(getoption(mautocomploc)); %let mautocomploc_tmp = %sysfunc(getoption(mautocomploc));
options NOnotes NOsource ls=MAX ps=MAX NOfullstimer NOstimer msglevel=N NOmautocomploc; options NOnotes NOsource NOsource2 ls=MAX ps=MAX NOfullstimer NOstimer msglevel=N NOmautocomploc;
%local _PackageFileref_; %local _PackageFileref_;
data _null_; data _null_;
@@ -314,7 +313,7 @@ minoperator
%if %superq(rVsign)= %then %let rVsign=<=; %if %superq(rVsign)= %then %let rVsign=<=;
%else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then
%do; %do;
%put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; %put WARNING: Illegal operator "%superq(rVsign)"! Default(<=) will be used.;
%put WARNING- Supported operators are: %str(= <= =< => >= < >); %put WARNING- Supported operators are: %str(= <= =< => >= < >);
%let rVsign=<=; %let rVsign=<=;
%end; %end;
@@ -325,8 +324,8 @@ minoperator
/* check if the package is already loaded */ /* check if the package is already loaded */
/* conditions 1) cherrypick=* 2) sysloadedpackages exists and is global, */ /* conditions 1) cherrypick=* 2) sysloadedpackages exists and is global, */
%local aleradyLoaded pLV pLV0; /* flag for already laded package check */ %local alreadyLoaded pLV pLV0; /* flag for already laded package check */
%let aleradyLoaded = 0; %let alreadyLoaded = 0;
%if 0=&force. AND %SYMEXIST(sysloadedpackages) AND (%superq(cherrypick)=%str(*)) %then %if 0=&force. AND %SYMEXIST(sysloadedpackages) AND (%superq(cherrypick)=%str(*)) %then
%do; %do;
%if %SYMGLOBL(sysloadedpackages) %then %if %SYMGLOBL(sysloadedpackages) %then
@@ -342,12 +341,12 @@ minoperator
+ (%scan(&pLV0.,2,.,M)+0)*1e4 + (%scan(&pLV0.,2,.,M)+0)*1e4
+ (%scan(&pLV0.,3,.,M)+0)*1e0); + (%scan(&pLV0.,3,.,M)+0)*1e0);
/* if package name was found and version is ok set aleradyLoaded flag to 1 */ /* if package name was found and version is ok set alreadyLoaded flag to 1 */
%let aleradyLoaded=%sysevalf(&findInLoaded. AND (&rV. &rVsign. &pLV.),boolean); %let alreadyLoaded=%sysevalf(&findInLoaded. AND (&rV. &rVsign. &pLV.),boolean);
%end; %end;
%end; %end;
%if (NOT &aleradyLoaded.) AND (NOT %sysevalf(&rV. &rVsign. &pV.)) %then %if (NOT &alreadyLoaded.) AND (NOT %sysevalf(&rV. &rVsign. &pV.)) %then
%do; %do;
%put ERROR: Package &packageName. will not be loaded!; %put ERROR: Package &packageName. will not be loaded!;
%put ERROR- Required version is &rV0.; %put ERROR- Required version is &rV0.;
@@ -367,7 +366,7 @@ minoperator
; ;
%if %sysevalf(%superq(lazyData)=,boolean) %then %if %sysevalf(%superq(lazyData)=,boolean) %then
%do; %do;
%if NOT &aleradyLoaded. %then %if NOT &alreadyLoaded. %then
%do; %do;
%local tempLoad_minoperator temp_noNotes_etc /* for hiding notes */ ; %local tempLoad_minoperator temp_noNotes_etc /* for hiding notes */ ;
%let tempLoad_minoperator = %sysfunc(getoption(minoperator)); %let tempLoad_minoperator = %sysfunc(getoption(minoperator));
@@ -385,7 +384,7 @@ minoperator
%else %else
%do; %do;
%put NOTE- %str( ); %put NOTE- %str( );
%put NOTE: It looks like the &packageName.(&pLV0.) package already loaded! Nothing to do.; %put NOTE: It looks like the &packageName.(&pLV0.) package is already loaded! Nothing to do.;
%put NOTE- To force reloading use the force=1; %put NOTE- To force reloading use the force=1;
/* if package is already loaded with req version. */ /* if package is already loaded with req version. */
%put NOTE- %str( ); %put NOTE- %str( );
@@ -433,7 +432,7 @@ minoperator
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to unload SAS package, version 20260602. Run %unloadPackage(HELP) for help info.' des = 'Macro to unload SAS package, version 20260721. Run %unloadPackage(HELP) for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -448,7 +447,7 @@ des = 'Macro to unload SAS package, version 20260602. Run %unloadPackage(HELP) f
%put ### This is short help information for the `unloadPackage` macro #; %put ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to unload SAS packages, version `20260602` #; %put # Macro to unload SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -606,7 +605,7 @@ des = 'Macro to unload SAS package, version 20260602. Run %unloadPackage(HELP) f
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to get help about SAS package, version 20260602. Run %helpPackage(HELP) for help info.' des = 'Macro to get help about SAS package, version 20260721. Run %helpPackage(HELP) for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -621,7 +620,7 @@ des = 'Macro to get help about SAS package, version 20260602. Run %helpPackage(H
%put ### This is short help information for the `helpPackage` macro #; %put ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get help about SAS packages, version `20260602` #; %put # Macro to get help about SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -766,7 +765,7 @@ TODO:
*/ */
/*+installPackage+*/ /*+installPackage+*/
/* Macros to install SAS packages, version 20260602 */ /* Macros to install SAS packages, version 20260721 */
/* A SAS package is a zip file containing a group of files /* A SAS package is a zip file containing a group of files
with SAS code (macros, functions, data steps generating with SAS code (macros, functions, data steps generating
data, etc.) wrapped up together and %INCLUDEed by data, etc.) wrapped up together and %INCLUDEed by
@@ -791,13 +790,13 @@ TODO:
, SFRCVN = /* name of a macro variable to store success-failure return code value */ , 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 */ , github = /* name of a user or an organization in GitHub, all characters except [A-z0-9_.-] are compressed */
, githubRepo = /* repo name to be used, by default it is the package name, but can be altered */ , githubRepo = /* repo name to be used, by default it is the package name, but can be altered */
, githubToken = /* user's github fine-grained personal access token */ , githubToken = /* user github fine-grained personal access token */
, githubTokenDebug = 0 /* debug values: 0,1,2,3 */ , githubTokenDebug = 0 /* debug values: 0,1,2,3 */
) )
/secure /secure
minoperator minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP) for help info.' des = 'Macro to install SAS package, version 20260721. Run %installPackage(HELP) for help info.'
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do; %do;
@@ -812,7 +811,7 @@ des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP)
%put ### This is short help information for the `installPackage` macro #; %put ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;; %put #--------------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to install SAS packages, version `20260602` #; %put # Macro to install SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -915,7 +914,7 @@ des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP)
%put # managing-your-personal-access-tokens #; %put # managing-your-personal-access-tokens #;
%put # #creating-a-fine-grained-personal-access-token` #; %put # #creating-a-fine-grained-personal-access-token` #;
%put # (lines break added for easier reading) #; %put # (lines break added for easier reading) #;
%put # Public repos do not need authentication. #; %put # Public repositories do not need authentication. #;
%put # [NOTE!] This feature is experimental in this release. #; %put # [NOTE!] This feature is experimental in this release. #;
%put # #; %put # #;
%put #--------------------------------------------------------------------------------------------#; %put #--------------------------------------------------------------------------------------------#;
@@ -1195,7 +1194,7 @@ des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP)
%if (%superq(URLuser) ne ) %then %if (%superq(URLuser) ne ) %then
%do; %do;
user = "&URLuser." user = "&URLuser."
pass = "&URLuser." pass = "&URLpass."
%end; %end;
&URLoptions. &URLoptions.
recfm=N lrecl=1; recfm=N lrecl=1;
@@ -1205,7 +1204,7 @@ des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP)
%if (%superq(URLuser) ne ) %then %if (%superq(URLuser) ne ) %then
%do; %do;
user = "&URLuser." user = "&URLuser."
pass = "&URLuser." pass = "&URLpass."
%end; %end;
&URLoptions. &URLoptions.
recfm=N lrecl=1; recfm=N lrecl=1;
@@ -1692,7 +1691,7 @@ des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP)
Macro to list SAS packages in packages folder. Macro to list SAS packages in packages folder.
Version 20260602 Version 20260721
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1714,7 +1713,7 @@ des = 'Macro to install SAS package, version 20260602. Run %installPackage(HELP)
listDataSet /* Name of a data set to save results */ listDataSet /* Name of a data set to save results */
, quiet = 0 /* Indicate if results should be printed in log */ , quiet = 0 /* Indicate if results should be printed in log */
)/secure parmbuff )/secure parmbuff
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20260602.' des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20260721.'
; ;
%if (%QUPCASE(&listDataSet.) = HELP) %then %if (%QUPCASE(&listDataSet.) = HELP) %then
%do; %do;
@@ -1729,7 +1728,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%put ### This is short help information for the `listPackages` macro #; %put ### This is short help information for the `listPackages` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list available SAS packages, version `20260602` #; %put # Macro to list available SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -1958,7 +1957,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
Macro to generate SAS packages. Macro to generate SAS packages.
Version 20260602 Version 20260721
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1986,7 +1985,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
if null (the default) the WORK is used */ if null (the default) the WORK is used */
,workInTestResults=0 /* indicates if WORK directories for tests should be located ,workInTestResults=0 /* indicates if WORK directories for tests should be located
in the same place as results */ in the same place as results */
,testWorkPath= /* location where tests SAS sessions' work directories ,testWorkPath= /* location where tests SAS session work directories
should be stored, if null (the default) the main SAS should be stored, if null (the default) the main SAS
session WORK is used. Takes precedence over workInTestResults= */ session WORK is used. Takes precedence over workInTestResults= */
,sasexe= /* a DIRECTORY where the SAS binary is located, ,sasexe= /* a DIRECTORY where the SAS binary is located,
@@ -2008,7 +2007,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
when empty takes buildLocation */ when empty takes buildLocation */
)/ secure minoperator )/ secure minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to generate SAS packages, version 20260602. Run %generatePackage(HELP) for help info.' des = 'Macro to generate SAS packages, version 20260721. Run %generatePackage(HELP) for help info.'
; ;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then %if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do; %do;
@@ -2023,7 +2022,7 @@ des = 'Macro to generate SAS packages, version 20260602. Run %generatePackage(HE
%put ### This is short help information for the `generatePackage` macro #; %put ### This is short help information for the `generatePackage` macro #;
%put #------------------------------------------------------------------------------------#; %put #------------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to generate SAS packages, version `20260602` #; %put # Macro to generate SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -2080,8 +2079,8 @@ des = 'Macro to generate SAS packages, version 20260602. Run %generatePackage(HE
%put # if null (the default) then the `!SASROOT` is used. #; %put # if null (the default) then the `!SASROOT` is used. #;
%put # #; %put # #;
%put # - `sascfgFile=` Location of a FILE with testing session configuration #; %put # - `sascfgFile=` Location of a FILE with testing session configuration #;
%put # parameters, if null (the default) then no config file #; %put # parameters, if null (the default) then no configuration #;
%put # is pointed during the SAS invocation, #; %put # file is pointed during the SAS invocation, #;
%put # if set to `DEF` then the `!SASROOT/sasv9.cfg` is used. #; %put # if set to `DEF` then the `!SASROOT/sasv9.cfg` is used. #;
%put # #; %put # #;
%put # - `delTestWork=` Indicates if `WORK` directories generated by user tests #; %put # - `delTestWork=` Indicates if `WORK` directories generated by user tests #;
@@ -2403,7 +2402,8 @@ data _null_;
/* test if version is a number */ /* test if version is a number */
/*data _null_;*/ /* <- comment out, because it can be 1 data step, not 2 */ /*data _null_;*/ /* <- comment out, because it can be 1 data step, not 2 */
v = "&packageVersion."; length v $ 64;
v = symget("packageVersion");
version = coalesce(input(scan(v,1,".","M"), ?? best32.),0)*1e8 version = coalesce(input(scan(v,1,".","M"), ?? best32.),0)*1e8
+ coalesce(input(scan(v,2,".","M"), ?? best32.),0)*1e4 + coalesce(input(scan(v,2,".","M"), ?? best32.),0)*1e4
+ coalesce(input(scan(v,3,".","M"), ?? best32.),0)*1e0 + coalesce(input(scan(v,3,".","M"), ?? best32.),0)*1e0
@@ -2411,7 +2411,7 @@ data _null_;
if not (version > 0) then if not (version > 0) then
do; do;
put 'ERROR: Package version should be a positive NUMBER.' put 'ERROR: Package version should be a positive NUMBER.'
/ 'ERROR- Current value is: ' "&packageVersion." / 'ERROR- Current value is: ' v
/ 'ERROR- Try something small, e.g. 0.1' / 'ERROR- Try something small, e.g. 0.1'
/ 'ERROR- Aborting.'; / 'ERROR- Aborting.';
put; put;
@@ -2905,7 +2905,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
title&_titleNumber_. "Package ZIP file location is: &buildLocation."; title&_titleNumber_. "Package ZIP file location is: &buildLocation.";
%end; %end;
footnote1 "SAS Packages Framework, version 20260602"; footnote1 "SAS Packages Framework, version 20260721";
proc print proc print
data = &filesWithCodes.(drop=base build folderRef fileRef rc folderid _abort_ fileId additionalContent) data = &filesWithCodes.(drop=base build folderRef fileRef rc folderid _abort_ fileId additionalContent)
@@ -3086,20 +3086,20 @@ data _null_;
/ ' %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 ' / ' %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 '
/ ' + (%scan(&pV0.,2,.,M)+0)*1e4 ' / ' + (%scan(&pV0.,2,.,M)+0)*1e4 '
/ ' + (%scan(&pV0.,3,.,M)+0)*1e0); ' / ' + (%scan(&pV0.,3,.,M)+0)*1e0); '
/ ' '
/ ' %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); ' / ' %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); '
/ ' %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); ' / ' %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); '
/ ' %if %superq(rVsign)= %then %let rVsign=<=; ' / ' %if %superq(rVsign)= %then %let rVsign=<=; '
/ ' %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then ' / ' %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then '
/ ' %do; ' / ' %do; '
/ ' %put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; ' / ' %put WARNING: Illegal operator "%superq(rVsign)"! Default(<=) will be used.; '
/ ' %put WARNING- Supported operators are: %str(= <= =< => >= < >); ' / ' %put WARNING- Supported operators are: %str(= <= =< => >= < >); '
/ ' %let rVsign=<=; ' / ' %let rVsign=<=; '
/ ' %end; ' / ' %end; '
/ ' %let rV = %sysevalf((%scan(&rV0.,1,.,M)+0)*1e8 ' / ' %let rV = %sysevalf((%scan(&rV0.,1,.,M)+0)*1e8 '
/ ' + (%scan(&rV0.,2,.,M)+0)*1e4 ' / ' + (%scan(&rV0.,2,.,M)+0)*1e4 '
/ ' + (%scan(&rV0.,3,.,M)+0)*1e0); ' / ' + (%scan(&rV0.,3,.,M)+0)*1e0); '
/ ' '
/ ' %if NOT %sysevalf(&rV. &rVsign. &pV.) %then ' / ' %if NOT %sysevalf(&rV. &rVsign. &pV.) %then '
/ ' %do; ' / ' %do; '
/ ' %put ERROR: Package &packageName. will not be loaded!; ' / ' %put ERROR: Package &packageName. will not be loaded!; '
@@ -3119,8 +3119,8 @@ data _null_;
/ ' %local cherryPick; %let cherryPick=*; ' / ' %local cherryPick; %let cherryPick=*; '
/ ' %local tempLoad_minoperator; ' / ' %local tempLoad_minoperator; '
/ ' %let tempLoad_minoperator = %sysfunc(getoption(minoperator)); ' / ' %let tempLoad_minoperator = %sysfunc(getoption(minoperator)); '
/ " "
/ ' %if %superq(suppressExec) NE 1 %then %let suppressExec = 0; ' / ' %if %sysevalf(%superq(suppressExec) NE 1,boolean) %then %let suppressExec = 0; '
/ ' %include &_PackageFileref_.(load.sas) / &source2.; ' / ' %include &_PackageFileref_.(load.sas) / &source2.; '
/ ' options &tempLoad_minoperator.; ' / ' options &tempLoad_minoperator.; '
/ ' filename &_PackageFileref_. clear; ' / ' filename &_PackageFileref_. clear; '
@@ -3178,72 +3178,71 @@ data _null_;
or (%superq(packageReqPackages) ne ) or (%superq(packageReqPackages) ne )
%then %then
%do; %do;
put ' data _null_; ' put ' data _null_; '
/ ' call symputX("packageRequiredErrors", 0, "L"); ' / ' call symputX("packageRequiredErrors", 0, "L"); '
/ ' run; '; / ' run; ';
%end; %end;
%if %sysevalf(%superq(packageRequired) ne,boolean) %then
%if %superq(packageRequired) ne %then
%do; %do;
put ' %put NOTE- *Testing required SAS components*%sysfunc(DoSubL(' /* <- DoSubL() is here */ put ' %put NOTE- *Testing required SAS components*%sysfunc(DoSubL(%str(' /* <- DoSubL() is here */
/ ' options nonotes nosource %str(;) ' / ' options nonotes nosource ; '
/ ' options ls=max ps=max locale=en_US %str(;) ' / ' options ls=max ps=max locale=en_US ; '
/ ' /* temporary redirect log */ ' / ' /* temporary redirect log */ '
/ ' filename _stinit_ TEMP %str(;) ' / ' filename _stinit_ TEMP ; '
/ ' proc printto log = _stinit_ %str(;) run %str(;) ' / ' proc printto log = _stinit_ ; run ; '
/ ' /* print out setinit */ ' / ' /* print out setinit */ '
/ ' proc setinit %str(;) run %str(;) ' / ' proc setinit ; run ; '
/ ' proc printto %str(;) run %str(;) ' / ' proc printto ; run ; '
/ ' options ps=min %str(;) ' / ' options ps=min ; '
/ ' data _null_ %str(;) ' / ' data _null_ ; '
/ ' /* loadup checklist of required SAS components */ ' / ' /* loadup checklist of required SAS components */ '
/ ' if _n_ = 1 then ' / ' if _n_ = 1 then '
/ ' do %str(;) ' / ' do ; '
/ ' length req $ 256 %str(;) ' / ' length req $ 256 ; '
/ ' declare hash R() %str(;) ' / ' declare hash R() ; '
/ ' _N_ = R.defineKey("req") %str(;) ' / ' _N_ = R.defineKey("req") ; '
/ ' _N_ = R.defineDone() %str(;) ' / ' _N_ = R.defineDone() ; '
/ ' declare hiter iR("R") %str(;) '; / ' declare hiter iR("R") ; ';
length packageRequired $ 32767; length packageRequired $ 32767;
packageRequired = upcase(symget('packageRequired')); packageRequired = upcase(symget('packageRequired'));
put ' do req = %bquote(' / packageRequired / ') %str(;) ' put ' do req = %bquote(' / packageRequired / ') ; '
/ ' _N_ = R.add(key:req,data:req) %str(;) ' / ' _N_ = R.add(key:req,data:req) ; '
/ ' end %str(;) ' / ' end ; '
/ ' end %str(;) ' / ' end ; '
/ ' ' / ' '
/ ' /* read in output from proc setinit */ ' / ' /* read in output from proc setinit */ '
/ ' infile _stinit_ end=eof %str(;) ' / ' infile _stinit_ end=eof ; '
/ ' input %str(;) ' / ' input ; '
/* / ' put "*> " _infile_ %str(;) ' */ /* for testing */ /* / ' put "*> " _infile_ ; ' */ /* for testing */
/ ' ' / ' '
/ ' /* if component is in setinit remove it from checklist */ ' / ' /* if component is in setinit remove it from checklist */ '
/ ' if _infile_ =: "---" then ' / ' if _infile_ =: "---" then '
/ ' do %str(;) ' / ' do ; '
/ ' req = upcase(substr(_infile_, 4, 64)) %str(;) ' / ' req = upcase(substr(_infile_, 4, 64)) ; '
/ ' if R.find(key:req) = 0 then ' / ' if R.find(key:req) = 0 then '
/ ' do %str(;) ' / ' do ; '
/ ' _N_ = R.remove() %str(;) ' / ' _N_ = R.remove() ; '
/ ' end %str(;) ' / ' end ; '
/ ' end %str(;) ' / ' end ; '
/ ' ' / ' '
/ ' /* if checklist is not null rise error */ ' / ' /* if checklist is not null rise error */ '
/ ' if eof and R.num_items > 0 then ' / ' if eof and R.num_items > 0 then '
/ ' do %str(;) ' / ' do ; '
/ ' put "WARNING- ###########################################" %str(;) ' / ' put "WARNING- ###########################################" ; '
/ ' put "WARNING: The following SAS components are missing! " %str(;) ' / ' put "WARNING: The following SAS components are missing! " ; '
/ ' call symputX("packageRequiredErrors", 0, "L") %str(;) ' / ' call symputX("packageRequiredErrors", 0, "L") ; '
/ ' do while(iR.next() = 0) %str(;) ' / ' do while(iR.next() = 0) ; '
/ ' put "WARNING- " req %str(;) ' / ' put "WARNING- " req ; '
/ ' end %str(;) ' / ' end ; '
/ ' put "WARNING: The package may NOT WORK as expected " %str(;) ' / ' put "WARNING: The package may NOT WORK as expected " ; '
/ ' put "WARNING: or even result with ERRORS! " %str(;) ' / ' put "WARNING: or even result with ERRORS! " ; '
/ ' put "WARNING- ###########################################" %str(;) ' / ' put "WARNING- ###########################################" ; '
/ ' put %str(;) ' / ' put ; '
/ ' end %str(;) ' / ' end ; '
/ ' run %str(;) ' / ' run ; '
/ ' filename _stinit_ clear %str(;) ' / ' filename _stinit_ clear ; '
/ ' options notes source %str(;) ' / ' options notes source ; '
/ ' ))*; '; / ' )))*; ';
%end; %end;
%if %superq(packageReqPackages) ne %then %if %superq(packageReqPackages) ne %then
@@ -3730,7 +3729,7 @@ data _null_;
%end; %end;
put +(-1) '`.;''' put +(-1) '`.;'''
/ ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' / ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"'
/ ' !! '' %put with the SAS Packages Framework version 20260602.;''' / ' !! '' %put with the SAS Packages Framework version 20260721.;'''
/ ' !! '' %put ****************************************************************************;''' / ' !! '' %put ****************************************************************************;'''
/ ' !! '' %GOTO theEndOfTheMacro;''' / ' !! '' %GOTO theEndOfTheMacro;'''
/ ' !! '' %end;''' ; / ' !! '' %end;''' ;
@@ -3894,7 +3893,7 @@ data _null_;
%end; %end;
put +(-1) '`.; '' !!' / put +(-1) '`.; '' !!' /
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !! ' / ''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !! ' /
''' %put with the SAS Packages Framework version 20260602.; '' !! ' / ''' %put with the SAS Packages Framework version 20260721.; '' !! ' /
''' %put ****************************************************************************; '' !! ' / ''' %put ****************************************************************************; '' !! ' /
''' %GOTO theEndOfTheMacro; '' !! ' / ''' %GOTO theEndOfTheMacro; '' !! ' /
''' %end; '' !! ' / ''' %end; '' !! ' /
@@ -4766,7 +4765,7 @@ data _null_;
%end; %end;
put 'put " " / @3 "---------------------------------------------------------------------" / " ";' put 'put " " / @3 "---------------------------------------------------------------------" / " ";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20260602`*";' / 'put @3 "*SAS package generated by SAS Package Framework, version `20260721`*";'
/ "put @3 '*under `&sysscp.`(`&sysscpl.`) operating system,*';" / "put @3 '*under `&sysscp.`(`&sysscpl.`) operating system,*';"
/ "put @3 '*using SAS release: `&sysvlong4.`.*';" / "put @3 '*using SAS release: `&sysvlong4.`.*';"
/ 'put " " / @3 "---------------------------------------------------------------------";'; / 'put " " / @3 "---------------------------------------------------------------------";';
@@ -4930,6 +4929,7 @@ data _null_;
call execute(' rc = fcopy("_SPFIN_", "_SPFOUT_");'); call execute(' rc = fcopy("_SPFIN_", "_SPFOUT_");');
call execute(' ex = fexist("_SPFOUT_"); Try + 1;'); call execute(' ex = fexist("_SPFOUT_"); Try + 1;');
call execute(' put Try= " File existence in ZIP verified as: " ex;'); call execute(' put Try= " File existence in ZIP verified as: " ex;');
call execute(' rc = sleep(^ex, 0.25);'); /* wait 0.25 sec if not copied successfully */
call execute(' end ;'); call execute(' end ;');
call execute(' if ex then put "File " pathname "copied into the package with return code: " rc "(0 = success)";'); call execute(' if ex then put "File " pathname "copied into the package with return code: " rc "(0 = success)";');
@@ -5205,7 +5205,7 @@ options &qlenmax_fstimer_tmp.;
/*+SPFint_gnPckg_tests+*/ /*+SPFint_gnPckg_tests+*/
%macro SPFint_gnPckg_tests()/secure minoperator %macro SPFint_gnPckg_tests()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the test part of the process. Version 20260602.'; des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the test part of the process. Version 20260721.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */ /* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then %if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do; %do;
@@ -5887,7 +5887,7 @@ options &quotelenmax_tmp.;
/*+SPFint_gnPckg_markdown+*/ /*+SPFint_gnPckg_markdown+*/
%macro SPFint_gnPckg_markdown()/secure minoperator %macro SPFint_gnPckg_markdown()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the markdown documentation part of the process. Version 20260602.'; des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the markdown documentation part of the process. Version 20260721.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */ /* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then %if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do; %do;
@@ -5999,7 +5999,7 @@ data &filesWithCodes.markdown;
%end; %end;
put " " / "---------------------------------------------------------------------" / " " put " " / "---------------------------------------------------------------------" / " "
/ "*SAS package generated by SAS Package Framework, version `20260602`,*" / "*SAS package generated by SAS Package Framework, version `20260721`,*"
/ "*under `&sysscp.`(`&sysscpl.`) operating system,*" / "*under `&sysscp.`(`&sysscpl.`) operating system,*"
/ "*using SAS release: `&sysvlong4.`.*" / "*using SAS release: `&sysvlong4.`.*"
/ " " / "---------------------------------------------------------------------" / " "; / " " / "---------------------------------------------------------------------" / " ";
@@ -6140,7 +6140,7 @@ options &MarkDownOptionsTmp.;
/*+SPFint_gnPckg_arch+*/ /*+SPFint_gnPckg_arch+*/
%macro SPFint_gnPckg_arch()/secure minoperator %macro SPFint_gnPckg_arch()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the archive version generation part of the process. Version 20260602.'; des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the archive version generation part of the process. Version 20260721.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */ /* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then %if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do; %do;
@@ -6307,7 +6307,7 @@ TODO: (in Polish)
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load multiple SAS packages at one run, version 20260602. Run %loadPackages(HELP) for help info.' des = 'Macro to load multiple SAS packages at one run, version 20260721. Run %loadPackages(HELP) for help info.'
parmbuff parmbuff
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -6323,7 +6323,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #; %put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro wrapper for the loadPackage macro, version `20260602` #; %put # Macro wrapper for the loadPackage macro, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -6421,7 +6421,7 @@ parmbuff
hashing_file() function, SAS 9.4M6 */ hashing_file() function, SAS 9.4M6 */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to verify SAS package with the hash digest, version 20260602. Run %verifyPackage(HELP) for help info.' des = 'Macro to verify SAS package with the hash digest, version 20260721. Run %verifyPackage(HELP) for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -6436,7 +6436,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20260602. Run %
%put ### This is short help information for the `verifyPackage` macro #; %put ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to verify SAS package with it hash digest, version `20260602` #; %put # Macro to verify SAS package with it hash digest, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -6567,10 +6567,10 @@ des = 'Macro to verify SAS package with the hash digest, version 20260602. Run %
length method $ 8 digest $ 128; length method $ 8 digest $ 128;
/* calculate SHA256 */ /* calculate SHA256 */
method="SHA256"; method="SHA256";
LINK CalcualteHashDigest; /* go to Link 1 */ LINK CalculateHashDigest; /* go to Link 1 */
if NOT emptyHash then if NOT emptyHash then
do; /* step for veryfication */ do; /* step for verification */
if upcase(digest) = upcase(providedHash) then if upcase(digest) = upcase(providedHash) then
do; do;
put "NOTE: Verification SUCCESSFUL." put "NOTE: Verification SUCCESSFUL."
@@ -6589,13 +6589,13 @@ des = 'Macro to verify SAS package with the hash digest, version 20260602. Run %
end; end;
end; end;
else else
do method = "SHA1", "MD5"; /* step for digest display, calcualte also SHA1 and MD5 */ do method = "SHA1", "MD5"; /* step for digest display, calculate also SHA1 and MD5 */
LINK CalcualteHashDigest; /* go to Link 1 */ LINK CalculateHashDigest; /* go to Link 1 */
end; end;
put 82*"-" /; put 82*"-" /;
stop; stop;
return; return;
CalcualteHashDigest: /* Link 1 */ CalculateHashDigest: /* Link 1 */
select; select;
when ( 'F*' = upcase(substr(providedHash,1,2)) ) /* F = file digest */ when ( 'F*' = upcase(substr(providedHash,1,2)) ) /* F = file digest */
@@ -6652,7 +6652,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20260602. Run %
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to preview content of a SAS package, version 20260602. Run %previewPackage(HELP) for help info.' des = 'Macro to preview content of a SAS package, version 20260721. Run %previewPackage(HELP) for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -6667,7 +6667,7 @@ des = 'Macro to preview content of a SAS package, version 20260602. Run %preview
%put ### This is short help information for the `previewPackage` macro #; %put ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get preview of a SAS packages, version `20260602` #; %put # Macro to get preview of a SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -6801,7 +6801,7 @@ des = 'Macro to preview content of a SAS package, version 20260602. Run %preview
when empty the "packages" value is used */ when empty the "packages" value is used */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to list directories pointed by "packages" fileref, version 20260602. Run %extendPackagesFileref(HELP) for help info.' des = 'Macro to list directories pointed by "packages" fileref, version 20260721. Run %extendPackagesFileref(HELP) for help info.'
; ;
%if %QUPCASE(&packages.) = HELP %then %if %QUPCASE(&packages.) = HELP %then
@@ -6817,7 +6817,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20260602
%put ### This is short help information for the `extendPackagesFileref` macro #; %put ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list directories pointed by 'packages' fileref, version `20260602` #; %put # Macro to list directories pointed by 'packages' fileref, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -6919,7 +6919,7 @@ filename packages list;
is provided in required version */ is provided in required version */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load additional content for a SAS package, version 20260602. Run %loadPackageAddCnt(HELP) for help info.' des = 'Macro to load additional content for a SAS package, version 20260721. Run %loadPackageAddCnt(HELP) for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -6935,7 +6935,7 @@ minoperator
%put ### This is short help information for the `loadPackageAddCnt` macro #; %put ### This is short help information for the `loadPackageAddCnt` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *load* additional content for a SAS package, version `20260602` #; %put # Macro to *load* additional content for a SAS package, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -7072,7 +7072,7 @@ minoperator
%if %superq(rVsign)= %then %let rVsign=<=; %if %superq(rVsign)= %then %let rVsign=<=;
%else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then
%do; %do;
%put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; %put WARNING: Illegal operator "%superq(rVsign)"! Default(<=) will be used.;
%put WARNING- Supported operators are: %str(= <= =< => >= < >); %put WARNING- Supported operators are: %str(= <= =< => >= < >);
%let rVsign=<=; %let rVsign=<=;
%end; %end;
@@ -7285,7 +7285,7 @@ minoperator
%WrongVersionOFPackageAddCnt: %WrongVersionOFPackageAddCnt:
/* restore optionos */ /* restore options */
options ls = &ls_tmp. ps = &ps_tmp. options ls = &ls_tmp. ps = &ps_tmp.
&notes_tmp. &source_tmp. &notes_tmp. &source_tmp.
&stimer_tmp. &fullstimer_tmp. &stimer_tmp. &fullstimer_tmp.
@@ -7306,7 +7306,7 @@ minoperator
,nobs=0 /* technical parameter */ ,nobs=0 /* technical parameter */
) )
/*** HELP END ***/ /*** HELP END ***/
/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260602. Run %splitCodeForPackage(HELP) for help info.' / des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260721. Run %splitCodeForPackage(HELP) for help info.'
; ;
%if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then %if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then
%do; %do;
@@ -7322,7 +7322,7 @@ minoperator
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Utility macro to *split* single file with SAS package code into multiple #; %put # Utility macro to *split* single file with SAS package code into multiple #;
%put # files with separate snippets, version `20260602` #; %put # files with separate snippets, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -7698,7 +7698,7 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ;
*/ */
if firstLine[j] then if firstLine[j] then
do; do;
put '/* File generated with help of SAS Packages Framework, version 20260602. */'; put '/* File generated with help of SAS Packages Framework, version 20260721. */';
firstLine[j]=0; firstLine[j]=0;
end; end;
put _infile_; put _infile_;
@@ -7731,7 +7731,7 @@ options &options_tmp2.;
,psMAX=MAX /* pageSise in case executed inside DoSubL() */ ,psMAX=MAX /* pageSise in case executed inside DoSubL() */
,ods= /* a data set for results, e.g., work.relocatePackageReport */ ,ods= /* a data set for results, e.g., work.relocatePackageReport */
) )
/ des = 'Utility macro that locally Copies or Moves Packages, version 20260602. Run %relocatePackage(HELP) for help info.' / des = 'Utility macro that locally Copies or Moves Packages, version 20260721. Run %relocatePackage(HELP) for help info.'
secure secure
minoperator minoperator
; ;
@@ -7749,7 +7749,7 @@ options &options_tmp2.;
%put ### This is short help information for the `relocatePackage` macro #; %put ### This is short help information for the `relocatePackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *locally copy or move* (relocate) SAS packages, version `20260602` #; %put # Macro to *locally copy or move* (relocate) SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -7947,7 +7947,7 @@ options &options_tmp2.;
%do; %do;
if NOT (input(resolve('%isPackagesFilerefOK(&debug.)'), best.)=1) then /* if debug=1 the isPackagesFilerefOK in verbose mode */ if NOT (input(resolve('%isPackagesFilerefOK(&debug.)'), best.)=1) then /* if debug=1 the isPackagesFilerefOK in verbose mode */
do; do;
putlog "WARNING: The PACKAGES fileres is not OK! Exiting!"; putlog "WARNING: The PACKAGES fileref is not OK! Exiting!";
LINK stopProcessing; LINK stopProcessing;
end; end;
%end; %end;
@@ -8333,7 +8333,7 @@ options &options_tmp2.;
run; run;
/* restore optionos */ /* restore options */
options ls = &ls_tmp. ps = &ps_tmp. options ls = &ls_tmp. ps = &ps_tmp.
&notes_tmp. &source_tmp. &notes_tmp. &source_tmp.
&stimer_tmp. &fullstimer_tmp. &stimer_tmp. &fullstimer_tmp.
@@ -8414,7 +8414,7 @@ filename PACKAGES ("R:\testPackages2" "R:\testPackages1");
vERRb /* indicates if macro should be verbose and report errors */ vERRb /* indicates if macro should be verbose and report errors */
) )
/ minoperator PARMBUFF / minoperator PARMBUFF
des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20260602.' des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20260721.'
; ;
/*** HELP END ***/ /*** HELP END ***/
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then %if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
@@ -8430,7 +8430,7 @@ des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFile
%put ### This is short help information for the `isPackagesFilerefOK` macro #; %put ### This is short help information for the `isPackagesFilerefOK` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to check if the `packages` fileref is "correct", version `20260602` #; %put # Macro to check if the `packages` fileref is "correct", version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -8495,7 +8495,7 @@ des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFile
%if &nobs. AND 1=&vERRb. %then %put INFO: PACKAGES fileref is: %sysfunc(pathname(PACKAGES)); %if &nobs. AND 1=&vERRb. %then %put INFO: PACKAGES fileref is: %sysfunc(pathname(PACKAGES));
%let isPackagesFilerefOK=%sysevalf(&nobs. AND 1, boolean); %let isPackagesFilerefOK=%sysevalf(&nobs. AND 1, boolean);
%do i = 1 %to &nobs.; %do i = 1 %to &nobs.;
%let rc=%sysfunc(FETCHOBS(&dsid., &i.)); %let rc=%sysfunc(FETCHOBS(&dsid., &i.));
@@ -8564,7 +8564,7 @@ SPFmacroName /* space separated list of names */
/ /
minoperator minoperator
secure secure
des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260602. Run %SasPackagesFrameworkNotes(HELP) for help info.' des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260721. Run %SasPackagesFrameworkNotes(HELP) for help info.'
; ;
%local list N i element; %local list N i element;
%let list= %let list=
@@ -8589,6 +8589,7 @@ relocatePackage
isPackagesFilerefOK isPackagesFilerefOK
bundlePackages bundlePackages
unbundlePackages unbundlePackages
requestPackage
/**/ /**/
SasPackagesFrameworkNotes SasPackagesFrameworkNotes
; ;
@@ -8610,7 +8611,7 @@ SasPackagesFrameworkNotes
%put ### This is short help information for the `SasPackagesFrameworkNotes` macro #; %put ### This is short help information for the `SasPackagesFrameworkNotes` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro prints help notes for SAS Packages Framework macros, version `20260602` #; %put # Macro prints help notes for SAS Packages Framework macros, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -8733,7 +8734,7 @@ options mlogic symbolgen;
,packagesRef=packages ,packagesRef=packages
,ods= /* data set for report file */ ,ods= /* data set for report file */
)/ )/
des='Macro to create a bundle of SAS packages, version 20260602. Run %bundlePackages(HELP) for help info.' des='Macro to create a bundle of SAS packages, version 20260721. Run %bundlePackages(HELP) for help info.'
secure minoperator secure minoperator
; ;
@@ -8750,7 +8751,7 @@ secure minoperator
%put ### This is short help information for the `bundlePackages` macro #; %put ### This is short help information for the `bundlePackages` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *create bundles* of SAS packages, version `20260602` #; %put # Macro to *create bundles* of SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -9151,7 +9152,7 @@ run;
/*===================================================================================================*/ /*===================================================================================================*/
/* restore optionos */ /* restore options */
options ls = &ls_tmp. ps = &ps_tmp. options ls = &ls_tmp. ps = &ps_tmp.
&notes_tmp. &source_tmp. &notes_tmp. &source_tmp.
&stimer_tmp. &fullstimer_tmp. &stimer_tmp. &fullstimer_tmp.
@@ -9244,7 +9245,7 @@ filename p2 "R:/dontexist";
,verify=0 ,verify=0
,quiet=0 ,quiet=0
)/ )/
des='Macro to extract a bundle of SAS packages, version 20260602. Run %unbundlePackages(HELP) for help info.' des='Macro to extract a bundle of SAS packages, version 20260721. Run %unbundlePackages(HELP) for help info.'
secure secure
minoperator minoperator
; ;
@@ -9262,7 +9263,7 @@ minoperator
%put ### This is short help information for the `unbundlePackages` macro #; %put ### This is short help information for the `unbundlePackages` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *extract* SAS packages from a bundle, version `20260602` #; %put # Macro to *extract* SAS packages from a bundle, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -9552,7 +9553,7 @@ else
end; end;
rc = Q.output(dataset: /* create propper tag */ rc = Q.output(dataset: /* create proper tag */
%if %superq(ods) NE %then %do; "&ods.(label='Bundle: " !! strip(bundleName) !! "')" %end; %if %superq(ods) NE %then %do; "&ods.(label='Bundle: " !! strip(bundleName) !! "')" %end;
%else %do; "&reportFile.1" %end; %else %do; "&reportFile.1" %end;
); );
@@ -9609,7 +9610,7 @@ rc = doSubL(
stop; stop;
run; run;
/*===================================================================================================*/ /*===================================================================================================*/
/* restore optionos */ /* restore options */
options ls = &ls_tmp. ps = &ps_tmp. options ls = &ls_tmp. ps = &ps_tmp.
&notes_tmp. &source_tmp. &notes_tmp. &source_tmp.
&stimer_tmp. &fullstimer_tmp. &stimer_tmp. &fullstimer_tmp.
@@ -9698,7 +9699,7 @@ libname _ "R:\check5";
%macro SPFinit_intrnl_forceV7DSname( %macro SPFinit_intrnl_forceV7DSname(
mcParam /* name of a macro parameter holding user provided data set name */ mcParam /* name of a macro parameter holding user provided data set name */
)/secure minoperator )/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside selected SPF macros. Macro generates 4GL code that forces V7 compatybility for user provided data set names. Version 20260602.'; des='SAS Packages Framework internal macro. Executable only inside selected SPF macros. Macro generates 4GL code that forces V7 compatibility for user provided data set names. Version 20260721.';
/* The macro can be called only inside a data step. */ /* The macro can be called only inside a data step. */
/**************************************************************************** /****************************************************************************
### Parameters: ### Parameters:
@@ -9735,7 +9736,7 @@ des='SAS Packages Framework internal macro. Executable only inside selected SPF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%macro A(ods); %macro A(ods);
data _null_; data _null_;
%SPDinit_intrnl_forceV7DSname(ods); %SPFinit_intrnl_forceV7DSname(ods);
call symputX("ods",ods,"L"); call symputX("ods",ods,"L");
run; run;
@@ -9808,31 +9809,32 @@ des='SAS Packages Framework internal macro. Executable only inside selected SPF
, github = /* name of a user or an organization in GitHub, all characters except [A-z0-9_.-] are compressed */ , github = /* name of a user or an organization in GitHub, all characters except [A-z0-9_.-] are compressed */
, githubRepo = /* repo name to be used, by default it is the package name, but can be altered */ , githubRepo = /* repo name to be used, by default it is the package name, but can be altered */
, githubToken = /* user's github fine-grained personal access token */ , githubToken = /* user github fine-grained personal access token */
, githubTokenDebug = 0 /* debug values: 0,1,2,3 */ , githubTokenDebug = 0 /* debug values: 0,1,2,3 */
, loadPackage=1 /* should the packages be installed after installing */ , loadPackage=1 /* should the packages be loaded after installing */
, force=0 /* force reloading even if already loaded */ , force=0 /* force reloading even if already loaded */
, ignoreDepVer=0 /* should dependencies version be ignore so that only the latest could be installed */ , ignoreDepVer=0 /* should dependencies version be ignore so that only the latest could be installed */
, successDS= /* technical */ , successDS= /* technical */
) )
/secure /secure
des = 'Macro to request SAS package installation and loading, version 20260602. Run %requestPackage(HELP) for help info.'; des = 'Macro to request SAS package installation and loading, version 20260721. Run %requestPackage(HELP) for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
%local options_tmp ; %local options_tmp ;
%let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps)) %let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps))
%sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(source2))
msglevel=%sysfunc(getoption(msglevel)) msglevel=%sysfunc(getoption(msglevel))
; ;
options NOnotes NOsource ls=MAX ps=MAX msglevel=N; options NOnotes NOsource NOsource2 ls=MAX ps=MAX msglevel=N;
%put ; %put ;
%put ##############################################################################################; %put ##############################################################################################;
%put ### This is short help information for the `requestPackage` macro #; %put ### This is short help information for the `requestPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;; %put #--------------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to request (install and load) SAS packages, version `20260602` #; %put # Macro to request (install and load) SAS packages, version `20260721` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -9856,8 +9858,11 @@ des = 'Macro to request SAS package installation and loading, version 20260602.
%put # #; %put # #;
%put # **Installation options:** #; %put # **Installation options:** #;
%put # #; %put # #;
%put # - `requiredVersion=` *Optional.* Indicates which package version we want #; %put # - `requiredVersion=` *Optional.* Indicates which (at least) package version we want #;
%put # to be requested, default value: `.` means "the latest". #; %put # to be requested. Empty value by default means: %str(%")load currently #;
%put # installed version or install and load the latest available one.%str(%") #;
%put # When loaded (installed) package version is greater or equal #;
%put # than requested, lower requested version is not loaded (installed). #;
%put # #; %put # #;
%put # - `sourcePath=` Location of the package, e.g. "www.some.web.page/" #; %put # - `sourcePath=` Location of the package, e.g. "www.some.web.page/" #;
%put # Mind the "/" at the end of the path! #; %put # Mind the "/" at the end of the path! #;
@@ -9877,12 +9882,6 @@ des = 'Macro to request SAS package installation and loading, version 20260602.
%put # `https://github.com/PharmaForest/` #; %put # `https://github.com/PharmaForest/` #;
%put # Default value is `0`. #; %put # Default value is `0`. #;
%put # #; %put # #;
%put # - `version=` Indicates which historical version of a package to install. #;
%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 the `version` variable #;
%put # is scan sequentially. #;
%put # #;
%put # - `replace=` When set to `1` and a package file exists, it forces the package #; %put # - `replace=` When set to `1` and a package file exists, it forces the package #;
%put # file replacement by the new downloaded file. #; %put # file replacement by the new downloaded file. #;
%put # It is a binary indicator ('0' or '1'). Default value is `1`. #; %put # It is a binary indicator ('0' or '1'). Default value is `1`. #;
@@ -9932,7 +9931,7 @@ des = 'Macro to request SAS package installation and loading, version 20260602.
%put # managing-your-personal-access-tokens #; %put # managing-your-personal-access-tokens #;
%put # #creating-a-fine-grained-personal-access-token` #; %put # #creating-a-fine-grained-personal-access-token` #;
%put # (lines break added for easier reading) #; %put # (lines break added for easier reading) #;
%put # Public repos do not need authentication. #; %put # Public repositories do not need authentication. #;
%put # [NOTE!] This feature is experimental in this release. #; %put # [NOTE!] This feature is experimental in this release. #;
%put # #; %put # #;
%put # **Loading options:** #; %put # **Loading options:** #;
@@ -9997,11 +9996,11 @@ des = 'Macro to request SAS package installation and loading, version 20260602.
%let _rname_ = _requestPckg_%sysfunc(sleep(1,0.042),best1.)%sysfunc(datetime(),hex16.)_; %let _rname_ = _requestPckg_%sysfunc(sleep(1,0.042),best1.)%sysfunc(datetime(),hex16.)_;
%let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps)) %let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps))
%sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(notes)) %sysfunc(getoption(source)) %sysfunc(getoption(source2))
msglevel=%sysfunc(getoption(msglevel)) msglevel=%sysfunc(getoption(msglevel))
; ;
options NOnotes NOsource ls=MAX ps=MAX msglevel=N; options NOnotes NOsource NOsource2 ls=MAX ps=MAX msglevel=N;
options source source2; /*options source source2;*/
%let loadPackage = %sysevalf((1=%superq(loadPackage)),boolean); %let loadPackage = %sysevalf((1=%superq(loadPackage)),boolean);
%let replace = %sysevalf(1=%superq(replace),boolean); %let replace = %sysevalf(1=%superq(replace),boolean);
@@ -10041,7 +10040,8 @@ data _null_;
/*put (_ALL_) (=/);*/ /*put (_ALL_) (=/);*/
if (. <= verRN <= versN) then if (. <= verRN <= versN) then
do; do;
put / "INFO: It looks like the " packageName "package is already loaded. Enjoy!"; put / "INFO: It looks like the " packageName "package is already loaded. Enjoy!"
/ @7 "The loaded version is: " vers;
call symputX('_alreadyLoaded_', 1, "L"); call symputX('_alreadyLoaded_', 1, "L");
end; end;
else else