diff --git a/README.md b/README.md index 8139acc..8701536 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ In this repository we are presenting the **SAS Packages Framework** which allows ### Current version: -**The latest version** of SPF is **`20221107`**. +**The latest version** of SPF is **`20221112`**. To get started with SAS Packages try this [**`Getting Started with SAS Packages`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/Getting_Started_with_SAS_Packages.pdf "Getting Started with SAS Packages") presentation (see the `./SPF/Documentation` directory). @@ -166,13 +166,13 @@ If you find the SPF useful **share info** about it or **give it a [star](https:/ Packages: -- **SQLinDS**\[2.2\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g. +- **SQLinDS**\[2.2.1\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g. ```sas data class; set %SQL(select * from sashelp.class order by age); run; ``` -SHA256 digest for SQLinDS: 96D0EFE02DF1AE0D7D875A10CAF7EF63CDEF85DD0CF9418934BEFAF0C067D453 +SHA256 digest for SQLinDS: A070214517CC36590083FCF9D5F488AC6E746793E94B9AA55D09A419CF291B5B [Documentation for SQLinDS](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/sqlinds.md "Documentation for SQLinDS") @@ -182,13 +182,13 @@ SHA256 digest for MacroCore: A23C29529F3CE7D0C8BEE9545C5D22D5B5594907547374A5135 [Documentation for MacroCore](https://core.sasjs.io "Documentation for MacroCore") -- **DFA** (Dynamic Function Arrays)\[0.5\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples. +- **DFA** (Dynamic Function Arrays)\[0.5.1\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples. -SHA256 digest for DFA: 5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC3535B4F491 +SHA256 digest for DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6 [Documentation for DFA](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/dfa.md "Documentation for DFA") -- **macroArray**\[1.0\], implementation of an array concept in a macrolanguage, e.g. +- **macroArray**\[1.0.1\], implementation of an array concept in a macrolanguage, e.g. ```sas %array(ABC[17] (111:127), macarray=Y); @@ -207,12 +207,12 @@ SHA256 digest for DFA: 5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC353 which = 1:H:2 ); ``` -SHA256 digest for macroArray: ED12BC96F8A4E9E7C4D651EC1E15479DB9B55D98B274B63C507ED842081F7AB7 +SHA256 digest for macroArray: 371B92A5ABBE82C53F7D63BC5C0D1EBD4695603D3894D8A9A5D5777D1AB59B30 [Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray") -- **BasePlus**\[1.17\] adds a bunch of functionalities I am missing in BASE SAS, such as: +- **BasePlus**\[1.17.1\] adds a bunch of functionalities I am missing in BASE SAS, such as: ```sas call arrMissToRight(myArray); call arrFillMiss(17, myArray); @@ -230,21 +230,21 @@ format x bool.; %zipLibrary(sashelp,libOut=work) ``` -SHA256 digest for BasePlus: 56B260350FEB7D5118F581B9EFD1B9CE1F0298DCB9A4C000A7654E2FF3F0298C +SHA256 digest for BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4 [Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus") -- **GSM** (Generate Secure Macros)\[0.20\], package allows +- **GSM** (Generate Secure Macros)\[0.20.1\], package allows to create secured macros stored in SAS Proc FCMP functions. The dataset with functions can be shared between different operating systems and allows to generate macros on site without showing their code. -SHA256 digest for GSM: 2AEBC150FBA99A4AAB0265A21C57E89200BFD96B633B898F32743D1C8831A159 +SHA256 digest for GSM: 5D1925970C9590CD195C15B8641B01D7857E3B2546323DC77D09154BCCA40922 [Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM") -- **dynMacroArray**\[0.2\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold. +- **dynMacroArray**\[0.2.1\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold. -SHA256 digest for dynMacroArray: D7E0B8F85C05EBF8622204E0D2F3E990D48D0A9B3911051C3AD44DC98954DDCF +SHA256 digest for dynMacroArray: C987C08615A53D7BD7AEC3911EADF436C676EAB3E233E7E422E42995B890E169 ### ====== 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 b0cebf2..5f573f2 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/extendpackagesfileref.sas b/SPF/Macros/extendpackagesfileref.sas index 258f3f2..bdee04d 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 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 @@ -22,7 +22,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 #; diff --git a/SPF/Macros/generatepackage.sas b/SPF/Macros/generatepackage.sas index 88649da..0db9ebb 100644 --- a/SPF/Macros/generatepackage.sas +++ b/SPF/Macros/generatepackage.sas @@ -23,7 +23,7 @@ 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; @@ -38,7 +38,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 #; @@ -133,16 +133,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; @@ -163,13 +166,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; @@ -498,6 +501,7 @@ DESCRIPTION END: /* collect the data */ data &filesWithCodes.; + putlog "NOTE- "; putlog "NOTE: Generating content dataset: &filesWithCodes.."; putlog "NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"; putlog "NOTE- "; @@ -511,7 +515,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.'; @@ -529,6 +534,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); @@ -551,6 +577,8 @@ data &filesWithCodes.; "WARNING- "; end; end; + + ignoreFolder: ; rc = dclose(fileId); rc = filename(fileRef); end; @@ -563,6 +591,7 @@ data &filesWithCodes.; put 'ERROR: Aborting due to previous errors.'; abort; end; + put " "; stop; run; @@ -637,7 +666,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; @@ -669,6 +698,7 @@ options ¬esSourceOptions.; /* packages description */ +%put NOTE-; %put NOTE: Preparing description file.; %put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^; %put NOTE-; @@ -680,6 +710,7 @@ data _null_; run; /* package license */ +%put NOTE-; %put NOTE: Preparing license file.; %put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^; %put NOTE-; @@ -698,8 +729,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 '; @@ -723,6 +756,7 @@ run; %end; /* package metadata */ +%put NOTE-; %put NOTE: Preparing metadata file.; %put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^; %put NOTE-; @@ -735,24 +769,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; @@ -771,6 +807,7 @@ run; %ICEloadpackage(sqlinds) */ +%put NOTE-; %put NOTE: Preparing iceloadpackage file.; %put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^; %put NOTE-; @@ -833,6 +870,7 @@ run; /* loading package files */ +%put NOTE-; %put NOTE: Preparing load file.; %put NOTE- ^^^^^^^^^^^^^^^^^^^^; %put NOTE-; @@ -844,10 +882,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- ;'; @@ -936,7 +975,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); '; @@ -953,7 +992,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 */ @@ -963,11 +1002,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 '; @@ -979,7 +1028,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); '; @@ -995,7 +1044,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; '; @@ -1003,12 +1052,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 ; '; @@ -1020,7 +1079,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 ; '; @@ -1188,6 +1247,7 @@ data _null_; run; /* to load lazydata */ +%put NOTE-; %put NOTE: Preparing "lazydata" file.; %put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^; %put NOTE-; @@ -1199,10 +1259,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- ;'; @@ -1245,6 +1306,7 @@ run; /* unloading package objects */ +%put NOTE-; %put NOTE: Preparing unload file.; %put NOTE- ^^^^^^^^^^^^^^^^^^^^^^; %put NOTE-; @@ -1489,6 +1551,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-; @@ -1502,10 +1565,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 ***;' /; @@ -1603,6 +1667,7 @@ data _null_; run; /* package help */ +%put NOTE-; %put NOTE: Preparing help file.; %put NOTE- ^^^^^^^^^^^^^^^^^^^^; %put NOTE-; @@ -1616,10 +1681,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 ***;' /; @@ -1676,7 +1742,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; ' /; @@ -1817,7 +1883,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;'); @@ -1833,7 +1899,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; '); @@ -1863,7 +1929,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;'); @@ -1920,6 +1986,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; @@ -2017,7 +2084,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; @@ -2030,7 +2097,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; @@ -2064,7 +2131,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; @@ -2203,6 +2270,10 @@ data _null_; put '%unloadPackage'"(&packageName.,"; put " path=&filesLocation.) " /; + put "filename packages '&filesLocation.';" / + '%listPackages() ' /; + + put "proc printto"; put "; run;"; diff --git a/SPF/Macros/helppackage.sas b/SPF/Macros/helppackage.sas index a25cda7..938c1ec 100644 --- a/SPF/Macros/helppackage.sas +++ b/SPF/Macros/helppackage.sas @@ -24,7 +24,7 @@ */ )/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; @@ -39,7 +39,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 #; @@ -169,7 +169,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 diff --git a/SPF/Macros/installpackage.sas b/SPF/Macros/installpackage.sas index 854dbd4..afece0e 100644 --- a/SPF/Macros/installpackage.sas +++ b/SPF/Macros/installpackage.sas @@ -14,7 +14,7 @@ /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; @@ -29,7 +29,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 #; @@ -458,7 +458,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 diff --git a/SPF/Macros/listpackages.sas b/SPF/Macros/listpackages.sas index a6c2ffd..471a78b 100644 --- a/SPF/Macros/listpackages.sas +++ b/SPF/Macros/listpackages.sas @@ -1,7 +1,7 @@ /*+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; @@ -16,7 +16,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 #; @@ -166,7 +166,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_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 diff --git a/SPF/Macros/loadpackage.sas b/SPF/Macros/loadpackage.sas index 738b50d..5b8e19e 100644 --- a/SPF/Macros/loadpackage.sas +++ b/SPF/Macros/loadpackage.sas @@ -27,7 +27,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; @@ -42,7 +42,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 #; diff --git a/SPF/Macros/loadpackages.sas b/SPF/Macros/loadpackages.sas index 378dad3..34fc8bb 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 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 @@ -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 `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 #; diff --git a/SPF/Macros/previewpackage.sas b/SPF/Macros/previewpackage.sas index 252660d..9a85d32 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 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; @@ -38,7 +38,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 #; diff --git a/SPF/Macros/unloadpackage.sas b/SPF/Macros/unloadpackage.sas index bbf5ea2..f01d602 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 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; @@ -35,7 +35,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 #; diff --git a/SPF/Macros/verifypackage.sas b/SPF/Macros/verifypackage.sas index d23887f..16f52a4 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 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; @@ -28,7 +28,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 #; diff --git a/SPF/SPFinit.md b/SPF/SPFinit.md index fca0f84..7cc966d 100644 --- a/SPF/SPFinit.md +++ b/SPF/SPFinit.md @@ -21,14 +21,14 @@ 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 **`20221107`**. +In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20221112`**. **To get started with SAS Packages** try this [**`Getting Started with SAS Packages`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/Getting_Started_with_SAS_Packages.pdf "Getting Started with SAS Packages") presentation (see the `./SPF/Documentation` directory). **The documentation and more advance reading** would be the [**`SAS(r) packages - the way to share (a how to)- Paper 4725-2020 - extended.pdf`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/SAS(r)%20packages%20-%20the%20way%20to%20share%20(a%20how%20to)-%20Paper%204725-2020%20-%20extended.pdf "SAS packages - the way to share") article (see the `./SPF/Documentation` directory). -*Note:* Filenames references `packages` and `package` are reserved keywords. +*Note:* Filenames references `packages` and `package` are **reserved keywords.** The first one should be used to point local folder with packages and the framework. The second is used internally by macros. After assigning the directory do not change them when using the SPF since it may affect stability of the framework. @@ -39,7 +39,7 @@ After assigning the directory do not change them when using the SPF since it may ## This is short help information for the `installPackage` macro -------------------------------------------------------------------------------------------- - Macro to install SAS packages, version `20221107` + Macro to install SAS packages, version `20221112` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -141,7 +141,7 @@ filename packages "C:/SAS_PACKAGES"; ## This is short help information for the `helpPackage` macro ------------------------------------------------------------------------------- - Macro to get help about SAS packages, version `20221107` + Macro to get help about SAS packages, version `20221112` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -211,7 +211,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 `20221107` + Macro to *load* SAS packages, version `20221112` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -284,7 +284,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages; ## This is short help information for the `loadPackageS` macro ------------------------------------------------------------------------------- - Macro wrapper for the loadPackage macro, version `20221107` + Macro wrapper for the loadPackage macro, version `20221112` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -333,7 +333,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 `20221107` + Macro to unload SAS packages, version `20221112` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -398,7 +398,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 `20221107` + Macro to list available SAS packages, version `20221112` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -439,7 +439,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages; ## This is short help information for the `verifyPackage` macro ------------------------------------------------------------------------------- - Macro to verify SAS package with it hash digest, version `20221107` + Macro to verify SAS package with it hash digest, version `20221112` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -493,7 +493,7 @@ filename packages "C:/SAS_PACKAGES"; %* set-up a directory for packages; ## This is short help information for the `previewPackage` macro ------------------------------------------------------------------------------- - Macro to get previwe of a SAS packages, version `20221107` + Macro to get previwe of a SAS packages, version `20221112` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -560,7 +560,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 `20221107` + Macro to generate SAS packages, version `20221112` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -626,7 +626,7 @@ The file should contain the following obligatory information: Type: Package Package: PackageName Title: A title/brief info for log note about your package. -Version: X.Y +Version: X.Y.Z Author: Firstname1 Lastname1 (xxxxxx1@yyyyy.com), Firstname2 Lastname2 (xxxxxx2@yyyyy.com) Maintainer: Firstname Lastname (xxxxxx@yyyyy.com) License: MIT @@ -650,6 +650,9 @@ Name of the `type` of folder and `files.sas` inside must be in the _low_ case le If order of loading is important, the sequential number can be used to order multiple types in the way you wish. +If folder name starts with `!` (e.g., `!ignore_me`) or *type* of the folder is "unknown" (e.g., not supported one) +the content of such folder is ignored during package generation process. + The "tree structure" of the folder could be for example as follows: All files have to have `.sas` extension. Other files are ignored. @@ -741,7 +744,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 `20221107` + Macro to list directories pointed by 'packages' fileref, version `20221112` 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 8e5f0d4..08e5f50 100644 --- a/SPF/SPFinit.sas +++ b/SPF/SPFinit.sas @@ -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. ¬es_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. ¬es_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 ¬esSourceOptions.; /* 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 #; diff --git a/packages/README.md b/packages/README.md index 2a21f21..0fd5a38 100644 --- a/packages/README.md +++ b/packages/README.md @@ -10,7 +10,7 @@ Packages: --- -- **SQLinDS**\[2.2\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g. +- **SQLinDS**\[2.2.1\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g. ```sas data class; set %SQL( @@ -22,7 +22,7 @@ data class; WH = weight + height; run; ``` -SHA256 digest for SQLinDS: 96D0EFE02DF1AE0D7D875A10CAF7EF63CDEF85DD0CF9418934BEFAF0C067D453 +SHA256 digest for SQLinDS: A070214517CC36590083FCF9D5F488AC6E746793E94B9AA55D09A419CF291B5B [Documentation for SQLinDS](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/sqlinds.md "Documentation for SQLinDS") @@ -36,7 +36,7 @@ SHA256 digest for MacroCore: A23C29529F3CE7D0C8BEE9545C5D22D5B5594907547374A5135 --- -- **DFA** (Dynamic Function Arrays)\[0.5\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples. +- **DFA** (Dynamic Function Arrays)\[0.5.1\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples. ```sas %createDFArray(ArrDynamic, resizefactor=17); @@ -63,13 +63,13 @@ data _null_; end; run; ``` -SHA256 digest for DFA: 5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC3535B4F491 +SHA256 digest for DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6 [Documentation for DFA](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/dfa.md "Documentation for DFA") --- -- **macroArray**\[1.0\], implementation of an array concept in a macro language, e.g. +- **macroArray**\[1.0.1\], implementation of an array concept in a macro language, e.g. ```sas %array(ABC[17] (111:127), macarray=Y); @@ -88,13 +88,13 @@ SHA256 digest for DFA: 5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC353 which = 1:H:2 ); ``` -SHA256 digest for macroArray: ED12BC96F8A4E9E7C4D651EC1E15479DB9B55D98B274B63C507ED842081F7AB7 +SHA256 digest for macroArray: 371B92A5ABBE82C53F7D63BC5C0D1EBD4695603D3894D8A9A5D5777D1AB59B30 [Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray") --- -- **BasePlus**\[1.17\] adds a bunch of functionalities I am missing in BASE SAS, such as: +- **BasePlus**\[1.17.1\] adds a bunch of functionalities I am missing in BASE SAS, such as: ```sas call arrMissToRight(myArray); call arrFillMiss(17, myArray); @@ -112,25 +112,25 @@ format x bool.; %zipLibrary(sashelp,libOut=work) ``` -SHA256 digest for BasePlus: 56B260350FEB7D5118F581B9EFD1B9CE1F0298DCB9A4C000A7654E2FF3F0298C +SHA256 digest for BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4 [Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus") --- -- **GSM** (Generate Secure Macros)\[0.20\], package allows +- **GSM** (Generate Secure Macros)\[0.20.1\], package allows to create secured macros stored in SAS Proc FCMP functions. The dataset with functions can be shared between different operating systems and allows to generate macros on site without showing their code. -SHA256 digest for GSM: 2AEBC150FBA99A4AAB0265A21C57E89200BFD96B633B898F32743D1C8831A159 +SHA256 digest for GSM: 5D1925970C9590CD195C15B8641B01D7857E3B2546323DC77D09154BCCA40922 [Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM") --- -- **dynMacroArray**\[0.2\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold. +- **dynMacroArray**\[0.2.1\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold. -SHA256 digest for dynMacroArray: D7E0B8F85C05EBF8622204E0D2F3E990D48D0A9B3911051C3AD44DC98954DDCF +SHA256 digest for dynMacroArray: C987C08615A53D7BD7AEC3911EADF436C676EAB3E233E7E422E42995B890E169 --- diff --git a/packages/SHA256_for_packages.txt b/packages/SHA256_for_packages.txt index d9ab5ec..486a814 100644 --- a/packages/SHA256_for_packages.txt +++ b/packages/SHA256_for_packages.txt @@ -1,3 +1,11 @@ +/* 20221112 */ +BasePlus: A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4 +DFA: 5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6 +dynMacroArray: C987C08615A53D7BD7AEC3911EADF436C676EAB3E233E7E422E42995B890E169 +GSM: 5D1925970C9590CD195C15B8641B01D7857E3B2546323DC77D09154BCCA40922 +macroArray: 371B92A5ABBE82C53F7D63BC5C0D1EBD4695603D3894D8A9A5D5777D1AB59B30 +SQLinDS: A070214517CC36590083FCF9D5F488AC6E746793E94B9AA55D09A419CF291B5B + /* 20220830 */ BasePlus: 56B260350FEB7D5118F581B9EFD1B9CE1F0298DCB9A4C000A7654E2FF3F0298C DFA: 5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC3535B4F491 diff --git a/packages/baseplus.md b/packages/baseplus.md index bf5afdd..6a73852 100644 --- a/packages/baseplus.md +++ b/packages/baseplus.md @@ -56,7 +56,7 @@ --- -# The BasePlus package [ver. 1.17] ############################################### +# The BasePlus package [ver. 1.17.1] ############################################### The **BasePlus** package implements useful functions and functionalities I miss in the BASE SAS. @@ -273,10 +273,10 @@ Package contains: 48. functions quicksorthashsddv 49. functions quicksortlight -*SAS package generated by generatePackage, version 20220830* +*SAS package generated by generatePackage, version 20221112* The SHA256 hash digest for package BasePlus: -`56B260350FEB7D5118F581B9EFD1B9CE1F0298DCB9A4C000A7654E2FF3F0298C` +`A80006D3C1409465E49F383D08F2F3AF1E33D6A67D71A8CAF29747ADC917E2E4` --- # Content description ############################################################################################ diff --git a/packages/baseplus.zip b/packages/baseplus.zip index 8935aae..3610610 100644 Binary files a/packages/baseplus.zip and b/packages/baseplus.zip differ diff --git a/packages/dfa.md b/packages/dfa.md index 7858ae7..ff90f2b 100644 --- a/packages/dfa.md +++ b/packages/dfa.md @@ -18,7 +18,7 @@ --- -# The DFA package [ver. 0.5] ############################################### +# The DFA package [ver. 0.5.1] ############################################### The **DFA** (a.k.a. *Dynamic Function Array*) package implements: - dynamic numeric and character arrays, @@ -52,10 +52,10 @@ Package contains: 12. exec generatearrays 13. clean generatearrays -*SAS package generated by generatePackage, version 20220830* +*SAS package generated by generatePackage, version 20221112* The SHA256 hash digest for package BasePlus: -`5BFFCE78439E1CDDCBB15C95CD287AA4195BF64BB17DDB8FE374EC3535B4F491` +`5A6FD2F6E962E6C191346A141FFAF354E35A546CA93146B55D7C6163BFB1BDD6` --- # Content description ############################################################################################ diff --git a/packages/dfa.zip b/packages/dfa.zip index 5a654fd..ab2786b 100644 Binary files a/packages/dfa.zip and b/packages/dfa.zip differ diff --git a/packages/dynmacroarray.zip b/packages/dynmacroarray.zip index 64b448a..6f7f044 100644 Binary files a/packages/dynmacroarray.zip and b/packages/dynmacroarray.zip differ diff --git a/packages/gsm.md b/packages/gsm.md index 85736d7..6d904ef 100644 --- a/packages/gsm.md +++ b/packages/gsm.md @@ -8,7 +8,7 @@ --- -# The GSM package [ver. 0.20] ############################################### +# The GSM package [ver. 0.20.1] ############################################### The **GSM** (a.k.a. *Generate Secure Macros*) package allows to create secured macros stored in SAS Proc FCMP functions. @@ -91,10 +91,10 @@ Package contains: Required SAS Components: `Base SAS Software` -* SAS package generated by generatePackage, version 20220830 * +* SAS package generated by generatePackage, version 20221112 * The SHA256 hash digest for package GSM: -`2AEBC150FBA99A4AAB0265A21C57E89200BFD96B633B898F32743D1C8831A159` +`5D1925970C9590CD195C15B8641B01D7857E3B2546323DC77D09154BCCA40922` ## >>> `%GSM()` macro: <<< ####################### diff --git a/packages/gsm.zip b/packages/gsm.zip index df3bf53..41703e6 100644 Binary files a/packages/gsm.zip and b/packages/gsm.zip differ diff --git a/packages/macroarray.md b/packages/macroarray.md index 5b60b44..5ceb5c1 100644 --- a/packages/macroarray.md +++ b/packages/macroarray.md @@ -19,7 +19,7 @@ --- -# The macroArray package [ver. 1.0] ############################################### +# The macroArray package [ver. 1.0.1] ############################################### The **macroArray** package implements a macro array facility: - `%array()`, @@ -75,10 +75,10 @@ Package contains: Required SAS Components: *Base SAS Software* -*SAS package generated by generatePackage, version 20220830.* +*SAS package generated by generatePackage, version 20221112.* The SHA256 hash digest for package macroArray: -`ED12BC96F8A4E9E7C4D651EC1E15479DB9B55D98B274B63C507ED842081F7AB7` +`371B92A5ABBE82C53F7D63BC5C0D1EBD4695603D3894D8A9A5D5777D1AB59B30` --- # Content description ############################################################################################ diff --git a/packages/macroarray.zip b/packages/macroarray.zip index 54dc081..01fd3ef 100644 Binary files a/packages/macroarray.zip and b/packages/macroarray.zip differ diff --git a/packages/sqlinds.md b/packages/sqlinds.md index 4d0eb4e..00ce86d 100644 --- a/packages/sqlinds.md +++ b/packages/sqlinds.md @@ -1,4 +1,4 @@ -- [The SQLinDS package [ver. 2.2]](#sqlinds-package) +- [The SQLinDS package [ver. 2.2.1]](#sqlinds-package) - [Content description](#content-description) * [library `dsSQL`](#library-dssql) * [`%dsSQL_inner()` macro](#dssql-inner-macro) @@ -8,7 +8,7 @@ --- -# The SQLinDS package [ver. 2.2] ############################################### +# The SQLinDS package [ver. 2.2.1] ############################################### The **SQLinDS** package is an implementation of the *macro-function-sandwich* concept introduced in the @@ -46,10 +46,10 @@ Package contains: Required SAS Components: *Base SAS Software* -*SAS package generated by generatePackage, version 20220830* +*SAS package generated by generatePackage, version 20221112* The SHA256 hash digest for package SQLinDS: -`96D0EFE02DF1AE0D7D875A10CAF7EF63CDEF85DD0CF9418934BEFAF0C067D453` +`A070214517CC36590083FCF9D5F488AC6E746793E94B9AA55D09A419CF291B5B` --- # Content description ############################################################################################ diff --git a/packages/sqlinds.zip b/packages/sqlinds.zip index dbf6341..e023a23 100644 Binary files a/packages/sqlinds.zip and b/packages/sqlinds.zip differ