diff --git a/README.md b/README.md index 1ca6a26..507f459 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Don't forget to **STAR** (:star:) the repository! :-) ### Current version: -**The latest version** of SPF is **`20241027`**. +**The latest version** of SPF is **`20241102`**. 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). 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 9160512..73a7544 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 3f82e6f..a569089 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 20241027. Run %extendPackagesFileref(HELP) for help info.' +des = 'Macro to list directories pointed by "packages" fileref, version 20241102. 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 20241027 %put ### This is short help information for the `extendPackagesFileref` macro #; %put #-----------------------------------------------------------------------------------------#;; %put # #; - %put # Macro to list directories pointed by 'packages' fileref, version `20241027` #; + %put # Macro to list directories pointed by 'packages' fileref, version `20241102` #; %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 a6287dc..fd0ec13 100644 --- a/SPF/Macros/generatepackage.sas +++ b/SPF/Macros/generatepackage.sas @@ -3,7 +3,7 @@ Macro to generate SAS packages. - Version 20241027 + Version 20241102 A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -43,7 +43,7 @@ file name be created */ )/ secure minoperator /*** HELP END ***/ -des = 'Macro to generate SAS packages, version 20241027. Run %generatePackage() for help info.' +des = 'Macro to generate SAS packages, version 20241102. Run %generatePackage() for help info.' ; %if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then %do; @@ -58,7 +58,7 @@ des = 'Macro to generate SAS packages, version 20241027. Run %generatePackage() %put ### This is short help information for the `generatePackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to generate SAS packages, version `20241027` #; + %put # Macro to generate SAS packages, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -871,7 +871,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_."; title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */ %end; -footnote1 "SAS Packages Framework, version 20241027"; +footnote1 "SAS Packages Framework, version 20241102"; proc print data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent) @@ -1048,22 +1048,35 @@ data _null_; put ' filename &_PackageFileref_. clear; '; /* test if required version of package is "good enough" */ - put ' %local rV pV; '; - put ' %let pV = %sysfunc(compress(&packageVersion.,.,kd)); '; - put ' %let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 '; - put ' + (%scan(&pV.,2,.,M)+0)*1e4 '; - put ' + (%scan(&pV.,3,.,M)+0)*1e0); '; - put ' %let rV = %sysfunc(compress(&requiredVersion.,.,kd)); '; - put ' %let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 '; - put ' + (%scan(&rV.,2,.,M)+0)*1e4 '; - put ' + (%scan(&rV.,3,.,M)+0)*1e0); '; - put ' %if %sysevalf(&requiredVersion. > &packageVersion.) %then '; - put ' %do; '; - put ' %put ERROR: Required version is &requiredVersion.; '; - put ' %put ERROR- Provided version is &packageVersion.; '; - put ' %GOTO WrongVersionOFPackage; /*%RETURN;*/ '; + put ' %local rV pV rV0 pV0 rVsign; '; + put ' %let pV0 = %sysfunc(compress(&packageVersion.,.,kd)); '; + put ' %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 '; + put ' + (%scan(&pV0.,2,.,M)+0)*1e4 '; + put ' + (%scan(&pV0.,3,.,M)+0)*1e0); '; + put ' '; + put ' %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); '; + put ' %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); '; + put ' %if %superq(rVsign)= %then %let rVsign=<=; '; + put ' %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then '; + put ' %do; '; + put ' %put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; '; + put ' %put WARNING- Supported operators are: %str(= <= =< => >= < >); '; + put ' %let rVsign=<=; '; + put ' %end; '; + put ' %let rV = %sysevalf((%scan(&rV0.,1,.,M)+0)*1e8 '; + put ' + (%scan(&rV0.,2,.,M)+0)*1e4 '; + put ' + (%scan(&rV0.,3,.,M)+0)*1e0); '; + put ' '; + put ' %if NOT %sysevalf(&rV. &rVsign. &pV.) %then '; + put ' %do; '; + put ' %put ERROR: Package &packageName. will not be loaded!; '; + put ' %put ERROR- Required version is &rV0.; '; + put ' %put ERROR- Provided version is &pV0.; '; + put ' %put ERROR- Condition %bquote((&rV0. &rVsign. &pV0.)) evaluates to %sysevalf(&rV. &rVsign. &pV.); '; + put ' %put ERROR- Verify installed version of the package.; '; + put ' %put ERROR- ; '; + put ' %GOTO WrongVersionOFPackage; /*%RETURN;*/ '; put ' %end; '; - put ' filename &_PackageFileref_. &ZIP. '; put ' "&path./%lowcase(&packageName.).&zip." %unquote(&options.) '; @@ -1683,7 +1696,7 @@ data _null_; %end; put +(-1) '`.;''' / ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' / - ' !! '' %put with the SAS Packages Framework version 20241027.;''' / + ' !! '' %put with the SAS Packages Framework version 20241102.;''' / ' !! '' %put ****************************************************************************;''' / ' !! '' %GOTO theEndOfTheMacro;''' / ' !! '' %end;''' ; @@ -1848,7 +1861,7 @@ data _null_; %end; put +(-1) '`.; '' !!' / ''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' / - ''' %put with the SAS Packages Framework version 20241027.; '' !! ' / + ''' %put with the SAS Packages Framework version 20241102.; '' !! ' / ''' %put ****************************************************************************; '' !! ' / ''' %GOTO theEndOfTheMacro; '' !! ' / ''' %end; '' !! ' / @@ -2655,7 +2668,7 @@ data _null_; %end; put 'put " " / @3 "--------------------------------------------------------------------" / " ";' - / 'put @3 "*SAS package generated by SAS Package Framework, version `20241027`*";' + / 'put @3 "*SAS package generated by SAS Package Framework, version `20241102`*";' / 'put " " / @3 "--------------------------------------------------------------------";'; put 'run; ' /; @@ -3693,7 +3706,7 @@ data &filesWithCodes.markdown; %end; put " " / "--------------------------------------------------------------------" / " " - / "*SAS package generated by SAS Package Framework, version `20241027`*" + / "*SAS package generated by SAS Package Framework, version `20241102`*" / " " / "--------------------------------------------------------------------" / " "; put "# The `&packageName.` package content"; diff --git a/SPF/Macros/helppackage.sas b/SPF/Macros/helppackage.sas index e98c072..a8d0375 100644 --- a/SPF/Macros/helppackage.sas +++ b/SPF/Macros/helppackage.sas @@ -28,7 +28,7 @@ */ )/secure /*** HELP END ***/ -des = 'Macro to get help about SAS package, version 20241027. Run %helpPackage() for help info.' +des = 'Macro to get help about SAS package, version 20241102. Run %helpPackage() for help info.' ; %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %do; @@ -43,7 +43,7 @@ des = 'Macro to get help about SAS package, version 20241027. Run %helpPackage() %put ### This is short help information for the `helpPackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to get help about SAS packages, version `20241027` #; + %put # Macro to get help about SAS packages, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; diff --git a/SPF/Macros/installpackage.sas b/SPF/Macros/installpackage.sas index 73bea12..1cf90b0 100644 --- a/SPF/Macros/installpackage.sas +++ b/SPF/Macros/installpackage.sas @@ -1,5 +1,5 @@ /*+installPackage+*/ -/* Macros to install SAS packages, version 20241027 */ +/* Macros to install SAS packages, version 20241102 */ /* 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 @@ -23,7 +23,7 @@ /secure minoperator /*** HELP END ***/ -des = 'Macro to install SAS package, version 20241027. Run %%installPackage() for help info.' +des = 'Macro to install SAS package, version 20241102. Run %%installPackage() for help info.' ; %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %do; @@ -38,7 +38,7 @@ des = 'Macro to install SAS package, version 20241027. Run %%installPackage() fo %put ### This is short help information for the `installPackage` macro #; %put #--------------------------------------------------------------------------------------------#;; %put # #; - %put # Macro to install SAS packages, version `20241027` #; + %put # Macro to install SAS packages, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; diff --git a/SPF/Macros/listpackages.sas b/SPF/Macros/listpackages.sas index 8647804..a8a80c5 100644 --- a/SPF/Macros/listpackages.sas +++ b/SPF/Macros/listpackages.sas @@ -3,7 +3,7 @@ Macro to list SAS packages in packages folder. - Version 20241027 + Version 20241102 A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -23,7 +23,7 @@ %macro listPackages() /secure PARMBUFF -des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20241027.' +des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20241102.' ; %if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then %do; @@ -38,7 +38,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE %put ### This is short help information for the `listPackages` macro #; %put #-----------------------------------------------------------------------------------------#;; %put # #; - %put # Macro to list available SAS packages, version `20241027` #; + %put # Macro to list available SAS packages, version `20241102` #; %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/loadpackage.sas b/SPF/Macros/loadpackage.sas index 53b1967..6f75428 100644 --- a/SPF/Macros/loadpackage.sas +++ b/SPF/Macros/loadpackage.sas @@ -36,7 +36,7 @@ */ )/secure /*** HELP END ***/ -des = 'Macro to load SAS package, version 20241027. Run %loadPackage() for help info.' +des = 'Macro to load SAS package, version 20241102. Run %loadPackage() for help info.' minoperator ; %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then @@ -52,7 +52,7 @@ minoperator %put ### This is short help information for the `loadPackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to *load* SAS packages, version `20241027` #; + %put # Macro to *load* SAS packages, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -233,21 +233,31 @@ minoperator filename &_PackageFileref_. clear; /* test if required version of package is "good enough" */ - %local rV pV; - %let pV = %sysfunc(compress(&packageVersion.,.,kd)); - %let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 - + (%scan(&pV.,2,.,M)+0)*1e4 - + (%scan(&pV.,3,.,M)+0)*1e0); - %let rV = %sysfunc(compress(&requiredVersion.,.,kd)); - %let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 - + (%scan(&rV.,2,.,M)+0)*1e4 - + (%scan(&rV.,3,.,M)+0)*1e0); + %local rV pV rV0 pV0 rVsign; + %let pV0 = %sysfunc(compress(&packageVersion.,.,kd)); + %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 + + (%scan(&pV0.,2,.,M)+0)*1e4 + + (%scan(&pV0.,3,.,M)+0)*1e0); + + %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); + %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); + %if %superq(rVsign)= %then %let rVsign=<=; + %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then + %do; + %put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; + %put WARNING- Supported operators are: %str(= <= =< => >= < >); + %let rVsign=<=; + %end; + %let rV = %sysevalf((%scan(&rV0.,1,.,M)+0)*1e8 + + (%scan(&rV0.,2,.,M)+0)*1e4 + + (%scan(&rV0.,3,.,M)+0)*1e0); - %if %sysevalf(&rV. > &pV.) %then + %if NOT %sysevalf(&rV. &rVsign. &pV.) %then %do; %put ERROR: Package &packageName. will not be loaded!; - %put ERROR- Required version is &requiredVersion.; - %put ERROR- Provided version is &packageVersion.; + %put ERROR- Required version is &rV0.; + %put ERROR- Provided version is &pV0.; + %put ERROR- Condition %bquote((&rV0. &rVsign. &pV0.)) evaluates to %sysevalf(&rV. &rVsign. &pV.); %put ERROR- Verify installed version of the package.; %put ERROR- ; %GOTO WrongVersionOFPackage; /*%RETURN;*/ diff --git a/SPF/Macros/loadpackageaddcnt.sas b/SPF/Macros/loadpackageaddcnt.sas index e3313e8..bc6657c 100644 --- a/SPF/Macros/loadpackageaddcnt.sas +++ b/SPF/Macros/loadpackageaddcnt.sas @@ -19,7 +19,7 @@ is provided in required version */ )/secure /*** HELP END ***/ -des = 'Macro to load additional content for a SAS package, version 20241027. Run %loadPackageAddCnt() for help info.' +des = 'Macro to load additional content for a SAS package, version 20241102. Run %loadPackageAddCnt() for help info.' minoperator ; %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then @@ -35,7 +35,7 @@ minoperator %put ### This is short help information for the `loadPackageAddCnt` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to *load* additional content for a SAS package, version `20241027` #; + %put # Macro to *load* additional content for a SAS package, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -157,22 +157,33 @@ minoperator %include &_PackageFileref_.(packagemetadata.sas) / &source2.; filename &_PackageFileref_. clear; + /* test if required version of package is "good enough" */ - %local rV pV; - %let pV = %sysfunc(compress(&packageVersion.,.,kd)); - %let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 - + (%scan(&pV.,2,.,M)+0)*1e4 - + (%scan(&pV.,3,.,M)+0)*1e0); - %let rV = %sysfunc(compress(&requiredVersion.,.,kd)); - %let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 - + (%scan(&rV.,2,.,M)+0)*1e4 - + (%scan(&rV.,3,.,M)+0)*1e0); + %local rV pV rV0 pV0 rVsign; + %let pV0 = %sysfunc(compress(&packageVersion.,.,kd)); + %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 + + (%scan(&pV0.,2,.,M)+0)*1e4 + + (%scan(&pV0.,3,.,M)+0)*1e0); + + %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); + %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); + %if %superq(rVsign)= %then %let rVsign=<=; + %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then + %do; + %put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; + %put WARNING- Supported operators are: %str(= <= =< => >= < >); + %let rVsign=<=; + %end; + %let rV = %sysevalf((%scan(&rV0.,1,.,M)+0)*1e8 + + (%scan(&rV0.,2,.,M)+0)*1e4 + + (%scan(&rV0.,3,.,M)+0)*1e0); - %if %sysevalf(&rV. > &pV.) %then + %if NOT %sysevalf(&rV. &rVsign. &pV.) %then %do; %put ERROR: Additional content for package &packageName. will not be loaded!; - %put ERROR- Required version is &requiredVersion.; - %put ERROR- Provided version is &packageVersion.; + %put ERROR- Required version is &rV0.; + %put ERROR- Provided version is &pV0.; + %put ERROR- Condition %bquote((&rV0. &rVsign. &pV0.)) evaluates to %sysevalf(&rV. &rVsign. &pV.); %put ERROR- Verify installed version of the package.; %put ERROR- ; %GOTO WrongVersionOFPackageAddCnt; /*%RETURN;*/ diff --git a/SPF/Macros/loadpackages.sas b/SPF/Macros/loadpackages.sas index be4d842..2f88e99 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 20241027. Run %loadPackages() for help info.' +des = 'Macro to load multiple SAS packages at one run, version 20241102. 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 `20241027` #; + %put # Macro wrapper for the loadPackage macro, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -79,7 +79,7 @@ parmbuff %local lengthOfsyspbuff numberOfPackagesNames i packageElement packageName packageVersion str; %let lengthOfsyspbuff = %qsysfunc(length(&syspbuff.)); - %let packagesNames = %qsysfunc(compress(%qsubstr(&syspbuff., 2, %eval(&lengthOfsyspbuff.-2)), {[(. _,)]}, KDA)); + %let packagesNames = %qsysfunc(compress(%qsubstr(&syspbuff., 2, %eval(&lengthOfsyspbuff.-2)), {[(. <=>_,)]}, KDA)); %let str = %qsysfunc(translate(%superq(packagesNames),[[ ]],{(,)})); %let str = %qsysfunc(transtrn(%superq(str),],%str(] ))); diff --git a/SPF/Macros/previewpackage.sas b/SPF/Macros/previewpackage.sas index 7d247e3..41c9757 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 20241027. Run %previewPackage() for help info.' +des = 'Macro to preview content of a SAS package, version 20241102. 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 20241027. Run %preview %put ### This is short help information for the `previewPackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to get preview of a SAS packages, version `20241027` #; + %put # Macro to get preview of a SAS packages, version `20241102` #; %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/splitcodeforpackage.sas b/SPF/Macros/splitcodeforpackage.sas index 28e9308..3c20d1e 100644 --- a/SPF/Macros/splitcodeforpackage.sas +++ b/SPF/Macros/splitcodeforpackage.sas @@ -8,7 +8,7 @@ ,nobs=0 /* technical parameter */ ) /*** HELP START ***/ -/ des = 'Macro to split single code into multiple files for a SAS package, version 20241027. Run %splitCodeForPackage() for help info.' +/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20241102. Run %splitCodeForPackage() for help info.' ; /*%macro _();%mend _;*/ %if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then @@ -25,7 +25,7 @@ %put #-------------------------------------------------------------------------------#; %put # #; %put # Utility macro to *split* single file with SAS package code into multiple #; - %put # files with separate snippets, version `20241027` #; + %put # files with separate snippets, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -402,7 +402,7 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ; */ if firstLine[j] then do; - put '/* File generated with help of SAS Packages Framework, version 20241027. */'; + put '/* File generated with help of SAS Packages Framework, version 20241102. */'; firstLine[j]=0; end; put _infile_; diff --git a/SPF/Macros/unloadpackage.sas b/SPF/Macros/unloadpackage.sas index ef9c58a..f590196 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 20241027. Run %unloadPackage() for help info.' +des = 'Macro to unload SAS package, version 20241102. 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 20241027. Run %unloadPackage() for h %put ### This is short help information for the `unloadPackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to unload SAS packages, version `20241027` #; + %put # Macro to unload SAS packages, version `20241102` #; %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 05b25b6..5530757 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 20241027. Run %verifyPackage() for help info.' +des = 'Macro to verify SAS package with the hash digest, version 20241102. 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 20241027. Run % %put ### This is short help information for the `verifyPackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to verify SAS package with it hash digest, version `20241027` #; + %put # Macro to verify SAS package with it hash digest, version `20241102` #; %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 dbf34d1..9265846 100644 --- a/SPF/SPFinit.md +++ b/SPF/SPFinit.md @@ -23,7 +23,7 @@ A **SAS package** is an automatically generated, single, stand alone *zip* file The *purpose of a package* is to be a simple, and easy to access, code sharing medium, which will allow: on the one hand, to separate the code complex dependencies created by the developer from the user experience with the final product and, on the other hand, reduce developer's and user's unnecessary frustration related to a remote deployment process. -In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20241027`**. +In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20241102`**. **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). @@ -41,7 +41,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 `20241027` + Macro to install SAS packages, version `20241102` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -155,7 +155,7 @@ filename packages "C:/SAS_PACKAGES"; ## This is short help information for the `helpPackage` macro ------------------------------------------------------------------------------- - Macro to get help about SAS packages, version `20241027` + Macro to get help about SAS packages, version `20241102` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -231,7 +231,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 `20241027` + Macro to *load* SAS packages, version `20241102` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -387,7 +387,7 @@ If created, those macros are automatically deleted when the `%unloadPackage()` m ## This is short help information for the `loadPackageS` macro ------------------------------------------------------------------------------- - Macro wrapper for the loadPackage macro, version `20241027` + Macro wrapper for the loadPackage macro, version `20241102` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -436,7 +436,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 `20241027` + Macro to unload SAS packages, version `20241102` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -501,7 +501,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 `20241027` + Macro to list available SAS packages, version `20241102` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -542,7 +542,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 `20241027` + Macro to verify SAS package with it hash digest, version `20241102` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -596,7 +596,7 @@ filename packages "C:/SAS_PACKAGES"; %* set-up a directory for packages; ## This is short help information for the `previewPackage` macro ------------------------------------------------------------------------------- - Macro to get preview of a SAS packages, version `20241027` + Macro to get preview of a SAS packages, version `20241102` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -663,7 +663,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 `20241027` + Macro to generate SAS packages, version `20241102` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -878,7 +878,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 `20241027` + Macro to list directories pointed by 'packages' fileref, version `20241102` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -918,7 +918,7 @@ filename packages ("D:/NEW_DIR" %extendPackagesFileref()); %* add new directory; ## This is short help information for the `loadPackageAddCnt` macro ------------------------------------------------------------------------------- - Macro to load *additional content* for a SAS package, version `20241027` + Macro to load *additional content* for a SAS package, version `20241102` A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -1010,7 +1010,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages; ------------------------------------------------------------------------------- Utility macro to *split* single file with SAS package code into multiple - files with separate snippets, version `20241027` + files with separate snippets, version `20241102` 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 70e8b1c..05b76ce 100644 --- a/SPF/SPFinit.sas +++ b/SPF/SPFinit.sas @@ -42,7 +42,7 @@ - to unload, or - to generate SAS packages. - Version 20241027. + Version 20241102. See examples below. A SAS package is a zip file containing a group of files @@ -91,7 +91,7 @@ */ )/secure /*** HELP END ***/ -des = 'Macro to load SAS package, version 20241027. Run %loadPackage() for help info.' +des = 'Macro to load SAS package, version 20241102. Run %loadPackage() for help info.' minoperator ; %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then @@ -107,7 +107,7 @@ minoperator %put ### This is short help information for the `loadPackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to *load* SAS packages, version `20241027` #; + %put # Macro to *load* SAS packages, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -288,21 +288,31 @@ minoperator filename &_PackageFileref_. clear; /* test if required version of package is "good enough" */ - %local rV pV; - %let pV = %sysfunc(compress(&packageVersion.,.,kd)); - %let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 - + (%scan(&pV.,2,.,M)+0)*1e4 - + (%scan(&pV.,3,.,M)+0)*1e0); - %let rV = %sysfunc(compress(&requiredVersion.,.,kd)); - %let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 - + (%scan(&rV.,2,.,M)+0)*1e4 - + (%scan(&rV.,3,.,M)+0)*1e0); + %local rV pV rV0 pV0 rVsign; + %let pV0 = %sysfunc(compress(&packageVersion.,.,kd)); + %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 + + (%scan(&pV0.,2,.,M)+0)*1e4 + + (%scan(&pV0.,3,.,M)+0)*1e0); + + %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); + %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); + %if %superq(rVsign)= %then %let rVsign=<=; + %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then + %do; + %put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; + %put WARNING- Supported operators are: %str(= <= =< => >= < >); + %let rVsign=<=; + %end; + %let rV = %sysevalf((%scan(&rV0.,1,.,M)+0)*1e8 + + (%scan(&rV0.,2,.,M)+0)*1e4 + + (%scan(&rV0.,3,.,M)+0)*1e0); - %if %sysevalf(&rV. > &pV.) %then + %if NOT %sysevalf(&rV. &rVsign. &pV.) %then %do; %put ERROR: Package &packageName. will not be loaded!; - %put ERROR- Required version is &requiredVersion.; - %put ERROR- Provided version is &packageVersion.; + %put ERROR- Required version is &rV0.; + %put ERROR- Provided version is &pV0.; + %put ERROR- Condition %bquote((&rV0. &rVsign. &pV0.)) evaluates to %sysevalf(&rV. &rVsign. &pV.); %put ERROR- Verify installed version of the package.; %put ERROR- ; %GOTO WrongVersionOFPackage; /*%RETURN;*/ @@ -372,7 +382,7 @@ minoperator */ )/secure /*** HELP END ***/ -des = 'Macro to unload SAS package, version 20241027. Run %unloadPackage() for help info.' +des = 'Macro to unload SAS package, version 20241102. Run %unloadPackage() for help info.' ; %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %do; @@ -387,7 +397,7 @@ des = 'Macro to unload SAS package, version 20241027. Run %unloadPackage() for h %put ### This is short help information for the `unloadPackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to unload SAS packages, version `20241027` #; + %put # Macro to unload SAS packages, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -538,7 +548,7 @@ des = 'Macro to unload SAS package, version 20241027. Run %unloadPackage() for h */ )/secure /*** HELP END ***/ -des = 'Macro to get help about SAS package, version 20241027. Run %helpPackage() for help info.' +des = 'Macro to get help about SAS package, version 20241102. Run %helpPackage() for help info.' ; %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %do; @@ -553,7 +563,7 @@ des = 'Macro to get help about SAS package, version 20241027. Run %helpPackage() %put ### This is short help information for the `helpPackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to get help about SAS packages, version `20241027` #; + %put # Macro to get help about SAS packages, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -694,7 +704,7 @@ TODO: */ /*+installPackage+*/ -/* Macros to install SAS packages, version 20241027 */ +/* Macros to install SAS packages, version 20241102 */ /* 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 @@ -718,7 +728,7 @@ TODO: /secure minoperator /*** HELP END ***/ -des = 'Macro to install SAS package, version 20241027. Run %%installPackage() for help info.' +des = 'Macro to install SAS package, version 20241102. Run %%installPackage() for help info.' ; %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %do; @@ -733,7 +743,7 @@ des = 'Macro to install SAS package, version 20241027. Run %%installPackage() fo %put ### This is short help information for the `installPackage` macro #; %put #--------------------------------------------------------------------------------------------#;; %put # #; - %put # Macro to install SAS packages, version `20241027` #; + %put # Macro to install SAS packages, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -1266,7 +1276,7 @@ des = 'Macro to install SAS package, version 20241027. Run %%installPackage() fo Macro to list SAS packages in packages folder. - Version 20241027 + Version 20241102 A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -1286,7 +1296,7 @@ des = 'Macro to install SAS package, version 20241027. Run %%installPackage() fo %macro listPackages() /secure PARMBUFF -des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20241027.' +des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20241102.' ; %if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then %do; @@ -1301,7 +1311,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 `20241027` #; + %put # Macro to list available SAS packages, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -1452,7 +1462,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.; Macro to generate SAS packages. - Version 20241027 + Version 20241102 A SAS package is a zip file containing a group of SAS codes (macros, functions, data steps generating @@ -1492,7 +1502,7 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.; file name be created */ )/ secure minoperator /*** HELP END ***/ -des = 'Macro to generate SAS packages, version 20241027. Run %generatePackage() for help info.' +des = 'Macro to generate SAS packages, version 20241102. Run %generatePackage() for help info.' ; %if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then %do; @@ -1507,7 +1517,7 @@ des = 'Macro to generate SAS packages, version 20241027. Run %generatePackage() %put ### This is short help information for the `generatePackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to generate SAS packages, version `20241027` #; + %put # Macro to generate SAS packages, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -2320,7 +2330,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_."; title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */ %end; -footnote1 "SAS Packages Framework, version 20241027"; +footnote1 "SAS Packages Framework, version 20241102"; proc print data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent) @@ -2497,22 +2507,35 @@ data _null_; put ' filename &_PackageFileref_. clear; '; /* test if required version of package is "good enough" */ - put ' %local rV pV; '; - put ' %let pV = %sysfunc(compress(&packageVersion.,.,kd)); '; - put ' %let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 '; - put ' + (%scan(&pV.,2,.,M)+0)*1e4 '; - put ' + (%scan(&pV.,3,.,M)+0)*1e0); '; - put ' %let rV = %sysfunc(compress(&requiredVersion.,.,kd)); '; - put ' %let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 '; - put ' + (%scan(&rV.,2,.,M)+0)*1e4 '; - put ' + (%scan(&rV.,3,.,M)+0)*1e0); '; - put ' %if %sysevalf(&requiredVersion. > &packageVersion.) %then '; - put ' %do; '; - put ' %put ERROR: Required version is &requiredVersion.; '; - put ' %put ERROR- Provided version is &packageVersion.; '; - put ' %GOTO WrongVersionOFPackage; /*%RETURN;*/ '; + put ' %local rV pV rV0 pV0 rVsign; '; + put ' %let pV0 = %sysfunc(compress(&packageVersion.,.,kd)); '; + put ' %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 '; + put ' + (%scan(&pV0.,2,.,M)+0)*1e4 '; + put ' + (%scan(&pV0.,3,.,M)+0)*1e0); '; + put ' '; + put ' %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); '; + put ' %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); '; + put ' %if %superq(rVsign)= %then %let rVsign=<=; '; + put ' %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then '; + put ' %do; '; + put ' %put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; '; + put ' %put WARNING- Supported operators are: %str(= <= =< => >= < >); '; + put ' %let rVsign=<=; '; + put ' %end; '; + put ' %let rV = %sysevalf((%scan(&rV0.,1,.,M)+0)*1e8 '; + put ' + (%scan(&rV0.,2,.,M)+0)*1e4 '; + put ' + (%scan(&rV0.,3,.,M)+0)*1e0); '; + put ' '; + put ' %if NOT %sysevalf(&rV. &rVsign. &pV.) %then '; + put ' %do; '; + put ' %put ERROR: Package &packageName. will not be loaded!; '; + put ' %put ERROR- Required version is &rV0.; '; + put ' %put ERROR- Provided version is &pV0.; '; + put ' %put ERROR- Condition %bquote((&rV0. &rVsign. &pV0.)) evaluates to %sysevalf(&rV. &rVsign. &pV.); '; + put ' %put ERROR- Verify installed version of the package.; '; + put ' %put ERROR- ; '; + put ' %GOTO WrongVersionOFPackage; /*%RETURN;*/ '; put ' %end; '; - put ' filename &_PackageFileref_. &ZIP. '; put ' "&path./%lowcase(&packageName.).&zip." %unquote(&options.) '; @@ -3132,7 +3155,7 @@ data _null_; %end; put +(-1) '`.;''' / ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' / - ' !! '' %put with the SAS Packages Framework version 20241027.;''' / + ' !! '' %put with the SAS Packages Framework version 20241102.;''' / ' !! '' %put ****************************************************************************;''' / ' !! '' %GOTO theEndOfTheMacro;''' / ' !! '' %end;''' ; @@ -3297,7 +3320,7 @@ data _null_; %end; put +(-1) '`.; '' !!' / ''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' / - ''' %put with the SAS Packages Framework version 20241027.; '' !! ' / + ''' %put with the SAS Packages Framework version 20241102.; '' !! ' / ''' %put ****************************************************************************; '' !! ' / ''' %GOTO theEndOfTheMacro; '' !! ' / ''' %end; '' !! ' / @@ -4104,7 +4127,7 @@ data _null_; %end; put 'put " " / @3 "--------------------------------------------------------------------" / " ";' - / 'put @3 "*SAS package generated by SAS Package Framework, version `20241027`*";' + / 'put @3 "*SAS package generated by SAS Package Framework, version `20241102`*";' / 'put " " / @3 "--------------------------------------------------------------------";'; put 'run; ' /; @@ -5142,7 +5165,7 @@ data &filesWithCodes.markdown; %end; put " " / "--------------------------------------------------------------------" / " " - / "*SAS package generated by SAS Package Framework, version `20241027`*" + / "*SAS package generated by SAS Package Framework, version `20241102`*" / " " / "--------------------------------------------------------------------" / " "; put "# The `&packageName.` package content"; @@ -5420,7 +5443,7 @@ TODO: (in Polish) */ )/secure /*** HELP END ***/ -des = 'Macro to load multiple SAS packages at one run, version 20241027. Run %loadPackages() for help info.' +des = 'Macro to load multiple SAS packages at one run, version 20241102. Run %loadPackages() for help info.' parmbuff ; %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then @@ -5436,7 +5459,7 @@ parmbuff %put ### This is short help information for the `loadPackageS` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro wrapper for the loadPackage macro, version `20241027` #; + %put # Macro wrapper for the loadPackage macro, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -5488,7 +5511,7 @@ parmbuff %local lengthOfsyspbuff numberOfPackagesNames i packageElement packageName packageVersion str; %let lengthOfsyspbuff = %qsysfunc(length(&syspbuff.)); - %let packagesNames = %qsysfunc(compress(%qsubstr(&syspbuff., 2, %eval(&lengthOfsyspbuff.-2)), {[(. _,)]}, KDA)); + %let packagesNames = %qsysfunc(compress(%qsubstr(&syspbuff., 2, %eval(&lengthOfsyspbuff.-2)), {[(. <=>_,)]}, KDA)); %let str = %qsysfunc(translate(%superq(packagesNames),[[ ]],{(,)})); %let str = %qsysfunc(transtrn(%superq(str),],%str(] ))); @@ -5533,7 +5556,7 @@ parmbuff hashing_file() function, SAS 9.4M6 */ )/secure /*** HELP END ***/ -des = 'Macro to verify SAS package with the hash digest, version 20241027. Run %verifyPackage() for help info.' +des = 'Macro to verify SAS package with the hash digest, version 20241102. Run %verifyPackage() for help info.' ; %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %do; @@ -5548,7 +5571,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20241027. Run % %put ### This is short help information for the `verifyPackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to verify SAS package with it hash digest, version `20241027` #; + %put # Macro to verify SAS package with it hash digest, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -5728,7 +5751,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20241027. Run % */ )/secure /*** HELP END ***/ -des = 'Macro to preview content of a SAS package, version 20241027. Run %previewPackage() for help info.' +des = 'Macro to preview content of a SAS package, version 20241102. Run %previewPackage() for help info.' ; %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %do; @@ -5743,7 +5766,7 @@ des = 'Macro to preview content of a SAS package, version 20241027. Run %preview %put ### This is short help information for the `previewPackage` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to get preview of a SAS packages, version `20241027` #; + %put # Macro to get preview of a SAS packages, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -5873,7 +5896,7 @@ des = 'Macro to preview content of a SAS package, version 20241027. Run %preview when empty the "packages" value is used */ )/secure /*** HELP END ***/ -des = 'Macro to list directories pointed by "packages" fileref, version 20241027. Run %extendPackagesFileref(HELP) for help info.' +des = 'Macro to list directories pointed by "packages" fileref, version 20241102. Run %extendPackagesFileref(HELP) for help info.' ; %if %QUPCASE(&packages.) = HELP %then @@ -5889,7 +5912,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20241027 %put ### This is short help information for the `extendPackagesFileref` macro #; %put #-----------------------------------------------------------------------------------------#;; %put # #; - %put # Macro to list directories pointed by 'packages' fileref, version `20241027` #; + %put # Macro to list directories pointed by 'packages' fileref, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -5990,7 +6013,7 @@ filename packages list; is provided in required version */ )/secure /*** HELP END ***/ -des = 'Macro to load additional content for a SAS package, version 20241027. Run %loadPackageAddCnt() for help info.' +des = 'Macro to load additional content for a SAS package, version 20241102. Run %loadPackageAddCnt() for help info.' minoperator ; %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then @@ -6006,7 +6029,7 @@ minoperator %put ### This is short help information for the `loadPackageAddCnt` macro #; %put #-------------------------------------------------------------------------------#; %put # #; - %put # Macro to *load* additional content for a SAS package, version `20241027` #; + %put # Macro to *load* additional content for a SAS package, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -6128,22 +6151,33 @@ minoperator %include &_PackageFileref_.(packagemetadata.sas) / &source2.; filename &_PackageFileref_. clear; + /* test if required version of package is "good enough" */ - %local rV pV; - %let pV = %sysfunc(compress(&packageVersion.,.,kd)); - %let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 - + (%scan(&pV.,2,.,M)+0)*1e4 - + (%scan(&pV.,3,.,M)+0)*1e0); - %let rV = %sysfunc(compress(&requiredVersion.,.,kd)); - %let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 - + (%scan(&rV.,2,.,M)+0)*1e4 - + (%scan(&rV.,3,.,M)+0)*1e0); + %local rV pV rV0 pV0 rVsign; + %let pV0 = %sysfunc(compress(&packageVersion.,.,kd)); + %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 + + (%scan(&pV0.,2,.,M)+0)*1e4 + + (%scan(&pV0.,3,.,M)+0)*1e0); + + %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); + %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); + %if %superq(rVsign)= %then %let rVsign=<=; + %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then + %do; + %put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; + %put WARNING- Supported operators are: %str(= <= =< => >= < >); + %let rVsign=<=; + %end; + %let rV = %sysevalf((%scan(&rV0.,1,.,M)+0)*1e8 + + (%scan(&rV0.,2,.,M)+0)*1e4 + + (%scan(&rV0.,3,.,M)+0)*1e0); - %if %sysevalf(&rV. > &pV.) %then + %if NOT %sysevalf(&rV. &rVsign. &pV.) %then %do; %put ERROR: Additional content for package &packageName. will not be loaded!; - %put ERROR- Required version is &requiredVersion.; - %put ERROR- Provided version is &packageVersion.; + %put ERROR- Required version is &rV0.; + %put ERROR- Provided version is &pV0.; + %put ERROR- Condition %bquote((&rV0. &rVsign. &pV0.)) evaluates to %sysevalf(&rV. &rVsign. &pV.); %put ERROR- Verify installed version of the package.; %put ERROR- ; %GOTO WrongVersionOFPackageAddCnt; /*%RETURN;*/ @@ -6353,7 +6387,7 @@ minoperator ,nobs=0 /* technical parameter */ ) /*** HELP START ***/ -/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20241027. Run %splitCodeForPackage() for help info.' +/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20241102. Run %splitCodeForPackage() for help info.' ; /*%macro _();%mend _;*/ %if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then @@ -6370,7 +6404,7 @@ minoperator %put #-------------------------------------------------------------------------------#; %put # #; %put # Utility macro to *split* single file with SAS package code into multiple #; - %put # files with separate snippets, version `20241027` #; + %put # files with separate snippets, version `20241102` #; %put # #; %put # A SAS package is a zip file containing a group #; %put # of SAS codes (macros, functions, data steps generating #; @@ -6747,7 +6781,7 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ; */ if firstLine[j] then do; - put '/* File generated with help of SAS Packages Framework, version 20241027. */'; + put '/* File generated with help of SAS Packages Framework, version 20241102. */'; firstLine[j]=0; end; put _infile_;