mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2026-01-07 15:10:04 +00:00
BasePlus, version 0.9
New parameter `mcArray=` added to the `%getVars()` macro. *Optional*, default value is blank. 1) When *null* - the macro behaves like a macro function and returns a text string with variables list. 2) When *not null* - behaviour of the macro is altered. In such case a macro array of selected variables, named with `mcArray` value as a prefix, is created. Furthermore a macro named as `mcArray` value is generated. (see the macroArray package for the details). When `mcArray=` parameter is active the `getVars` macro cannot be called within the `%put` statement. Execution like: `%put %getVars(..., mcArray=XXX);` will result with an Explicit & Radical Refuse Of Run (aka ERROR).
This commit is contained in:
@@ -119,7 +119,7 @@ SHA256 digest for macroArray: 75056F508E96296DC50096BBB054C58334DB913AD378859580
|
|||||||
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")
|
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")
|
||||||
|
|
||||||
|
|
||||||
- **BasePlus**\[0.8\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
- **BasePlus**\[0.9\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
||||||
```
|
```
|
||||||
call arrMissToRight(myArray);
|
call arrMissToRight(myArray);
|
||||||
call arrFillMiss(17, myArray);
|
call arrFillMiss(17, myArray);
|
||||||
@@ -133,7 +133,7 @@ format x bool.;
|
|||||||
|
|
||||||
%put %getVars(sashelp.class, pattern = ght$, sep = +, varRange = _numeric_);
|
%put %getVars(sashelp.class, pattern = ght$, sep = +, varRange = _numeric_);
|
||||||
```
|
```
|
||||||
SHA256 digest for BasePlus: 9549378E5F81DA4DC421C366DF006D270261852336CE3DCD88FF8E2A759938C8
|
SHA256 digest for BasePlus: 9AC9F71DBC890068BBD972311BEF3F0D1CA100C3F80A5C34C56B9646D04BFEFB
|
||||||
|
|
||||||
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
|
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ SHA256 digest for macroArray: 75056F508E96296DC50096BBB054C58334DB913AD378859580
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- **BasePlus**\[0.8\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
- **BasePlus**\[0.9\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
||||||
```
|
```
|
||||||
call arrMissToRight(myArray);
|
call arrMissToRight(myArray);
|
||||||
call arrFillMiss(17, myArray);
|
call arrFillMiss(17, myArray);
|
||||||
@@ -102,7 +102,7 @@ format x bool.;
|
|||||||
|
|
||||||
%put %getVars(sashelp.class, pattern = ght$, sep = +, varRange = _numeric_);
|
%put %getVars(sashelp.class, pattern = ght$, sep = +, varRange = _numeric_);
|
||||||
```
|
```
|
||||||
SHA256 digest for BasePlus: 9549378E5F81DA4DC421C366DF006D270261852336CE3DCD88FF8E2A759938C8
|
SHA256 digest for BasePlus: 9AC9F71DBC890068BBD972311BEF3F0D1CA100C3F80A5C34C56B9646D04BFEFB
|
||||||
|
|
||||||
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
|
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
/* 20201103 */
|
||||||
|
BasePlus: 9AC9F71DBC890068BBD972311BEF3F0D1CA100C3F80A5C34C56B9646D04BFEFB
|
||||||
|
|
||||||
/* 20201029 */
|
/* 20201029 */
|
||||||
MacroCore: A23C29529F3CE7D0C8BEE9545C5D22D5B5594907547374A5135B8E5A48D7687B
|
MacroCore: A23C29529F3CE7D0C8BEE9545C5D22D5B5594907547374A5135B8E5A48D7687B
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
- [The BasePlus package [ver. 0.8]](#baseplus-package)
|
- [The BasePlus package](#baseplus-package)
|
||||||
- [Content description](#content-description)
|
- [Content description](#content-description)
|
||||||
* [`%getVars()` macro](#getvars-macro)
|
* [`%getVars()` macro](#getvars-macro)
|
||||||
* [`%QgetVars()` macro](#qgetvars-macro)
|
* [`%QgetVars()` macro](#qgetvars-macro)
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# The BasePlus package [ver. 0.8] <a name="baseplus-package"></a> ###############################################
|
# The BasePlus package [ver. 0.9] <a name="baseplus-package"></a> ###############################################
|
||||||
|
|
||||||
The **BasePlus** package implements useful
|
The **BasePlus** package implements useful
|
||||||
functions and functionalities I miss in the BASE SAS.
|
functions and functionalities I miss in the BASE SAS.
|
||||||
@@ -199,10 +199,10 @@ Package contains:
|
|||||||
32. functions quicksorthashsddv
|
32. functions quicksorthashsddv
|
||||||
33. functions quicksortlight
|
33. functions quicksortlight
|
||||||
|
|
||||||
*SAS package generated by generatePackage, version 20201018*
|
*SAS package generated by generatePackage, version 20201101*
|
||||||
|
|
||||||
The SHA256 hash digest for package BasePlus:
|
The SHA256 hash digest for package BasePlus:
|
||||||
`9549378E5F81DA4DC421C366DF006D270261852336CE3DCD88FF8E2A759938C8`
|
`9AC9F71DBC890068BBD972311BEF3F0D1CA100C3F80A5C34C56B9646D04BFEFB`
|
||||||
|
|
||||||
---
|
---
|
||||||
# Content description ############################################################################################
|
# Content description ############################################################################################
|
||||||
@@ -230,6 +230,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
<,pattern=>
|
<,pattern=>
|
||||||
<,varRange=>
|
<,varRange=>
|
||||||
<,quote=>
|
<,quote=>
|
||||||
|
<,mcArray=>
|
||||||
)
|
)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@@ -250,6 +251,19 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
* `quote =` - *Optional*, default value is blank, a quotation
|
* `quote =` - *Optional*, default value is blank, a quotation
|
||||||
symbol to be used around values.
|
symbol to be used around values.
|
||||||
|
|
||||||
|
* `mcArray=` - *Optional*, default value is blank.
|
||||||
|
1) When *null* - the macro behaves like a macro function
|
||||||
|
and returns a text string with variables list.
|
||||||
|
2) When *not null* - behaviour of the macro is altered.
|
||||||
|
In such case a macro array of selected variables, named
|
||||||
|
with `mcArray` value as a prefix, is created.
|
||||||
|
Furthermore a macro named as `mcArray` value is generated.
|
||||||
|
(see the macroArray package for the details).
|
||||||
|
When `mcArray=` parameter is active the `getVars` macro
|
||||||
|
cannot be called within the `%put` statement. Execution like:
|
||||||
|
`%put %getVars(..., mcArray=XXX);` will result with
|
||||||
|
an Explicit & Radical Refuse Of Run (aka ERROR).
|
||||||
|
|
||||||
|
|
||||||
### EXAMPLES AND USECASES: ####################################################
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
@@ -454,6 +468,30 @@ run;
|
|||||||
%put #%getVars(class, varRange=%getVars(class, varRange=_numeric_, sep=%str(: )):, sep=\)#;
|
%put #%getVars(class, varRange=%getVars(class, varRange=_numeric_, sep=%str(: )):, sep=\)#;
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 11.** Create a macro array `XYZ...` of variables names and an additional
|
||||||
|
macro `%XYZ()` which allows easy access to the list. Can be used with
|
||||||
|
the `%do_over()` macro (provided with the macroArray package).
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data test;
|
||||||
|
array x[30];
|
||||||
|
array y[30] $ ;
|
||||||
|
array z[30];
|
||||||
|
run;
|
||||||
|
|
||||||
|
%getVars(test
|
||||||
|
,mcArray=XYZ
|
||||||
|
,varRange=x10-numeric-z22 y6-y26
|
||||||
|
,pattern=(5|7)$
|
||||||
|
,quote=#)
|
||||||
|
|
||||||
|
%put _user_;
|
||||||
|
%put *%XYZ(1)**%XYZ(2)*%XYZ(3)*;
|
||||||
|
|
||||||
|
%* Load the macroArray package first. ;
|
||||||
|
%put %do_over(XYZ);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## >>> `%QgetVars()` macro: <<< <a name="qgetvars-macro"></a> #######################
|
## >>> `%QgetVars()` macro: <<< <a name="qgetvars-macro"></a> #######################
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user