loading required packages is now available

loading required packages is now available sience each package has its own unique file reference by MD5(packageName).
This commit is contained in:
yabwon
2019-11-04 20:26:44 +01:00
parent cdfb7a8b1d
commit c10e517fe3
8 changed files with 1413 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
/*** HELP START ***/
/*** HELP START ***/
/**############################################################################**/
/* */
@@ -71,15 +71,17 @@ TODO:
%let notes_tmp = %sysfunc(getoption(notes));
%let source_tmp = %sysfunc(getoption(source));
options NOnotes NOsource ls=MAX ps=MAX;
%local _PackageFileref_;
%let _PackageFileref_ = P%sysfunc(MD5(%lowcase(&packageName.)),hex7.);
filename package ZIP
filename &_PackageFileref_. ZIP
/* put location of package myPackageFile.zip here */
"&path./%lowcase(&packageName.).zip" %unquote(&options.)
;
%if %sysfunc(fexist(package)) %then
%if %sysfunc(fexist(&_PackageFileref_.)) %then
%do;
%include package(packagemetadata.sas) / &source2.;
filename package clear;
%include &_PackageFileref_.(packagemetadata.sas) / &source2.;
filename &_PackageFileref_. clear;
/* test if required version of package is "good enough" */
%if %sysevalf(&requiredVersion. > &packageVersion.) %then
@@ -90,16 +92,16 @@ TODO:
%end;
options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
filename package ZIP
filename &_PackageFileref_. ZIP
"&path./%lowcase(&packageName.).zip" %unquote(&options.)
ENCODING =
%if %bquote(&packageEncoding.) NE %then &packageEncoding. ;
%else utf8 ;
;
%include package(load.sas) / &source2.;
%include &_PackageFileref_.(load.sas) / &source2.;
%end;
%else %put ERROR:[&sysmacroname] File "&path./&packageName..zip" does not exist;
filename package clear;
filename &_PackageFileref_. clear;
options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
%mend loadPackage;
@@ -123,26 +125,28 @@ TODO:
%let notes_tmp = %sysfunc(getoption(notes));
%let source_tmp = %sysfunc(getoption(source));
options NOnotes NOsource ls=MAX ps=MAX;
%local _PackageFileref_;
%let _PackageFileref_ = P%sysfunc(MD5(%lowcase(&packageName.)),hex7.);
filename package ZIP
filename &_PackageFileref_. ZIP
/* put location of package myPackageFile.zip here */
"&path./%lowcase(&packageName.).zip" %unquote(&options.)
;
%if %sysfunc(fexist(package)) %then
%if %sysfunc(fexist(&_PackageFileref_.)) %then
%do;
%include package(packagemetadata.sas) / &source2.;
filename package clear;
%include &_PackageFileref_.(packagemetadata.sas) / &source2.;
filename &_PackageFileref_. clear;
options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
filename package ZIP
filename &_PackageFileref_. ZIP
"&path./%lowcase(&packageName.).zip" %unquote(&options.)
ENCODING =
%if %bquote(&packageEncoding.) NE %then &packageEncoding. ;
%else utf8 ;
;
%include package(unload.sas) / &source2.;
%include &_PackageFileref_.(unload.sas) / &source2.;
%end;
%else %put ERROR:[&sysmacroname] File "&path./&packageName..zip" does not exist;
filename package clear;
filename &_PackageFileref_. clear;
options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
%mend unloadPackage;
@@ -170,26 +174,28 @@ TODO:
%let notes_tmp = %sysfunc(getoption(notes));
%let source_tmp = %sysfunc(getoption(source));
options NOnotes NOsource ls=MAX ps=MAX;
%local _PackageFileref_;
%let _PackageFileref_ = P%sysfunc(MD5(%lowcase(&packageName.)),hex7.);
filename package ZIP
filename &_PackageFileref_. ZIP
/* put location of package myPackageFile.zip here */
"&path./%lowcase(&packageName.).zip" %unquote(&options.)
;
%if %sysfunc(fexist(package)) %then
%if %sysfunc(fexist(&_PackageFileref_.)) %then
%do;
%include package(packagemetadata.sas) / &source2.;
filename package clear;
%include &_PackageFileref_.(packagemetadata.sas) / &source2.;
filename &_PackageFileref_. clear;
options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
filename package ZIP
filename &_PackageFileref_. ZIP
"&path./%lowcase(&packageName.).zip" %unquote(&options.)
ENCODING =
%if %bquote(&packageEncoding.) NE %then &packageEncoding. ;
%else utf8 ;
;
%include package(help.sas) / &source2.;
%include &_PackageFileref_.(help.sas) / &source2.;
%end;
%else %put ERROR:[&sysmacroname] File "&path./&packageName..zip" does not exist;
filename package clear;
filename &_PackageFileref_. clear;
options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
%mend helpPackage;