Package MacroArray, version 0.9

Package MacroArray, version 0.9:

-New macro `%sortMacroArra()` added.
-The doc. updated.
This commit is contained in:
Bart Jablonski (yabwon)
2021-12-28 18:29:24 +01:00
parent 00c63c4d8a
commit 0cf35c15a7
5 changed files with 102 additions and 7 deletions

View File

@@ -122,7 +122,7 @@ SHA256 digest for DFA: C32A81304A411C1EB6BA7B76EDB8D70550F3935F35A1506E2B8019A20
[Documentation for DFA](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/dfa.md "Documentation for DFA")
- **macroArray**\[0.8\], implementation of an array concept in a macrolanguage, e.g.
- **macroArray**\[0.9\], implementation of an array concept in a macrolanguage, e.g.
```sas
%array(ABC[17] (111:127), macarray=Y);
@@ -141,7 +141,7 @@ SHA256 digest for DFA: C32A81304A411C1EB6BA7B76EDB8D70550F3935F35A1506E2B8019A20
which = 1:H:2
);
```
SHA256 digest for macroArray: 9FE227EF3144431B51063D599148BDD8873509D1B32F1AC2979EC566E1BB1487
SHA256 digest for macroArray: 95164E71AF0B86AC816F13821F6468F611C6E5BB9036AC10459CDEB10487B08E
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")

View File

@@ -65,7 +65,7 @@ SHA256 digest for DFA: C32A81304A411C1EB6BA7B76EDB8D70550F3935F35A1506E2B8019A20
---
- **macroArray**\[0.8\], implementation of an array concept in a macro language, e.g.
- **macroArray**\[0.9\], implementation of an array concept in a macro language, e.g.
```sas
%array(ABC[17] (111:127), macarray=Y);
@@ -84,7 +84,7 @@ SHA256 digest for DFA: C32A81304A411C1EB6BA7B76EDB8D70550F3935F35A1506E2B8019A20
which = 1:H:2
);
```
SHA256 digest for macroArray: 70032D27081A0EE15BC82B8F14D2A61700FA7C1F0D88B4DB516AB433CD06C4D3
SHA256 digest for macroArray: 95164E71AF0B86AC816F13821F6468F611C6E5BB9036AC10459CDEB10487B08E
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")

View File

@@ -1,3 +1,6 @@
/* 20211228 */
macroArray: 95164E71AF0B86AC816F13821F6468F611C6E5BB9036AC10459CDEB10487B08E
/* 20211123 */
BasePlus: 105F0CEB95C49102BDB085DF67C785301F623CB337D466F07B5E051626E4AE61

View File

@@ -12,11 +12,13 @@
* [`%mcHashTable()` macro](#mchashtable-macro)
* [`%QzipArrays()` macro](#qziparrays-macro)
* [`%zipArrays()` macro](#ziparrays-macro)
* [`%sortMacroArray()` macro](#sortmacroarray-macro)
* [License](#license)
---
# The macroArray package [ver. 0.8] <a name="macroarray-package"></a> ###############################################
# The macroArray package [ver. 0.9] <a name="macroarray-package"></a> ###############################################
The **macroArray** package implements a macro array facility:
- `%array()`,
@@ -27,6 +29,7 @@ The **macroArray** package implements a macro array facility:
- `%appendcell()`,
- `%mcHashTable()`,
- `%zipArrays()`,
- `%sortMacroArray()`,
- etc.
The set of macros, which emulates classic
@@ -62,14 +65,17 @@ Package contains:
8. macro do_over3
9. macro make_do_over
10. macro mchashtable
11. macro sortmacroarray
12. macro qziparrays
13. macro ziparrays
Required SAS Components:
*Base SAS Software*
*SAS package generated by generatePackage, version 20211111.*
*SAS package generated by generatePackage, version 20211216.*
The SHA256 hash digest for package macroArray:
`70032D27081A0EE15BC82B8F14D2A61700FA7C1F0D88B4DB516AB433CD06C4D3`
`95164E71AF0B86AC816F13821F6468F611C6E5BB9036AC10459CDEB10487B08E`
---
# Content description ############################################################################################
@@ -1833,6 +1839,92 @@ The basic syntax is the following, the `<...>` means optional parameters:
---
## >>> `%sortMacroArray()` macro: <<< <a name="sortmacroarray-macro"></a> #######################
The sortMacroArray() macro
allow to sort elements of a macro array.
The **limitation** is that sorted values are limited to 32767 bytes of length.
See examples below for the details.
### SYNTAX: ###################################################################
The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~sas
%sortMacroArray(
array
<,valLength=>
<,outSet=>
<,sortseq=>
)
~~~~~~~~~~~~~~~~~~~~~~~
**Arguments description**:
1. `array` - *Required*, name of an array generated by the `%array()` macro.
* `valLength = 32767` - *Optional*, default value is `32767`,
maximum length of a variable storing macrovariable data.
(the reason of 32767 limitation)
* `outSet = _NULL_` - *Optional*, default value is `_NULL_`,
an optional output dataset name.
* `sortseq =` - *Optional*, default value is `LINGUISTIC(NUMERIC_COLLATION = ON)`,
sorting options for use in an internal `Proc SORT`.
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Basic use-case.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
options mprint;
ods html;
ods listing close;
%array(hij [4:9] $ 512 ("C33" "B22" "A11" "A01" "A02" "X42"), macarray=Y)
%put NOTE: %do_over(hij);
%sortMacroArray(hij, valLength=3, outSet = A_NULL_(compress=char))
%put NOTE: %do_over(hij);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 2.** Basic use-case.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
options mprint;
ods html;
ods listing close;
%array(ds = sashelp.class, vars = name|NNN height|h, macarray=Y)
%array(ds = sashelp.cars, vars = model|, macarray=Y)
%put NOTE: %do_over(NNN);
%put NOTE: %do_over(H);
%put NOTE: %do_over(model);
%sortMacroArray(NNN, valLength=30, outSet = A_NULL_(compress=char))
%sortMacroArray(H, valLength=32)
%sortMacroArray(model, valLength=120)
%put NOTE: %do_over(NNN);
%put NOTE: %do_over(H);
%put NOTE: %do_over(model);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
## License ####################################################################
Copyright (c) Bartosz Jablonski, since January 2019

Binary file not shown.