Compare commits

..

3 Commits

Author SHA1 Message Date
Bart Jablonski
c4e21e86b6 SAS Packages Framework, version 20241129
SAS Packages Framework, version 20241129

Bug Fix in:
- `%generatePackage()` macro, and
- `%splitCodeForPackage()` macro.

---
2024-11-29 17:01:10 +01:00
Bart Jablonski
006377b255 PHUSE EU 2024 conference article on SAS packages
PHUSE EU 2024 conference article on SAS packages
2024-11-11 10:43:30 +01:00
Bart Jablonski
4b640e8ce1 SAS Packages Framework, version 20241102
SAS Packages Framework, version 20241102

Changes:

In the `%loadPackage()`, the `%ICEloadPackage()`, and the `%loadPackageAddCnt()` macros version of a package can be provided with a comparison condition.

If the required version is provided with a comparison operator, e.g., `<=`, `=`, or `>`, then the operator is used to compare `required` and `provided` versions.

The following example:
```sas
%loadPackage(myPackage
  ,requiredVersion=1.2.2=
)
```
will force to load the package only if the required version is exactly equal to the provided one.

Comparison is done in form "`req. comparison prov.`".

Documentation and HoW-materials updated.
2024-11-02 22:18:23 +01:00
17 changed files with 247 additions and 179 deletions

View File

@@ -16,7 +16,7 @@ Don't forget to **STAR** (:star:) the repository! :-)
### Current version: ### Current version:
**The latest version** of SPF is **`20241027`**. **The latest version** of SPF is **`20241129`**.
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). 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).

Binary file not shown.

View File

@@ -6,7 +6,7 @@
when empty the "packages" value is used */ when empty the "packages" value is used */
)/secure )/secure
/*** HELP END ***/ /*** 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 20241129. Run %extendPackagesFileref(HELP) for help info.'
; ;
%if %QUPCASE(&packages.) = HELP %then %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 ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list directories pointed by 'packages' fileref, version `20241027` #; %put # Macro to list directories pointed by 'packages' fileref, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -3,7 +3,7 @@
Macro to generate SAS packages. Macro to generate SAS packages.
Version 20241027 Version 20241129
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -43,7 +43,7 @@
file name be created */ file name be created */
)/ secure minoperator )/ secure minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to generate SAS packages, version 20241027. Run %generatePackage() for help info.' des = 'Macro to generate SAS packages, version 20241129. Run %generatePackage() for help info.'
; ;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then %if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do; %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 ### This is short help information for the `generatePackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to generate SAS packages, version `20241027` #; %put # Macro to generate SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %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(%'%")))" ; /* " */ title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */
%end; %end;
footnote1 "SAS Packages Framework, version 20241027"; footnote1 "SAS Packages Framework, version 20241129";
proc print proc print
data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent) data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent)
@@ -1048,22 +1048,35 @@ data _null_;
put ' filename &_PackageFileref_. clear; '; put ' filename &_PackageFileref_. clear; ';
/* test if required version of package is "good enough" */ /* test if required version of package is "good enough" */
put ' %local rV pV; '; put ' %local rV pV rV0 pV0 rVsign; ';
put ' %let pV = %sysfunc(compress(&packageVersion.,.,kd)); '; put ' %let pV0 = %sysfunc(compress(&packageVersion.,.,kd)); ';
put ' %let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 '; put ' %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 ';
put ' + (%scan(&pV.,2,.,M)+0)*1e4 '; put ' + (%scan(&pV0.,2,.,M)+0)*1e4 ';
put ' + (%scan(&pV.,3,.,M)+0)*1e0); '; put ' + (%scan(&pV0.,3,.,M)+0)*1e0); ';
put ' %let rV = %sysfunc(compress(&requiredVersion.,.,kd)); '; put ' ';
put ' %let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 '; put ' %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); ';
put ' + (%scan(&rV.,2,.,M)+0)*1e4 '; put ' %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); ';
put ' + (%scan(&rV.,3,.,M)+0)*1e0); '; put ' %if %superq(rVsign)= %then %let rVsign=<=; ';
put ' %if %sysevalf(&requiredVersion. > &packageVersion.) %then '; put ' %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then ';
put ' %do; '; put ' %do; ';
put ' %put ERROR: Required version is &requiredVersion.; '; put ' %put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; ';
put ' %put ERROR- Provided version is &packageVersion.; '; put ' %put WARNING- Supported operators are: %str(= <= =< => >= < >); ';
put ' %GOTO WrongVersionOFPackage; /*%RETURN;*/ '; 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 ' %end; ';
put ' filename &_PackageFileref_. &ZIP. '; put ' filename &_PackageFileref_. &ZIP. ';
put ' "&path./%lowcase(&packageName.).&zip." %unquote(&options.) '; put ' "&path./%lowcase(&packageName.).&zip." %unquote(&options.) ';
@@ -1683,7 +1696,7 @@ data _null_;
%end; %end;
put +(-1) '`.;''' / put +(-1) '`.;''' /
' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' / ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' /
' !! '' %put with the SAS Packages Framework version 20241027.;''' / ' !! '' %put with the SAS Packages Framework version 20241129.;''' /
' !! '' %put ****************************************************************************;''' / ' !! '' %put ****************************************************************************;''' /
' !! '' %GOTO theEndOfTheMacro;''' / ' !! '' %GOTO theEndOfTheMacro;''' /
' !! '' %end;''' ; ' !! '' %end;''' ;
@@ -1848,7 +1861,7 @@ data _null_;
%end; %end;
put +(-1) '`.; '' !!' / put +(-1) '`.; '' !!' /
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' / ''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' /
''' %put with the SAS Packages Framework version 20241027.; '' !! ' / ''' %put with the SAS Packages Framework version 20241129.; '' !! ' /
''' %put ****************************************************************************; '' !! ' / ''' %put ****************************************************************************; '' !! ' /
''' %GOTO theEndOfTheMacro; '' !! ' / ''' %GOTO theEndOfTheMacro; '' !! ' /
''' %end; '' !! ' / ''' %end; '' !! ' /
@@ -2364,20 +2377,20 @@ data _null_;
end; end;
/* delete data sets */ /* delete data sets */
put "proc fedsql noprint;"; put "proc SQL noprint;";
EOF = 0; EOF = 0;
do until(EOF); do until(EOF);
set &filesWithCodes. end = EOF; set &filesWithCodes. end = EOF;
if not (upcase(type) in: ('DATA')) then continue; if not (upcase(type) in: ('DATA')) then continue;
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;'; put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
put '%put NOTE- ;'; put '%put NOTE- ;';
put 'drop table ' fileshort ' FORCE;' /; put '%sysfunc(ifc(%sysfunc(exist(' fileshort ')),drop table ' fileshort ',));' /;
end; end;
put "quit;" /; put "quit;" /;
/* delete PROC DS2 packages or threads */ /* delete PROC DS2 packages or threads */
put 'data _null_; call symputx("_DS2_2_del_",0,"L"); run;'; put 'data _null_; call symputx("_DS2_2_del_",0,"L"); run;';
put "proc fedsql noprint;"; put "proc SQL noprint;";
EOF = 0; EOF = 0;
do until(EOF); do until(EOF);
set &filesWithCodes. end = EOF; set &filesWithCodes. end = EOF;
@@ -2386,10 +2399,10 @@ data _null_;
/ '%put NOTE- ;' / '%put NOTE- ;'
/ '%let _DS2_2_del_ = %sysfunc(open(' fileshort '));' / '%let _DS2_2_del_ = %sysfunc(open(' fileshort '));'
/ '%sysfunc(ifc(&_DS2_2_del_. AND %sysfunc(ATTRC(&_DS2_2_del_.,LABEL))=' / '%sysfunc(ifc(&_DS2_2_del_. AND %sysfunc(ATTRC(&_DS2_2_del_.,LABEL))='
/ '%str(' "Package: &packageName. ; Type: " type "; Name: " fileshort +(-1) '),drop table ' fileshort ' FORCE,)) ;' / '%str(' "Package: &packageName. ; Type: " type "; Name: " fileshort +(-1) '),drop table ' fileshort ',)) '
/ '%let _DS2_2_del_ = %sysfunc(close(&_DS2_2_del_.));' / '%let _DS2_2_del_ = %sysfunc(close(&_DS2_2_del_.));'
; ;
put ';' /; put ';' /; /* this is semicolon closing drop table statement */
end; end;
put "quit;" /; put "quit;" /;
@@ -2655,7 +2668,7 @@ data _null_;
%end; %end;
put 'put " " / @3 "--------------------------------------------------------------------" / " ";' put 'put " " / @3 "--------------------------------------------------------------------" / " ";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20241027`*";' / 'put @3 "*SAS package generated by SAS Package Framework, version `20241129`*";'
/ 'put " " / @3 "--------------------------------------------------------------------";'; / 'put " " / @3 "--------------------------------------------------------------------";';
put 'run; ' /; put 'run; ' /;
@@ -3184,7 +3197,7 @@ run;
%if %Qupcase(&sascfgFile.) = DEF %then /* the DEF value points to the sasv9.cfg file in the sasroot directory */ %if %Qupcase(&sascfgFile.) = DEF %then /* the DEF value points to the sasv9.cfg file in the sasroot directory */
%do; %do;
%let SASCONFIG = -config ""&SASROOT./sasv9.cfg""; %let SASCONFIG = -config "&SASROOT./sasv9.cfg";
%put NOTE: The following SAS config file will be used:; %put NOTE: The following SAS config file will be used:;
%put NOTE- &=SASCONFIG.; %put NOTE- &=SASCONFIG.;
%end; %end;
@@ -3192,7 +3205,7 @@ run;
%do; %do;
%if %sysfunc(fileexist(&sascfgFile.)) %then %if %sysfunc(fileexist(&sascfgFile.)) %then
%do; %do;
%let SASCONFIG = -config ""&SASCFGFILE.""; %let SASCONFIG = -config "&SASCFGFILE.";
%put NOTE: The following SAS config file will be used:; %put NOTE: The following SAS config file will be used:;
%put NOTE- &=SASCONFIG.; %put NOTE- &=SASCONFIG.;
%end; %end;
@@ -3693,7 +3706,7 @@ data &filesWithCodes.markdown;
%end; %end;
put " " / "--------------------------------------------------------------------" / " " put " " / "--------------------------------------------------------------------" / " "
/ "*SAS package generated by SAS Package Framework, version `20241027`*" / "*SAS package generated by SAS Package Framework, version `20241129`*"
/ " " / "--------------------------------------------------------------------" / " "; / " " / "--------------------------------------------------------------------" / " ";
put "# The `&packageName.` package content"; put "# The `&packageName.` package content";

View File

@@ -28,7 +28,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** 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 20241129. Run %helpPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %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 ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get help about SAS packages, version `20241027` #; %put # Macro to get help about SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -1,5 +1,5 @@
/*+installPackage+*/ /*+installPackage+*/
/* Macros to install SAS packages, version 20241027 */ /* Macros to install SAS packages, version 20241129 */
/* A SAS package is a zip file containing a group of files /* A SAS package is a zip file containing a group of files
with SAS code (macros, functions, data steps generating with SAS code (macros, functions, data steps generating
data, etc.) wrapped up together and %INCLUDEed by data, etc.) wrapped up together and %INCLUDEed by
@@ -23,7 +23,7 @@
/secure /secure
minoperator minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to install SAS package, version 20241027. Run %%installPackage() for help info.' des = 'Macro to install SAS package, version 20241129. Run %%installPackage() for help info.'
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do; %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 ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;; %put #--------------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to install SAS packages, version `20241027` #; %put # Macro to install SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -3,7 +3,7 @@
Macro to list SAS packages in packages folder. Macro to list SAS packages in packages folder.
Version 20241027 Version 20241129
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -23,7 +23,7 @@
%macro listPackages() %macro listPackages()
/secure PARMBUFF /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 20241129.'
; ;
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then %if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
%do; %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 ### This is short help information for the `listPackages` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list available SAS packages, version `20241027` #; %put # Macro to list available SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -36,7 +36,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load SAS package, version 20241027. Run %loadPackage() for help info.' des = 'Macro to load SAS package, version 20241129. Run %loadPackage() for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -52,7 +52,7 @@ minoperator
%put ### This is short help information for the `loadPackage` macro #; %put ### This is short help information for the `loadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *load* SAS packages, version `20241027` #; %put # Macro to *load* SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -233,21 +233,31 @@ minoperator
filename &_PackageFileref_. clear; filename &_PackageFileref_. clear;
/* test if required version of package is "good enough" */ /* test if required version of package is "good enough" */
%local rV pV; %local rV pV rV0 pV0 rVsign;
%let pV = %sysfunc(compress(&packageVersion.,.,kd)); %let pV0 = %sysfunc(compress(&packageVersion.,.,kd));
%let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8
+ (%scan(&pV.,2,.,M)+0)*1e4 + (%scan(&pV0.,2,.,M)+0)*1e4
+ (%scan(&pV.,3,.,M)+0)*1e0); + (%scan(&pV0.,3,.,M)+0)*1e0);
%let rV = %sysfunc(compress(&requiredVersion.,.,kd));
%let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd));
+ (%scan(&rV.,2,.,M)+0)*1e4 %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k));
+ (%scan(&rV.,3,.,M)+0)*1e0); %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; %do;
%put ERROR: Package &packageName. will not be loaded!; %put ERROR: Package &packageName. will not be loaded!;
%put ERROR- Required version is &requiredVersion.; %put ERROR- Required version is &rV0.;
%put ERROR- Provided version is &packageVersion.; %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- Verify installed version of the package.;
%put ERROR- ; %put ERROR- ;
%GOTO WrongVersionOFPackage; /*%RETURN;*/ %GOTO WrongVersionOFPackage; /*%RETURN;*/

View File

@@ -19,7 +19,7 @@
is provided in required version */ is provided in required version */
)/secure )/secure
/*** HELP END ***/ /*** 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 20241129. Run %loadPackageAddCnt() for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -35,7 +35,7 @@ minoperator
%put ### This is short help information for the `loadPackageAddCnt` macro #; %put ### This is short help information for the `loadPackageAddCnt` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%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 `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -157,22 +157,33 @@ minoperator
%include &_PackageFileref_.(packagemetadata.sas) / &source2.; %include &_PackageFileref_.(packagemetadata.sas) / &source2.;
filename &_PackageFileref_. clear; filename &_PackageFileref_. clear;
/* test if required version of package is "good enough" */ /* test if required version of package is "good enough" */
%local rV pV; %local rV pV rV0 pV0 rVsign;
%let pV = %sysfunc(compress(&packageVersion.,.,kd)); %let pV0 = %sysfunc(compress(&packageVersion.,.,kd));
%let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8
+ (%scan(&pV.,2,.,M)+0)*1e4 + (%scan(&pV0.,2,.,M)+0)*1e4
+ (%scan(&pV.,3,.,M)+0)*1e0); + (%scan(&pV0.,3,.,M)+0)*1e0);
%let rV = %sysfunc(compress(&requiredVersion.,.,kd));
%let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd));
+ (%scan(&rV.,2,.,M)+0)*1e4 %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k));
+ (%scan(&rV.,3,.,M)+0)*1e0); %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; %do;
%put ERROR: Additional content for package &packageName. will not be loaded!; %put ERROR: Additional content for package &packageName. will not be loaded!;
%put ERROR- Required version is &requiredVersion.; %put ERROR- Required version is &rV0.;
%put ERROR- Provided version is &packageVersion.; %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- Verify installed version of the package.;
%put ERROR- ; %put ERROR- ;
%GOTO WrongVersionOFPackageAddCnt; /*%RETURN;*/ %GOTO WrongVersionOFPackageAddCnt; /*%RETURN;*/

View File

@@ -11,7 +11,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** 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 20241129. Run %loadPackages() for help info.'
parmbuff parmbuff
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -27,7 +27,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #; %put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro wrapper for the loadPackage macro, version `20241027` #; %put # Macro wrapper for the loadPackage macro, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -79,7 +79,7 @@ parmbuff
%local lengthOfsyspbuff numberOfPackagesNames i packageElement packageName packageVersion str; %local lengthOfsyspbuff numberOfPackagesNames i packageElement packageName packageVersion str;
%let lengthOfsyspbuff = %qsysfunc(length(&syspbuff.)); %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(translate(%superq(packagesNames),[[ ]],{(,)}));
%let str = %qsysfunc(transtrn(%superq(str),],%str(] ))); %let str = %qsysfunc(transtrn(%superq(str),],%str(] )));

View File

@@ -23,7 +23,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** 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 20241129. Run %previewPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %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 ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get preview of a SAS packages, version `20241027` #; %put # Macro to get preview of a SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -8,7 +8,7 @@
,nobs=0 /* technical parameter */ ,nobs=0 /* technical parameter */
) )
/*** HELP START ***/ /*** 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 20241129. Run %splitCodeForPackage() for help info.'
; ;
/*%macro _();%mend _;*/ /*%macro _();%mend _;*/
%if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then %if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then
@@ -25,7 +25,7 @@
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Utility macro to *split* single file with SAS package code into multiple #; %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 `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -150,8 +150,8 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ;
end; end;
else else
do; do;
put 'ERROR: File ' codeFile 'does not exist!'; put "ERROR: [splitCodeForPackage] File " codeFile 'does not exist!';
call symputX("codeFile",pathname('d'),"L"); call symputX("codeFile",quote(strip(pathname('d'))),"L");
end; end;
run; run;
@@ -402,7 +402,7 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ;
*/ */
if firstLine[j] then if firstLine[j] then
do; do;
put '/* File generated with help of SAS Packages Framework, version 20241027. */'; put '/* File generated with help of SAS Packages Framework, version 20241129. */';
firstLine[j]=0; firstLine[j]=0;
end; end;
put _infile_; put _infile_;

View File

@@ -20,7 +20,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to unload SAS package, version 20241027. Run %unloadPackage() for help info.' des = 'Macro to unload SAS package, version 20241129. Run %unloadPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %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 ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to unload SAS packages, version `20241027` #; %put # Macro to unload SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -13,7 +13,7 @@
hashing_file() function, SAS 9.4M6 */ hashing_file() function, SAS 9.4M6 */
)/secure )/secure
/*** HELP END ***/ /*** 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 20241129. Run %verifyPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %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 ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%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 `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -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. 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 **`20241129`**.
**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). **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 <a name="installpackage"></a> ## This is short help information for the `installPackage` macro <a name="installpackage"></a>
-------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------
Macro to install SAS packages, version `20241027` Macro to install SAS packages, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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 <a name="helppackage"></a> ## This is short help information for the `helpPackage` macro <a name="helppackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to get help about SAS packages, version `20241027` Macro to get help about SAS packages, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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 <a name="loadpackage"></a> ## This is short help information for the `loadPackage` macro <a name="loadpackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to *load* SAS packages, version `20241027` Macro to *load* SAS packages, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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 <a name="loadpackages"></a> ## This is short help information for the `loadPackageS` macro <a name="loadpackages"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro wrapper for the loadPackage macro, version `20241027` Macro wrapper for the loadPackage macro, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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 <a name="unloadpackage"></a> ## This is short help information for the `unloadPackage` macro <a name="unloadpackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to unload SAS packages, version `20241027` Macro to unload SAS packages, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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 <a name="listpackages"></a> ## This is short help information for the `listPackages` macro <a name="listpackages"></a>
----------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------
Macro to list available SAS packages, version `20241027` Macro to list available SAS packages, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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 <a name="verifypackage"></a> ## This is short help information for the `verifyPackage` macro <a name="verifypackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to verify SAS package with it hash digest, version `20241027` Macro to verify SAS package with it hash digest, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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 <a name="previewpackage"></a> ## This is short help information for the `previewPackage` macro <a name="previewpackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to get preview of a SAS packages, version `20241027` Macro to get preview of a SAS packages, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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 <a name="generatepackage"></a> ## This is short help information for the `generatePackage` macro <a name="generatepackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to generate SAS packages, version `20241027` Macro to generate SAS packages, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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 <a name="extendpackagesfileref"></a> ## This is short help information for the `extendPackagesFileref` macro <a name="extendpackagesfileref"></a>
----------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------
Macro to list directories pointed by 'packages' fileref, version `20241027` Macro to list directories pointed by 'packages' fileref, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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 <a name="loadpackageaddcnt"></a> ## This is short help information for the `loadPackageAddCnt` macro <a name="loadpackageaddcnt"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to load *additional content* for a SAS package, version `20241027` Macro to load *additional content* for a SAS package, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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 Utility macro to *split* single file with SAS package code into multiple
files with separate snippets, version `20241027` files with separate snippets, version `20241129`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating

View File

@@ -42,7 +42,7 @@
- to unload, or - to unload, or
- to generate SAS packages. - to generate SAS packages.
Version 20241027. Version 20241129.
See examples below. See examples below.
A SAS package is a zip file containing a group of files A SAS package is a zip file containing a group of files
@@ -91,7 +91,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load SAS package, version 20241027. Run %loadPackage() for help info.' des = 'Macro to load SAS package, version 20241129. Run %loadPackage() for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -107,7 +107,7 @@ minoperator
%put ### This is short help information for the `loadPackage` macro #; %put ### This is short help information for the `loadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *load* SAS packages, version `20241027` #; %put # Macro to *load* SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -288,21 +288,31 @@ minoperator
filename &_PackageFileref_. clear; filename &_PackageFileref_. clear;
/* test if required version of package is "good enough" */ /* test if required version of package is "good enough" */
%local rV pV; %local rV pV rV0 pV0 rVsign;
%let pV = %sysfunc(compress(&packageVersion.,.,kd)); %let pV0 = %sysfunc(compress(&packageVersion.,.,kd));
%let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8
+ (%scan(&pV.,2,.,M)+0)*1e4 + (%scan(&pV0.,2,.,M)+0)*1e4
+ (%scan(&pV.,3,.,M)+0)*1e0); + (%scan(&pV0.,3,.,M)+0)*1e0);
%let rV = %sysfunc(compress(&requiredVersion.,.,kd));
%let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd));
+ (%scan(&rV.,2,.,M)+0)*1e4 %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k));
+ (%scan(&rV.,3,.,M)+0)*1e0); %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; %do;
%put ERROR: Package &packageName. will not be loaded!; %put ERROR: Package &packageName. will not be loaded!;
%put ERROR- Required version is &requiredVersion.; %put ERROR- Required version is &rV0.;
%put ERROR- Provided version is &packageVersion.; %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- Verify installed version of the package.;
%put ERROR- ; %put ERROR- ;
%GOTO WrongVersionOFPackage; /*%RETURN;*/ %GOTO WrongVersionOFPackage; /*%RETURN;*/
@@ -372,7 +382,7 @@ minoperator
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to unload SAS package, version 20241027. Run %unloadPackage() for help info.' des = 'Macro to unload SAS package, version 20241129. Run %unloadPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %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 ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to unload SAS packages, version `20241027` #; %put # Macro to unload SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %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 )/secure
/*** HELP END ***/ /*** 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 20241129. Run %helpPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %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 ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get help about SAS packages, version `20241027` #; %put # Macro to get help about SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -694,7 +704,7 @@ TODO:
*/ */
/*+installPackage+*/ /*+installPackage+*/
/* Macros to install SAS packages, version 20241027 */ /* Macros to install SAS packages, version 20241129 */
/* A SAS package is a zip file containing a group of files /* A SAS package is a zip file containing a group of files
with SAS code (macros, functions, data steps generating with SAS code (macros, functions, data steps generating
data, etc.) wrapped up together and %INCLUDEed by data, etc.) wrapped up together and %INCLUDEed by
@@ -718,7 +728,7 @@ TODO:
/secure /secure
minoperator minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to install SAS package, version 20241027. Run %%installPackage() for help info.' des = 'Macro to install SAS package, version 20241129. Run %%installPackage() for help info.'
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do; %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 ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;; %put #--------------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to install SAS packages, version `20241027` #; %put # Macro to install SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %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. Macro to list SAS packages in packages folder.
Version 20241027 Version 20241129
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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() %macro listPackages()
/secure PARMBUFF /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 20241129.'
; ;
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then %if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
%do; %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 ### This is short help information for the `listPackages` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list available SAS packages, version `20241027` #; %put # Macro to list available SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -1452,7 +1462,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
Macro to generate SAS packages. Macro to generate SAS packages.
Version 20241027 Version 20241129
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1492,7 +1502,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
file name be created */ file name be created */
)/ secure minoperator )/ secure minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to generate SAS packages, version 20241027. Run %generatePackage() for help info.' des = 'Macro to generate SAS packages, version 20241129. Run %generatePackage() for help info.'
; ;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then %if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do; %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 ### This is short help information for the `generatePackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to generate SAS packages, version `20241027` #; %put # Macro to generate SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %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(%'%")))" ; /* " */ title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */
%end; %end;
footnote1 "SAS Packages Framework, version 20241027"; footnote1 "SAS Packages Framework, version 20241129";
proc print proc print
data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent) data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent)
@@ -2497,22 +2507,35 @@ data _null_;
put ' filename &_PackageFileref_. clear; '; put ' filename &_PackageFileref_. clear; ';
/* test if required version of package is "good enough" */ /* test if required version of package is "good enough" */
put ' %local rV pV; '; put ' %local rV pV rV0 pV0 rVsign; ';
put ' %let pV = %sysfunc(compress(&packageVersion.,.,kd)); '; put ' %let pV0 = %sysfunc(compress(&packageVersion.,.,kd)); ';
put ' %let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 '; put ' %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8 ';
put ' + (%scan(&pV.,2,.,M)+0)*1e4 '; put ' + (%scan(&pV0.,2,.,M)+0)*1e4 ';
put ' + (%scan(&pV.,3,.,M)+0)*1e0); '; put ' + (%scan(&pV0.,3,.,M)+0)*1e0); ';
put ' %let rV = %sysfunc(compress(&requiredVersion.,.,kd)); '; put ' ';
put ' %let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 '; put ' %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd)); ';
put ' + (%scan(&rV.,2,.,M)+0)*1e4 '; put ' %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k)); ';
put ' + (%scan(&rV.,3,.,M)+0)*1e0); '; put ' %if %superq(rVsign)= %then %let rVsign=<=; ';
put ' %if %sysevalf(&requiredVersion. > &packageVersion.) %then '; put ' %else %if NOT (%superq(rVsign) IN (%str(=) %str(<=) %str(=<) %str(=>) %str(>=) %str(<) %str(>))) %then ';
put ' %do; '; put ' %do; ';
put ' %put ERROR: Required version is &requiredVersion.; '; put ' %put WARNING: Illegal operatopr "%superq(rVsign)"! Default(<=) will be used.; ';
put ' %put ERROR- Provided version is &packageVersion.; '; put ' %put WARNING- Supported operators are: %str(= <= =< => >= < >); ';
put ' %GOTO WrongVersionOFPackage; /*%RETURN;*/ '; 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 ' %end; ';
put ' filename &_PackageFileref_. &ZIP. '; put ' filename &_PackageFileref_. &ZIP. ';
put ' "&path./%lowcase(&packageName.).&zip." %unquote(&options.) '; put ' "&path./%lowcase(&packageName.).&zip." %unquote(&options.) ';
@@ -3132,7 +3155,7 @@ data _null_;
%end; %end;
put +(-1) '`.;''' / put +(-1) '`.;''' /
' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' / ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' /
' !! '' %put with the SAS Packages Framework version 20241027.;''' / ' !! '' %put with the SAS Packages Framework version 20241129.;''' /
' !! '' %put ****************************************************************************;''' / ' !! '' %put ****************************************************************************;''' /
' !! '' %GOTO theEndOfTheMacro;''' / ' !! '' %GOTO theEndOfTheMacro;''' /
' !! '' %end;''' ; ' !! '' %end;''' ;
@@ -3297,7 +3320,7 @@ data _null_;
%end; %end;
put +(-1) '`.; '' !!' / put +(-1) '`.; '' !!' /
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' / ''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' /
''' %put with the SAS Packages Framework version 20241027.; '' !! ' / ''' %put with the SAS Packages Framework version 20241129.; '' !! ' /
''' %put ****************************************************************************; '' !! ' / ''' %put ****************************************************************************; '' !! ' /
''' %GOTO theEndOfTheMacro; '' !! ' / ''' %GOTO theEndOfTheMacro; '' !! ' /
''' %end; '' !! ' / ''' %end; '' !! ' /
@@ -3813,20 +3836,20 @@ data _null_;
end; end;
/* delete data sets */ /* delete data sets */
put "proc fedsql noprint;"; put "proc SQL noprint;";
EOF = 0; EOF = 0;
do until(EOF); do until(EOF);
set &filesWithCodes. end = EOF; set &filesWithCodes. end = EOF;
if not (upcase(type) in: ('DATA')) then continue; if not (upcase(type) in: ('DATA')) then continue;
put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;'; put '%put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
put '%put NOTE- ;'; put '%put NOTE- ;';
put 'drop table ' fileshort ' FORCE;' /; put '%sysfunc(ifc(%sysfunc(exist(' fileshort ')),drop table ' fileshort ',));' /;
end; end;
put "quit;" /; put "quit;" /;
/* delete PROC DS2 packages or threads */ /* delete PROC DS2 packages or threads */
put 'data _null_; call symputx("_DS2_2_del_",0,"L"); run;'; put 'data _null_; call symputx("_DS2_2_del_",0,"L"); run;';
put "proc fedsql noprint;"; put "proc SQL noprint;";
EOF = 0; EOF = 0;
do until(EOF); do until(EOF);
set &filesWithCodes. end = EOF; set &filesWithCodes. end = EOF;
@@ -3835,10 +3858,10 @@ data _null_;
/ '%put NOTE- ;' / '%put NOTE- ;'
/ '%let _DS2_2_del_ = %sysfunc(open(' fileshort '));' / '%let _DS2_2_del_ = %sysfunc(open(' fileshort '));'
/ '%sysfunc(ifc(&_DS2_2_del_. AND %sysfunc(ATTRC(&_DS2_2_del_.,LABEL))=' / '%sysfunc(ifc(&_DS2_2_del_. AND %sysfunc(ATTRC(&_DS2_2_del_.,LABEL))='
/ '%str(' "Package: &packageName. ; Type: " type "; Name: " fileshort +(-1) '),drop table ' fileshort ' FORCE,)) ;' / '%str(' "Package: &packageName. ; Type: " type "; Name: " fileshort +(-1) '),drop table ' fileshort ',)) '
/ '%let _DS2_2_del_ = %sysfunc(close(&_DS2_2_del_.));' / '%let _DS2_2_del_ = %sysfunc(close(&_DS2_2_del_.));'
; ;
put ';' /; put ';' /; /* this is semicolon closing drop table statement */
end; end;
put "quit;" /; put "quit;" /;
@@ -4104,7 +4127,7 @@ data _null_;
%end; %end;
put 'put " " / @3 "--------------------------------------------------------------------" / " ";' put 'put " " / @3 "--------------------------------------------------------------------" / " ";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20241027`*";' / 'put @3 "*SAS package generated by SAS Package Framework, version `20241129`*";'
/ 'put " " / @3 "--------------------------------------------------------------------";'; / 'put " " / @3 "--------------------------------------------------------------------";';
put 'run; ' /; put 'run; ' /;
@@ -4633,7 +4656,7 @@ run;
%if %Qupcase(&sascfgFile.) = DEF %then /* the DEF value points to the sasv9.cfg file in the sasroot directory */ %if %Qupcase(&sascfgFile.) = DEF %then /* the DEF value points to the sasv9.cfg file in the sasroot directory */
%do; %do;
%let SASCONFIG = -config ""&SASROOT./sasv9.cfg""; %let SASCONFIG = -config "&SASROOT./sasv9.cfg";
%put NOTE: The following SAS config file will be used:; %put NOTE: The following SAS config file will be used:;
%put NOTE- &=SASCONFIG.; %put NOTE- &=SASCONFIG.;
%end; %end;
@@ -4641,7 +4664,7 @@ run;
%do; %do;
%if %sysfunc(fileexist(&sascfgFile.)) %then %if %sysfunc(fileexist(&sascfgFile.)) %then
%do; %do;
%let SASCONFIG = -config ""&SASCFGFILE.""; %let SASCONFIG = -config "&SASCFGFILE.";
%put NOTE: The following SAS config file will be used:; %put NOTE: The following SAS config file will be used:;
%put NOTE- &=SASCONFIG.; %put NOTE- &=SASCONFIG.;
%end; %end;
@@ -5142,7 +5165,7 @@ data &filesWithCodes.markdown;
%end; %end;
put " " / "--------------------------------------------------------------------" / " " put " " / "--------------------------------------------------------------------" / " "
/ "*SAS package generated by SAS Package Framework, version `20241027`*" / "*SAS package generated by SAS Package Framework, version `20241129`*"
/ " " / "--------------------------------------------------------------------" / " "; / " " / "--------------------------------------------------------------------" / " ";
put "# The `&packageName.` package content"; put "# The `&packageName.` package content";
@@ -5420,7 +5443,7 @@ TODO: (in Polish)
*/ */
)/secure )/secure
/*** HELP END ***/ /*** 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 20241129. Run %loadPackages() for help info.'
parmbuff parmbuff
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -5436,7 +5459,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #; %put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro wrapper for the loadPackage macro, version `20241027` #; %put # Macro wrapper for the loadPackage macro, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -5488,7 +5511,7 @@ parmbuff
%local lengthOfsyspbuff numberOfPackagesNames i packageElement packageName packageVersion str; %local lengthOfsyspbuff numberOfPackagesNames i packageElement packageName packageVersion str;
%let lengthOfsyspbuff = %qsysfunc(length(&syspbuff.)); %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(translate(%superq(packagesNames),[[ ]],{(,)}));
%let str = %qsysfunc(transtrn(%superq(str),],%str(] ))); %let str = %qsysfunc(transtrn(%superq(str),],%str(] )));
@@ -5533,7 +5556,7 @@ parmbuff
hashing_file() function, SAS 9.4M6 */ hashing_file() function, SAS 9.4M6 */
)/secure )/secure
/*** HELP END ***/ /*** 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 20241129. Run %verifyPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %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 ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%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 `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %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 )/secure
/*** HELP END ***/ /*** 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 20241129. Run %previewPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %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 ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get preview of a SAS packages, version `20241027` #; %put # Macro to get preview of a SAS packages, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %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 */ when empty the "packages" value is used */
)/secure )/secure
/*** HELP END ***/ /*** 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 20241129. Run %extendPackagesFileref(HELP) for help info.'
; ;
%if %QUPCASE(&packages.) = HELP %then %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 ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list directories pointed by 'packages' fileref, version `20241027` #; %put # Macro to list directories pointed by 'packages' fileref, version `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -5990,7 +6013,7 @@ filename packages list;
is provided in required version */ is provided in required version */
)/secure )/secure
/*** HELP END ***/ /*** 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 20241129. Run %loadPackageAddCnt() for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -6006,7 +6029,7 @@ minoperator
%put ### This is short help information for the `loadPackageAddCnt` macro #; %put ### This is short help information for the `loadPackageAddCnt` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%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 `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -6128,22 +6151,33 @@ minoperator
%include &_PackageFileref_.(packagemetadata.sas) / &source2.; %include &_PackageFileref_.(packagemetadata.sas) / &source2.;
filename &_PackageFileref_. clear; filename &_PackageFileref_. clear;
/* test if required version of package is "good enough" */ /* test if required version of package is "good enough" */
%local rV pV; %local rV pV rV0 pV0 rVsign;
%let pV = %sysfunc(compress(&packageVersion.,.,kd)); %let pV0 = %sysfunc(compress(&packageVersion.,.,kd));
%let pV = %sysevalf((%scan(&pV.,1,.,M)+0)*1e8 %let pV = %sysevalf((%scan(&pV0.,1,.,M)+0)*1e8
+ (%scan(&pV.,2,.,M)+0)*1e4 + (%scan(&pV0.,2,.,M)+0)*1e4
+ (%scan(&pV.,3,.,M)+0)*1e0); + (%scan(&pV0.,3,.,M)+0)*1e0);
%let rV = %sysfunc(compress(&requiredVersion.,.,kd));
%let rV = %sysevalf((%scan(&rV.,1,.,M)+0)*1e8 %let rV0 = %sysfunc(compress(&requiredVersion.,.,kd));
+ (%scan(&rV.,2,.,M)+0)*1e4 %let rVsign = %sysfunc(compress(&requiredVersion.,<=>,k));
+ (%scan(&rV.,3,.,M)+0)*1e0); %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; %do;
%put ERROR: Additional content for package &packageName. will not be loaded!; %put ERROR: Additional content for package &packageName. will not be loaded!;
%put ERROR- Required version is &requiredVersion.; %put ERROR- Required version is &rV0.;
%put ERROR- Provided version is &packageVersion.; %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- Verify installed version of the package.;
%put ERROR- ; %put ERROR- ;
%GOTO WrongVersionOFPackageAddCnt; /*%RETURN;*/ %GOTO WrongVersionOFPackageAddCnt; /*%RETURN;*/
@@ -6353,7 +6387,7 @@ minoperator
,nobs=0 /* technical parameter */ ,nobs=0 /* technical parameter */
) )
/*** HELP START ***/ /*** 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 20241129. Run %splitCodeForPackage() for help info.'
; ;
/*%macro _();%mend _;*/ /*%macro _();%mend _;*/
%if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then %if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then
@@ -6370,7 +6404,7 @@ minoperator
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Utility macro to *split* single file with SAS package code into multiple #; %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 `20241129` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -6495,8 +6529,8 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ;
end; end;
else else
do; do;
put 'ERROR: File ' codeFile 'does not exist!'; put "ERROR: [splitCodeForPackage] File " codeFile 'does not exist!';
call symputX("codeFile",pathname('d'),"L"); call symputX("codeFile",quote(strip(pathname('d'))),"L");
end; end;
run; run;
@@ -6747,7 +6781,7 @@ options nomprint nosymbolgen nomlogic notes source ls=MAX ps=MAX msglevel=N ;
*/ */
if firstLine[j] then if firstLine[j] then
do; do;
put '/* File generated with help of SAS Packages Framework, version 20241027. */'; put '/* File generated with help of SAS Packages Framework, version 20241129. */';
firstLine[j]=0; firstLine[j]=0;
end; end;
put _infile_; put _infile_;