mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2026-01-06 14:50:04 +00:00
## SAS Packages Framework, version `20230904` --- New features in this release are: - in `%generatePackage()` macro - test for check of duplicated names of the same type was added to the package generation process. - in `%loadPackage()` macro - User can now suppress running the `exec` type files during the loading process. Parameter name is `suppressExec=`. - in `%helpPackage()` macro - User can now generate dataset `work.packageName_content` containing list of the package elements similar to the one printed in the log. Parameter name is `packageContentDS=`. Documentation updated. --- Packages regenerated with new version of the SPF: - BasePlus package [ver. `1.29.1`] - DFA package [ver. `0.5.6`] - GSM package [ver. `0.21.1`] - macroArray package [ver. `1.0.6`] - SQLinDS package [ver. `2.2.7`] - dynMacroArray package [ver. `0.2.6`]
135 lines
4.3 KiB
Markdown
135 lines
4.3 KiB
Markdown
## SAS Packages:
|
|
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).
|
|
|
|
## Available packages:
|
|
For "backward compatibility"/historical point of view the following packages are available under the `./packages` directory.
|
|
|
|
Since *September 2022* the default location for packages is **SASPAC - the SAS Packages Archive** located under: [`https://github.com/SASPAC`](https://github.com/SASPAC) where each package is stored as a separate repository with historical versions too.
|
|
|
|
Packages:
|
|
|
|
---
|
|
|
|
- **SQLinDS**\[2.2.7\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g.
|
|
```sas
|
|
data class;
|
|
set %SQL(
|
|
select age, name, weight, height
|
|
from sashelp.class
|
|
order by age
|
|
);
|
|
|
|
WH = weight + height;
|
|
run;
|
|
```
|
|
SHA256 digest for SQLinDS: F*42DC179E1D2B946AD519C4EC04A068061B312E021C3F4BC4826D2775E116E1B9
|
|
|
|
[Documentation for SQLinDS](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/sqlinds.md "Documentation for SQLinDS")
|
|
|
|
---
|
|
|
|
- **DFA** (Dynamic Function Arrays)\[0.5.6\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples.
|
|
```sas
|
|
%createDFArray(ArrDynamic, resizefactor=17);
|
|
|
|
data _null_;
|
|
call ArrDynamic("Allocate", -2, 2);
|
|
|
|
do i = -2 to 2;
|
|
call ArrDynamic("Input", i, 2**i);
|
|
end;
|
|
|
|
L = .; H = .;
|
|
call ArrDynamic("Dim", L, H);
|
|
put L= H=;
|
|
|
|
call ArrDynamic("+", 3, 8);
|
|
call ArrDynamic("+",-3, 0.125);
|
|
call ArrDynamic("Dim", L, H);
|
|
put L= H=;
|
|
|
|
Value = .;
|
|
do i = L to H;
|
|
call ArrDynamic("O", i, Value);
|
|
put i= Value=;
|
|
end;
|
|
run;
|
|
```
|
|
SHA256 digest for DFA: F*09EA5201360922A91A9EEE72F4567792E9CFDFB591BA33419E2BF2B31D9B7C62
|
|
|
|
[Documentation for DFA](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/dfa.md "Documentation for DFA")
|
|
|
|
---
|
|
|
|
- **macroArray**\[1.0.6\], implementation of an array concept in a macro language, e.g.
|
|
```sas
|
|
%array(ABC[17] (111:127), macarray=Y);
|
|
|
|
%macro test();
|
|
%do i = 1 %to 17;
|
|
%put &i.) %ABC(&i.);
|
|
%end;
|
|
%mend;
|
|
%test()
|
|
|
|
%let %ABC(13,i) = 99999; /* i = insert */
|
|
|
|
%do_over(ABC, phrase=%nrstr(
|
|
%put &_i_.%) %ABC(&_i_.);
|
|
),
|
|
which = 1:H:2
|
|
);
|
|
```
|
|
SHA256 digest for macroArray: F*4FAAEE7DF2854EA31933AE017A89C1615C7291A66A07CCE345041EB0D587ED4E
|
|
|
|
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")
|
|
|
|
---
|
|
|
|
- **BasePlus**\[1.29.1\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
|
```sas
|
|
call arrMissToRight(myArray);
|
|
call arrFillMiss(17, myArray);
|
|
call arrFill(42, myArray);
|
|
|
|
rc = delDataset("DataSetToDrop");
|
|
|
|
string = catXFn("date9.", "#", myArray);
|
|
|
|
format x bool.;
|
|
|
|
%put %getVars(sashelp.class, pattern = ght$, sep = +, varRange = _numeric_);
|
|
|
|
%rainCloudPlot(sashelp.cars,DriveTrain,Invoice)
|
|
|
|
%zipLibrary(sashelp,libOut=work)
|
|
|
|
%bpPIPE(ls -la ~/)
|
|
|
|
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result)
|
|
|
|
%put %repeatTxt(#,15,s=$) HELLO SAS! %repeatTxt(#,15,s=$);
|
|
```
|
|
SHA256 digest for BasePlus: F*2FE68DD9B3692B9D46EF85B82F63C7E65010BF9E89D670FD1779F4670FA03F31
|
|
|
|
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
|
|
|
|
---
|
|
|
|
- **GSM** (Generate Secure Macros)\[0.21.1\], package allows
|
|
to create secured macros stored in SAS Proc FCMP functions.
|
|
The dataset with functions can be shared between different operating systems
|
|
and allows to generate macros on site without showing their code.
|
|
|
|
SHA256 digest for GSM: F*2FECDDB568B38E206CA4ADA6FDEF5209C0A08B99401A1510D777BABF9DA54682
|
|
|
|
[Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM")
|
|
|
|
---
|
|
|
|
- **dynMacroArray**\[0.2.6\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold.
|
|
|
|
SHA256 digest for dynMacroArray: F*F50BEDB542D96B07C763EAB7549FBC5F08ED389DC2338BFAAEBFBD1FD20E22B6
|
|
|
|
---
|