SAS Packages Framework, version 20260216

SAS Packages Framework, version 20260216

BugFix:
- When package loading with `cherryPick=` is done the `<packageName>META` is created. This should not be the case. Release 20260216 fixes the issue.
This commit is contained in:
Bart Jablonski
2026-02-16 20:34:03 +01:00
parent 0a3226f4d0
commit d6da6d7232
23 changed files with 119 additions and 117 deletions

View File

@@ -43,7 +43,7 @@
- to unload, or
- to generate SAS packages.
Version 20260205.
Version 20260216.
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 20260205. Run %loadPackage() for help info.'
des = 'Macro to load SAS package, version 20260216. 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 `20260205` #;
%put # Macro to *load* SAS packages, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -398,7 +398,7 @@ minoperator
*/
)/secure
/*** HELP END ***/
des = 'Macro to unload SAS package, version 20260205. Run %unloadPackage() for help info.'
des = 'Macro to unload SAS package, version 20260216. Run %unloadPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -413,7 +413,7 @@ des = 'Macro to unload SAS package, version 20260205. Run %unloadPackage() for h
%put ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to unload SAS packages, version `20260205` #;
%put # Macro to unload SAS packages, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -568,7 +568,7 @@ des = 'Macro to unload SAS package, version 20260205. Run %unloadPackage() for h
*/
)/secure
/*** HELP END ***/
des = 'Macro to get help about SAS package, version 20260205. Run %helpPackage() for help info.'
des = 'Macro to get help about SAS package, version 20260216. Run %helpPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -583,7 +583,7 @@ des = 'Macro to get help about SAS package, version 20260205. Run %helpPackage()
%put ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to get help about SAS packages, version `20260205` #;
%put # Macro to get help about SAS packages, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -728,7 +728,7 @@ TODO:
*/
/*+installPackage+*/
/* Macros to install SAS packages, version 20260205 */
/* Macros to install SAS packages, version 20260216 */
/* 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
@@ -755,7 +755,7 @@ TODO:
/secure
minoperator
/*** HELP END ***/
des = 'Macro to install SAS package, version 20260205. Run %%installPackage() for help info.'
des = 'Macro to install SAS package, version 20260216. Run %%installPackage() for help info.'
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do;
@@ -770,7 +770,7 @@ des = 'Macro to install SAS package, version 20260205. Run %%installPackage() fo
%put ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to install SAS packages, version `20260205` #;
%put # Macro to install SAS packages, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -1422,7 +1422,7 @@ des = 'Macro to install SAS package, version 20260205. Run %%installPackage() fo
Macro to list SAS packages in packages folder.
Version 20260205
Version 20260216
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1444,7 +1444,7 @@ des = 'Macro to install SAS package, version 20260205. Run %%installPackage() fo
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 20260205.'
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20260216.'
;
%if (%QUPCASE(&listDataSet.) = HELP) %then
%do;
@@ -1459,7 +1459,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 `20260205` #;
%put # Macro to list available SAS packages, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -1685,7 +1685,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
Macro to generate SAS packages.
Version 20260205
Version 20260216
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1735,7 +1735,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
when empty takes buildLocation */
)/ secure minoperator
/*** HELP END ***/
des = 'Macro to generate SAS packages, version 20260205. Run %generatePackage() for help info.'
des = 'Macro to generate SAS packages, version 20260216. Run %generatePackage() for help info.'
;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do;
@@ -1750,7 +1750,7 @@ des = 'Macro to generate SAS packages, version 20260205. Run %generatePackage()
%put ### This is short help information for the `generatePackage` macro #;
%put #------------------------------------------------------------------------------------#;
%put # #;
%put # Macro to generate SAS packages, version `20260205` #;
%put # Macro to generate SAS packages, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -2632,7 +2632,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
title&_titleNumber_. "Package ZIP file location is: &buildLocation.";
%end;
footnote1 "SAS Packages Framework, version 20260205";
footnote1 "SAS Packages Framework, version 20260216";
proc print
data = &filesWithCodes.(drop=base build folderRef fileRef rc folderid _abort_ fileId additionalContent)
@@ -3457,7 +3457,7 @@ data _null_;
%end;
put +(-1) '`.;'''
/ ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"'
/ ' !! '' %put with the SAS Packages Framework version 20260205.;'''
/ ' !! '' %put with the SAS Packages Framework version 20260216.;'''
/ ' !! '' %put ****************************************************************************;'''
/ ' !! '' %GOTO theEndOfTheMacro;'''
/ ' !! '' %end;''' ;
@@ -3621,7 +3621,7 @@ data _null_;
%end;
put +(-1) '`.; '' !!' /
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !! ' /
''' %put with the SAS Packages Framework version 20260205.; '' !! ' /
''' %put with the SAS Packages Framework version 20260216.; '' !! ' /
''' %put ****************************************************************************; '' !! ' /
''' %GOTO theEndOfTheMacro; '' !! ' /
''' %end; '' !! ' /
@@ -3861,6 +3861,7 @@ data _null_;
packageRequired = quote(strip(packageRequired));
%end;
put '%if (%str(*)=%superq(cherryPick)) %then %do;'; /* cherryPick 4 ---*/
put "proc fcmp outlib = work.&packageName.fcmp.packagemeta ; "
/ " function &packageName.META(meta $) $ 32767;"
/ ' m = char(upcase(meta),1);'
@@ -3893,7 +3894,7 @@ data _null_;
/ '%if %superq(meta) = %then %return;'
/ '%do;%qsysfunc(strip(%qsysfunc(' "&packageName.META" '&syspbuff.)))%end;'
/ '%mend;' / /;
put '%end;'; /* cherryPick 4 ---*/
/*==========================================================================================*/
/* list cmplib for functions and fmtsearch for formats*/
@@ -3953,7 +3954,7 @@ data _null_;
put 'options NOTES;'
/ '%put NOTE- ;'
/ '%put NOTE: '"Loading package &packageName., version "'%'"&packageName.META(V), license &packageLicense.;"
/ '%put NOTE: '"Loading package &packageName., version &packageVersion., license &packageLicense.;"
/ '%put NOTE- *** END ***;' /;
put 'options &temp_noNotes_etc.;'
@@ -4492,7 +4493,7 @@ data _null_;
%end;
put 'put " " / @3 "---------------------------------------------------------------------" / " ";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20260205`*";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20260216`*";'
/ "put @3 '*under `&sysscp.`(`&sysscpl.`) operating system,*';"
/ "put @3 '*using SAS release: `&sysvlong4.`.*';"
/ 'put " " / @3 "---------------------------------------------------------------------";';
@@ -4931,7 +4932,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 20260205.';
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the test part of the process. Version 20260216.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
@@ -5613,7 +5614,7 @@ options &quotelenmax_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 20260205.';
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the markdown documentation part of the process. Version 20260216.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
@@ -5725,7 +5726,7 @@ data &filesWithCodes.markdown;
%end;
put " " / "---------------------------------------------------------------------" / " "
/ "*SAS package generated by SAS Package Framework, version `20260205`,*"
/ "*SAS package generated by SAS Package Framework, version `20260216`,*"
/ "*under `&sysscp.`(`&sysscpl.`) operating system,*"
/ "*using SAS release: `&sysvlong4.`.*"
/ " " / "---------------------------------------------------------------------" / " ";
@@ -5866,7 +5867,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 20260205.';
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the archive version generation part of the process. Version 20260216.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
@@ -6033,7 +6034,7 @@ TODO: (in Polish)
*/
)/secure
/*** HELP END ***/
des = 'Macro to load multiple SAS packages at one run, version 20260205. Run %loadPackages() for help info.'
des = 'Macro to load multiple SAS packages at one run, version 20260216. Run %loadPackages() for help info.'
parmbuff
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -6049,7 +6050,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro wrapper for the loadPackage macro, version `20260205` #;
%put # Macro wrapper for the loadPackage macro, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6147,7 +6148,7 @@ parmbuff
hashing_file() function, SAS 9.4M6 */
)/secure
/*** HELP END ***/
des = 'Macro to verify SAS package with the hash digest, version 20260205. Run %verifyPackage() for help info.'
des = 'Macro to verify SAS package with the hash digest, version 20260216. Run %verifyPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -6162,7 +6163,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20260205. Run %
%put ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to verify SAS package with it hash digest, version `20260205` #;
%put # Macro to verify SAS package with it hash digest, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6378,7 +6379,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20260205. Run %
*/
)/secure
/*** HELP END ***/
des = 'Macro to preview content of a SAS package, version 20260205. Run %previewPackage() for help info.'
des = 'Macro to preview content of a SAS package, version 20260216. Run %previewPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -6393,7 +6394,7 @@ des = 'Macro to preview content of a SAS package, version 20260205. Run %preview
%put ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to get preview of a SAS packages, version `20260205` #;
%put # Macro to get preview of a SAS packages, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6527,7 +6528,7 @@ des = 'Macro to preview content of a SAS package, version 20260205. Run %preview
when empty the "packages" value is used */
)/secure
/*** HELP END ***/
des = 'Macro to list directories pointed by "packages" fileref, version 20260205. Run %extendPackagesFileref(HELP) for help info.'
des = 'Macro to list directories pointed by "packages" fileref, version 20260216. Run %extendPackagesFileref(HELP) for help info.'
;
%if %QUPCASE(&packages.) = HELP %then
@@ -6543,7 +6544,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20260205
%put ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to list directories pointed by 'packages' fileref, version `20260205` #;
%put # Macro to list directories pointed by 'packages' fileref, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6645,7 +6646,7 @@ filename packages list;
is provided in required version */
)/secure
/*** HELP END ***/
des = 'Macro to load additional content for a SAS package, version 20260205. Run %loadPackageAddCnt() for help info.'
des = 'Macro to load additional content for a SAS package, version 20260216. Run %loadPackageAddCnt() for help info.'
minoperator
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -6661,7 +6662,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 `20260205` #;
%put # Macro to *load* additional content for a SAS package, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -7032,7 +7033,7 @@ minoperator
,nobs=0 /* technical parameter */
)
/*** HELP END ***/
/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260205. Run %splitCodeForPackage() for help info.'
/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260216. Run %splitCodeForPackage() for help info.'
;
%if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then
%do;
@@ -7048,7 +7049,7 @@ minoperator
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Utility macro to *split* single file with SAS package code into multiple #;
%put # files with separate snippets, version `20260205` #;
%put # files with separate snippets, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -7424,7 +7425,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 20260205. */';
put '/* File generated with help of SAS Packages Framework, version 20260216. */';
firstLine[j]=0;
end;
put _infile_;
@@ -7457,7 +7458,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 20260205. Run %relocatePackage() for help info.'
/ des = 'Utility macro that locally Copies or Moves Packages, version 20260216. Run %relocatePackage() for help info.'
secure
minoperator
;
@@ -7475,7 +7476,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 `20260205` #;
%put # Macro to *locally copy or move* (relocate) SAS packages, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -8133,7 +8134,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 20260205.'
des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20260216.'
;
/*** HELP END ***/
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
@@ -8149,7 +8150,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 `20260205` #;
%put # Macro to check if the `packages` fileref is "correct", version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -8283,7 +8284,7 @@ SPFmacroName /* space separated list of names */
/
minoperator
secure
des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260205. Run %SasPackagesFrameworkNotes(HELP) for help info.'
des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260216. Run %SasPackagesFrameworkNotes(HELP) for help info.'
;
%local list N i element;
%let list=
@@ -8329,7 +8330,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 `20260205` #;
%put # Macro prints help notes for SAS Packages Framework macros, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -8452,7 +8453,7 @@ options mlogic symbolgen;
,packagesRef=packages
,ods= /* data set for report file */
)/
des='Macro to create a bundle of SAS packages, version 20260205. Run %bundlePackages(HELP) for help info.'
des='Macro to create a bundle of SAS packages, version 20260216. Run %bundlePackages(HELP) for help info.'
secure minoperator
;
@@ -8469,7 +8470,7 @@ secure minoperator
%put ### This is short help information for the `bundlePackages` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to *create bundles* of SAS packages, version `20260205` #;
%put # Macro to *create bundles* of SAS packages, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -8954,7 +8955,7 @@ filename p2 "R:/dontexist";
,ods= /* data set for report file */
,verify=0
)/
des='Macro to extract a bundle of SAS packages, version 20260205. Run %unbundlePackages(HELP) for help info.'
des='Macro to extract a bundle of SAS packages, version 20260216. Run %unbundlePackages(HELP) for help info.'
secure
minoperator
;
@@ -8972,7 +8973,7 @@ minoperator
%put ### This is short help information for the `unbundlePackages` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to *extract* SAS packages from a bundle, version `20260205` #;
%put # Macro to *extract* SAS packages from a bundle, version `20260216` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;