mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2025-12-11 03:04:35 +00:00
macroArray package, version 0.6
macroArray package, version 0.6: New feature of the `%array()` macro. If the `macarray` parameter of the `%array()` macro is set to `M` then for a given array name the macro symbols table is scanned for macrovariables with prefix like the array name and numeric suffixes. Then the minimum and the maximum index is determined and all not existing global macrovariables are created and a macro is generated in the same way as it is generated for the `Y` value. Documentation updated.
This commit is contained in:
@@ -88,7 +88,7 @@ SHA256 digest for SQLinDS: FCD7EE5B59E08CD1A2E31F6A5D94D7275C99AFFAACEA3D187F60A
|
||||
SHA256 digest for DFA: CC19058354D4B51F0675A8414F18089CCC583AA45822CEFC79368F06D8715846
|
||||
|
||||
|
||||
- **macroArray**\[0.5\], implementation of an array concept in a macrolanguage, e.g.
|
||||
- **macroArray**\[0.6\], implementation of an array concept in a macrolanguage, e.g.
|
||||
```
|
||||
%array(ABC[17] (111:127), macarray=Y);
|
||||
|
||||
@@ -107,7 +107,7 @@ SHA256 digest for DFA: CC19058354D4B51F0675A8414F18089CCC583AA45822CEFC79368F06D
|
||||
which = 1:H:2
|
||||
);
|
||||
```
|
||||
SHA256 digest for macroArray: 96215AC04EF26C97719F6B1EDA5ACAF7DD491B7F2DDDE9985A0560CD2916ABA1
|
||||
SHA256 digest for macroArray: 022A7CD5F0C1E72032CC3426A8AC53D61A8766868B6B48195BC69F59007323B8
|
||||
|
||||
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/master/packages/macroarray.md "Documentation for macroArray")
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ SHA256 digest for DFA: CC19058354D4B51F0675A8414F18089CCC583AA45822CEFC79368F06D
|
||||
|
||||
---
|
||||
|
||||
- **macroArray**\[0.5\], implementation of an array concept in a macro language, e.g.
|
||||
- **macroArray**\[0.6\], implementation of an array concept in a macro language, e.g.
|
||||
```
|
||||
%array(ABC[17] (111:127), macarray=Y);
|
||||
|
||||
@@ -74,7 +74,7 @@ SHA256 digest for DFA: CC19058354D4B51F0675A8414F18089CCC583AA45822CEFC79368F06D
|
||||
which = 1:H:2
|
||||
);
|
||||
```
|
||||
SHA256 digest for macroArray: 96215AC04EF26C97719F6B1EDA5ACAF7DD491B7F2DDDE9985A0560CD2916ABA1
|
||||
SHA256 digest for macroArray: 022A7CD5F0C1E72032CC3426A8AC53D61A8766868B6B48195BC69F59007323B8
|
||||
|
||||
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/master/packages/macroarray.md "Documentation for macroArray")
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* 20201017 */
|
||||
macroArray: 022A7CD5F0C1E72032CC3426A8AC53D61A8766868B6B48195BC69F59007323B8
|
||||
|
||||
/* 20201014 */
|
||||
BasePlus: 4E0C2A45CF8A5863C0D054568C712D10A296240877D604E77A778451A740874B
|
||||
DFA: CC19058354D4B51F0675A8414F18089CCC583AA45822CEFC79368F06D8715846
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
---
|
||||
|
||||
# The macroArray package [ver. 0.5] <a name="macroarray-package"></a> ###############################################
|
||||
# The macroArray package [ver. 0.6] <a name="macroarray-package"></a> ###############################################
|
||||
|
||||
The **macroArray** package implements a macro array facility:
|
||||
- `%array()`,
|
||||
@@ -63,7 +63,7 @@ Required SAS Components:
|
||||
*SAS package generated by generatePackage, version 20200911*
|
||||
|
||||
The SHA256 hash digest for package macroArray:
|
||||
`96215AC04EF26C97719F6B1EDA5ACAF7DD491B7F2DDDE9985A0560CD2916ABA1`
|
||||
`022A7CD5F0C1E72032CC3426A8AC53D61A8766868B6B48195BC69F59007323B8`
|
||||
|
||||
---
|
||||
# Content description ############################################################################################
|
||||
@@ -306,7 +306,12 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
or when used with second parameter equal `I` (insert) allow to overwrite macroarrays
|
||||
value:
|
||||
`%let %myArr(17,i) = 42;`
|
||||
|
||||
If set to `M` then for a given array name the macro symbols table is scanned for
|
||||
macrovariables with prefix like the array name and numeric suffixes,
|
||||
then the minimum and the maximum index is determined
|
||||
and all not existing global macrovariables are created and
|
||||
a macro is generated in the same way as for the `Y` value
|
||||
|
||||
* `ds=` - *Optional*, use a dataset as a basis for a macroarray data,
|
||||
if used by default overwrites use of the `array` parameter, honors `macarray=`
|
||||
argument, dataset options are allowed, e.g. `sashelp.class(obs=5)`
|
||||
@@ -570,6 +575,19 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
%array(ds = sashelp.cars(obs=100 where=(Cylinders=6)), vars = Make| Type| Model, macarray=Y)
|
||||
%put *%make(&makeLBOUND.)*%Model(2)*%Model(3)*%Model(4)*%type(&typeHBOUND.)*;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
**EXAMPLE 13.** Creating an array and macro from existing list of macrovariables
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%let myTest3 = 13;
|
||||
%let myTest6 = 16;
|
||||
%let myTest9 = 19;
|
||||
|
||||
%array(myTest, macarray=M)
|
||||
%do_over(myTest, phrase = %nrstr(%put *&_I_.*%myTest(&_I_.)*;))
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1088,7 +1106,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
**EXAMPLE 3.** Create a "4-loop" `%DO_OVER4()` macro
|
||||
**EXAMPLE 2.** Create a "4-loop" `%DO_OVER4()` macro
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%make_do_over(4);
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user