Merge pull request #131 from yabwon/main

SAS Packages Framework, version 20260514
This commit is contained in:
Bart Jablonski
2026-05-14 14:20:39 +02:00
committed by GitHub
28 changed files with 422 additions and 175 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ Don't forget to give the repository a **STAR** and become [stargazer](https://gi
### Current version:
**The latest version** of the **SAS Packages Framework** is **`20260411`**.
**The latest version** of the **SAS Packages Framework** is **`20260514**.
---
+17 -10
View File
@@ -8,7 +8,7 @@
,packagesRef=packages
,ods= /* data set for report file */
)/
des='Macro to create a bundle of SAS packages, version 20260411. Run %bundlePackages(HELP) for help info.'
des='Macro to create a bundle of SAS packages, version 20260514. Run %bundlePackages(HELP) for help info.'
secure minoperator
;
@@ -25,7 +25,7 @@ secure minoperator
%put ### This is short help information for the `bundlePackages` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to *create bundles* of SAS packages, version `20260411` #;
%put # Macro to *create bundles* of SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -62,7 +62,7 @@ secure minoperator
%put # - `packagesRef=` *Optional.* Fileref to location of packages for the #;
%put # bundle. Default value is `packages`. #;
%put # #;
%put # - `ods=` *Optional.* Name of SAS data set for the report. #;
%put # - `ods=` *Optional.* V7 style name of SAS data set for report. #;
%put # #;
%put #-------------------------------------------------------------------------------#;
%put # #;
@@ -126,6 +126,13 @@ secure minoperator
%let datetime = %sysfunc(datetime());
%let reportFile = WORK.tmpbundlefile%sysfunc(int(&datetime.), b8601dt15.)_;
%if NOT %sysevalf(%superq(ods)=,BOOLEAN) %then %do;
data _null_; /* verify ods= value */
%SPFinit_intrnl_forceV7DSname(ods);
call symputX("ods",ods,"L");
run;
%end;
data _null_ %if %superq(ods) NE %then %do; &ods. %end;
%else %do; &reportFile.1 %end;
;
@@ -399,8 +406,8 @@ put "INFO: The " bundleName "bundle creation ended.";
;
format datetime e8601dt.;
output
%if %superq(ods) NE %then %do; %scan(&ods.,1,()) %end;
%else %do; &reportFile.1 %end;
%if %superq(ods) NE %then %do; &ods. %end;
%else %do; &reportFile.1 %end;
;
put " ";
rc=sleep(1,1);
@@ -408,13 +415,13 @@ stop;
run;
title2 "Summary of the bundle file";;
proc print
data= %if %superq(ods) NE %then %do; %scan(&ods.,1,()) %end;
%else %do; &reportFile.1 %end;
noObs label;
proc print noObs label
data= %if %superq(ods) NE %then %do; &ods. %end;
%else %do; &reportFile.1 %end;
;
var bundleName datetime BundleSHA256 path;
run;
%if %superq(ods) NE %then %do; %put INFO: Report file: %scan(&ods.,1,()); %end;
%if %superq(ods) NE %then %do; %put INFO: Report file: &ods.; %end;
%else %do; proc delete data=&reportFile.1; run; %end;
+2 -2
View File
@@ -6,7 +6,7 @@
when empty the "packages" value is used */
)/secure
/*** HELP END ***/
des = 'Macro to list directories pointed by "packages" fileref, version 20260411. Run %extendPackagesFileref(HELP) for help info.'
des = 'Macro to list directories pointed by "packages" fileref, version 20260514. 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 20260411
%put ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to list directories pointed by 'packages' fileref, version `20260411` #;
%put # Macro to list directories pointed by 'packages' fileref, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
+6 -6
View File
@@ -53,7 +53,7 @@
when empty takes buildLocation */
)/ secure minoperator
/*** HELP END ***/
des = 'Macro to generate SAS packages, version 20260411. Run %generatePackage() for help info.'
des = 'Macro to generate SAS packages, version 20260514. Run %generatePackage() for help info.'
;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do;
@@ -68,7 +68,7 @@ des = 'Macro to generate SAS packages, version 20260411. Run %generatePackage()
%put ### This is short help information for the `generatePackage` macro #;
%put #------------------------------------------------------------------------------------#;
%put # #;
%put # Macro to generate SAS packages, version `20260411` #;
%put # Macro to generate SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -950,7 +950,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
title&_titleNumber_. "Package ZIP file location is: &buildLocation.";
%end;
footnote1 "SAS Packages Framework, version 20260411";
footnote1 "SAS Packages Framework, version 20260514";
proc print
data = &filesWithCodes.(drop=base build folderRef fileRef rc folderid _abort_ fileId additionalContent)
@@ -1775,7 +1775,7 @@ data _null_;
%end;
put +(-1) '`.;'''
/ ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"'
/ ' !! '' %put with the SAS Packages Framework version 20260411.;'''
/ ' !! '' %put with the SAS Packages Framework version 20260514.;'''
/ ' !! '' %put ****************************************************************************;'''
/ ' !! '' %GOTO theEndOfTheMacro;'''
/ ' !! '' %end;''' ;
@@ -1939,7 +1939,7 @@ data _null_;
%end;
put +(-1) '`.; '' !!' /
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !! ' /
''' %put with the SAS Packages Framework version 20260411.; '' !! ' /
''' %put with the SAS Packages Framework version 20260514.; '' !! ' /
''' %put ****************************************************************************; '' !! ' /
''' %GOTO theEndOfTheMacro; '' !! ' /
''' %end; '' !! ' /
@@ -2811,7 +2811,7 @@ data _null_;
%end;
put 'put " " / @3 "---------------------------------------------------------------------" / " ";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20260411`*";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20260514`*";'
/ "put @3 '*under `&sysscp.`(`&sysscpl.`) operating system,*';"
/ "put @3 '*using SAS release: `&sysvlong4.`.*';"
/ 'put " " / @3 "---------------------------------------------------------------------";';
+2 -2
View File
@@ -28,7 +28,7 @@
*/
)/secure
/*** HELP END ***/
des = 'Macro to get help about SAS package, version 20260411. Run %helpPackage() for help info.'
des = 'Macro to get help about SAS package, version 20260514. 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 20260411. Run %helpPackage()
%put ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to get help about SAS packages, version `20260411` #;
%put # Macro to get help about SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
+2 -2
View File
@@ -30,7 +30,7 @@
/secure
minoperator
/*** HELP END ***/
des = 'Macro to install SAS package, version 20260411. Run %%installPackage() for help info.'
des = 'Macro to install SAS package, version 20260514. Run %%installPackage() for help info.'
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do;
@@ -45,7 +45,7 @@ des = 'Macro to install SAS package, version 20260411. Run %%installPackage() fo
%put ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to install SAS packages, version `20260411` #;
%put # Macro to install SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
+2 -2
View File
@@ -4,7 +4,7 @@
vERRb /* indicates if macro should be verbose and report errors */
)
/ minoperator PARMBUFF
des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20260411.'
des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20260514.'
;
/*** HELP END ***/
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
@@ -20,7 +20,7 @@ des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFile
%put ### This is short help information for the `isPackagesFilerefOK` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to check if the `packages` fileref is "correct", version `20260411` #;
%put # Macro to check if the `packages` fileref is "correct", version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
+13 -10
View File
@@ -25,7 +25,7 @@
listDataSet /* Name of a data set to save results */
, quiet = 0 /* Indicate if results should be printed in log */
)/secure parmbuff
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20260411.'
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20260514.'
;
%if (%QUPCASE(&listDataSet.) = HELP) %then
%do;
@@ -40,7 +40,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 `20260411` #;
%put # Macro to list available SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -101,14 +101,17 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
options NOnotes NOsource ls=MAX ps=MAX;
data _null_;
length listDataSet $ 41;
listDataSet = strip(scan(symget('listDataSet'),1,'( )'));
call symputX('listDataSet',listDataSet,"L");
if not (listDataSet = " ") then
call symputX('listDataSetCheck',1,"L");
else call symputX('quiet',0,"L");
run;
%if %superq(listDataSet) NE %then
%do;
data _null_; /* verify listDataSet compatibility with V7 naming */
%SPFinit_intrnl_forceV7DSname(listDataSet);
call symputX('listDataSet',listDataSet,"L");
if not (listDataSet = " ") then
call symputX('listDataSetCheck',1,"L");
else call symputX('quiet',0,"L");
run;
%end;
data _null_
%if 1=&listDataSetCheck. %then
+2 -2
View File
@@ -36,7 +36,7 @@
*/
)/secure
/*** HELP END ***/
des = 'Macro to load SAS package, version 20260411. Run %loadPackage() for help info.'
des = 'Macro to load SAS package, version 20260514. 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 `20260411` #;
%put # Macro to *load* SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
+2 -2
View File
@@ -19,7 +19,7 @@
is provided in required version */
)/secure
/*** HELP END ***/
des = 'Macro to load additional content for a SAS package, version 20260411. Run %loadPackageAddCnt() for help info.'
des = 'Macro to load additional content for a SAS package, version 20260514. 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 `20260411` #;
%put # Macro to *load* additional content for a SAS package, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
+2 -2
View File
@@ -11,7 +11,7 @@
*/
)/secure
/*** HELP END ***/
des = 'Macro to load multiple SAS packages at one run, version 20260411. Run %loadPackages() for help info.'
des = 'Macro to load multiple SAS packages at one run, version 20260514. 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 `20260411` #;
%put # Macro wrapper for the loadPackage macro, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
+2 -2
View File
@@ -23,7 +23,7 @@
*/
)/secure
/*** HELP END ***/
des = 'Macro to preview content of a SAS package, version 20260411. Run %previewPackage() for help info.'
des = 'Macro to preview content of a SAS package, version 20260514. 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 20260411. Run %preview
%put ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to get preview of a SAS packages, version `20260411` #;
%put # Macro to get preview of a SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
+11 -4
View File
@@ -15,7 +15,7 @@
,psMAX=MAX /* pageSise in case executed inside DoSubL() */
,ods= /* a data set for results, e.g., work.relocatePackageReport */
)
/ des = 'Utility macro that locally Copies or Moves Packages, version 20260411. Run %relocatePackage() for help info.'
/ des = 'Utility macro that locally Copies or Moves Packages, version 20260514. Run %relocatePackage() for help info.'
secure
minoperator
;
@@ -33,7 +33,7 @@
%put ### This is short help information for the `relocatePackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to *locally copy or move* (relocate) SAS packages, version `20260411` #;
%put # Macro to *locally copy or move* (relocate) SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -185,7 +185,14 @@
%put WARNING: Checksum verification impossible! Minimum SAS version required for the process is 9.4M6. ;
%end;
data _null_ %if %superq(ods) NE %then %do; &ods. %end;
%if NOT %sysevalf(%superq(ods)=,BOOLEAN) %then %do;
data _null_; /* verify ods= value */
%SPFinit_intrnl_forceV7DSname(ods);
call symputX("ods",ods,"L");
run;
%end;
data _null_ &ods. /* the &ods. will be used if not missing */
;
putlog 52*"*" 24*"=" 52*"*";
length packages source target $ 32767 sDevice tDevice $ 32;
@@ -565,7 +572,7 @@
/ "WARNING- Source is: " s_HASHING
/ "WARNING- Target is: " t_HASHING
/ "WARNING- There could be errors during copying. Check your files.";
%if %superq(ods) NE %then %do; output %scan(&ods.,1,()) ; %end;
output &ods.; /* the &ods. will be used if not missing */
end;
%end;
+2 -2
View File
@@ -5,7 +5,7 @@ SPFmacroName /* space separated list of names */
/
minoperator
secure
des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260411. Run %SasPackagesFrameworkNotes(HELP) for help info.'
des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260514. Run %SasPackagesFrameworkNotes(HELP) for help info.'
;
%local list N i element;
%let list=
@@ -51,7 +51,7 @@ SasPackagesFrameworkNotes
%put ### This is short help information for the `SasPackagesFrameworkNotes` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro prints help notes for SAS Packages Framework macros, version `20260411` #;
%put # Macro prints help notes for SAS Packages Framework macros, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -0,0 +1,94 @@
/*+SPFinit_intrnl_forceV7DSname+*/
%macro SPFinit_intrnl_forceV7DSname(
mcParam /* name of a macro parameter holding user provided data set name */
)/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside selected SPF macros. Macro generates 4GL code that forces V7 compatybility for user provided data set names. Version 20260514.';
/* The macro can be called only inside a data step. */
/****************************************************************************
### Parameters:
`mcParam` - name of a macro parameter holding user provided data set name
### Behavior:
Description:
The 4GL code SYMGETs macro variable value, SCANs only first
part of the string in case there are parenthesis "()" in it.
Then it COMPRESSes the string and keep _only_ digits, letters,
underscore, and period. All periods are TRANSLATEd to spaces.
If created string is not empty its last chunk is SCANned for
data set name, the second to last chunk is SCANned for libname
(if empty then "work" is used). First character of LIB and DS
variables is checked, if it is a digit, then underscore is added.
At the end the LIB and DS are concatenated and casted to upper
case letters.
Examples:
abc.xyz -> ABC.XYZ
ABC.XYZ(obs=42) -> ABC.XYZ
XYZ -> WORK.XYZ
abc. -> WORK.ABC
.XYZ -> WORK.XYZ
123.456 -> _123._456
A#B.x$y -> AB.XY
Usecase:
Inside a macro for value check
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%macro A(ods);
data _null_;
%SPDinit_intrnl_forceV7DSname(ods);
call symputX("ods",ods,"L");
run;
%if %superq(ods) ne %then
%do;
data &ods.;
...
run;
%end;
%mend;
%A()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
****************************************************************************/
%local allowedSPFmacrosList;
%let allowedSPFmacrosList=LISTPACKAGES RELOCATEPACKAGE UNBUNDLEPACKAGES BUNDLEPACKAGES;
%if %sysmexecname(%sysmexecdepth-1) in (&allowedSPFmacrosList.) %then
%do;
/*=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=*/
length &mcParam. $ 41 lib $ 8 ds $ 32;
/* force only V7 valid symbols */
&mcParam. = symget("&mcParam.");
if NOT (&mcParam. = " ") then
do;
/* drop every illegal character */
&mcParam. = compress(scan(&mcParam,1,'()'),'_.','kad');
&mcParam. = cats(translate(&mcParam.," ","."));
if NOT (&mcParam.=" ") then
do;
/* use 2 last blocks of symbols */
lib = coalescec(scan(&mcParam.,-2),"work");
ds = scan(&mcParam.,-1);
/* check first symbol, in case leading digit add _ */
if ("0" <=: lib <=: "9")
then lib=cats("_",lib);
if ("0" <=: ds <=: "9")
then ds=cats("_",ds);
&mcParam. = upcase(catx(".",lib,ds));
end;
end;
/*=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=*/
%end;
%else
%do;
%put INFO: SAS Packages Framework internal macro.;
%put INFO: Executable only inside &allowedSPFmacrosList. macros.;
%end;
%mend SPFinit_intrnl_forceV7DSname;
/* end of SPFinit.sas file */
+1 -1
View File
@@ -1,6 +1,6 @@
/*+SPFint_gnPckg_arch+*/
%macro SPFint_gnPckg_arch()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the archive version generation part of the process. Version 20260411.';
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the archive version generation part of the process. Version 20260514.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
+2 -2
View File
@@ -1,6 +1,6 @@
/*+SPFint_gnPckg_markdown+*/
%macro SPFint_gnPckg_markdown()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the markdown documentation part of the process. Version 20260411.';
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the markdown documentation part of the process. Version 20260514.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
@@ -112,7 +112,7 @@ data &filesWithCodes.markdown;
%end;
put " " / "---------------------------------------------------------------------" / " "
/ "*SAS package generated by SAS Package Framework, version `20260411`,*"
/ "*SAS package generated by SAS Package Framework, version `20260514`,*"
/ "*under `&sysscp.`(`&sysscpl.`) operating system,*"
/ "*using SAS release: `&sysvlong4.`.*"
/ " " / "---------------------------------------------------------------------" / " ";
+1 -1
View File
@@ -1,6 +1,6 @@
/*+SPFint_gnPckg_tests+*/
%macro SPFint_gnPckg_tests()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the test part of the process. Version 20260411.';
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the test part of the process. Version 20260514.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
+2 -2
View File
@@ -8,7 +8,7 @@
,nobs=0 /* technical parameter */
)
/*** HELP END ***/
/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260411. Run %splitCodeForPackage() for help info.'
/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260514. Run %splitCodeForPackage() for help info.'
;
%if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then
%do;
@@ -24,7 +24,7 @@
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Utility macro to *split* single file with SAS package code into multiple #;
%put # files with separate snippets, version `20260411` #;
%put # files with separate snippets, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
+24 -13
View File
@@ -8,7 +8,7 @@
,ods= /* data set for report file */
,verify=0
)/
des='Macro to extract a bundle of SAS packages, version 20260411. Run %unbundlePackages(HELP) for help info.'
des='Macro to extract a bundle of SAS packages, version 20260514. Run %unbundlePackages(HELP) for help info.'
secure
minoperator
;
@@ -26,7 +26,7 @@ minoperator
%put ### This is short help information for the `unbundlePackages` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to *extract* SAS packages from a bundle, version `20260411` #;
%put # Macro to *extract* SAS packages from a bundle, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -58,7 +58,7 @@ minoperator
%put # - `packagesRef=` *Optional.* Fileref to location where packages will #;
%put # be extracted. Default value is `packages`. #;
%put # #;
%put # - `ods=` *Optional.* Name of SAS data set for the report. #;
%put # - `ods=` *Optional.* V7 style name of SAS data set for report. #;
%put # #;
%put # - `verify=` *Optional.* Indicates if verification code should #;
%put # be executed after bundle extraction. #;
@@ -128,6 +128,13 @@ minoperator
%let datetime = %sysfunc(datetime());
%let reportFile = WORK.tmpbundlefile%sysfunc(int(&datetime.), b8601dt15.)_;
%if NOT %sysevalf(%superq(ods)=,BOOLEAN) %then %do;
data _null_; /* verify ods= value */
%SPFinit_intrnl_forceV7DSname(ods);
call symputX("ods",ods,"L");
run;
%end;
data _null_;
datetime=symgetn('datetime');
@@ -289,7 +296,12 @@ else
packagesList = catx(" ", packagesList, package);
end;
rc = Q.output(dataset:"&reportFile.1");
rc = Q.output(dataset: /* create propper tag */
%if %superq(ods) NE %then %do; "&ods." %end;
%else %do; "&reportFile.1" %end;
);
/* code executed for unbundling */
length code1 code2 $ 32767;
@@ -321,16 +333,14 @@ put " ";
rc=sleep(1,1);
rc = doSubL("title 'Summary of the extracted bundle file';" !!
"proc print data=" !!
"proc print label data=" !!
%if %superq(ods) NE %then %do; "&ods." %end;
%else %do; "&reportFile.1" %end; !!
"; var package pckVer pckDtm hash; run;" !!
%if %superq(ods) NE %then
%do; "%scan(&ods.,1,())" %end;
%do; %put INFO: Report file: &ods.; %end;
%else
%do; "&reportFile.1" %end; !!
" label; var package pckVer pckDtm hash; run;" !!
%if %superq(ods) NE %then
%do; %put INFO: Report file: %scan(&ods.,1,()); %end;
%else
%do; "proc delete data=&reportFile.1; run;" %end; !!
%do; "proc delete data=&reportFile.1; run;" !! %end;
"title;");
stop;
@@ -359,6 +369,7 @@ options mprint;
,path=R:\
,packagesPath=R:\check2
,verify=1
,ods=WORK.bundlenametest124_reportDS
)
%unbundlePackages(
@@ -384,4 +395,4 @@ options mprint;
*/
/* end of SPFinit.sas file */
+2 -2
View File
@@ -20,7 +20,7 @@
*/
)/secure
/*** HELP END ***/
des = 'Macro to unload SAS package, version 20260411. Run %unloadPackage() for help info.'
des = 'Macro to unload SAS package, version 20260514. 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 20260411. Run %unloadPackage() for h
%put ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to unload SAS packages, version `20260411` #;
%put # Macro to unload SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
+2 -2
View File
@@ -13,7 +13,7 @@
hashing_file() function, SAS 9.4M6 */
)/secure
/*** HELP END ***/
des = 'Macro to verify SAS package with the hash digest, version 20260411. Run %verifyPackage() for help info.'
des = 'Macro to verify SAS package with the hash digest, version 20260514. 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 20260411. Run %
%put ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to verify SAS package with it hash digest, version `20260411` #;
%put # Macro to verify SAS package with it hash digest, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
+19 -19
View File
@@ -1,7 +1,7 @@
---
# SAS Packages Framework, version `20260411`
# SAS Packages Framework, version `20260514`
---
@@ -34,7 +34,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 **`20260411`**.
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20260514`**.
**To get started with SAS Packages** try this [**`Introduction to SAS Packages`**](https://youtube.com/playlist?list=PLeMzGEImIT5eV13IGXQIgWmTFCJt_cLZG&si=ElQm0_ifq76mvUbq "Introduction to SAS Packages video series") video series or [**`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).
@@ -57,7 +57,7 @@ them using the SPF can be found [**HERE**](https://github.com/yabwon/HoW-SASPack
## This is short help information for the `installPackage` macro <a name="installpackage"></a>
--------------------------------------------------------------------------------------------
Macro to install SAS packages, version `20260411`
Macro to install SAS packages, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -210,7 +210,7 @@ filename packages "C:/SAS_PACKAGES";
## This is short help information for the `helpPackage` macro <a name="helppackage"></a>
-------------------------------------------------------------------------------
Macro to get help about SAS packages, version `20260411`
Macro to get help about SAS packages, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -288,7 +288,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `loadPackage` macro <a name="loadpackage"></a>
-------------------------------------------------------------------------------
Macro to *load* SAS packages, version `20260411`
Macro to *load* SAS packages, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -446,7 +446,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>
-------------------------------------------------------------------------------
Macro wrapper for the loadPackage macro, version `20260411`
Macro wrapper for the loadPackage macro, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -497,7 +497,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `unloadPackage` macro <a name="unloadpackage"></a>
-------------------------------------------------------------------------------
Macro to unload SAS packages, version `20260411`
Macro to unload SAS packages, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -564,7 +564,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `listPackages` macro <a name="listpackages"></a>
-----------------------------------------------------------------------------------------
Macro to list available SAS packages, version `20260411`
Macro to list available SAS packages, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -613,7 +613,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `verifyPackage` macro <a name="verifypackage"></a>
-------------------------------------------------------------------------------
Macro to verify SAS package with it hash digest, version `20260411`
Macro to verify SAS package with it hash digest, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -669,7 +669,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>
-------------------------------------------------------------------------------
Macro to get preview of a SAS packages, version `20260411`
Macro to get preview of a SAS packages, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -738,7 +738,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `generatePackage` macro <a name="generatepackage"></a>
-------------------------------------------------------------------------------
Macro to generate SAS packages, version `20260411`
Macro to generate SAS packages, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -971,7 +971,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>
-----------------------------------------------------------------------------------------
Macro to list directories pointed by 'packages' fileref, version `20260411`
Macro to list directories pointed by 'packages' fileref, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1013,7 +1013,7 @@ filename packages ("D:/NEW_DIR" %extendPackagesFileref()); %* add new directory;
## This is short help information for the `loadPackageAddCnt` macro <a name="loadpackageaddcnt"></a>
-------------------------------------------------------------------------------
Macro to load *additional content* for a SAS package, version `20260411`
Macro to load *additional content* for a SAS package, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1107,7 +1107,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 `20260411`
files with separate snippets, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1188,7 +1188,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `relocatePackage` macro <a name="relocatepackage"></a>
-------------------------------------------------------------------------------
Macro to *locally copy or move* (relocate) SAS packages, version `20260411`
Macro to *locally copy or move* (relocate) SAS packages, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1300,7 +1300,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `isPackagesFilerefOK` macro <a name="ispackagesfilerefok"></a>
-----------------------------------------------------------------------------------------
Macro to check if the `packages` fileref is "correct", version `20260411`
Macro to check if the `packages` fileref is "correct", version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1351,7 +1351,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `SasPackagesFrameworkNotes` macro <a name="saspackagesframeworknotes"></a>
-------------------------------------------------------------------------------
Macro prints help notes for SAS Packages Framework macros, version `20260411`
Macro prints help notes for SAS Packages Framework macros, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1401,7 +1401,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `bundlePackages` macro <a name="bundlepackages"></a>
-------------------------------------------------------------------------------
Macro to *create bundles* of SAS packages, version `20260411`
Macro to *create bundles* of SAS packages, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1470,7 +1470,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
## This is short help information for the `unbundlePackages` macro <a name="unbundlepackages"></a>
-------------------------------------------------------------------------------
Macro to *extract* SAS packages from a bundle, version `20260411`
Macro to *extract* SAS packages from a bundle, version `20260514`
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
+197 -75
View File
@@ -43,7 +43,7 @@
- to unload, or
- to generate SAS packages.
Version 20260411.
SAS Packages Framework, version 20260514.
See examples below.
A SAS package is a zip file containing a group of files
@@ -101,7 +101,7 @@ Contributors:
*/
)/secure
/*** HELP END ***/
des = 'Macro to load SAS package, version 20260411. Run %loadPackage() for help info.'
des = 'Macro to load SAS package, version 20260514. Run %loadPackage() for help info.'
minoperator
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -117,7 +117,7 @@ minoperator
%put ### This is short help information for the `loadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to *load* SAS packages, version `20260411` #;
%put # Macro to *load* SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -398,7 +398,7 @@ minoperator
*/
)/secure
/*** HELP END ***/
des = 'Macro to unload SAS package, version 20260411. Run %unloadPackage() for help info.'
des = 'Macro to unload SAS package, version 20260514. Run %unloadPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -413,7 +413,7 @@ des = 'Macro to unload SAS package, version 20260411. Run %unloadPackage() for h
%put ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to unload SAS packages, version `20260411` #;
%put # Macro to unload SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -568,7 +568,7 @@ des = 'Macro to unload SAS package, version 20260411. Run %unloadPackage() for h
*/
)/secure
/*** HELP END ***/
des = 'Macro to get help about SAS package, version 20260411. Run %helpPackage() for help info.'
des = 'Macro to get help about SAS package, version 20260514. Run %helpPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -583,7 +583,7 @@ des = 'Macro to get help about SAS package, version 20260411. Run %helpPackage()
%put ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to get help about SAS packages, version `20260411` #;
%put # Macro to get help about SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -728,7 +728,7 @@ TODO:
*/
/*+installPackage+*/
/* Macros to install SAS packages, version 20260411 */
/* Macros to install SAS packages, version 20260514 */
/* 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
@@ -759,7 +759,7 @@ TODO:
/secure
minoperator
/*** HELP END ***/
des = 'Macro to install SAS package, version 20260411. Run %%installPackage() for help info.'
des = 'Macro to install SAS package, version 20260514. Run %%installPackage() for help info.'
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do;
@@ -774,7 +774,7 @@ des = 'Macro to install SAS package, version 20260411. Run %%installPackage() fo
%put ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to install SAS packages, version `20260411` #;
%put # Macro to install SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -1644,7 +1644,7 @@ des = 'Macro to install SAS package, version 20260411. Run %%installPackage() fo
Macro to list SAS packages in packages folder.
Version 20260411
Version 20260514
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1666,7 +1666,7 @@ des = 'Macro to install SAS package, version 20260411. Run %%installPackage() fo
listDataSet /* Name of a data set to save results */
, quiet = 0 /* Indicate if results should be printed in log */
)/secure parmbuff
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20260411.'
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20260514.'
;
%if (%QUPCASE(&listDataSet.) = HELP) %then
%do;
@@ -1681,7 +1681,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 `20260411` #;
%put # Macro to list available SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -1742,14 +1742,17 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
options NOnotes NOsource ls=MAX ps=MAX;
data _null_;
length listDataSet $ 41;
listDataSet = strip(scan(symget('listDataSet'),1,'( )'));
call symputX('listDataSet',listDataSet,"L");
if not (listDataSet = " ") then
call symputX('listDataSetCheck',1,"L");
else call symputX('quiet',0,"L");
run;
%if %superq(listDataSet) NE %then
%do;
data _null_; /* verify listDataSet compatibility with V7 naming */
%SPFinit_intrnl_forceV7DSname(listDataSet);
call symputX('listDataSet',listDataSet,"L");
if not (listDataSet = " ") then
call symputX('listDataSetCheck',1,"L");
else call symputX('quiet',0,"L");
run;
%end;
data _null_
%if 1=&listDataSetCheck. %then
@@ -1907,7 +1910,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
Macro to generate SAS packages.
Version 20260411
Version 20260514
A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating
@@ -1957,7 +1960,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
when empty takes buildLocation */
)/ secure minoperator
/*** HELP END ***/
des = 'Macro to generate SAS packages, version 20260411. Run %generatePackage() for help info.'
des = 'Macro to generate SAS packages, version 20260514. Run %generatePackage() for help info.'
;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do;
@@ -1972,7 +1975,7 @@ des = 'Macro to generate SAS packages, version 20260411. Run %generatePackage()
%put ### This is short help information for the `generatePackage` macro #;
%put #------------------------------------------------------------------------------------#;
%put # #;
%put # Macro to generate SAS packages, version `20260411` #;
%put # Macro to generate SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -2854,7 +2857,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
title&_titleNumber_. "Package ZIP file location is: &buildLocation.";
%end;
footnote1 "SAS Packages Framework, version 20260411";
footnote1 "SAS Packages Framework, version 20260514";
proc print
data = &filesWithCodes.(drop=base build folderRef fileRef rc folderid _abort_ fileId additionalContent)
@@ -3679,7 +3682,7 @@ data _null_;
%end;
put +(-1) '`.;'''
/ ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"'
/ ' !! '' %put with the SAS Packages Framework version 20260411.;'''
/ ' !! '' %put with the SAS Packages Framework version 20260514.;'''
/ ' !! '' %put ****************************************************************************;'''
/ ' !! '' %GOTO theEndOfTheMacro;'''
/ ' !! '' %end;''' ;
@@ -3843,7 +3846,7 @@ data _null_;
%end;
put +(-1) '`.; '' !!' /
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !! ' /
''' %put with the SAS Packages Framework version 20260411.; '' !! ' /
''' %put with the SAS Packages Framework version 20260514.; '' !! ' /
''' %put ****************************************************************************; '' !! ' /
''' %GOTO theEndOfTheMacro; '' !! ' /
''' %end; '' !! ' /
@@ -4715,7 +4718,7 @@ data _null_;
%end;
put 'put " " / @3 "---------------------------------------------------------------------" / " ";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20260411`*";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20260514`*";'
/ "put @3 '*under `&sysscp.`(`&sysscpl.`) operating system,*';"
/ "put @3 '*using SAS release: `&sysvlong4.`.*';"
/ 'put " " / @3 "---------------------------------------------------------------------";';
@@ -5154,7 +5157,7 @@ options &qlenmax_fstimer_tmp.;
/*+SPFint_gnPckg_tests+*/
%macro SPFint_gnPckg_tests()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the test part of the process. Version 20260411.';
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the test part of the process. Version 20260514.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
@@ -5836,7 +5839,7 @@ options &quotelenmax_tmp.;
/*+SPFint_gnPckg_markdown+*/
%macro SPFint_gnPckg_markdown()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the markdown documentation part of the process. Version 20260411.';
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the markdown documentation part of the process. Version 20260514.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
@@ -5948,7 +5951,7 @@ data &filesWithCodes.markdown;
%end;
put " " / "---------------------------------------------------------------------" / " "
/ "*SAS package generated by SAS Package Framework, version `20260411`,*"
/ "*SAS package generated by SAS Package Framework, version `20260514`,*"
/ "*under `&sysscp.`(`&sysscpl.`) operating system,*"
/ "*using SAS release: `&sysvlong4.`.*"
/ " " / "---------------------------------------------------------------------" / " ";
@@ -6089,7 +6092,7 @@ options &MarkDownOptionsTmp.;
/*+SPFint_gnPckg_arch+*/
%macro SPFint_gnPckg_arch()/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the archive version generation part of the process. Version 20260411.';
des='SAS Packages Framework internal macro. Executable only inside the %generatePackage() macro. The macro encapsulates the archive version generation part of the process. Version 20260514.';
/* macro picks up all macrovariables from external scope, so from the %generatePackage() macro */
%if %sysmexecname(%sysmexecdepth-1) in (GENERATEPACKAGE) %then
%do;
@@ -6256,7 +6259,7 @@ TODO: (in Polish)
*/
)/secure
/*** HELP END ***/
des = 'Macro to load multiple SAS packages at one run, version 20260411. Run %loadPackages() for help info.'
des = 'Macro to load multiple SAS packages at one run, version 20260514. Run %loadPackages() for help info.'
parmbuff
;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -6272,7 +6275,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro wrapper for the loadPackage macro, version `20260411` #;
%put # Macro wrapper for the loadPackage macro, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6370,7 +6373,7 @@ parmbuff
hashing_file() function, SAS 9.4M6 */
)/secure
/*** HELP END ***/
des = 'Macro to verify SAS package with the hash digest, version 20260411. Run %verifyPackage() for help info.'
des = 'Macro to verify SAS package with the hash digest, version 20260514. Run %verifyPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -6385,7 +6388,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20260411. Run %
%put ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to verify SAS package with it hash digest, version `20260411` #;
%put # Macro to verify SAS package with it hash digest, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6601,7 +6604,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20260411. Run %
*/
)/secure
/*** HELP END ***/
des = 'Macro to preview content of a SAS package, version 20260411. Run %previewPackage() for help info.'
des = 'Macro to preview content of a SAS package, version 20260514. Run %previewPackage() for help info.'
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do;
@@ -6616,7 +6619,7 @@ des = 'Macro to preview content of a SAS package, version 20260411. Run %preview
%put ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to get preview of a SAS packages, version `20260411` #;
%put # Macro to get preview of a SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6750,7 +6753,7 @@ des = 'Macro to preview content of a SAS package, version 20260411. Run %preview
when empty the "packages" value is used */
)/secure
/*** HELP END ***/
des = 'Macro to list directories pointed by "packages" fileref, version 20260411. Run %extendPackagesFileref(HELP) for help info.'
des = 'Macro to list directories pointed by "packages" fileref, version 20260514. Run %extendPackagesFileref(HELP) for help info.'
;
%if %QUPCASE(&packages.) = HELP %then
@@ -6766,7 +6769,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20260411
%put ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to list directories pointed by 'packages' fileref, version `20260411` #;
%put # Macro to list directories pointed by 'packages' fileref, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -6868,7 +6871,7 @@ filename packages list;
is provided in required version */
)/secure
/*** HELP END ***/
des = 'Macro to load additional content for a SAS package, version 20260411. Run %loadPackageAddCnt() for help info.'
des = 'Macro to load additional content for a SAS package, version 20260514. Run %loadPackageAddCnt() for help info.'
minoperator
;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -6884,7 +6887,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 `20260411` #;
%put # Macro to *load* additional content for a SAS package, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -7255,7 +7258,7 @@ minoperator
,nobs=0 /* technical parameter */
)
/*** HELP END ***/
/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260411. Run %splitCodeForPackage() for help info.'
/ des = 'Utility macro to split "one big" code into multiple files for a SAS package, version 20260514. Run %splitCodeForPackage() for help info.'
;
%if (%superq(codeFile) = ) OR (%qupcase(&codeFile.) = HELP) %then
%do;
@@ -7271,7 +7274,7 @@ minoperator
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Utility macro to *split* single file with SAS package code into multiple #;
%put # files with separate snippets, version `20260411` #;
%put # files with separate snippets, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -7647,7 +7650,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 20260411. */';
put '/* File generated with help of SAS Packages Framework, version 20260514. */';
firstLine[j]=0;
end;
put _infile_;
@@ -7680,7 +7683,7 @@ options &options_tmp2.;
,psMAX=MAX /* pageSise in case executed inside DoSubL() */
,ods= /* a data set for results, e.g., work.relocatePackageReport */
)
/ des = 'Utility macro that locally Copies or Moves Packages, version 20260411. Run %relocatePackage() for help info.'
/ des = 'Utility macro that locally Copies or Moves Packages, version 20260514. Run %relocatePackage() for help info.'
secure
minoperator
;
@@ -7698,7 +7701,7 @@ options &options_tmp2.;
%put ### This is short help information for the `relocatePackage` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to *locally copy or move* (relocate) SAS packages, version `20260411` #;
%put # Macro to *locally copy or move* (relocate) SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -7850,7 +7853,14 @@ options &options_tmp2.;
%put WARNING: Checksum verification impossible! Minimum SAS version required for the process is 9.4M6. ;
%end;
data _null_ %if %superq(ods) NE %then %do; &ods. %end;
%if NOT %sysevalf(%superq(ods)=,BOOLEAN) %then %do;
data _null_; /* verify ods= value */
%SPFinit_intrnl_forceV7DSname(ods);
call symputX("ods",ods,"L");
run;
%end;
data _null_ &ods. /* the &ods. will be used if not missing */
;
putlog 52*"*" 24*"=" 52*"*";
length packages source target $ 32767 sDevice tDevice $ 32;
@@ -8230,7 +8240,7 @@ options &options_tmp2.;
/ "WARNING- Source is: " s_HASHING
/ "WARNING- Target is: " t_HASHING
/ "WARNING- There could be errors during copying. Check your files.";
%if %superq(ods) NE %then %do; output %scan(&ods.,1,()) ; %end;
output &ods.; /* the &ods. will be used if not missing */
end;
%end;
@@ -8356,7 +8366,7 @@ filename PACKAGES ("R:\testPackages2" "R:\testPackages1");
vERRb /* indicates if macro should be verbose and report errors */
)
/ minoperator PARMBUFF
des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20260411.'
des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFilerefOK(HELP) for help, version 20260514.'
;
/*** HELP END ***/
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
@@ -8372,7 +8382,7 @@ des = 'Macro to check if the PACKAGES fileref is "correct", type %isPackagesFile
%put ### This is short help information for the `isPackagesFilerefOK` macro #;
%put #-----------------------------------------------------------------------------------------#;;
%put # #;
%put # Macro to check if the `packages` fileref is "correct", version `20260411` #;
%put # Macro to check if the `packages` fileref is "correct", version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -8506,7 +8516,7 @@ SPFmacroName /* space separated list of names */
/
minoperator
secure
des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260411. Run %SasPackagesFrameworkNotes(HELP) for help info.'
des = 'Macro to provide help notes about SAS Packages Framework macros, version 20260514. Run %SasPackagesFrameworkNotes(HELP) for help info.'
;
%local list N i element;
%let list=
@@ -8552,7 +8562,7 @@ SasPackagesFrameworkNotes
%put ### This is short help information for the `SasPackagesFrameworkNotes` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro prints help notes for SAS Packages Framework macros, version `20260411` #;
%put # Macro prints help notes for SAS Packages Framework macros, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -8675,7 +8685,7 @@ options mlogic symbolgen;
,packagesRef=packages
,ods= /* data set for report file */
)/
des='Macro to create a bundle of SAS packages, version 20260411. Run %bundlePackages(HELP) for help info.'
des='Macro to create a bundle of SAS packages, version 20260514. Run %bundlePackages(HELP) for help info.'
secure minoperator
;
@@ -8692,7 +8702,7 @@ secure minoperator
%put ### This is short help information for the `bundlePackages` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to *create bundles* of SAS packages, version `20260411` #;
%put # Macro to *create bundles* of SAS packages, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -8729,7 +8739,7 @@ secure minoperator
%put # - `packagesRef=` *Optional.* Fileref to location of packages for the #;
%put # bundle. Default value is `packages`. #;
%put # #;
%put # - `ods=` *Optional.* Name of SAS data set for the report. #;
%put # - `ods=` *Optional.* V7 style name of SAS data set for report. #;
%put # #;
%put #-------------------------------------------------------------------------------#;
%put # #;
@@ -8793,6 +8803,13 @@ secure minoperator
%let datetime = %sysfunc(datetime());
%let reportFile = WORK.tmpbundlefile%sysfunc(int(&datetime.), b8601dt15.)_;
%if NOT %sysevalf(%superq(ods)=,BOOLEAN) %then %do;
data _null_; /* verify ods= value */
%SPFinit_intrnl_forceV7DSname(ods);
call symputX("ods",ods,"L");
run;
%end;
data _null_ %if %superq(ods) NE %then %do; &ods. %end;
%else %do; &reportFile.1 %end;
;
@@ -9066,8 +9083,8 @@ put "INFO: The " bundleName "bundle creation ended.";
;
format datetime e8601dt.;
output
%if %superq(ods) NE %then %do; %scan(&ods.,1,()) %end;
%else %do; &reportFile.1 %end;
%if %superq(ods) NE %then %do; &ods. %end;
%else %do; &reportFile.1 %end;
;
put " ";
rc=sleep(1,1);
@@ -9075,13 +9092,13 @@ stop;
run;
title2 "Summary of the bundle file";;
proc print
data= %if %superq(ods) NE %then %do; %scan(&ods.,1,()) %end;
%else %do; &reportFile.1 %end;
noObs label;
proc print noObs label
data= %if %superq(ods) NE %then %do; &ods. %end;
%else %do; &reportFile.1 %end;
;
var bundleName datetime BundleSHA256 path;
run;
%if %superq(ods) NE %then %do; %put INFO: Report file: %scan(&ods.,1,()); %end;
%if %superq(ods) NE %then %do; %put INFO: Report file: &ods.; %end;
%else %do; proc delete data=&reportFile.1; run; %end;
@@ -9177,7 +9194,7 @@ filename p2 "R:/dontexist";
,ods= /* data set for report file */
,verify=0
)/
des='Macro to extract a bundle of SAS packages, version 20260411. Run %unbundlePackages(HELP) for help info.'
des='Macro to extract a bundle of SAS packages, version 20260514. Run %unbundlePackages(HELP) for help info.'
secure
minoperator
;
@@ -9195,7 +9212,7 @@ minoperator
%put ### This is short help information for the `unbundlePackages` macro #;
%put #-------------------------------------------------------------------------------#;
%put # #;
%put # Macro to *extract* SAS packages from a bundle, version `20260411` #;
%put # Macro to *extract* SAS packages from a bundle, version `20260514` #;
%put # #;
%put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #;
@@ -9227,7 +9244,7 @@ minoperator
%put # - `packagesRef=` *Optional.* Fileref to location where packages will #;
%put # be extracted. Default value is `packages`. #;
%put # #;
%put # - `ods=` *Optional.* Name of SAS data set for the report. #;
%put # - `ods=` *Optional.* V7 style name of SAS data set for report. #;
%put # #;
%put # - `verify=` *Optional.* Indicates if verification code should #;
%put # be executed after bundle extraction. #;
@@ -9297,6 +9314,13 @@ minoperator
%let datetime = %sysfunc(datetime());
%let reportFile = WORK.tmpbundlefile%sysfunc(int(&datetime.), b8601dt15.)_;
%if NOT %sysevalf(%superq(ods)=,BOOLEAN) %then %do;
data _null_; /* verify ods= value */
%SPFinit_intrnl_forceV7DSname(ods);
call symputX("ods",ods,"L");
run;
%end;
data _null_;
datetime=symgetn('datetime');
@@ -9458,7 +9482,12 @@ else
packagesList = catx(" ", packagesList, package);
end;
rc = Q.output(dataset:"&reportFile.1");
rc = Q.output(dataset: /* create propper tag */
%if %superq(ods) NE %then %do; "&ods." %end;
%else %do; "&reportFile.1" %end;
);
/* code executed for unbundling */
length code1 code2 $ 32767;
@@ -9490,16 +9519,14 @@ put " ";
rc=sleep(1,1);
rc = doSubL("title 'Summary of the extracted bundle file';" !!
"proc print data=" !!
"proc print label data=" !!
%if %superq(ods) NE %then %do; "&ods." %end;
%else %do; "&reportFile.1" %end; !!
"; var package pckVer pckDtm hash; run;" !!
%if %superq(ods) NE %then
%do; "%scan(&ods.,1,())" %end;
%do; %put INFO: Report file: &ods.; %end;
%else
%do; "&reportFile.1" %end; !!
" label; var package pckVer pckDtm hash; run;" !!
%if %superq(ods) NE %then
%do; %put INFO: Report file: %scan(&ods.,1,()); %end;
%else
%do; "proc delete data=&reportFile.1; run;" %end; !!
%do; "proc delete data=&reportFile.1; run;" !! %end;
"title;");
stop;
@@ -9528,6 +9555,7 @@ options mprint;
,path=R:\
,packagesPath=R:\check2
,verify=1
,ods=WORK.bundlenametest124_reportDS
)
%unbundlePackages(
@@ -9553,4 +9581,98 @@ options mprint;
*/
/*+SPFinit_intrnl_forceV7DSname+*/
%macro SPFinit_intrnl_forceV7DSname(
mcParam /* name of a macro parameter holding user provided data set name */
)/secure minoperator
des='SAS Packages Framework internal macro. Executable only inside selected SPF macros. Macro generates 4GL code that forces V7 compatybility for user provided data set names. Version 20260514.';
/* The macro can be called only inside a data step. */
/****************************************************************************
### Parameters:
`mcParam` - name of a macro parameter holding user provided data set name
### Behavior:
Description:
The 4GL code SYMGETs macro variable value, SCANs only first
part of the string in case there are parenthesis "()" in it.
Then it COMPRESSes the string and keep _only_ digits, letters,
underscore, and period. All periods are TRANSLATEd to spaces.
If created string is not empty its last chunk is SCANned for
data set name, the second to last chunk is SCANned for libname
(if empty then "work" is used). First character of LIB and DS
variables is checked, if it is a digit, then underscore is added.
At the end the LIB and DS are concatenated and casted to upper
case letters.
Examples:
abc.xyz -> ABC.XYZ
ABC.XYZ(obs=42) -> ABC.XYZ
XYZ -> WORK.XYZ
abc. -> WORK.ABC
.XYZ -> WORK.XYZ
123.456 -> _123._456
A#B.x$y -> AB.XY
Usecase:
Inside a macro for value check
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%macro A(ods);
data _null_;
%SPDinit_intrnl_forceV7DSname(ods);
call symputX("ods",ods,"L");
run;
%if %superq(ods) ne %then
%do;
data &ods.;
...
run;
%end;
%mend;
%A()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
****************************************************************************/
%local allowedSPFmacrosList;
%let allowedSPFmacrosList=LISTPACKAGES RELOCATEPACKAGE UNBUNDLEPACKAGES BUNDLEPACKAGES;
%if %sysmexecname(%sysmexecdepth-1) in (&allowedSPFmacrosList.) %then
%do;
/*=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=*/
length &mcParam. $ 41 lib $ 8 ds $ 32;
/* force only V7 valid symbols */
&mcParam. = symget("&mcParam.");
if NOT (&mcParam. = " ") then
do;
/* drop every illegal character */
&mcParam. = compress(scan(&mcParam,1,'()'),'_.','kad');
&mcParam. = cats(translate(&mcParam.," ","."));
if NOT (&mcParam.=" ") then
do;
/* use 2 last blocks of symbols */
lib = coalescec(scan(&mcParam.,-2),"work");
ds = scan(&mcParam.,-1);
/* check first symbol, in case leading digit add _ */
if ("0" <=: lib <=: "9")
then lib=cats("_",lib);
if ("0" <=: ds <=: "9")
then ds=cats("_",ds);
&mcParam. = upcase(catx(".",lib,ds));
end;
end;
/*=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=*/
%end;
%else
%do;
%put INFO: SAS Packages Framework internal macro.;
%put INFO: Executable only inside &allowedSPFmacrosList. macros.;
%end;
%mend SPFinit_intrnl_forceV7DSname;
/* end of SPFinit.sas file */
+2 -2
View File
@@ -86,7 +86,7 @@ SHA256 digest for macroArray: F*35A657517CD2B1AB86C4E7C5320B5EDDDFBA9348075AE31D
---
- **BasePlus**\[3.1.4\] adds a bunch of functionalities I am missing in BASE SAS, such as:
- **BasePlus**\[3.1.5\] adds a bunch of functionalities I am missing in BASE SAS, such as:
```sas
call arrMissToRight(myArray);
call arrFillMiss(17, myArray);
@@ -120,7 +120,7 @@ format x bool.;
%workLib(ABC)
```
SHA256 digest for BasePlus: F*BD248E5F8CBD94B5F45467B723A73D97D646CD665BA98679F87C7A03A484E83E
SHA256 digest for BasePlus: F*2308959251D1BF9259B693EB8C60D30D24D5D7E06AED05A03639A7C7E458658F
[Documentation for BasePlus](https://github.com/SASPAC/baseplus/blob/main/baseplus.md "Documentation for BasePlus")
+3
View File
@@ -1,3 +1,6 @@
/* 20260512 */
BasePlus: F*2308959251D1BF9259B693EB8C60D30D24D5D7E06AED05A03639A7C7E458658F
/* 20260511 */
SQLinDS: F*A3DC9400DEF1403DC9E191611790244A8B0FB23303D3A98D29777E46A1D4E8B4
+7 -7
View File
@@ -9,17 +9,17 @@
### Version information:
- Package: BasePlus
- Version: 3.1.4
- Generated: 2026-02-17T12:22:24
- Version: 3.1.5
- Generated: 2026-05-12T16:34:34
- Author(s): Bartosz Jablonski (yabwon@gmail.com), contributors are Quentin McMullen (qmcmullen@gmail.com) and Ryo Nakaya (nakaya.ryou@gmail.com)
- Maintainer(s): Bartosz Jablonski (yabwon@gmail.com)
- License: MIT
- File SHA256: `F*BD248E5F8CBD94B5F45467B723A73D97D646CD665BA98679F87C7A03A484E83E` for this version
- Content SHA256: `C*373E1A4CDC1A2462C90D6EC88E2BAA2F9902DFE5C6A4CC70356EE7281337C70A` for this version
- File SHA256: `F*2308959251D1BF9259B693EB8C60D30D24D5D7E06AED05A03639A7C7E458658F` for this version
- Content SHA256: `C*9CA3E5365260C4D439592CCD16311BE30C82DE03AFC80BC2EA6B9677B3F7A8CE` for this version
---
# The `BasePlus` package, version: `3.1.4`;
# The `BasePlus` package, version: `3.1.5`;
---
@@ -407,9 +407,9 @@ localization (only if additional content was deployed during the installation pr
---------------------------------------------------------------------
*SAS package generated by SAS Package Framework, version `20260216`,*
*SAS package generated by SAS Package Framework, version `20260411`,*
*under `WIN`(`X64_10PRO`) operating system,*
*using SAS release: `9.04.01M9P06042025`.*
*using SAS release: `9.04.01M9P06052025`.*
---------------------------------------------------------------------
Binary file not shown.