SAS Packages Framework, ver. 20221112

SAS Packages Framework, ver. 20221112

Changes in `%generatePackage()` macro:
- refactoring of package metadata extraction and metadata file preparation,
- in a package folder all subfolders which name starts with `!` are ignored in the package generation process,
- in a package folder all subfolders with unknown code types are ignored in the package generation process,
- bug fix in package version extraction for required package list,
- new test added to loading test,
- documentation updated.

---

The following packages were regenerated:
- BasePlus [1.17.1]
- DFA [0.5.1]
- dynMacroArray [0.2.1]
- GSM [0.20.1]
- macroArray [1.0.1]
- SQLinDS [2.2.1]
This commit is contained in:
Bartosz Jablonski
2022-11-12 17:27:00 +01:00
parent 5bd013c925
commit 35e6ff8d5e
27 changed files with 386 additions and 233 deletions

View File

@@ -42,7 +42,7 @@
- to unload, or
- to generate SAS packages.
Version 20221107.
Version 20221112.
See examples below.
A SAS package is a zip file containing a group of files
@@ -82,7 +82,7 @@
*/
)/secure
/*** HELP END ***/
des = 'Macro to load SAS package, version 20221107. Run %loadPackage() for help info.'
des = 'Macro to load SAS package, version 20221112. Run %loadPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -97,7 +97,7 @@ des = 'Macro to load SAS package, version 20221107. Run %loadPackage() for help
%put ### This is short help information for the `loadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to *load* SAS packages, version `20221107` #;
%put # Macro to *load* SAS packages, version `20221112` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -283,7 +283,7 @@ des = 'Macro to load SAS package, version 20221107. Run %loadPackage() for help
*/
)/secure
/*** HELP END ***/
des = 'Macro to unload SAS package, version 20221107. Run %unloadPackage() for help info.'
des = 'Macro to unload SAS package, version 20221112. Run %unloadPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -298,7 +298,7 @@ des = 'Macro to unload SAS package, version 20221107. Run %unloadPackage() for h
%put ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to unload SAS packages, version `20221107` #;
%put # Macro to unload SAS packages, version `20221112` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -443,7 +443,7 @@ des = 'Macro to unload SAS package, version 20221107. Run %unloadPackage() for h
*/
)/secure
/*** HELP END ***/
des = 'Macro to get help about SAS package, version 20221107. Run %helpPackage() for help info.'
des = 'Macro to get help about SAS package, version 20221112. Run %helpPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -458,7 +458,7 @@ des = 'Macro to get help about SAS package, version 20221107. Run %helpPackage()
%put ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to get help about SAS packages, version `20221107` #;
%put # Macro to get help about SAS packages, version `20221112` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -588,7 +588,7 @@ TODO:
- add MD5(&packageName.) value hash instead "package" word in filenames [DONE]
*/
/* Macros to install SAS packages, version 20221107 */
/* Macros to install SAS packages, version 20221112 */
/* 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
@@ -611,7 +611,7 @@ TODO:
/secure
minoperator
/*** HELP END ***/
des = 'Macro to install SAS package, version 20221107. Run %%installPackage() for help info.'
des = 'Macro to install SAS package, version 20221112. Run %%installPackage() for help info.'
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do;
@@ -626,7 +626,7 @@ des = 'Macro to install SAS package, version 20221107. Run %%installPackage() fo
%put ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to install SAS packages, version `20221107` #;
%put # Macro to install SAS packages, version `20221112` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -1055,7 +1055,7 @@ des = 'Macro to install SAS package, version 20221107. Run %%installPackage() fo
/* Macro to list SAS packages in packages folder.
Version 20221107
Version 20221112
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1076,7 +1076,7 @@ des = 'Macro to install SAS package, version 20221107. Run %%installPackage() fo
/*+listPackages+*/
%macro listPackages()/secure PARMBUFF
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20221107.'
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20221112.'
;
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
%do;
@@ -1091,7 +1091,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 `20221107` #;
%put # Macro to list available SAS packages, version `20221112` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -1241,7 +1241,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
/* Macro to generate SAS packages.
Version 20221107
Version 20221112
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1278,7 +1278,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
default value 1 means "delete tests work" */
)/secure minoperator
/*** HELP END ***/
des = 'Macro to generate SAS packages, version 20221107. Run %generatePackage() for help info.'
des = 'Macro to generate SAS packages, version 20221112. Run %generatePackage() for help info.'
;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do;
@@ -1293,7 +1293,7 @@ des = 'Macro to generate SAS packages, version 20221107. Run %generatePackage()
%put ### This is short help information for the `generatePackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to generate SAS packages, version `20221107` #;
%put # Macro to generate SAS packages, version `20221112` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -1388,16 +1388,19 @@ filename &_LIC_. "&filesLocation./license.sas" lrecl = 1024;
infile &_DESCR_.;
input;
%local metaExtStr; /* metadata Extraction String; */
%let metaExtStr=kscanx(_INFILE_, 2, ":");
select( strip(upcase(kscanx(_INFILE_, 1, ":"))) );
when("PACKAGE") call symputX("packageName", kscanx(_INFILE_, 2, ":"),"L");
when("VERSION") call symputX("packageVersion", kscanx(_INFILE_, 2, ":"),"L");
when("AUTHOR") call symputX("packageAuthor", kscanx(_INFILE_, 2, ":"),"L");
when("MAINTAINER") call symputX("packageMaintainer", kscanx(_INFILE_, 2, ":"),"L");
when("TITLE") call symputX("packageTitle", kscanx(_INFILE_, 2, ":"),"L");
when("ENCODING") call symputX("packageEncoding", kscanx(_INFILE_, 2, ":"),"L");
when("LICENSE") call symputX("packageLicense", kscanx(_INFILE_, 2, ":"),"L");
when("REQUIRED") call symputX("packageRequired", kscanx(_INFILE_, 2, ":"),"L");
when("REQPACKAGES") call symputX("packageReqPackages", kscanx(_INFILE_, 2, ":"),"L");
when("PACKAGE") call symputX("packageName", &metaExtStr., "L");
when("VERSION") call symputX("packageVersion", &metaExtStr., "L");
when("AUTHOR") call symputX("packageAuthor", &metaExtStr., "L");
when("MAINTAINER") call symputX("packageMaintainer", &metaExtStr., "L");
when("TITLE") call symputX("packageTitle", &metaExtStr., "L");
when("ENCODING") call symputX("packageEncoding", &metaExtStr., "L");
when("LICENSE") call symputX("packageLicense", &metaExtStr., "L");
when("REQUIRED") call symputX("packageRequired", &metaExtStr., "L");
when("REQPACKAGES") call symputX("packageReqPackages", &metaExtStr., "L");
/* stop at the beginning of description */
when("DESCRIPTION START") stop;
@@ -1418,13 +1421,13 @@ filename &_LIC_. "&filesLocation./license.sas" lrecl = 1024;
%do;
%put ERROR: At least one of descriptors is missing!;
%put ERROR- They are required to create a package.;
%put ERROR- &=packageName.;
%put ERROR- &=packageTitle.;
%put ERROR- &=packageVersion.;
%put ERROR- &=packageAuthor.;
%put ERROR- &=packageMaintainer.;
%put ERROR- &=packageEncoding.;
%put ERROR- &=packageLicense.;
%put ERROR- packageName=%superq(packageName);
%put ERROR- packageTitle=%superq(packageTitle);
%put ERROR- packageVersion=%superq(packageVersion);
%put ERROR- packageAuthor=%superq(packageAuthor);
%put ERROR- packageMaintainer=%superq(packageMaintainer);
%put ERROR- packageEncoding=%superq(packageEncoding);
%put ERROR- packageLicense=%superq(packageLicense);
%put ERROR- ;
%put ERROR- Aborting.;
%abort;
@@ -1753,6 +1756,7 @@ DESCRIPTION END:
/* collect the data */
data &filesWithCodes.;
putlog "NOTE- ";
putlog "NOTE: Generating content dataset: &filesWithCodes..";
putlog "NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
putlog "NOTE- ";
@@ -1766,7 +1770,8 @@ data &filesWithCodes.;
folderid=dopen(folderRef);
do i=1 to dnum(folderId); drop i;
folder = dread(folderId, i);
folder = dread(folderId, i);
if folder NE lowcase(folder) then
do;
put 'ERROR: Folder should be named ONLY with low case letters.';
@@ -1784,6 +1789,27 @@ data &filesWithCodes.;
fileId = dopen(fileRef);
file = ' ';
/* ignore folders which name starts with ! */
if fileId AND "!" =: folder then
do;
put "INFO: Folder " folder "name starts with ! and will be ignored. " /
" No content from it will be used to generate the package." / " ";
goto ignoreFolder;
end;
/* ignore unknown types for folders */
if fileId AND not (upcase(type) in:
('LIBNAME' 'MACRO' /*'MACROS'*/ 'DATA' 'FUNCTION' /*'FUNCTIONS'*/ 'FORMAT' /*'FORMATS'*/ 'IMLMODULE' 'PROTO' 'EXEC' 'CLEAN' 'LAZYDATA' 'TEST'))
then
do;
put "WARNING: Type " type 'is not yet supported.' /
"WARNING- Folder " folder " will be ignored. " /
"WARNING- No content from it will be used to generate the package." / " ";
goto ignoreFolder;
end;
/* if it is a directory then read its content */
if fileId then
do j = 1 to dnum(fileId); drop j;
file = dread(fileId, j);
@@ -1806,6 +1832,8 @@ data &filesWithCodes.;
"WARNING- ";
end;
end;
ignoreFolder: ;
rc = dclose(fileId);
rc = filename(fileRef);
end;
@@ -1818,6 +1846,7 @@ data &filesWithCodes.;
put 'ERROR: Aborting due to previous errors.';
abort;
end;
put " ";
stop;
run;
@@ -1892,7 +1921,7 @@ data _null_;
put "ERROR: There are " e "EXECs files and " c "CLEANs files!" /
"ERROR- Each EXEC file should have CLEAN file counterpart and vice versa." /
'ERROR- Please create appropriate files and make your package a "role model".' /
'ERROR: Aborting package generation!' ;
'ERROR: [&sysmacroname.] Aborting package generation!' ;
abort;
end;
end;
@@ -1924,6 +1953,7 @@ options &notesSourceOptions.;
/* packages description */
%put NOTE-;
%put NOTE: Preparing description file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -1935,6 +1965,7 @@ data _null_;
run;
/* package license */
%put NOTE-;
%put NOTE: Preparing license file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -1953,8 +1984,10 @@ run;
%let packageLicense = MIT;
data _null_;
file &zipReferrence.(license.sas) encoding = &packageEncoding.;
length packageAuthor $ 1024;
packageAuthor = symget('packageAuthor');
put " ";
put " Copyright (c) %sysfunc(today(),year4.) &packageAuthor. ";
put " Copyright (c) since %sysfunc(today(),year4.) " packageAuthor ;
put " ";
put " Permission is hereby granted, free of charge, to any person obtaining a copy ";
put ' of this software and associated documentation files (the "Software"), to deal ';
@@ -1978,6 +2011,7 @@ run;
%end;
/* package metadata */
%put NOTE-;
%put NOTE: Preparing metadata file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -1990,24 +2024,26 @@ data _null_;
end;
file &zipReferrence.(packagemetadata.sas) encoding = &packageEncoding.;
put ' data _null_; '; /* simple "%local" returns error while loading package */
put ' call symputX("packageName", " ", "L");';
put ' call symputX("packageVersion", " ", "L");';
put ' call symputX("packageTitle", " ", "L");';
put ' call symputX("packageAuthor", " ", "L");';
put ' call symputX("packageMaintainer", " ", "L");';
put ' call symputX("packageEncoding", " ", "L");';
put ' call symputX("packageLicense", " ", "L");';
put ' run; ';
length packageName $ 32 packageVersion $ 24
packageTitle packageAuthor packageMaintainer $ 2048
packageEncoding $ 8 packageLicense $ 128;
packageName = quote(strip(symget('packageName')),'"');
packageVersion = quote(strip(symget('packageVersion')),'"');
packageTitle = quote(strip(symget('packageTitle')),'"');
packageAuthor = quote(strip(symget('packageAuthor')),'"');
packageMaintainer = quote(strip(symget('packageMaintainer')),'"');
packageEncoding = quote(strip(symget('packageEncoding')),'"');
packageLicense = quote(strip(symget('packageLicense')),'"');
put ' %let packageName =' "&packageName.;";
put ' %let packageVersion =' "&packageVersion.;";
put ' %let packageTitle =' "&packageTitle.;";
put ' %let packageAuthor =' "&packageAuthor.;";
put ' %let packageMaintainer =' "&packageMaintainer.;";
put ' %let packageEncoding =' "&packageEncoding.;";
put ' %let packageLicense =' "&packageLicense.;";
put ' ; ';
put ' data _null_; '; /* simple "%local" returns error while loading package */
put ' call symputX("packageName", ' packageName ', "L");';
put ' call symputX("packageVersion", ' packageVersion ', "L");';
put ' call symputX("packageTitle", ' packageTitle ', "L");';
put ' call symputX("packageAuthor", ' packageAuthor ', "L");';
put ' call symputX("packageMaintainer", ' packageMaintainer ', "L");';
put ' call symputX("packageEncoding", ' packageEncoding ', "L");';
put ' call symputX("packageLicense", ' packageLicense ', "L");';
put ' run; ';
stop;
run;
@@ -2026,6 +2062,7 @@ run;
%ICEloadpackage(sqlinds)
*/
%put NOTE-;
%put NOTE: Preparing iceloadpackage file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -2088,6 +2125,7 @@ run;
/* loading package files */
%put NOTE-;
%put NOTE: Preparing load file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -2099,10 +2137,11 @@ data _null_;
put "filename &_PackageFileref_. list;" /;
put ' %put NOTE- ;';
put ' %put NOTE: ' @; put "Loading package &packageName., version &packageVersion., license &packageLicense.; ";
put ' %put NOTE: ' @; put "*** &packageTitle. ***; ";
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
put ' %put NOTE- ' @; put "Author(s): &packageAuthor.; ";
put ' %put NOTE- ' @; put "Maintainer(s): &packageMaintainer.; ";
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
put ' %put NOTE- ;';
put ' %put NOTE- Run %nrstr(%%)helpPackage(' "&packageName." ') for the description;';
put ' %put NOTE- ;';
@@ -2191,7 +2230,7 @@ data _null_;
packageReqPackages = lowcase(symget('packageReqPackages'));
/* try to load required packages */
put 'data _null_ ; ';
put ' length req name $ 64 vers verR 8 SYSloadedPackages $ 32767; ';
put ' length req name $ 64 vers verR $ 24 versN verRN 8 SYSloadedPackages $ 32767; ';
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
put ' do; ';
put ' do until(EOF); ';
@@ -2208,7 +2247,7 @@ data _null_;
put ' do _N_ = 1 to countw(SYSloadedPackages); ';
put ' req = kscanx(SYSloadedPackages, _N_, " "); ';
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
put ' vers = input(compress(kscanx(req,-1, "("), ".", "KD"),best32.); ';
put ' vers = compress(kscanx(req,-1, "("), ".", "KD"); ';
put ' _RC_ = LP.add(); ';
put ' end; ';
/* check if elements of the framework are available */
@@ -2218,11 +2257,21 @@ data _null_;
put ' do req = ' / packageReqPackages / ' ; ';
/* put ' req = compress(req, "(.)", "KDF"); ';*/
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
put ' verR = input(compress(kscanx(req,-1, "("), ".", "KD"),best32.); vers = .; ';
put ' verR = compress(kscanx(req,-1, "("), ".", "KD"); vers = ""; ';
put ' LP_find = LP.find(); ';
put ' if (LP_find ne 0) or (LP_find = 0 and . < vers < verR) then ';
/* convert major.minor.patch to number*/
put ' array V verR vers ; ';
put ' array VN verRN versN; ';
put ' do over V; ';
put ' VN = input("0"!!scan(V,1,".","M"),?? best.)*1e8 ';
put ' + input("0"!!scan(V,2,".","M"),?? best.)*1e4 ';
put ' + input("0"!!scan(V,3,".","M"),?? best.)*1e0; ';
put ' end; ';
put ' if (LP_find ne 0) or (LP_find = 0 and . < versN < verRN) then ';
put ' do; ';
put ' put "NOTE: Trying to load required SAS package " req; ';
put ' put "NOTE: Trying to load required SAS package: " req; ';
put ' if LoadPackageExist then ';
put ' call execute(cats(''%nrstr(%loadPackage('', name, ", requiredVersion = ", verR, "))")); ';
put ' else if ICELoadPackageExist then ';
@@ -2234,7 +2283,7 @@ data _null_;
/* test if required packages are loaded */
put 'data _null_ ; ';
put ' length req name $ 64 SYSloadedPackages $ 32767; ';
put ' length req name $ 64 vers verR $ 24 versN verRN 8 SYSloadedPackages $ 32767; ';
put ' if SYMEXIST("SYSloadedPackages") = 1 and SYMGLOBL("SYSloadedPackages") = 1 then ';
put ' do; ';
put ' do until(EOF); ';
@@ -2250,7 +2299,7 @@ data _null_;
put ' do _N_ = 1 to countw(SYSloadedPackages); ';
put ' req = kscanx(SYSloadedPackages, _N_, " "); ';
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
put ' vers = input(compress(kscanx(req,-1, "("), ".", "KD"), best32.); ';
put ' vers = compress(kscanx(req,-1, "("), ".", "KD"); ';
put ' _RC_ = LP.add(); ';
put ' end; ';
@@ -2258,12 +2307,22 @@ data _null_;
put ' do req = ' / packageReqPackages / ' ; ';
/* put ' req = compress(req, "(.)", "KDF"); ';*/
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
put ' verR = input(compress(kscanx(req,-1, "("), ".", "KD"),best32.); vers = .; ';
put ' verR = compress(kscanx(req,-1, "("), ".", "KD"); vers = " "; ';
put ' LP_find = LP.find(); ';
put ' if (LP_find ne 0) or (LP_find = 0 and . < vers < verR) then ';
/* convert major.minor.patch to number*/
put ' array V verR vers ; ';
put ' array VN verRN versN; ';
put ' do over V; ';
put ' VN = input("0"!!scan(V,1,".","M"),?? best.)*1e8 ';
put ' + input("0"!!scan(V,2,".","M"),?? best.)*1e4 ';
put ' + input("0"!!scan(V,3,".","M"),?? best.)*1e0; ';
put ' end; ';
put ' if (LP_find ne 0) or (LP_find = 0 and . < versN < verRN) then ';
put ' do; ';
put ' missingPackagr = 1; ';
put ' put "ERROR: SAS package " req "is missing! Download it and" ; ';
put ' put "ERROR: SAS package: " req "is missing! Download it and" ; ';
put ' put ''ERROR- use %loadPackage('' name ", requiredVersion = " verR ") to load it." ;';
put ' end ; ';
put ' end ; ';
@@ -2275,7 +2334,7 @@ data _null_;
put ' call symputX("packageRequiredErrors", 1, "L"); ';
put ' do req = ' / packageReqPackages / ' ; ';
put ' name = lowcase(strip(kscanx(req, 1, "("))); ';
put ' vers = input(compress(kscanx(req,-1, "("), ".", "KD"), best32.); ';
put ' vers = compress(kscanx(req,-1, "("), ".", "KD"); ';
put ' put "ERROR: SAS package " req "is missing! Download/install it and" ; ';
put ' put ''ERROR- use %loadPackage('' name ", requiredVersion = " vers ") to load it." ; ';
put ' end ; ';
@@ -2443,6 +2502,7 @@ data _null_;
run;
/* to load lazydata */
%put NOTE-;
%put NOTE: Preparing "lazydata" file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -2454,10 +2514,11 @@ data _null_;
put "filename &_PackageFileref_. list;" /;
put ' %put NOTE- ;';
put ' %put NOTE: ' @; put "Data for package &packageName., version &packageVersion., license &packageLicense.; ";
put ' %put NOTE: ' @; put "*** &packageTitle. ***; ";
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
put ' %put NOTE- ' @; put "Author(s): &packageAuthor.; ";
put ' %put NOTE- ' @; put "Maintainer(s): &packageMaintainer.; ";
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
put ' %put NOTE- ;';
put ' %put NOTE- Write %nrstr(%%)helpPackage(' "&packageName." ') for the description;';
put ' %put NOTE- ;';
@@ -2500,6 +2561,7 @@ run;
/* unloading package objects */
%put NOTE-;
%put NOTE: Preparing unload file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -2744,6 +2806,7 @@ data _null_;
run;
/* package preview, i.e. print out all content of the package files into the log */
%put NOTE-;
%put NOTE: Preparing preview file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -2757,10 +2820,11 @@ data _null_;
put "filename &_PackageFileref_. list;" /;
put ' %put NOTE- ;';
put ' %put NOTE: '"Preview of the &packageName. package, version &packageVersion., license &packageLicense.;";
put ' %put NOTE: ' @; put "*** &packageTitle. ***; ";
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
put ' %put NOTE- ' @; put "Author(s): &packageAuthor.; ";
put ' %put NOTE- ' @; put "Maintainer(s): &packageMaintainer.; ";
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
put ' %put NOTE- ;';
put ' %put NOTE- *** START ***;' /;
@@ -2858,6 +2922,7 @@ data _null_;
run;
/* package help */
%put NOTE-;
%put NOTE: Preparing help file.;
%put NOTE- ^^^^^^^^^^^^^^^^^^^^;
%put NOTE-;
@@ -2871,10 +2936,11 @@ data _null_;
put "filename &_PackageFileref_. list;" /;
put ' %put NOTE- ;';
put ' %put NOTE: '"Help for package &packageName., version &packageVersion., license &packageLicense.;";
put ' %put NOTE: ' @; put "*** &packageTitle. ***; ";
put ' %put NOTE: ' @; put '*** %superq(packageTitle) ***; ';
put ' %put NOTE- ' @; put "Generated: %sysfunc(datetime(), datetime21.); ";
put ' %put NOTE- ' @; put "Author(s): &packageAuthor.; ";
put ' %put NOTE- ' @; put "Maintainer(s): &packageMaintainer.; ";
put ' %put NOTE- ' @; put 'Author(s): %superq(packageAuthor); ';
put ' %put NOTE- ' @; put 'Maintainer(s): %superq(packageMaintainer); ';
put ' %put NOTE- ;';
put ' %put NOTE- *** START ***;' /;
@@ -2931,7 +2997,7 @@ data _null_;
put ' end ; ';
%end;
put 'put "***"; put "* SAS package generated by generatePackage, version 20221107 *"; put "***";';
put 'put "***"; put "* SAS package generated by generatePackage, version 20221112 *"; put "***";';
put 'run; ' /;
@@ -3072,7 +3138,7 @@ data _null_;
call execute(' if ex then put "File " pathname "copied into the package with return code: " rc "(0 = success)";');
call execute(' else do;');
call execute(' put "ERROR: File " pathname "NOT copied into the package!" ;');
call execute(' put "ERROR: [&sysmacroname.] File " pathname "NOT copied into the package!" ;');
call execute(' call symputX("createPackageContentStatus",1,"L");');
call execute(' end;');
@@ -3088,7 +3154,7 @@ data _null_;
call execute(' if 18 <= lengthn(_endhelpline_) AND _endhelpline_ =: "/*** DNE PLEH ***/" then test + (-1); '); /* *** HELP END *** */
call execute(' if (test not in (.,0,1)) or (EOF and test) then ');
call execute(' do; ');
call execute(' put "ERROR: Unmatched or nested HELP tags in ' !! catx('/', folder, file) !! '! Line: " _N_; ');
call execute(' put "ERROR: [&sysmacroname.] Unmatched or nested HELP tags in ' !! catx('/', folder, file) !! '! Line: " _N_; ');
call execute(' put "ERROR- Aborting! "; ');
call execute(' call symputX("createPackageContentStatus",1,"L"); ');
call execute(' abort; ');
@@ -3118,7 +3184,7 @@ data _null_;
call execute(' ex = fexist("_SPFOUT_");');
call execute(' if not ex then do;');
call execute(' put "ERROR: File ' !! strip(drivFile) !! '.sas DOES NOT EXIST in the package!" ;');
call execute(' put "ERROR: [&sysmacroname.] File ' !! strip(drivFile) !! '.sas DOES NOT EXIST in the package!" ;');
call execute(' call symputX("createPackageContentStatus",1,"L"); ');
call execute(' end;');
@@ -3175,6 +3241,7 @@ filename &zipReferrence. clear;
/* verify if there were errors while package content creation */
%if %bquote(&createPackageContentStatus.) ne 0 %then
%do;
%put ERROR- ** [&sysmacroname.] **;
%put ERROR: ** ERRORS IN PACKAGE CONTENT CREATION! **;
%put ERROR- ** NO TESTING WILL BE EXECUTED. **;
%GOTO NOTESTING;
@@ -3272,7 +3339,7 @@ run;
%end;
%else
%do;
%put ERROR: Provided location of the SAS binary file does not exist!;
%put ERROR: [&sysmacroname.] Provided location of the SAS binary file does not exist!;
%put ERROR- The directory was: &SASEXE.;
%put ERROR- Testing would not be executed.;
filename sasroot;
@@ -3285,7 +3352,7 @@ run;
0 = %sysfunc(fileexist(&SASEXE..exe)) /* WINDOWS */
%then
%do;
%put ERROR: Provided location of the SAS binary file does not contain SAS file!;
%put ERROR: [&sysmacroname.] Provided location of the SAS binary file does not contain SAS file!;
%put ERROR- The file searched was: &SASEXE.;
%put ERROR- Testing would not be executed.;
%GOTO NOTESTING;
@@ -3319,7 +3386,7 @@ run;
%end;
%else
%do;
%put ERROR: Provided SAS config file does not exist!;
%put ERROR: [&sysmacroname.] Provided SAS config file does not exist!;
%put ERROR- The file was: &SASCFGFILE.;
%put ERROR- Testing would not be executed.;
%GOTO NOTESTING;
@@ -3458,6 +3525,10 @@ data _null_;
put '%unloadPackage'"(&packageName.,";
put " path=&filesLocation.) " /;
put "filename packages '&filesLocation.';" /
'%listPackages() ' /;
put "proc printto";
put "; run;";
@@ -3790,7 +3861,7 @@ TODO: (in Polish)
*/
)/secure
/*** HELP END ***/
des = 'Macro to load multiple SAS packages at one run, version 20221107. Run %loadPackages() for help info.'
des = 'Macro to load multiple SAS packages at one run, version 20221112. Run %loadPackages() for help info.'
parmbuff
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -3806,7 +3877,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro wrapper for the loadPackage macro, version `20221107` #;
%put # Macro wrapper for the loadPackage macro, version `20221112` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -3903,7 +3974,7 @@ parmbuff
hashing_file() function, SAS 9.4M6 */
)/secure
/*** HELP END ***/
des = 'Macro to verify SAS package with the hash digest, version 20221107. Run %verifyPackage() for help info.'
des = 'Macro to verify SAS package with the hash digest, version 20221112. Run %verifyPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -3918,7 +3989,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20221107. Run %
%put ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to verify SAS package with it hash digest, version `20221107` #;
%put # Macro to verify SAS package with it hash digest, version `20221112` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -4089,7 +4160,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20221107. Run %
*/
)/secure
/*** HELP END ***/
des = 'Macro to preview content of a SAS package, version 20221107. Run %previewPackage() for help info.'
des = 'Macro to preview content of a SAS package, version 20221112. Run %previewPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -4104,7 +4175,7 @@ des = 'Macro to preview content of a SAS package, version 20221107. Run %preview
%put ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to get previwe of a SAS packages, version `20221107` #;
%put # Macro to get previwe of a SAS packages, version `20221112` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -4231,7 +4302,7 @@ des = 'Macro to preview content of a SAS package, version 20221107. Run %preview
when empty the "packages" value is used */
)/secure
/*** HELP END ***/
des = 'Macro to list directories pointed by "packages" fileref, version 20221107. Run %extendPackagesFileref(HELP) for help info.'
des = 'Macro to list directories pointed by "packages" fileref, version 20221112. Run %extendPackagesFileref(HELP) for help info.'
;
%if %QUPCASE(&packages.) = HELP %then
@@ -4247,7 +4318,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20221107
%put ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to list directories pointed by 'packages' fileref, version `20221107` #;
%put # Macro to list directories pointed by 'packages' fileref, version `20221112` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;