diff --git a/README.md b/README.md
index 7969a50..599ef34 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ Don't forget to give the repository a **STAR** and become [stargazer](https://gi
### Current version:
-**The latest version** of the **SAS Packages Framework** is **`20251231`**.
+**The latest version** of the **SAS Packages Framework** is **`20260125`**.
---
diff --git a/SPF/Documentation/SAS(r) packages - the way to share (a how to)- Paper 4725-2020 - extended.pdf b/SPF/Documentation/SAS(r) packages - the way to share (a how to)- Paper 4725-2020 - extended.pdf
index 23776b0..15a898e 100644
Binary files a/SPF/Documentation/SAS(r) packages - the way to share (a how to)- Paper 4725-2020 - extended.pdf and b/SPF/Documentation/SAS(r) packages - the way to share (a how to)- Paper 4725-2020 - extended.pdf differ
diff --git a/SPF/Macros/bundlePackages.sas b/SPF/Macros/bundlePackages.sas
index d7213d5..1058764 100644
--- a/SPF/Macros/bundlePackages.sas
+++ b/SPF/Macros/bundlePackages.sas
@@ -8,7 +8,7 @@
,packagesRef=packages
,ods= /* data set for report file */
)/
-des='Macro to create a bundle of SAS packages, version 20251231. Run %bundlePackages(HELP) for help info.'
+des='Macro to create a bundle of SAS packages, version 20260125. Run %bundlePackages(HELP) for help info.'
secure minoperator
;
@@ -25,7 +25,7 @@ secure minoperator
%put ### This is short help information for the `bundlePackages` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to *create bundles* of SAS packages, version `20251231` #;
+ %put # Macro to *create bundles* of SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/extendpackagesfileref.sas b/SPF/Macros/extendpackagesfileref.sas
index 5bc7e3e..33f9513 100644
--- a/SPF/Macros/extendpackagesfileref.sas
+++ b/SPF/Macros/extendpackagesfileref.sas
@@ -6,7 +6,7 @@
when empty the "packages" value is used */
)/secure
/*** HELP END ***/
-des = 'Macro to list directories pointed by "packages" fileref, version 20251231. Run %extendPackagesFileref(HELP) for help info.'
+des = 'Macro to list directories pointed by "packages" fileref, version 20260125. Run %extendPackagesFileref(HELP) for help info.'
;
%if %QUPCASE(&packages.) = HELP %then
@@ -22,7 +22,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20251231
%put ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
- %put # Macro to list directories pointed by 'packages' fileref, version `20251231` #;
+ %put # Macro to list directories pointed by 'packages' fileref, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/generatepackage.sas b/SPF/Macros/generatepackage.sas
index fb0ed92..9615ea4 100644
--- a/SPF/Macros/generatepackage.sas
+++ b/SPF/Macros/generatepackage.sas
@@ -3,7 +3,7 @@
Macro to generate SAS packages.
- Version 20251231
+ Version 20260125
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -53,7 +53,7 @@
when empty takes buildLocation */
)/ secure minoperator
/*** HELP END ***/
-des = 'Macro to generate SAS packages, version 20251231. Run %generatePackage() for help info.'
+des = 'Macro to generate SAS packages, version 20260125. Run %generatePackage() for help info.'
;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do;
@@ -68,7 +68,7 @@ des = 'Macro to generate SAS packages, version 20251231. Run %generatePackage()
%put ### This is short help information for the `generatePackage` macro #;
%put #------------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to generate SAS packages, version `20251231` #;
+ %put # Macro to generate SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -950,7 +950,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
title&_titleNumber_. "Package ZIP file location is: &buildLocation.";
%end;
-footnote1 "SAS Packages Framework, version 20251231";
+footnote1 "SAS Packages Framework, version 20260125";
proc print
data = &filesWithCodes.(drop=base build folderRef fileRef rc folderid _abort_ fileId additionalContent)
@@ -1769,7 +1769,7 @@ data _null_;
%end;
put +(-1) '`.;'''
/ ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"'
- / ' !! '' %put with the SAS Packages Framework version 20251231.;'''
+ / ' !! '' %put with the SAS Packages Framework version 20260125.;'''
/ ' !! '' %put ****************************************************************************;'''
/ ' !! '' %GOTO theEndOfTheMacro;'''
/ ' !! '' %end;''' ;
@@ -1933,7 +1933,7 @@ data _null_;
%end;
put +(-1) '`.; '' !!' /
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !! ' /
- ''' %put with the SAS Packages Framework version 20251231.; '' !! ' /
+ ''' %put with the SAS Packages Framework version 20260125.; '' !! ' /
''' %put ****************************************************************************; '' !! ' /
''' %GOTO theEndOfTheMacro; '' !! ' /
''' %end; '' !! ' /
@@ -2736,7 +2736,7 @@ data _null_;
%end;
put 'put " " / @3 "---------------------------------------------------------------------" / " ";'
- / 'put @3 "*SAS package generated by SAS Package Framework, version `20251231`*";'
+ / 'put @3 "*SAS package generated by SAS Package Framework, version `20260125`*";'
/ "put @3 '*under `&sysscp.`(`&sysscpl.`) operating system,*';"
/ "put @3 '*using SAS release: `&sysvlong4.`.*';"
/ 'put " " / @3 "---------------------------------------------------------------------";';
diff --git a/SPF/Macros/helppackage.sas b/SPF/Macros/helppackage.sas
index 455a048..9591f78 100644
--- a/SPF/Macros/helppackage.sas
+++ b/SPF/Macros/helppackage.sas
@@ -28,7 +28,7 @@
*/
)/secure
/*** HELP END ***/
-des = 'Macro to get help about SAS package, version 20251231. Run %helpPackage() for help info.'
+des = 'Macro to get help about SAS package, version 20260125. Run %helpPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -43,7 +43,7 @@ des = 'Macro to get help about SAS package, version 20251231. Run %helpPackage()
%put ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to get help about SAS packages, version `20251231` #;
+ %put # Macro to get help about SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/installpackage.sas b/SPF/Macros/installpackage.sas
index 492237f..fd00309 100644
--- a/SPF/Macros/installpackage.sas
+++ b/SPF/Macros/installpackage.sas
@@ -1,5 +1,5 @@
/*+installPackage+*/
-/* Macros to install SAS packages, version 20251231 */
+/* Macros to install SAS packages, version 20260125 */
/* 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
@@ -26,7 +26,7 @@
/secure
minoperator
/*** HELP END ***/
-des = 'Macro to install SAS package, version 20251231. Run %%installPackage() for help info.'
+des = 'Macro to install SAS package, version 20260125. Run %%installPackage() for help info.'
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do;
@@ -41,7 +41,7 @@ des = 'Macro to install SAS package, version 20251231. Run %%installPackage() fo
%put ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;;
%put # #;
- %put # Macro to install SAS packages, version `20251231` #;
+ %put # Macro to install SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/ispackagesfilerefok.sas b/SPF/Macros/ispackagesfilerefok.sas
index d3b0291..3772e24 100644
--- a/SPF/Macros/ispackagesfilerefok.sas
+++ b/SPF/Macros/ispackagesfilerefok.sas
@@ -4,7 +4,7 @@
vERRb /* indicates if macro should be verbose and report errors */
)
/ minoperator PARMBUFF
-des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20251231.'
+des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20260125.'
;
/*** HELP END ***/
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
@@ -20,7 +20,7 @@ des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFile
%put ### This is short help information for the `isPackagesFilerefOK` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
- %put # Macro to check if the `packages` fileref is "correct", version `20251231` #;
+ %put # Macro to check if the `packages` fileref is "correct", version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/listpackages.sas b/SPF/Macros/listpackages.sas
index 17e00c5..52615ce 100644
--- a/SPF/Macros/listpackages.sas
+++ b/SPF/Macros/listpackages.sas
@@ -3,7 +3,7 @@
Macro to list SAS packages in packages folder.
- Version 20251231
+ Version 20260125
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -21,11 +21,11 @@
*//*** HELP END ***/
-%macro listPackages()
-/secure PARMBUFF
-des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20251231.'
+%macro listPackages(listDataSet, quiet=0)
+/ secure PARMBUFF
+des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20260125.'
;
-%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
+%if (%QUPCASE(&listDataSet.) = HELP) %then
%do;
%local options_tmp ;
%let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps))
@@ -38,7 +38,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%put ### This is short help information for the `listPackages` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
- %put # Macro to list available SAS packages, version `20251231` #;
+ %put # Macro to list available SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -49,7 +49,11 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%put # #;
%put #### Parameters: #;
%put # #;
- %put # NO PARAMETERS #;
+ %put # 1. `listDataSet` Name of a SAS data set to store results in. #;
+ %put # No data set options are honored. #;
+ %put # #;
+ %put # - `quiet=` *Optional.* Indicates if the LOG printout should be suspended. #;
+ %put # Default value of zero (`0`) means "Do printout", other means "No". #;
%put # #;
%put # When used as: `%nrstr(%%listPackages(HELP))` it displays this help information. #;
%put # #;
@@ -74,6 +78,8 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%put %nrstr( %%include packages(SPFinit.sas); %%* enable the framework; );
%put ;
%put %nrstr( %%listPackages() %%* list available packages; );
+ %put ;
+ %put %nrstr( %%listPackages(ListDS,quiet=1) %%* save packages list in ListDS data set; );
%put ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
%put ###########################################################################################;
%put ;
@@ -81,30 +87,47 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%GOTO ENDoflistPackages;
%end;
-%local ls_tmp ps_tmp notes_tmp source_tmp filesWithCodes;
-
-%let filesWithCodes = WORK._%sysfunc(datetime(), hex16.)_;
+%local ls_tmp ps_tmp notes_tmp source_tmp listDataSetCheck ;
%let ls_tmp = %sysfunc(getoption(ls));
%let ps_tmp = %sysfunc(getoption(ps));
%let notes_tmp = %sysfunc(getoption(notes));
%let source_tmp = %sysfunc(getoption(source));
+%let listDataSetCheck=0;
+
+%let quiet = %sysevalf(NOT(0=%superq(quiet)));
options NOnotes NOsource ls=MAX ps=MAX;
data _null_;
- length baseAll $ 32767 base $ 1024;
+ length listDataSet $ 41;
+ listDataSet = strip(scan(symget('listDataSet'),1,'( )'));
+ call symputX('listDataSet',listDataSet,"L");
+ if not (listDataSet = " ") then
+ call symputX('listDataSetCheck',1,"L");
+ else call symputX('quiet',0,"L");
+run;
+
+data _null_
+ %if 1=&listDataSetCheck. %then
+ %do;
+ &listDataSet.(compress=yes keep=k base PackageZIPNumber folder n tag value rename=(folder=PackageZIP k=baseNumber n=tagNumber))
+ %end;
+;
+ length k 8 baseAll $ 32767 base $ 1024 PackageZIPNumber 8;
baseAll = pathname("packages");
+ array TAGSLIST[6] $ 16 _temporary_ ("PACKAGE" "TITLE" "VERSION" "AUTHOR" "MAINTAINER" "LICENSE");
+
if baseAll = " " then
do;
- put "NOTE: The file reference PACKAGES is not assigned.";
+ put "WARNING: The file reference PACKAGES is not assigned.";
stop;
end;
if char(baseAll,1) ^= "(" then baseAll = quote(strip(baseAll)); /* for paths with spaces */
- do k = 1 to kcountw(baseAll, "()", "QS"); drop k;
+ do k = 1 to kcountw(baseAll, "()", "QS"); /*drop k;*/
base = dequote(kscanx(baseAll, k, "()", "QS"));
length folder $ 64 file $ 1024 folderRef fileRef $ 8;
@@ -114,15 +137,21 @@ data _null_;
rc=filename(folderRef, base);
folderid=dopen(folderRef);
- putlog " ";
- put "/*" 100*"+" ;
+ %if 0=&quiet. %then
+ %do;
+ putlog " ";
+ put "/*" 100*"+" ;
+ %end;
do i=1 to dnum(folderId); drop i;
if i = 1 then
do;
+ %if 0=&quiet. %then
+ %do;
put " #";
put " # Listing packages for: " base;
put " #";
+ %end;
end;
folder = dread(folderId, i);
@@ -133,7 +162,7 @@ data _null_;
EOF = 0;
if fileId = 0 and lowcase(kscanx(folder, -1, ".")) = 'zip' then
- do;
+ do;
file = catx('/',base, folder);
rc1 = filename("package", strip(file), 'zip', 'member="description.sas"');
@@ -142,24 +171,43 @@ data _null_;
if rcE then /* if the description.sas exists in the zip then read it */
do;
- putlog " * ";
+ PackageZIPNumber+1;
length nn $ 96;
- if (96-lengthn(file)) < 1 then
- put " * " file;
- else
- do;
- nn = repeat("*", (96-lengthn(file)));
- put " * " file nn;
- end;
-
+ %if 0=&quiet. %then
+ %do;
+ putlog " * ";
+ if (96-lengthn(file)) < 1 then
+ put " * " file;
+ else
+ do;
+ nn = repeat("*", (96-lengthn(file)));
+ put " * " file nn;
+ end;
+ %end;
+
infile _DUMMY_ ZIP FILEVAR=file member="description.sas" end=EOF;
- do until(EOF);
+ n = 0;
+ do lineinfile = 1 by 1 until(EOF);
input;
- if strip(upcase(kscanx(_INFILE_,1,":"))) in ("PACKAGE" "TITLE" "VERSION" "AUTHOR" "MAINTAINER" "LICENSE") then
+
+ length tag $ 16 value $ 4096;
+
+ tag = strip(upcase(kscanx(_INFILE_,1,":")));
+ value = kscanx(_INFILE_,2,":");
+ n = whichc(tag, of TAGSLIST[*]);
+
+ if (n > 0) then
do;
- _INFILE_ = kscanx(_INFILE_,1,":") !! ":" !! kscanx(_INFILE_,2,":");
- putlog " * " _INFILE_;
+ %if 0=&quiet. %then
+ %do;
+ putlog " * " tag +(-1) ":" @ 17 value;
+ %end;
+ %if 1=&listDataSetCheck. %then
+ %do;
+ output &listDataSet.;
+ %end;
+ n=0;
end;
if strip(upcase(strip(_INFILE_))) =: "DESCRIPTION START:" then leave;
end;
@@ -170,15 +218,41 @@ data _null_;
rc = filename(fileRef);
end;
- putlog " * ";
- put 100*"+" "*/";
+ %if 0=&quiet. %then
+ %do;
+ putlog " * ";
+ put 100*"+" "*/";
+ %end;
rc = dclose(folderid);
rc = filename(folderRef);
end;
stop;
+ label
+ k = "Packages path ordering number."
+ base = "Packages path."
+ PackageZIPNumber = "Packages ZIP file number."
+ folder = "Packages ZIP file."
+ n = "Tag number"
+ tag = "Package Tag Name"
+ value = "Value"
+ ;
run;
+%if 1=&listDataSetCheck. %then
+ %do;
+ proc sort data=&listDataSet. out=&listDataSet.(compress=yes label='Output from the %listPackages() macro');
+ by baseNumber PackageZIPNumber tagNumber;
+ run;
+
+ %if 0=&quiet. %then
+ %do;
+ %put %str( );
+ %put # Results ptovided in the &listDataSet. data set. #;
+ %put %str( );
+ %end;
+ %end;
+
options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
%ENDoflistPackages:
diff --git a/SPF/Macros/loadpackage.sas b/SPF/Macros/loadpackage.sas
index ccbf78e..31f071b 100644
--- a/SPF/Macros/loadpackage.sas
+++ b/SPF/Macros/loadpackage.sas
@@ -36,7 +36,7 @@
*/
)/secure
/*** HELP END ***/
-des = 'Macro to load SAS package, version 20251231. Run %loadPackage() for help info.'
+des = 'Macro to load SAS package, version 20260125. Run %loadPackage() for help info.'
minoperator
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -52,7 +52,7 @@ minoperator
%put ### This is short help information for the `loadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to *load* SAS packages, version `20251231` #;
+ %put # Macro to *load* SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/loadpackageaddcnt.sas b/SPF/Macros/loadpackageaddcnt.sas
index 8800448..4c9c31e 100644
--- a/SPF/Macros/loadpackageaddcnt.sas
+++ b/SPF/Macros/loadpackageaddcnt.sas
@@ -19,7 +19,7 @@
is provided in required version */
)/secure
/*** HELP END ***/
-des = 'Macro to load additional content for a SAS package, version 20251231. Run %loadPackageAddCnt() for help info.'
+des = 'Macro to load additional content for a SAS package, version 20260125. Run %loadPackageAddCnt() for help info.'
minoperator
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -35,7 +35,7 @@ minoperator
%put ### This is short help information for the `loadPackageAddCnt` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to *load* additional content for a SAS package, version `20251231` #;
+ %put # Macro to *load* additional content for a SAS package, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/loadpackages.sas b/SPF/Macros/loadpackages.sas
index 968a032..2713c27 100644
--- a/SPF/Macros/loadpackages.sas
+++ b/SPF/Macros/loadpackages.sas
@@ -11,7 +11,7 @@
*/
)/secure
/*** HELP END ***/
-des = 'Macro to load multiple SAS packages at one run, version 20251231. Run %loadPackages() for help info.'
+des = 'Macro to load multiple SAS packages at one run, version 20260125. Run %loadPackages() for help info.'
parmbuff
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -27,7 +27,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro wrapper for the loadPackage macro, version `20251231` #;
+ %put # Macro wrapper for the loadPackage macro, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/previewpackage.sas b/SPF/Macros/previewpackage.sas
index 694654f..55ff273 100644
--- a/SPF/Macros/previewpackage.sas
+++ b/SPF/Macros/previewpackage.sas
@@ -23,7 +23,7 @@
*/
)/secure
/*** HELP END ***/
-des = 'Macro to preview content of a SAS package, version 20251231. Run %previewPackage() for help info.'
+des = 'Macro to preview content of a SAS package, version 20260125. Run %previewPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -38,7 +38,7 @@ des = 'Macro to preview content of a SAS package, version 20251231. Run %preview
%put ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to get preview of a SAS packages, version `20251231` #;
+ %put # Macro to get preview of a SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/relocatepackage.sas b/SPF/Macros/relocatepackage.sas
index 99d1b52..e6037f9 100644
--- a/SPF/Macros/relocatepackage.sas
+++ b/SPF/Macros/relocatepackage.sas
@@ -15,7 +15,7 @@
,psMAX=MAX /* pageSise in case executed inside DoSubL() */
,ods= /* a data set for results, e.g., work.relocatePackageReport */
)
-/ des = 'Utility macro that locally Copies or Moves Packages, version 20251231. Run %relocatePackage() for help info.'
+/ des = 'Utility macro that locally Copies or Moves Packages, version 20260125. Run %relocatePackage() for help info.'
secure
minoperator
;
@@ -33,7 +33,7 @@
%put ### This is short help information for the `relocatePackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to *locally copy or move* (relocate) SAS packages, version `20251231` #;
+ %put # Macro to *locally copy or move* (relocate) SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/saspackagesframeworknotes.sas b/SPF/Macros/saspackagesframeworknotes.sas
index e31080f..c57e3c1 100644
--- a/SPF/Macros/saspackagesframeworknotes.sas
+++ b/SPF/Macros/saspackagesframeworknotes.sas
@@ -5,7 +5,7 @@ SPFmacroName /* space separated list of names */
/
minoperator
secure
-des = 'Macro to provide help notes about SAS Packages Framework macros, version 20251231. Run %SasPackagesFrameworkNotes(HELP) for help info.'
+des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260125. Run %SasPackagesFrameworkNotes(HELP) for help info.'
;
%local list N i element;
%let list=
@@ -51,7 +51,7 @@ SasPackagesFrameworkNotes
%put ### This is short help information for the `SasPackagesFrameworkNotes` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro prints help notes for SAS Packages Framework macros, version `20251231` #;
+ %put # Macro prints help notes for SAS Packages Framework macros, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/spfint_gnpckg_arch.sas b/SPF/Macros/spfint_gnpckg_arch.sas
index b210439..6d06a09 100644
--- a/SPF/Macros/spfint_gnpckg_arch.sas
+++ b/SPF/Macros/spfint_gnpckg_arch.sas
@@ -1,6 +1,6 @@
/*+SPFint_gnPckg_arch+*/
%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 20251231.';
+des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the archive version generation part of the process. Version 20260125.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
diff --git a/SPF/Macros/spfint_gnpckg_markdown.sas b/SPF/Macros/spfint_gnpckg_markdown.sas
index be67ffe..4c9c563 100644
--- a/SPF/Macros/spfint_gnpckg_markdown.sas
+++ b/SPF/Macros/spfint_gnpckg_markdown.sas
@@ -1,6 +1,6 @@
/*+SPFint_gnPckg_markdown+*/
%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 20251231.';
+des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the markdown documentation part of the process. Version 20260125.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
@@ -112,7 +112,7 @@ data &filesWithCodes.markdown;
%end;
put " " / "---------------------------------------------------------------------" / " "
- / "*SAS package generated by SAS Package Framework, version `20251231`,*"
+ / "*SAS package generated by SAS Package Framework, version `20260125`,*"
/ "*under `&sysscp.`(`&sysscpl.`) operating system,*"
/ "*using SAS release: `&sysvlong4.`.*"
/ " " / "---------------------------------------------------------------------" / " ";
diff --git a/SPF/Macros/spfint_gnpckg_tests.sas b/SPF/Macros/spfint_gnpckg_tests.sas
index ef1fe77..f4208ba 100644
--- a/SPF/Macros/spfint_gnpckg_tests.sas
+++ b/SPF/Macros/spfint_gnpckg_tests.sas
@@ -1,6 +1,6 @@
/*+SPFint_gnPckg_tests+*/
%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 20251231.';
+des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the test part of the process. Version 20260125.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
diff --git a/SPF/Macros/splitcodeforpackage.sas b/SPF/Macros/splitcodeforpackage.sas
index f89eedd..e66b80f 100644
--- a/SPF/Macros/splitcodeforpackage.sas
+++ b/SPF/Macros/splitcodeforpackage.sas
@@ -8,7 +8,7 @@
,nobs=0 /* technical parameter */
)
/*** HELP END ***/
-/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20251231. Run %splitCodeForPackage() for help info.'
+/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260125. Run %splitCodeForPackage() for help info.'
;
%if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then
%do;
@@ -24,7 +24,7 @@
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Utility macro to *split* single file with SAS package code into multiple #;
- %put # files with separate snippets, version `20251231` #;
+ %put # files with separate snippets, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -400,7 +400,7 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ;
*/
if firstLine[j] then
do;
- put '/* File generated with help of SAS Packages Framework, version 20251231. */';
+ put '/* File generated with help of SAS Packages Framework, version 20260125. */';
firstLine[j]=0;
end;
put _infile_;
diff --git a/SPF/Macros/unbundlePackages.sas b/SPF/Macros/unbundlePackages.sas
index 5f3ca5d..fd07f80 100644
--- a/SPF/Macros/unbundlePackages.sas
+++ b/SPF/Macros/unbundlePackages.sas
@@ -8,7 +8,7 @@
,ods= /* data set for report file */
,verify=0
)/
-des='Macro to extract a bundle of SAS packages, version 20251231. Run %unbundlePackages(HELP) for help info.'
+des='Macro to extract a bundle of SAS packages, version 20260125. Run %unbundlePackages(HELP) for help info.'
secure
minoperator
;
@@ -26,7 +26,7 @@ minoperator
%put ### This is short help information for the `unbundlePackages` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to *extract* SAS packages from a bundle, version `20251231` #;
+ %put # Macro to *extract* SAS packages from a bundle, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/unloadpackage.sas b/SPF/Macros/unloadpackage.sas
index 28e2905..6f89a64 100644
--- a/SPF/Macros/unloadpackage.sas
+++ b/SPF/Macros/unloadpackage.sas
@@ -20,7 +20,7 @@
*/
)/secure
/*** HELP END ***/
-des = 'Macro to unload SAS package, version 20251231. Run %unloadPackage() for help info.'
+des = 'Macro to unload SAS package, version 20260125. Run %unloadPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -35,7 +35,7 @@ des = 'Macro to unload SAS package, version 20251231. Run %unloadPackage() for h
%put ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to unload SAS packages, version `20251231` #;
+ %put # Macro to unload SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/Macros/verifypackage.sas b/SPF/Macros/verifypackage.sas
index 352c59f..e90ac7e 100644
--- a/SPF/Macros/verifypackage.sas
+++ b/SPF/Macros/verifypackage.sas
@@ -13,7 +13,7 @@
hashing_file() function, SAS 9.4M6 */
)/secure
/*** HELP END ***/
-des = 'Macro to verify SAS package with the hash digest, version 20251231. Run %verifyPackage() for help info.'
+des = 'Macro to verify SAS package with the hash digest, version 20260125. Run %verifyPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -28,7 +28,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20251231. Run %
%put ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to verify SAS package with it hash digest, version `20251231` #;
+ %put # Macro to verify SAS package with it hash digest, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/SPF/SPFinit.md b/SPF/SPFinit.md
index 6e2d4d1..94ccf80 100644
--- a/SPF/SPFinit.md
+++ b/SPF/SPFinit.md
@@ -1,7 +1,7 @@
---
-# SAS Packages Framework, version `20251231`
+# SAS Packages Framework, version `20260125`
---
@@ -34,7 +34,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.
-In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20251231`**.
+In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20260125`**.
**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).
@@ -57,7 +57,7 @@ them using the SPF can be found [**HERE**](https://github.com/yabwon/HoW-SASPack
## This is short help information for the `installPackage` macro
--------------------------------------------------------------------------------------------
- Macro to install SAS packages, version `20251231`
+ Macro to install SAS packages, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -185,7 +185,7 @@ filename packages "C:/SAS_PACKAGES";
## This is short help information for the `helpPackage` macro
-------------------------------------------------------------------------------
- Macro to get help about SAS packages, version `20251231`
+ Macro to get help about SAS packages, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -263,7 +263,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `loadPackage` macro
-------------------------------------------------------------------------------
- Macro to *load* SAS packages, version `20251231`
+ Macro to *load* SAS packages, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -421,7 +421,7 @@ If created, those macros are automatically deleted when the `%unloadPackage()` m
## This is short help information for the `loadPackageS` macro
-------------------------------------------------------------------------------
- Macro wrapper for the loadPackage macro, version `20251231`
+ Macro wrapper for the loadPackage macro, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -472,7 +472,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `unloadPackage` macro
-------------------------------------------------------------------------------
- Macro to unload SAS packages, version `20251231`
+ Macro to unload SAS packages, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -539,7 +539,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `listPackages` macro
-----------------------------------------------------------------------------------------
- Macro to list available SAS packages, version `20251231`
+ Macro to list available SAS packages, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -550,7 +550,11 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
### Parameters:
- NO PARAMETERS
+ 1. `listDataSet` Name of a SAS data set to store results in.
+ No data set options are honored.
+
+ - `quiet=` *Optional.* Indicates if the LOG printout should be suspended.
+ Default value of zero (`0`) means "Do printout", other means "No".
When used as: `%listPackages(HELP)` it displays this help information.
@@ -576,13 +580,15 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
%include packages(SPFinit.sas); %* enable the framework;
%listPackages() %* list available packages;
+
+%listPackages(ListDS,quiet=1) %* save packages list in ListDS data set;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## This is short help information for the `verifyPackage` macro
-------------------------------------------------------------------------------
- Macro to verify SAS package with it hash digest, version `20251231`
+ Macro to verify SAS package with it hash digest, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -636,7 +642,7 @@ filename packages "C:/SAS_PACKAGES"; %* set-up a directory for packages;
## This is short help information for the `previewPackage` macro
-------------------------------------------------------------------------------
- Macro to get preview of a SAS packages, version `20251231`
+ Macro to get preview of a SAS packages, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -705,7 +711,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `generatePackage` macro
-------------------------------------------------------------------------------
- Macro to generate SAS packages, version `20251231`
+ Macro to generate SAS packages, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -938,7 +944,7 @@ All files have to have `.sas` extension. Other files are ignored.
## This is short help information for the `extendPackagesFileref` macro
-----------------------------------------------------------------------------------------
- Macro to list directories pointed by 'packages' fileref, version `20251231`
+ Macro to list directories pointed by 'packages' fileref, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -980,7 +986,7 @@ filename packages ("D:/NEW_DIR" %extendPackagesFileref()); %* add new directory;
## This is short help information for the `loadPackageAddCnt` macro
-------------------------------------------------------------------------------
- Macro to load *additional content* for a SAS package, version `20251231`
+ Macro to load *additional content* for a SAS package, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1074,7 +1080,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
-------------------------------------------------------------------------------
Utility macro to *split* single file with SAS package code into multiple
- files with separate snippets, version `20251231`
+ files with separate snippets, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1155,7 +1161,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `relocatePackage` macro
-------------------------------------------------------------------------------
- Macro to *locally copy or move* (relocate) SAS packages, version `20251231`
+ Macro to *locally copy or move* (relocate) SAS packages, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1267,7 +1273,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `isPackagesFilerefOK` macro
-----------------------------------------------------------------------------------------
- Macro to check if the `packages` fileref is "correct", version `20251231`
+ Macro to check if the `packages` fileref is "correct", version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1318,7 +1324,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `SasPackagesFrameworkNotes` macro
-------------------------------------------------------------------------------
- Macro prints help notes for SAS Packages Framework macros, version `20251231`
+ Macro prints help notes for SAS Packages Framework macros, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1368,7 +1374,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `bundlePackages` macro
-------------------------------------------------------------------------------
- Macro to *create bundles* of SAS packages, version `20251231`
+ Macro to *create bundles* of SAS packages, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1437,7 +1443,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `unbundlePackages` macro
-------------------------------------------------------------------------------
- Macro to *extract* SAS packages from a bundle, version `20251231`
+ Macro to *extract* SAS packages from a bundle, version `20260125`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
diff --git a/SPF/SPFinit.sas b/SPF/SPFinit.sas
index fb7f8e4..8c60412 100644
--- a/SPF/SPFinit.sas
+++ b/SPF/SPFinit.sas
@@ -43,7 +43,7 @@
- to unload, or
- to generate SAS packages.
- Version 20251231.
+ Version 20260125.
See examples below.
A SAS package is a zip file containing a group of files
@@ -101,7 +101,7 @@ Contributors:
*/
)/secure
/*** HELP END ***/
-des = 'Macro to load SAS package, version 20251231. Run %loadPackage() for help info.'
+des = 'Macro to load SAS package, version 20260125. Run %loadPackage() for help info.'
minoperator
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -117,7 +117,7 @@ minoperator
%put ### This is short help information for the `loadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to *load* SAS packages, version `20251231` #;
+ %put # Macro to *load* SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -394,7 +394,7 @@ minoperator
*/
)/secure
/*** HELP END ***/
-des = 'Macro to unload SAS package, version 20251231. Run %unloadPackage() for help info.'
+des = 'Macro to unload SAS package, version 20260125. Run %unloadPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -409,7 +409,7 @@ des = 'Macro to unload SAS package, version 20251231. Run %unloadPackage() for h
%put ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to unload SAS packages, version `20251231` #;
+ %put # Macro to unload SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -562,7 +562,7 @@ des = 'Macro to unload SAS package, version 20251231. Run %unloadPackage() for h
*/
)/secure
/*** HELP END ***/
-des = 'Macro to get help about SAS package, version 20251231. Run %helpPackage() for help info.'
+des = 'Macro to get help about SAS package, version 20260125. Run %helpPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -577,7 +577,7 @@ des = 'Macro to get help about SAS package, version 20251231. Run %helpPackage()
%put ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to get help about SAS packages, version `20251231` #;
+ %put # Macro to get help about SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -720,7 +720,7 @@ TODO:
*/
/*+installPackage+*/
-/* Macros to install SAS packages, version 20251231 */
+/* Macros to install SAS packages, version 20260125 */
/* 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
@@ -747,7 +747,7 @@ TODO:
/secure
minoperator
/*** HELP END ***/
-des = 'Macro to install SAS package, version 20251231. Run %%installPackage() for help info.'
+des = 'Macro to install SAS package, version 20260125. Run %%installPackage() for help info.'
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do;
@@ -762,7 +762,7 @@ des = 'Macro to install SAS package, version 20251231. Run %%installPackage() fo
%put ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;;
%put # #;
- %put # Macro to install SAS packages, version `20251231` #;
+ %put # Macro to install SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -1414,7 +1414,7 @@ des = 'Macro to install SAS package, version 20251231. Run %%installPackage() fo
Macro to list SAS packages in packages folder.
- Version 20251231
+ Version 20260125
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1432,11 +1432,13 @@ des = 'Macro to install SAS package, version 20251231. Run %%installPackage() fo
*//*** HELP END ***/
-%macro listPackages()
-/secure PARMBUFF
-des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20251231.'
+%macro listPackages(
+ listDataSet /* Name of a data set to save results */
+, quiet = 0 /* Indicate if results should be printed in log */
+)/secure parmbuff
+des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20260125.'
;
-%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
+%if (%QUPCASE(&listDataSet.) = HELP) %then
%do;
%local options_tmp ;
%let options_tmp = ls=%sysfunc(getoption(ls)) ps=%sysfunc(getoption(ps))
@@ -1449,7 +1451,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%put ### This is short help information for the `listPackages` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
- %put # Macro to list available SAS packages, version `20251231` #;
+ %put # Macro to list available SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -1460,7 +1462,11 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%put # #;
%put #### Parameters: #;
%put # #;
- %put # NO PARAMETERS #;
+ %put # 1. `listDataSet` Name of a SAS data set to store results in. #;
+ %put # No data set options are honored. #;
+ %put # #;
+ %put # - `quiet=` *Optional.* Indicates if the LOG printout should be suspended. #;
+ %put # Default value of zero (`0`) means "Do printout", other means "No". #;
%put # #;
%put # When used as: `%nrstr(%%listPackages(HELP))` it displays this help information. #;
%put # #;
@@ -1485,6 +1491,8 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%put %nrstr( %%include packages(SPFinit.sas); %%* enable the framework; );
%put ;
%put %nrstr( %%listPackages() %%* list available packages; );
+ %put ;
+ %put %nrstr( %%listPackages(ListDS,quiet=1) %%* save packages list in ListDS data set; );
%put ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
%put ###########################################################################################;
%put ;
@@ -1492,30 +1500,47 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%GOTO ENDoflistPackages;
%end;
-%local ls_tmp ps_tmp notes_tmp source_tmp filesWithCodes;
-
-%let filesWithCodes = WORK._%sysfunc(datetime(), hex16.)_;
+%local ls_tmp ps_tmp notes_tmp source_tmp listDataSetCheck ;
%let ls_tmp = %sysfunc(getoption(ls));
%let ps_tmp = %sysfunc(getoption(ps));
%let notes_tmp = %sysfunc(getoption(notes));
%let source_tmp = %sysfunc(getoption(source));
+%let listDataSetCheck=0;
+
+%let quiet = %sysevalf(NOT(0=%superq(quiet)));
options NOnotes NOsource ls=MAX ps=MAX;
data _null_;
- length baseAll $ 32767 base $ 1024;
+ length listDataSet $ 41;
+ listDataSet = strip(scan(symget('listDataSet'),1,'( )'));
+ call symputX('listDataSet',listDataSet,"L");
+ if not (listDataSet = " ") then
+ call symputX('listDataSetCheck',1,"L");
+ else call symputX('quiet',0,"L");
+run;
+
+data _null_
+ %if 1=&listDataSetCheck. %then
+ %do;
+ &listDataSet.(compress=yes keep=k base PackageZIPNumber folder n tag value rename=(folder=PackageZIP k=baseNumber n=tagNumber))
+ %end;
+;
+ length k 8 baseAll $ 32767 base $ 1024 PackageZIPNumber 8;
baseAll = pathname("packages");
+ array TAGSLIST[6] $ 16 _temporary_ ("PACKAGE" "TITLE" "VERSION" "AUTHOR" "MAINTAINER" "LICENSE");
+
if baseAll = " " then
do;
- put "NOTE: The file reference PACKAGES is not assigned.";
+ put "WARNING: The file reference PACKAGES is not assigned.";
stop;
end;
if char(baseAll,1) ^= "(" then baseAll = quote(strip(baseAll)); /* for paths with spaces */
- do k = 1 to kcountw(baseAll, "()", "QS"); drop k;
+ do k = 1 to kcountw(baseAll, "()", "QS"); /*drop k;*/
base = dequote(kscanx(baseAll, k, "()", "QS"));
length folder $ 64 file $ 1024 folderRef fileRef $ 8;
@@ -1525,15 +1550,21 @@ data _null_;
rc=filename(folderRef, base);
folderid=dopen(folderRef);
- putlog " ";
- put "/*" 100*"+" ;
+ %if 0=&quiet. %then
+ %do;
+ putlog " ";
+ put "/*" 100*"+" ;
+ %end;
do i=1 to dnum(folderId); drop i;
if i = 1 then
do;
+ %if 0=&quiet. %then
+ %do;
put " #";
put " # Listing packages for: " base;
put " #";
+ %end;
end;
folder = dread(folderId, i);
@@ -1544,7 +1575,7 @@ data _null_;
EOF = 0;
if fileId = 0 and lowcase(kscanx(folder, -1, ".")) = 'zip' then
- do;
+ do;
file = catx('/',base, folder);
rc1 = filename("package", strip(file), 'zip', 'member="description.sas"');
@@ -1553,24 +1584,43 @@ data _null_;
if rcE then /* if the description.sas exists in the zip then read it */
do;
- putlog " * ";
+ PackageZIPNumber+1;
length nn $ 96;
- if (96-lengthn(file)) < 1 then
- put " * " file;
- else
- do;
- nn = repeat("*", (96-lengthn(file)));
- put " * " file nn;
- end;
-
+ %if 0=&quiet. %then
+ %do;
+ putlog " * ";
+ if (96-lengthn(file)) < 1 then
+ put " * " file;
+ else
+ do;
+ nn = repeat("*", (96-lengthn(file)));
+ put " * " file nn;
+ end;
+ %end;
+
infile _DUMMY_ ZIP FILEVAR=file member="description.sas" end=EOF;
- do until(EOF);
+ n = 0;
+ do lineinfile = 1 by 1 until(EOF);
input;
- if strip(upcase(kscanx(_INFILE_,1,":"))) in ("PACKAGE" "TITLE" "VERSION" "AUTHOR" "MAINTAINER" "LICENSE") then
+
+ length tag $ 16 value $ 4096;
+
+ tag = strip(upcase(kscanx(_INFILE_,1,":")));
+ value = kscanx(_INFILE_,2,":");
+ n = whichc(tag, of TAGSLIST[*]);
+
+ if (n > 0) then
do;
- _INFILE_ = kscanx(_INFILE_,1,":") !! ":" !! kscanx(_INFILE_,2,":");
- putlog " * " _INFILE_;
+ %if 0=&quiet. %then
+ %do;
+ putlog " * " tag +(-1) ":" @ 17 value;
+ %end;
+ %if 1=&listDataSetCheck. %then
+ %do;
+ output &listDataSet.;
+ %end;
+ n=0;
end;
if strip(upcase(strip(_INFILE_))) =: "DESCRIPTION START:" then leave;
end;
@@ -1581,15 +1631,41 @@ data _null_;
rc = filename(fileRef);
end;
- putlog " * ";
- put 100*"+" "*/";
+ %if 0=&quiet. %then
+ %do;
+ putlog " * ";
+ put 100*"+" "*/";
+ %end;
rc = dclose(folderid);
rc = filename(folderRef);
end;
stop;
+ label
+ k = "Packages path ordering number."
+ base = "Packages path."
+ PackageZIPNumber = "Packages ZIP file number."
+ folder = "Packages ZIP file."
+ n = "Tag number"
+ tag = "Package Tag Name"
+ value = "Value"
+ ;
run;
+%if 1=&listDataSetCheck. %then
+ %do;
+ proc sort data=&listDataSet. out=&listDataSet.(compress=yes label='Output from the %listPackages() macro');
+ by baseNumber PackageZIPNumber tagNumber;
+ run;
+
+ %if 0=&quiet. %then
+ %do;
+ %put %str( );
+ %put # Results ptovided in the &listDataSet. data set. #;
+ %put %str( );
+ %end;
+ %end;
+
options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
%ENDoflistPackages:
@@ -1601,7 +1677,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
Macro to generate SAS packages.
- Version 20251231
+ Version 20260125
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1651,7 +1727,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
when empty takes buildLocation */
)/ secure minoperator
/*** HELP END ***/
-des = 'Macro to generate SAS packages, version 20251231. Run %generatePackage() for help info.'
+des = 'Macro to generate SAS packages, version 20260125. Run %generatePackage() for help info.'
;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do;
@@ -1666,7 +1742,7 @@ des = 'Macro to generate SAS packages, version 20251231. Run %generatePackage()
%put ### This is short help information for the `generatePackage` macro #;
%put #------------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to generate SAS packages, version `20251231` #;
+ %put # Macro to generate SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -2548,7 +2624,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
title&_titleNumber_. "Package ZIP file location is: &buildLocation.";
%end;
-footnote1 "SAS Packages Framework, version 20251231";
+footnote1 "SAS Packages Framework, version 20260125";
proc print
data = &filesWithCodes.(drop=base build folderRef fileRef rc folderid _abort_ fileId additionalContent)
@@ -3367,7 +3443,7 @@ data _null_;
%end;
put +(-1) '`.;'''
/ ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"'
- / ' !! '' %put with the SAS Packages Framework version 20251231.;'''
+ / ' !! '' %put with the SAS Packages Framework version 20260125.;'''
/ ' !! '' %put ****************************************************************************;'''
/ ' !! '' %GOTO theEndOfTheMacro;'''
/ ' !! '' %end;''' ;
@@ -3531,7 +3607,7 @@ data _null_;
%end;
put +(-1) '`.; '' !!' /
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !! ' /
- ''' %put with the SAS Packages Framework version 20251231.; '' !! ' /
+ ''' %put with the SAS Packages Framework version 20260125.; '' !! ' /
''' %put ****************************************************************************; '' !! ' /
''' %GOTO theEndOfTheMacro; '' !! ' /
''' %end; '' !! ' /
@@ -4334,7 +4410,7 @@ data _null_;
%end;
put 'put " " / @3 "---------------------------------------------------------------------" / " ";'
- / 'put @3 "*SAS package generated by SAS Package Framework, version `20251231`*";'
+ / 'put @3 "*SAS package generated by SAS Package Framework, version `20260125`*";'
/ "put @3 '*under `&sysscp.`(`&sysscpl.`) operating system,*';"
/ "put @3 '*using SAS release: `&sysvlong4.`.*';"
/ 'put " " / @3 "---------------------------------------------------------------------";';
@@ -4773,7 +4849,7 @@ options &qlenmax_fstimer_tmp.;
/*+SPFint_gnPckg_tests+*/
%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 20251231.';
+des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the test part of the process. Version 20260125.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
@@ -5422,7 +5498,7 @@ options "elenmax_tmp.;
/*+SPFint_gnPckg_markdown+*/
%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 20251231.';
+des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the markdown documentation part of the process. Version 20260125.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
@@ -5534,7 +5610,7 @@ data &filesWithCodes.markdown;
%end;
put " " / "---------------------------------------------------------------------" / " "
- / "*SAS package generated by SAS Package Framework, version `20251231`,*"
+ / "*SAS package generated by SAS Package Framework, version `20260125`,*"
/ "*under `&sysscp.`(`&sysscpl.`) operating system,*"
/ "*using SAS release: `&sysvlong4.`.*"
/ " " / "---------------------------------------------------------------------" / " ";
@@ -5675,7 +5751,7 @@ options &MarkDownOptionsTmp.;
/*+SPFint_gnPckg_arch+*/
%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 20251231.';
+des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the archive version generation part of the process. Version 20260125.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
@@ -5842,7 +5918,7 @@ TODO: (in Polish)
*/
)/secure
/*** HELP END ***/
-des = 'Macro to load multiple SAS packages at one run, version 20251231. Run %loadPackages() for help info.'
+des = 'Macro to load multiple SAS packages at one run, version 20260125. Run %loadPackages() for help info.'
parmbuff
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -5858,7 +5934,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro wrapper for the loadPackage macro, version `20251231` #;
+ %put # Macro wrapper for the loadPackage macro, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -5956,7 +6032,7 @@ parmbuff
hashing_file() function, SAS 9.4M6 */
)/secure
/*** HELP END ***/
-des = 'Macro to verify SAS package with the hash digest, version 20251231. Run %verifyPackage() for help info.'
+des = 'Macro to verify SAS package with the hash digest, version 20260125. Run %verifyPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -5971,7 +6047,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20251231. Run %
%put ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to verify SAS package with it hash digest, version `20251231` #;
+ %put # Macro to verify SAS package with it hash digest, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6154,7 +6230,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20251231. Run %
*/
)/secure
/*** HELP END ***/
-des = 'Macro to preview content of a SAS package, version 20251231. Run %previewPackage() for help info.'
+des = 'Macro to preview content of a SAS package, version 20260125. Run %previewPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -6169,7 +6245,7 @@ des = 'Macro to preview content of a SAS package, version 20251231. Run %preview
%put ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to get preview of a SAS packages, version `20251231` #;
+ %put # Macro to get preview of a SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6301,7 +6377,7 @@ des = 'Macro to preview content of a SAS package, version 20251231. Run %preview
when empty the "packages" value is used */
)/secure
/*** HELP END ***/
-des = 'Macro to list directories pointed by "packages" fileref, version 20251231. Run %extendPackagesFileref(HELP) for help info.'
+des = 'Macro to list directories pointed by "packages" fileref, version 20260125. Run %extendPackagesFileref(HELP) for help info.'
;
%if %QUPCASE(&packages.) = HELP %then
@@ -6317,7 +6393,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20251231
%put ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
- %put # Macro to list directories pointed by 'packages' fileref, version `20251231` #;
+ %put # Macro to list directories pointed by 'packages' fileref, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6419,7 +6495,7 @@ filename packages list;
is provided in required version */
)/secure
/*** HELP END ***/
-des = 'Macro to load additional content for a SAS package, version 20251231. Run %loadPackageAddCnt() for help info.'
+des = 'Macro to load additional content for a SAS package, version 20260125. Run %loadPackageAddCnt() for help info.'
minoperator
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -6435,7 +6511,7 @@ minoperator
%put ### This is short help information for the `loadPackageAddCnt` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to *load* additional content for a SAS package, version `20251231` #;
+ %put # Macro to *load* additional content for a SAS package, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6804,7 +6880,7 @@ minoperator
,nobs=0 /* technical parameter */
)
/*** HELP END ***/
-/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20251231. Run %splitCodeForPackage() for help info.'
+/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260125. Run %splitCodeForPackage() for help info.'
;
%if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then
%do;
@@ -6820,7 +6896,7 @@ minoperator
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Utility macro to *split* single file with SAS package code into multiple #;
- %put # files with separate snippets, version `20251231` #;
+ %put # files with separate snippets, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -7196,7 +7272,7 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ;
*/
if firstLine[j] then
do;
- put '/* File generated with help of SAS Packages Framework, version 20251231. */';
+ put '/* File generated with help of SAS Packages Framework, version 20260125. */';
firstLine[j]=0;
end;
put _infile_;
@@ -7229,7 +7305,7 @@ options &options_tmp2.;
,psMAX=MAX /* pageSise in case executed inside DoSubL() */
,ods= /* a data set for results, e.g., work.relocatePackageReport */
)
-/ des = 'Utility macro that locally Copies or Moves Packages, version 20251231. Run %relocatePackage() for help info.'
+/ des = 'Utility macro that locally Copies or Moves Packages, version 20260125. Run %relocatePackage() for help info.'
secure
minoperator
;
@@ -7247,7 +7323,7 @@ options &options_tmp2.;
%put ### This is short help information for the `relocatePackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to *locally copy or move* (relocate) SAS packages, version `20251231` #;
+ %put # Macro to *locally copy or move* (relocate) SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -7905,7 +7981,7 @@ filename PACKAGES ("R:\testPackages2" "R:\testPackages1");
vERRb /* indicates if macro should be verbose and report errors */
)
/ minoperator PARMBUFF
-des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20251231.'
+des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20260125.'
;
/*** HELP END ***/
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
@@ -7921,7 +7997,7 @@ des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFile
%put ### This is short help information for the `isPackagesFilerefOK` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
- %put # Macro to check if the `packages` fileref is "correct", version `20251231` #;
+ %put # Macro to check if the `packages` fileref is "correct", version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -8055,7 +8131,7 @@ SPFmacroName /* space separated list of names */
/
minoperator
secure
-des = 'Macro to provide help notes about SAS Packages Framework macros, version 20251231. Run %SasPackagesFrameworkNotes(HELP) for help info.'
+des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260125. Run %SasPackagesFrameworkNotes(HELP) for help info.'
;
%local list N i element;
%let list=
@@ -8101,7 +8177,7 @@ SasPackagesFrameworkNotes
%put ### This is short help information for the `SasPackagesFrameworkNotes` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro prints help notes for SAS Packages Framework macros, version `20251231` #;
+ %put # Macro prints help notes for SAS Packages Framework macros, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -8224,7 +8300,7 @@ options mlogic symbolgen;
,packagesRef=packages
,ods= /* data set for report file */
)/
-des='Macro to create a bundle of SAS packages, version 20251231. Run %bundlePackages(HELP) for help info.'
+des='Macro to create a bundle of SAS packages, version 20260125. Run %bundlePackages(HELP) for help info.'
secure minoperator
;
@@ -8241,7 +8317,7 @@ secure minoperator
%put ### This is short help information for the `bundlePackages` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to *create bundles* of SAS packages, version `20251231` #;
+ %put # Macro to *create bundles* of SAS packages, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -8726,7 +8802,7 @@ filename p2 "R:/dontexist";
,ods= /* data set for report file */
,verify=0
)/
-des='Macro to extract a bundle of SAS packages, version 20251231. Run %unbundlePackages(HELP) for help info.'
+des='Macro to extract a bundle of SAS packages, version 20260125. Run %unbundlePackages(HELP) for help info.'
secure
minoperator
;
@@ -8744,7 +8820,7 @@ minoperator
%put ### This is short help information for the `unbundlePackages` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
- %put # Macro to *extract* SAS packages from a bundle, version `20251231` #;
+ %put # Macro to *extract* SAS packages from a bundle, version `20260125` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
diff --git a/packages/README.md b/packages/README.md
index e2e7267..49dd072 100644
--- a/packages/README.md
+++ b/packages/README.md
@@ -61,7 +61,7 @@ SHA256 digest for DFA: F*012375D87F66EB3A7BF5DDD0CC5AEE28851733EE33CC63231DF9045
---
-- **macroArray**\[1.2.6\], implementation of an array concept in a macro language, e.g.
+- **macroArray**\[1.3.0\], implementation of an array concept in a macro language, e.g.
```sas
%array(ABC[17] (111:127), macarray=Y);
@@ -80,7 +80,7 @@ SHA256 digest for DFA: F*012375D87F66EB3A7BF5DDD0CC5AEE28851733EE33CC63231DF9045
which = 1:H:2
);
```
-SHA256 digest for macroArray: F*3F3893F1FCD78719543703E4353F4CC19811D247C016F220FF729B283C1AD790
+SHA256 digest for macroArray: F*C6C2B5507B6590365222FC764076E294CCE3AAE99971D9CAA942F8BAEBEFAE24
[Documentation for macroArray](https://github.com/SASPAC/blob/main/macroarray.md "Documentation for macroArray")
diff --git a/packages/SHA256_for_packages.txt b/packages/SHA256_for_packages.txt
index e3963e7..a656188 100644
--- a/packages/SHA256_for_packages.txt
+++ b/packages/SHA256_for_packages.txt
@@ -1,3 +1,6 @@
+/* 20260113 */
+macroArray: F*C6C2B5507B6590365222FC764076E294CCE3AAE99971D9CAA942F8BAEBEFAE24
+
/* 20251122 */
SQLinDS: F*606A24A2A6B06DAAD2D443FA9A9819D9564235A5CD8599FD15586F1EFFCB41BC
diff --git a/packages/macroarray.md b/packages/macroarray.md
index 58b4192..af8be65 100644
--- a/packages/macroarray.md
+++ b/packages/macroarray.md
@@ -1,27 +1,36 @@
-- [The macroArray package](#macroarray)
-- [Content description](#content-description)
- * [`%appendArray()` macro](#appendarray-macro)
- * [`%appendCell()` macro](#appendcell-macro)
- * [`%array()` macro](#array-macro)
- * [`%concatArrays()` macro](#concatarrays-macro)
- * [`%deleteMacArray()` macro](#deletemacarray-macro)
- * [`%do_over()` macro](#do-over-macro)
- * [`%do_over2()` macro](#do-over2-macro)
- * [`%do_over3()` macro](#do-over3-macro)
- * [`%make_do_over()` macro](#make-do-over-macro)
- * [`%mcHashTable()` macro](#mchashtable-macro)
- * [`%mcDictionary()` macro](#mcdictionary-macro)
- * [`%QzipArrays()` macro](#qziparrays-macro)
- * [`%zipArrays()` macro](#ziparrays-macro)
- * [`%sortMacroArray()` macro](#sortmacroarray-macro)
+# Documentation for the `macroArray` package.
+
+----------------------------------------------------------------
+
+ *Macroarrays for macro codes*
+
+----------------------------------------------------------------
+
+### Version information:
+
+- Package: macroArray
+- Version: 1.3.0
+- Generated: 2026-01-13T15:30:15
+- Author(s): Bartosz Jablonski (yabwon@gmail.com)
+- Maintainer(s): Bartosz Jablonski (yabwon@gmail.com)
+- License: MIT
+- File SHA256: `F*C6C2B5507B6590365222FC764076E294CCE3AAE99971D9CAA942F8BAEBEFAE24` for this version
+- Content SHA256: `C*9119F3A4C7C4D859C7FB03373AB4FE6551CD7BDFA42BA9B4303D36C367BC8855` for this version
- * [License](#license)
-
---
+
+# The `macroArray` package, version: `1.3.0`;
+
+---
+
-# The macroArray package [ver. 1.2.6] ###############################################
+The **macroArray** package implements a macroarray facility.
-The **macroArray** package implements a macroarray facility:
+The set of macros, which emulates classic
+data-step-array functionality on the macro
+programming level, is provided.
+
+Some of components are:
- `%array()`,
- `%do_over()`,
- `%make_do_over()`,
@@ -34,10 +43,6 @@ The **macroArray** package implements a macroarray facility:
- `%mcDictionary()`,
- etc.
-The set of macros, which emulates classic
-data-step-array functionality on the macro
-programming level, is provided.
-
*Note:*
If you are working with BIG macroarrays do not
forget to verify your session setting for macro
@@ -56,35 +61,51 @@ to verify the following options:
---
-Package contains:
- 1. macro appendarray
- 2. macro appendcell
- 3. macro array
- 4. macro concatarrays
- 5. macro deletemacarray
- 6. macro do_over
- 7. macro do_over2
- 8. macro do_over3
- 9. macro make_do_over
- 10. macro mcdictionary
- 11. macro mchashtable
- 12. macro qziparrays
- 13. macro sortmacroarray
- 14. macro ziparrays
-
-Required SAS Components:
- *Base SAS Software*
-
-*SAS package generated by generatePackage, version 20231123*
-
-The SHA256 hash digest for package macroArray:
-`F*3F3893F1FCD78719543703E4353F4CC19811D247C016F220FF729B283C1AD790`
-
+
---
-# Content description ############################################################################################
-## >>> `%appendArray()` macro: <<< ############
-
+
+---
+
+Required SAS Components:
+ - Base SAS Software
+
+---
+
+
+---------------------------------------------------------------------
+
+*SAS package generated by SAS Package Framework, version `20251231`,*
+*under `WIN`(`X64_10PRO`) operating system,*
+*using SAS release: `9.04.01M9P06042025`.*
+
+---------------------------------------------------------------------
+
+# The `macroArray` package content
+The `macroArray` package consists of the following content:
+
+1. [`%appendarray()` macro ](#appendarray-macro-1 )
+2. [`%appendcell()` macro ](#appendcell-macro-2 )
+3. [`%array()` macro ](#array-macro-3 )
+4. [`%concatarrays()` macro ](#concatarrays-macro-4 )
+5. [`%deletemacarray()` macro ](#deletemacarray-macro-5 )
+6. [`%do_over()` macro ](#doover-macro-6 )
+7. [`%do_over2()` macro ](#doover2-macro-7 )
+8. [`%do_over3()` macro ](#doover3-macro-8 )
+9. [`%make_do_over()` macro ](#makedoover-macro-9 )
+10. [`%mcdictionary()` macro ](#mcdictionary-macro-10 )
+11. [`%mchashtable()` macro ](#mchashtable-macro-11 )
+12. [`%qziparrays()` macro ](#qziparrays-macro-12 )
+13. [`%sortmacroarray()` macro ](#sortmacroarray-macro-13 )
+14. [`%ziparrays()` macro ](#ziparrays-macro-14 )
+
+
+15. [License note](#license)
+
+---
+
+## `%appendarray()` macro ######
+
The `%appendArray()` macro is a macrowrapper
which allows to concatenate two macroarrays
created by `%array()` macro.
@@ -111,9 +132,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
2. `second` - *Required*, a name of a macroarray created by the `%array()` macro.
-
-
-
+
### EXAMPLES AND USECASES: ######################################################
**EXAMPLE 1.** Append macroarrays LL and MM.
@@ -146,10 +165,11 @@ The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
-
+
+---
+
+## `%appendcell()` macro ######
-## >>> `%appendCell()` macro: <<< ##############
-
The `%appendCell()` macro allows to append
a macrovariable to a macroarray created by the `%array()` macro.
@@ -176,10 +196,8 @@ The basic syntax is the following, the `<...>` means optional parameters:
3. `hilo` - *Required*, if `H` macrovariable is appended at the end
if `L` macrovariable is appended at the beginning
-);
-
-
+
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Create two macro wrappers.
@@ -235,10 +253,11 @@ The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
-
-
-## >>> `%array()` macro: <<< #######################
-
+
+---
+
+## `%array()` macro ######
+
The code of a macro was inspired by
*Ted Clay's* and *David Katz's* macro `%array()`.
@@ -351,8 +370,6 @@ The basic syntax is the following, the `<...>` means optional parameters:
Value `1` is for apostrophes, value `2` is for double quotes.
Ignored for `macarray=M`.
-
----
### EXAMPLES AND USECASES: ####################################################
@@ -611,9 +628,11 @@ The basic syntax is the following, the `<...>` means optional parameters:
---
-
+
+---
+
+## `%concatarrays()` macro ######
-## >>> `%concatArrays()` macro: <<< ###########
The `%concatArrays()` macro allows to concatenate
two macroarrays created by the `%array()` macro.
@@ -644,9 +663,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
* `removeSecond=Y` - *Optional*, default value `Y`, if set to `Y` then
the second array is removed.
-
-
-
+
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Concatenate macroarrays LL and MM.
@@ -679,10 +696,11 @@ The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
-
+
+---
+
+## `%deletemacarray()` macro ######
-## >>> `%deleteMacArray()` macro: <<< #######
-
The `%deleteMacArray()` macro allows to delete
macroarrays created by the `%array()` macro.
@@ -702,15 +720,15 @@ The basic syntax is the following, the `<...>` means optional parameters:
1. `arrs` - *Required*, a space separated list of manes
of macroarray created by the `%array()` macro.
-
+
* `macarray=N` - *Optional*, indicator should a macro
associated with macroarray to be deleted?
If `Y` or `YES` then the associated macro is deleted.
-
-
+
+---
-## >>> `%do_over()` macro: <<< ######################
+## `%do_over()` macro ######
The code of the macro was inspired by
*Ted Clay's* and *David Katz's* macro `%do_over()`.
@@ -725,17 +743,22 @@ The `%do_over()` macro executes like a pure macro code.
The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~sas
%do_over(
- array
- <,phrase=%nrstr(%&array(&_I_.))>
- <,between=%str( )>
+ arrays
+ <,phrase = %nrstr(%&array(&_I_.))>
+ <,between = %str( )>
<,which = >
+ <,check = 0>
+ <,rephrase = >
+ <,trigger = ?>
+ <,unq = 1>
)
~~~~~~~~~~~~~~~~~~~~~~~
**Arguments description**:
-1. `array` - *Required*, indicates a macroarray which metadata (Lbound, Hbouns)
- are to be used to loop in the `%do_over()`
+1. `arrays` - *Required*, a space-separated list of macroarrays names.
+ The first one identifies the macroarray which metadata
+ (Lbound, Hbouns, and N) are used to loop in the `%do_over()`.
* `phrase=` - *Optional*, Default value `%nrstr(%&array(&_I_.))`,
a statement to be called in each iteration
@@ -750,7 +773,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
If macroquoted (e.g. `%str( + )`) then the `%unquote()`
function is automatically applied.
-* `which=` - *Optional*, a _SPACE_ separated list of indexes which
+* `which=` - *Optional*, a space-separated list of indexes which
should be used to iterate over selected macroarray.
Possible special characters are `H` and `L` which means
*high* and *low* bound of an array, list could be set with
@@ -758,15 +781,58 @@ The basic syntax is the following, the `<...>` means optional parameters:
if `by` is omitted the default is `1`. If possible use
`1:5` rather `1 2 3 4 5` since the firs works faster.
+* `check=` - *Optional*, indicates should a check for a macro corresponding
+ to a macroarray be executed. If the macro does not exist warning
+ is issued and the `do_over` stops.
+ Default value `0` means: do not execute check.
+* `rephrase=` - *Optional*, this parameter allows for an alternative approach
+ in providing the phrase to be looped over. The idea is to make
+ writing the phrase string code more convenient and easy to grasp.
+ The value is a string containing triggers (symbols) that are
+ replaced by proper macroarray calls. For example, if a macroarray
+ `myArr` has 7 values form `varName1` to `varName7` and you want
+ to use them as arguments in code renaming variables, say
+ `rename old_varName1=new_varName1 ... ;`, instead typing phrase:
+ `rename %do_over(myArr,phrase=%nrstr(old_%myArr(&_I_.)=new_%myArr(&_I_.)));`
+ you can type much easier rephrase:
+ `rename %do_over(myArr,rephrase=old_?=new_?);`,
+ and all `?` will be replaced, under the hood, by calls to the macroarray.
+ For easier debugging the `do_over` macro prints the rephrased string
+ before and after change.
+ When the `do_over` loops with multiple array, say `myArrA`, `myArrB`,
+ and `myArrC`, then those arrays should be referred by `?1?`, `?2?`,
+ and `?3?` respectively.
+ See `trigger` parameter definition to learn more.
+ If both `phrase` and `rephrase` are used, the second takes precedence.
+* `trigger=` - *Optional*, a single byte character (symbol) used for marking
+ macroarrays in the newly created phrase.
+ Default value is `?` symbol.
+ When one macroarray is used, only the symbol should be used in
+ `rephrase=` string. When multiple macroarrays are used then the
+ symbol should surround a number identifying array, e.g. `?2?`.
+ See examples below for details.
+
+* `unq=` - *Optional*, indicates that the `%unquote()` macro function should
+ be added around every macroarray call. Because of SAS internal
+ behavior `unq=1` is needed for certain cases when plain 4GL code
+ is used in `rephrase=`. For example, let macro array `myArr()`
+ has 3 values: `A1`, `B2`, and `C3`. When the following code
+ is run: `%do_over(myArr, rephrase=data ?_test; run;)` without
+ `unq=1`, SAS will create 4 data sets: `A1`, `B2`, `C3`,
+ and `_test`, instead 3 data sets: `A1_test`, `B2_test`, and `C3_test`.
+ Default value `1` means: add the `%unquote()`.
+ See example below to learn more.
+
+
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Simple looping.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%array(beta[*] j k l m (101 102 103 104), vnames=Y, macarray=Y)
-
+
%put #%do_over(beta)#;
%put #%do_over(beta, phrase=%nrstr("%beta(&_I_.)"), between=%str(,))#;
@@ -856,7 +922,6 @@ The basic syntax is the following, the `<...>` means optional parameters:
%array(alpha[11] (5:15), macarray=Y)
%let x = %do_over(alpha
- , phrase = %NRSTR(%alpha(&_I_.))
, between= %str( + )
);
%put &=x.;
@@ -887,12 +952,113 @@ The basic syntax is the following, the `<...>` means optional parameters:
%put #%do_over(test, which= L:H h:l:-1 13 14, between=%str(,))#;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**EXAMPLE 8.** Simpler multiple arrays looping with `rephrase=`.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+ %array(alpha[*] j k l m n o p, vnames=Y, macarray=Y)
+ %array( beta[&alphaN.], function = (2**_i_), macarray=Y)
+ %array(gamma[&alphaN.] (1:&alphaN.), macarray=Y)
+
+ %put >>%do_over(alpha)<<;
+ %put >>%do_over(beta)<<;
+ %put >>%do_over(gamma)<<;
+
+ data test8;
+ call streaminit(123);
+
+ %do_over( alpha beta gamma
+ , rephrase = ?1? = ?2? + ?3? * rand('Uniform'); output;
+ , between = put _all_;
+ )
+ put _all_;
+ run;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**EXAMPLE 9.** Simpler multiple arrays looping with `rephrase=`, cont.
+ Create multiple datasets. Array `alpha`, `beta`, and `gamma` are
+ from the previous example.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+ %do_over(alpha beta gamma
+ , rephrase =
+ data ?1?_2;
+ call streaminit(?2?);
+ ?1?X = ?2? + ?3? * rand('Uniform');
+ output;
+ run;
+ )
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**EXAMPLE 10.** Simpler multiple arrays looping with `rephrase=`, cont.
+ Create multiple datasets using a macro. Array `alpha`, `beta`,
+ and `gamma` are from the previous example.
+ The `%nrstr()` is required to mask call to the `%doit2()` macro.
+ Default `?` is replaced with `@`.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+ %macro doit2(ds, var=a, val1=1, val2=2);
+ data &ds._3;
+ call streaminit(&val1.);
+ &var. = &val1. + &val2. * rand('Uniform');
+ output;
+ run;
+ %mend doit2;
+
+ %do_over( alpha beta gamma
+ , rephrase = %nrstr(%doit2(@1@, var = @1@, val1 = @2@, val2 = @3@))
+ , trigger = @
+ )
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**EXAMPLE 11.** Simpler multiple arrays looping with `rephrase=`, cont.
+ Why the `unq=` is needed.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+ %array(myArr[3] $ ("A1" "B2" "C3"), macarray=Y)
+
+ %do_over(myArr, rephrase=data ?_testUNQ1; run;, unq=1)
+
+ %do_over(myArr, rephrase=data ?_testUNQ0; run;, unq=0)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+
+**EXAMPLE 12.** Simpler multiple arrays looping with `rephrase=`, cont.
+ Renaming variables is easy now.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+ %array(V[*] a b c d e f g h, vnames=1, macarray=1)
+
+ data test12;
+ array x{*} %do_over(V) (1:&VN.);
+ run;
+
+ proc datasets nolist noprint lib=work;
+ modify test12;
+ rename
+ %do_over(V,rephrase = $=new_$,trigger=$)
+ ;
+ run;
+ quit;
+
+ data _null_;
+ set test12;
+ put _ALL_;
+ run;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+---
+
---
-
-
-## >>> `%do_over2()` macro: <<< ####################
-
+## `%do_over2()` macro ######
+
The code of the macro was inspired by
*Ted Clay's* and *David Katz's* macro `%do_over()`.
@@ -935,9 +1101,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
If macroquoted (e.g. `%str( + )`) then the `%unquote()`
function is automatically applied.
-
-
-
+
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Looping over two arrays.
@@ -981,11 +1145,11 @@ The basic syntax is the following, the `<...>` means optional parameters:
%put %sysevalf(&x.);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
-
-
+
+---
+
+## `%do_over3()` macro ######
-## >>> `%do_over3()` macro: <<< ####################
-
The code of the macro was inspired by
*Ted Clay's* and *David Katz's* macro `%do_over()`.
@@ -1032,9 +1196,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
If macroquoted (e.g. `%str( + )`) then the `%unquote()`
function is automatically applied.
-
-
-
+
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Looping over 3 macroarrays.
@@ -1059,11 +1221,11 @@ The basic syntax is the following, the `<...>` means optional parameters:
)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
-
-
+
+---
+
+## `%make_do_over()` macro ######
-## >>> `%make_do_over()` macro: <<< ###########
-
The code of the macro was inspired by
*Ted Clay's* and *David Katz's* macro `%do_over()`.
@@ -1086,9 +1248,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
1. `size` - *Required*, indicates the number of dimensions
(i.e. inner loops) of the `%DO_OVER()` macro.
-
-
-
+
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Code of created "4-loop" `%DO_OVER4()` macro
@@ -1181,9 +1341,342 @@ The basic syntax is the following, the `<...>` means optional parameters:
);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
+
+---
+
+## `%mcdictionary()` macro ######
+
+The `%mcDictionary()` macro provided in the package
+is designed to facilitate the idea of a "macro dictionary"
+concept, i.e. *a list of macrovariables with common prefix
+and suffixes generated as a hash digest* which allows
+to use values other than integers as indexes.
-## >>> `%mcHashTable()` macro: <<< #######################
+The `%mcDictionary()` macro allows to generate other macros
+which behaves like a dictionary. See examples below.
+The `%mcDictionary()` macro executes like a pure macro code.
+
+### SYNTAX: ###################################################################
+
+The basic syntax is the following, the `<...>` means optional parameters:
+~~~~~~~~~~~~~~~~~~~~~~~sas
+%mcDictionary(
+ H
+ <,METHOD>
+ <,DS=>
+ <,K=Key>
+ <,D=Data>
+)
+~~~~~~~~~~~~~~~~~~~~~~~
+
+**Arguments description**:
+
+1. `H` - *Required*, a dictionary macro name and a declaration/definition,
+ e.g. `mcDictionary(HT)`. It names a macro which is generated by
+ the `%mcDictionary()` macro. Provided name cannot be empty
+ or an underscore (`_`). No longer than *13* characters.
+
+2. `METHOD` - *Optional*, if empty (or DECLARE or DCL) then the code of
+ a macro dictionary is compiled.
+ If `DELETE` then the macro dictionary named by `H` and all
+ macrovariables named like "`&H._`" are deleted.
+
+* `DS=` - *Optional*, if NOT empty then the `&DS.` dataset is used to
+ populate dictionary with keys from variable `&K.` and data
+ from variable `&D.` Works only during declaration.
+
+* `K=` - *Optional*, if the `&DS.` is NOT empty then `&K.` holds a name of
+ a variable which keeps or an expression which generates keys values.
+ Default is `Key`.
+
+* `D=` - *Optional*, if the `&DS.` is NOT empty then `&D.` holds a name of
+ a variable which keeps or an expression which generates data values.
+ Default is `Data`.
+
+---
+
+### THE CREATED MACRO `%&H.()`: ####################################################
+
+The created macro imitates behaviour of a dictionary.
+
+The basic syntax is the following, the `<...>` means optional parameters:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%&H.(
+ METHOD
+ <,KEY=>
+ <,DATA=>
+)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+**Arguments description**:
+
+1. `METHOD` - *Required*, indicate what behaviour should be executed.
+ Allowed values are:
+ - `ADD`, adds key and data portion to the macro dictionary,
+ *multiple data portions* are NOT available for one key.
+ - `FIND`, tests if given key exists in the macro dictionary
+ and, if yes, returns data value associated with the key.
+ For multiple data portions see the `data=` parameter.
+ - `CHECK`, returns indicator if the key exists in dictionary.
+ - `DEL`, removes key and data portion from the macro dictionary.
+ - `LIST`, prints out a dictionary to the log.
+ - `CLEAR` removes all data and keys values.
+
+* `KEY=` - *Optional*, provides key value for `ADD`, `FIND`, `CHECK`
+ and `DEL` methods.
+ Leading and trimming spaces are removed from the value.
+ The `MD5(...)` function is used to generate the hash.
+ Default value is `_`.
+
+* `DATA=` - *Optional*, provides data value for the `ADD` method.
+ Default value is blank.
+
+
+When macro is executed and when data are added the following types of
+*global* macrovariables are created:
+- `&H._########_K`,
+- `&H._########_V`,
+- `&H._KEYSNUM`.
+
+The `#` represents value generated by the `MD5(...)` function for the given key.
+
+The first type keeps information about the key.
+
+The second type keeps information about the value of a given key
+
+The third type keeps the number of unique values of the key.
+
+See examples below to see use cases.
+
+---
+
+### EXAMPLES AND USECASES: ####################################################
+
+
+**EXAMPLE 1.** Basic use-case.
+ Creating macro dictionary, macro `Dict` is generated.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%mcDictionary(Dict)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Add elements to the `Dict`.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%Dict(ADD,key=x,data=17)
+%Dict(ADD,key=y y,data=42)
+%Dict(ADD,key=z z z,data=303)
+
+%put _user_;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Add some duplicates for the key x.
+ See macrovariables created.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%Dict(ADD,key=x,data=18)
+
+%put _user_;
+
+%Dict(ADD,key=x,data=19)
+
+%put _user_;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Check for the key `x` and non existing key `t`.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%put ##%Dict(CHECK,key=x)##;
+%put ##%Dict(CHECK,key=t)##;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Prints data values for various keys.
+ Key `t` does not exist in the macrodictionary.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%put #%Dict(FIND,key=x)#;
+%put #%Dict(FIND,key=y y)#;
+%put #%Dict(FIND,key=z z z)#;
+%put #%Dict(FIND,key=t)#;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ List dictionary content to the log.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%Dict(LIST);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Delete keys.
+ Key `t` does not exist in the macrodictionary.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%put #%Dict(DEL,key=z z z)#;
+%put _user_;
+%put #%Dict(DEL,key=t)#;
+%put _user_;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Clear and delete macro dictionary `Dict`.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%Dict(CLEAR)
+%put _user_;
+
+%mcDictionary(Dict,DELETE)
+%put _user_;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**EXAMPLE 2A.** Populate macro dictionary from a dataset "by hand".
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%mcDictionary(CLASS)
+%let t = %sysfunc(datetime());
+data _null_;
+ set sashelp.class;
+ call execute('%CLASS(ADD,key=' !! name !! ',data=' !! age !! ')');
+run;
+%put t = %sysevalf(%sysfunc(datetime()) - &t.);
+%put &=Class_KEYSNUM.;
+%put _user_;
+%CLASS(CLEAR)
+
+
+%mcDictionary(CARS)
+%let t = %sysfunc(datetime());
+data _null_;
+ set sashelp.cars(obs=42);
+ call execute('%CARS(ADD,key=' !! catx("|",make,model,type) !! ',data=' !! put(MPG_CITY*10,dollar10.2) !! ')');
+run;
+%put t = %sysevalf(%sysfunc(datetime()) - &t.);
+%put &=CARS_KEYSNUM.;
+%CARS(LIST);
+
+%put %CARS(F,key=Audi|TT 3.2 coupe 2dr (convertible)|Sports);
+
+%CARS(CLEAR)
+%put &=CARS_KEYSNUM.;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**EXAMPLE 2B.** Populate macro dictionary from a dataset "automatically".
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%let t = %sysfunc(datetime());
+%mcDictionary(CLASS,DCL,DS=sashelp.class,k=name,d=_N_)
+%put t = %sysevalf(%sysfunc(datetime()) - &t.);
+%put &=CLASS_KEYSNUM.;
+%put _user_;
+%CLASS(CLEAR)
+
+
+%let t = %sysfunc(datetime());
+%mcDictionary(CARS,DCL,DS=sashelp.cars(obs=42),k=catx("|",make,model,type),d=put(MPG_CITY*10,dollar10.2))
+%put t = %sysevalf(%sysfunc(datetime()) - &t.);
+%put &=CARS_KEYSNUM.;
+%CARS(LIST);
+
+%put %CARS(F,key=Audi|TT 3.2 coupe 2dr (convertible)|Sports);
+
+%CARS(CLEAR)
+%put &=CARS_KEYSNUM.;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**EXAMPLE 3.** Data portion may require quoting and un-quoting.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%mcDictionary(CODE)
+%CODE(CLEAR)
+%CODE(ADD,key=data, data=%str(data test; x = 42; run;))
+%CODE(ADD,key=proc, data=%str(proc print; run;))
+%CODE(ADD,key=macro,data=%nrstr(%put *1*2*3*4*;))
+
+%CODE(FIND,key=data)
+%CODE(FIND,key=proc)
+%unquote(%CODE(FIND,key=macro))
+
+%CODE(LIST);
+
+%mcDictionary(CODE,DELETE)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**EXAMPLE 4.** Longer lists.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%let size = 1000;
+
+%mcDictionary(AAA)
+
+%let t = %sysfunc(datetime());
+data _null_;
+ do i = 1 to &size.;
+ call execute(cats('%AAA(ADD,key=A', i, ',data=', i, ')'));
+ end;
+run;
+%put t = %sysevalf(%sysfunc(datetime()) - &t.);
+%put %AAA(F,key=A555) %AAA(CHECK,key=A555);
+%put &=AAA_KEYSNUM;
+%AAA(CLEAR)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**EXAMPLE 5.** Forbidden names.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+%mcDictionary()
+%mcDictionary(_)
+
+%mcDictionary(ABCDEFGHIJKLMN) %* bad;
+%mcDictionary(ABCDEFGHIJKLM) %* good;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**EXAMPLE 6.** More fun with datasets.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+
+data work.metadata;
+ input key :$16. data :$128.;
+cards;
+ID ABC-123-XYZ
+path /path/to/study/data
+cutoffDT 2023-01-01
+startDT 2020-01-01
+endDT 2024-12-31
+MedDRA v26.0
+;
+run;
+proc print;
+run;
+
+%mcDictionary(Study,dcl,DS=work.metadata)
+
+%put _user_;
+
+%put *%Study(F,key=ID)**%Study(C,key=ID)*;
+
+title1 "Study %Study(F,key=ID) is located at %Study(F,key=path)";
+title2 "it starts %Study(F,key=startDT) and ends %Study(F,key=endDT)";
+footnote "MedDRA version: %Study(F,key=MedDRA)";
+
+proc print data=sashelp.class(obs=7);
+run;
+
+title;
+footnote;
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+
+---
+
+---
+
+## `%mchashtable()` macro ######
+
The `%mcHashTable()` macro provided in the package
is designed to facilitate the idea of a "macro hash table"
concept, i.e. *a list of macrovariables with common prefix
@@ -1296,7 +1789,7 @@ the `i` indicates key number.
See examples below to see use cases.
---
-
+
### EXAMPLES AND USECASES: ####################################################
@@ -1524,8 +2017,8 @@ run;
%mcHashTable()
%mcHashTable(_)
-%mcHashTable(ABCDEFGHIJKLMNOPQ) %* bad;
-%mcHashTable(ABCDEFGHIJKLMNOP) %* good;
+%mcHashTable(ABCDEFGHIJK) %* bad;
+%mcHashTable(ABCDEFGHIJ) %* good;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 7.** Hashing algorithms.
@@ -1536,339 +2029,14 @@ run;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
-
-## >>> `%mcDictionary()` macro: <<< #######################
-
-The `%mcDictionary()` macro provided in the package
-is designed to facilitate the idea of a "macro dictionary"
-concept, i.e. *a list of macrovariables with common prefix
-and suffixes generated as a hash digest* which allows
-to use values other than integers as indexes.
-
-The `%mcDictionary()` macro allows to generate other macros
-which behaves like a dictionary. See examples below.
-
-The `%mcDictionary()` macro executes like a pure macro code.
-
-### SYNTAX: ###################################################################
-
-The basic syntax is the following, the `<...>` means optional parameters:
-~~~~~~~~~~~~~~~~~~~~~~~sas
-%mcDictionary(
- H
- <,METHOD>
- <,DS=>
- <,K=Key>
- <,D=Data>
-)
-~~~~~~~~~~~~~~~~~~~~~~~
-
-**Arguments description**:
-
-1. `H` - *Required*, a dictionary macro name and a declaration/definition,
- e.g. `mcDictionary(HT)`. It names a macro which is generated by
- the `%mcDictionary()` macro. Provided name cannot be empty
- or an underscore (`_`). No longer than *13* characters.
-
-2. `METHOD` - *Optional*, if empty (or DECLARE or DCL) then the code of
- a macro dictionary is compiled.
- If `DELETE` then the macro dictionary named by `H` and all
- macrovariables named like "`&H._`" are deleted.
-
-* `DS=` - *Optional*, if NOT empty then the `&DS.` dataset is used to
- populate dictionary with keys from variable `&K.` and data
- from variable `&D.` Works only during declaration.
-
-* `K=` - *Optional*, if the `&DS.` is NOT empty then `&K.` holds a name of
- a variable which keeps or an expression which generates keys values.
- Default is `Key`.
-
-* `D=` - *Optional*, if the `&DS.` is NOT empty then `&D.` holds a name of
- a variable which keeps or an expression which generates data values.
- Default is `Data`.
-
----
-
-### THE CREATED MACRO `%&H.()`: ####################################################
-
-The created macro imitates behaviour of a dictionary.
-
-The basic syntax is the following, the `<...>` means optional parameters:
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%&H.(
- METHOD
- <,KEY=>
- <,DATA=>
-)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-**Arguments description**:
-
-1. `METHOD` - *Required*, indicate what behaviour should be executed.
- Allowed values are:
- - `ADD`, adds key and data portion to the macro dictionary,
- *multiple data portions* are NOT available for one key.
- - `FIND`, tests if given key exists in the macro dictionary
- and, if yes, returns data value associated with the key.
- For multiple data portions see the `data=` parameter.
- - `CHECK`, returns indicator if the key exists in dictionary.
- - `DEL`, removes key and data portion from the macro dictionary.
- - `LIST`, prints out a dictionary to the log.
- - `CLEAR` removes all data and keys values.
-
-* `KEY=` - *Optional*, provides key value for `ADD`, `FIND`, `CHECK`
- and `DEL` methods.
- Leading and trimming spaces are removed from the value.
- The `MD5(...)` function is used to generate the hash.
- Default value is `_`.
-
-* `DATA=` - *Optional*, provides data value for the `ADD` method.
- Default value is blank.
-
-
-When macro is executed and when data are added the following types of
-*global* macrovariables are created:
-- `&H._########_K`,
-- `&H._########_V`,
-- `&H._KEYSNUM`.
-
-The `#` represents value generated by the `MD5(...)` function for the given key.
-
-The first type keeps information about the key.
-
-The second type keeps information about the value of a given key
-
-The third type keeps the number of unique values of the key.
-
-See examples below to see use cases.
-
----
-
-### EXAMPLES AND USECASES: ####################################################
-
-
-**EXAMPLE 1.** Basic use-case.
- Creating macro dictionary, macro `Dict` is generated.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%mcDictionary(Dict)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Add elements to the `Dict`.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%Dict(ADD,key=x,data=17)
-%Dict(ADD,key=y y,data=42)
-%Dict(ADD,key=z z z,data=303)
-
-%put _user_;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Add some duplicates for the key x.
- See macrovariables created.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%Dict(ADD,key=x,data=18)
-
-%put _user_;
-
-%Dict(ADD,key=x,data=19)
-
-%put _user_;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Check for the key `x` and non existing key `t`.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%put ##%Dict(CHECK,key=x)##;
-%put ##%Dict(CHECK,key=t)##;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Prints data values for various keys.
- Key `t` does not exist in the macrodictionary.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%put #%Dict(FIND,key=x)#;
-%put #%Dict(FIND,key=y y)#;
-%put #%Dict(FIND,key=z z z)#;
-%put #%Dict(FIND,key=t)#;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- List dictionary content to the log.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%Dict(LIST);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Delete keys.
- Key `t` does not exist in the macrodictionary.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%put #%Dict(DEL,key=z z z)#;
-%put _user_;
-%put #%Dict(DEL,key=t)#;
-%put _user_;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Clear and delete macro dictionary `Dict`.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%Dict(CLEAR)
-%put _user_;
-
-%mcDictionary(Dict,DELETE)
-%put _user_;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-**EXAMPLE 2A.** Populate macro dictionary from a dataset "by hand".
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%mcDictionary(CLASS)
-%let t = %sysfunc(datetime());
-data _null_;
- set sashelp.class;
- call execute('%CLASS(ADD,key=' !! name !! ',data=' !! age !! ')');
-run;
-%put t = %sysevalf(%sysfunc(datetime()) - &t.);
-%put &=Class_KEYSNUM.;
-%put _user_;
-%CLASS(CLEAR)
-
-
-%mcDictionary(CARS)
-%let t = %sysfunc(datetime());
-data _null_;
- set sashelp.cars(obs=42);
- call execute('%CARS(ADD,key=' !! catx("|",make,model,type) !! ',data=' !! put(MPG_CITY*10,dollar10.2) !! ')');
-run;
-%put t = %sysevalf(%sysfunc(datetime()) - &t.);
-%put &=CARS_KEYSNUM.;
-%CARS(LIST);
-
-%put %CARS(F,key=Audi|TT 3.2 coupe 2dr (convertible)|Sports);
-
-%CARS(CLEAR)
-%put &=CARS_KEYSNUM.;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-**EXAMPLE 2B.** Populate macro dictionary from a dataset "automatically".
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%let t = %sysfunc(datetime());
-%mcDictionary(CLASS,DCL,DS=sashelp.class,k=name,d=_N_)
-%put t = %sysevalf(%sysfunc(datetime()) - &t.);
-%put &=CLASS_KEYSNUM.;
-%put _user_;
-%CLASS(CLEAR)
-
-
-%let t = %sysfunc(datetime());
-%mcDictionary(CARS,DCL,DS=sashelp.cars(obs=42),k=catx("|",make,model,type),d=put(MPG_CITY*10,dollar10.2))
-%put t = %sysevalf(%sysfunc(datetime()) - &t.);
-%put &=CARS_KEYSNUM.;
-%CARS(LIST);
-
-%put %CARS(F,key=Audi|TT 3.2 coupe 2dr (convertible)|Sports);
-
-%CARS(CLEAR)
-%put &=CARS_KEYSNUM.;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-**EXAMPLE 3.** Data portion may require quoting and un-quoting.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%mcDictionary(CODE)
-%CODE(CLEAR)
-%CODE(ADD,key=data, data=%str(data test; x = 42; run;))
-%CODE(ADD,key=proc, data=%str(proc print; run;))
-%CODE(ADD,key=macro,data=%nrstr(%put *1*2*3*4*;))
-
-%CODE(FIND,key=data)
-%CODE(FIND,key=proc)
-%unquote(%CODE(FIND,key=macro))
-
-%CODE(LIST);
-
-%mcDictionary(CODE,DELETE)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-**EXAMPLE 4.** Longer lists.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%let size = 1000;
-
-%mcDictionary(AAA)
-
-%let t = %sysfunc(datetime());
-data _null_;
- do i = 1 to &size.;
- call execute(cats('%AAA(ADD,key=A', i, ',data=', i, ')'));
- end;
-run;
-%put t = %sysevalf(%sysfunc(datetime()) - &t.);
-%put %AAA(F,key=A555) %AAA(CHECK,key=A555);
-%put &=AAA_KEYSNUM;
-%AAA(CLEAR)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-**EXAMPLE 5.** Forbidden names.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-%mcDictionary()
-%mcDictionary(_)
-
-%mcDictionary(ABCDEFGHIJKLMNOPQ) %* bad;
-%mcDictionary(ABCDEFGHIJKLMNOP) %* good;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-**EXAMPLE 6.** More fun with datasets.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-
-data work.metadata;
- input key :$16. data :$128.;
-cards;
-ID ABC-123-XYZ
-path /path/to/study/data
-cutoffDT 2023-01-01
-startDT 2020-01-01
-endDT 2024-12-31
-MedDRA v26.0
-;
-run;
-proc print;
-run;
-
-%mcDictionary(Study,dcl,DS=work.metadata)
-
-%put _user_;
-
-%put *%Study(F,key=ID)**%Study(C,key=ID)*;
-
-title1 "Study %Study(F,key=ID) is located at %Study(F,key=path)";
-title2 "it starts %Study(F,key=startDT) and ends %Study(F,key=endDT)";
-footnote "MedDRA version: %Study(F,key=MedDRA)";
-
-proc print data=sashelp.class(obs=7);
-run;
-
-title;
-footnote;
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
---
-
-## >>> `%QzipArrays()` macro: <<< #######################
-
+
+## `%qziparrays()` macro ######
+
The zipArrays() and QzipArrays() macros
allow to use a function on elements of pair of
-macroarrays.
+macro arrays.
For two macroarrays the corresponding
elements are taken and the macro applies a function, provided by user,
@@ -1969,17 +2137,110 @@ The basic syntax is the following, the `<...>` means optional parameters:
cut the process with the end of the shorter array.
See examples for the details.
+
### EXAMPLES AND USECASES: ####################################################
See examples in `%zipArrays()` help for the details.
---
+
+---
+
+## `%sortmacroarray()` macro ######
-## >>> `%zipArrays()` macro: <<< #######################
+The sortMacroArray() macro
+allow to sort elements of a macro array.
+The **limitation** is that sorted values are limited to 32767 bytes of length.
+
+See examples below for the details.
+
+### SYNTAX: ###################################################################
+
+The basic syntax is the following, the `<...>` means optional parameters:
+~~~~~~~~~~~~~~~~~~~~~~~sas
+%sortMacroArray(
+ array
+ <,valLength=>
+ <,outSet=>
+ <,sortseq=>
+)
+~~~~~~~~~~~~~~~~~~~~~~~
+
+**Arguments description**:
+
+1. `array` - *Required*, name of an array generated by the `%array()` macro.
+
+* `valLength = 32767` - *Optional*, default value is `32767`,
+ maximum length of a variable storing macrovariable data.
+ (the reason of 32767 limitation)
+
+* `outSet = _NULL_` - *Optional*, default value is `_NULL_`,
+ an optional output dataset name.
+
+* `sortseq =` - *Optional*, default value is `LINGUISTIC(NUMERIC_COLLATION = ON)`,
+ sorting options for use in an internal `Proc SORT`.
+
+
+### EXAMPLES AND USECASES: ####################################################
+
+
+**EXAMPLE 1.** Basic use-case.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+
+options mprint;
+ods html;
+ods listing close;
+
+
+%array(hij [4:9] $ 512 ("C33" "B22" "A11" "A01" "A02" "X42"), macarray=Y)
+
+%put NOTE: %do_over(hij);
+
+%sortMacroArray(hij, valLength=3, outSet = A_NULL_(compress=char))
+
+%put NOTE: %do_over(hij);
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**EXAMPLE 2.** Basic use-case.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
+
+options mprint;
+ods html;
+ods listing close;
+
+
+%array(ds = sashelp.class, vars = name|NNN height|h, macarray=Y)
+%array(ds = sashelp.cars, vars = model|, macarray=Y)
+
+%put NOTE: %do_over(NNN);
+%put NOTE: %do_over(H);
+%put NOTE: %do_over(model);
+
+%sortMacroArray(NNN, valLength=30, outSet = A_NULL_(compress=char))
+%sortMacroArray(H, valLength=32)
+%sortMacroArray(model, valLength=120)
+
+%put NOTE: %do_over(NNN);
+%put NOTE: %do_over(H);
+%put NOTE: %do_over(model);
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+---
+
+
+---
+
+## `%ziparrays()` macro ######
+
The zipArrays() and QzipArrays() macros
allow to use a function on elements of pair of
-macroarrays.
+macro arrays.
For two macroarrays the corresponding
elements are taken and the macro applies a function, provided by user,
@@ -2080,6 +2341,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
cut the process with the end of the shorter array.
See examples for the details.
+
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Simple concatenation of elements:
@@ -2174,96 +2436,15 @@ The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
-
-## >>> `%sortMacroArray()` macro: <<< #######################
-
-The sortMacroArray() macro
-allow to sort elements of a macroarray.
-
-The **limitation** is that sorted values are limited to 32767 bytes of length.
-
-See examples below for the details.
-
-### SYNTAX: ###################################################################
-
-The basic syntax is the following, the `<...>` means optional parameters:
-~~~~~~~~~~~~~~~~~~~~~~~sas
-%sortMacroArray(
- array
- <,valLength=>
- <,outSet=>
- <,sortseq=>
-)
-~~~~~~~~~~~~~~~~~~~~~~~
-
-**Arguments description**:
-
-1. `array` - *Required*, name of an array generated by the `%array()` macro.
-
-* `valLength = 32767` - *Optional*, default value is `32767`,
- maximum length of a variable storing macrovariable data.
- (the reason of 32767 limitation)
-
-* `outSet = _NULL_` - *Optional*, default value is `_NULL_`,
- an optional output dataset name.
-
-* `sortseq =` - *Optional*, default value is `LINGUISTIC(NUMERIC_COLLATION = ON)`,
- sorting options for use in an internal `Proc SORT`.
-
-### EXAMPLES AND USECASES: ####################################################
-
-
-**EXAMPLE 1.** Basic use-case.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-
-options mprint;
-ods html;
-ods listing close;
-
-
-%array(hij [4:9] $ 512 ("C33" "B22" "A11" "A01" "A02" "X42"), macarray=Y)
-
-%put NOTE: %do_over(hij);
-
-%sortMacroArray(hij, valLength=3, outSet = A_NULL_(compress=char))
-
-%put NOTE: %do_over(hij);
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-**EXAMPLE 2.** Basic use-case.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
-
-options mprint;
-ods html;
-ods listing close;
-
-
-%array(ds = sashelp.class, vars = name|NNN height|h, macarray=Y)
-%array(ds = sashelp.cars, vars = model|, macarray=Y)
-
-%put NOTE: %do_over(NNN);
-%put NOTE: %do_over(H);
-%put NOTE: %do_over(model);
-
-%sortMacroArray(NNN, valLength=30, outSet = A_NULL_(compress=char))
-%sortMacroArray(H, valLength=32)
-%sortMacroArray(model, valLength=120)
-
-%put NOTE: %do_over(NNN);
-%put NOTE: %do_over(H);
-%put NOTE: %do_over(model);
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
+
---
-
-## License ####################################################################
-
-Copyright (c) Bartosz Jablonski, since January 2019
+
+
+---
+
+# License ######
+
+Copyright (c) Bartosz Jablonski, 2019 - 2026
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -2282,5 +2463,6 @@ 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.
-
+
---
+
diff --git a/packages/macroarray.zip b/packages/macroarray.zip
index c42bf1c..eea55b4 100644
Binary files a/packages/macroarray.zip and b/packages/macroarray.zip differ