mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2026-01-03 13:20:05 +00:00
## **SAS Packages Framework**, version `20230411`. --- Fixes: - Bug fix for cherry picking. Cherry picking from already loaded package caused deletion of search paths to FCMP functions, Proto functions, Formats, and Informats. Also corresponding dataset for Proc Proto was deleted. - Bug fix for Proc Proto C functions. The way how Proc Proto adds new portions of stored C functions caused that, if there were multiple directories with proto C functions all content was overwritten by the last one. [Documentation](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/SAS(r)%20packages%20-%20the%20way%20to%20share%20(a%20how%20to)-%20Paper%204725-2020%20-%20extended.pdf "Documentation") updated. --- Packages regenerated with latest version of SAS Packages Framework: - [BasePlus](https://github.com/SASPAC/baseplus "BasePlus") package [ver. 1.19.1] - [DFA](https://github.com/SASPAC/dfa "DFA") package [ver. 0.5.5] - dynMacroArray package [ver. 0.2.5] - [GSM](https://github.com/SASPAC/gsm "GSM") package [ver. 0.20.5] - [macroArray](https://github.com/SASPAC/macroarray "macroArray") package [ver. 1.0.5] - [SQLinDS](https://github.com/SASPAC/sqlinds "SQLinDS") package [ver. 2.2.6] ---
105 lines
5.8 KiB
SAS
105 lines
5.8 KiB
SAS
/*+extendPackagesFileref+*/
|
|
/*** HELP START ***/
|
|
|
|
%macro extendPackagesFileref(
|
|
packages /* A valid fileref name,
|
|
when empty the "packages" value is used */
|
|
)/secure
|
|
/*** HELP END ***/
|
|
des = 'Macro to list directories pointed by "packages" fileref, version 20230411. Run %extendPackagesFileref(HELP) for help info.'
|
|
;
|
|
|
|
%if %QUPCASE(&packages.) = HELP %then
|
|
%do;
|
|
%local options_tmp ;
|
|
%let options_tmp = ls=%sysfunc(getoption(ls))ps=%sysfunc(getoption(ps))
|
|
%sysfunc(getoption(notes)) %sysfunc(getoption(source))
|
|
msglevel=%sysfunc(getoption(msglevel))
|
|
;
|
|
options NOnotes NOsource ls=MAX ps=MAX msglevel=N;
|
|
%put ;
|
|
%put ###########################################################################################;
|
|
%put ### This is short help information for the `extendPackagesFileref` macro #;
|
|
%put #-----------------------------------------------------------------------------------------#;;
|
|
%put # #;
|
|
%put # Macro to list directories pointed by 'packages' fileref, version `20230411` #;
|
|
%put # #;
|
|
%put # A SAS package is a zip file containing a group #;
|
|
%put # of SAS codes (macros, functions, data steps generating #;
|
|
%put # data, etc.) wrapped up together and embedded inside the zip. #;
|
|
%put # #;
|
|
%put # The `%nrstr(%%extendPackagesFileref())` macro lists directories pointed by #;
|
|
%put # the packages fileref. It allows to add new dierctories to packages folder list. #;
|
|
%put # #;
|
|
%put #### Parameters: #;
|
|
%put # #;
|
|
%put # 1. `packages` *Optional.* A valid fileref name, when empty the "packages" is used. #;
|
|
%put # Use case: #;
|
|
%put # `%nrstr(%%extendPackagesFileref()).` #;
|
|
%put # #;
|
|
%put # When used as: `%nrstr(%%extendPackagesFileref(HELP))` it displays this help information. #;
|
|
%put # #;
|
|
%put #-----------------------------------------------------------------------------------------#;
|
|
%put # #;
|
|
%put # Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation` #;
|
|
%put # to learn more. #;
|
|
%put # #;
|
|
%put #### Example ##############################################################################;
|
|
%put # #;
|
|
%put # Enabling the SAS Package Framework #;
|
|
%put # from the local directory and adding #;
|
|
%put # new directory. #;
|
|
%put # #;
|
|
%put # Assume that the `SPFinit.sas` file #;
|
|
%put # is located in one of "C:/SAS_PK1" or "C:/SAS_PK2" folders. #;
|
|
%put # #;
|
|
%put # Run the following code in your SAS session: #;
|
|
%put ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas;
|
|
%put %nrstr( filename packages ("C:/SAS_PK1" "C:/SAS_PK2"); %%* setup a directory for packages; );
|
|
%put %nrstr( %%include packages(SPFinit.sas); %%* enable the framework; );
|
|
%put ;
|
|
%put %nrstr( filename packages ("D:/NEW_DIR" %%extendPackagesFileref()); %%* add new directory; );
|
|
%put ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
|
|
%put ###########################################################################################;
|
|
%put ;
|
|
options &options_tmp.;
|
|
%GOTO ENDextendPackagesFileref;
|
|
%end;
|
|
|
|
%if %superq(packages) = %then %let packages = packages;
|
|
%if %qsysfunc(pathname(&packages.)) ne %then
|
|
%do;
|
|
%if %qsubstr(%qsysfunc(pathname(&packages.)), 1, 1) = %str(%() %then
|
|
%do;
|
|
%local length;
|
|
%let length = %eval(%length(%qsysfunc(pathname(&packages.)))-2);
|
|
%unquote(%qsubstr(%qsysfunc(pathname(&packages.)), 2, &length.))
|
|
%end;
|
|
%else "%sysfunc(pathname(&packages.))";
|
|
%end;
|
|
%ENDextendPackagesFileref:
|
|
%mend extendPackagesFileref;
|
|
|
|
/* Examples:
|
|
|
|
filename packages "C:\";
|
|
%include packages(SPFinit.sas)
|
|
|
|
%extendPackagesFileref(HELP)
|
|
|
|
filename packages (%extendPackagesFileref() "D:\");
|
|
filename packages list;
|
|
|
|
filename packages clear;
|
|
|
|
filename packages "C:\";
|
|
filename packages ("D:\" %extendPackagesFileref());
|
|
filename packages list;
|
|
|
|
%put *%extendPackagesFileref()*;
|
|
|
|
|
|
|
|
*/
|
|
|