diff --git a/README.md b/README.md index 4a0e2f0..c96ed22 100644 --- a/README.md +++ b/README.md @@ -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") -- **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 arrFillMiss(17, myArray); @@ -133,7 +133,7 @@ format x bool.; %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") diff --git a/packages/README.md b/packages/README.md index 8f46f22..76433c1 100644 --- a/packages/README.md +++ b/packages/README.md @@ -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 arrFillMiss(17, myArray); @@ -102,7 +102,7 @@ format x bool.; %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") diff --git a/packages/SHA256_for_packages.txt b/packages/SHA256_for_packages.txt index 9986fec..123c010 100644 --- a/packages/SHA256_for_packages.txt +++ b/packages/SHA256_for_packages.txt @@ -1,3 +1,6 @@ +/* 20201103 */ +BasePlus: 9AC9F71DBC890068BBD972311BEF3F0D1CA100C3F80A5C34C56B9646D04BFEFB + /* 20201029 */ MacroCore: A23C29529F3CE7D0C8BEE9545C5D22D5B5594907547374A5135B8E5A48D7687B diff --git a/packages/baseplus.md b/packages/baseplus.md index 9841f48..5ed1e98 100644 --- a/packages/baseplus.md +++ b/packages/baseplus.md @@ -1,4 +1,4 @@ -- [The BasePlus package [ver. 0.8]](#baseplus-package) +- [The BasePlus package](#baseplus-package) - [Content description](#content-description) * [`%getVars()` macro](#getvars-macro) * [`%QgetVars()` macro](#qgetvars-macro) @@ -38,7 +38,7 @@ --- -# The BasePlus package [ver. 0.8] ############################################### +# The BasePlus package [ver. 0.9] ############################################### The **BasePlus** package implements useful functions and functionalities I miss in the BASE SAS. @@ -199,10 +199,10 @@ Package contains: 32. functions quicksorthashsddv 33. functions quicksortlight -*SAS package generated by generatePackage, version 20201018* +*SAS package generated by generatePackage, version 20201101* The SHA256 hash digest for package BasePlus: -`9549378E5F81DA4DC421C366DF006D270261852336CE3DCD88FF8E2A759938C8` +`9AC9F71DBC890068BBD972311BEF3F0D1CA100C3F80A5C34C56B9646D04BFEFB` --- # Content description ############################################################################################ @@ -229,7 +229,8 @@ The basic syntax is the following, the `<...>` means optional parameters: <,sep=> <,pattern=> <,varRange=> - <,quote=> + <,quote=> + <,mcArray=> ) ~~~~~~~~~~~~~~~~~~~~~~~ @@ -250,7 +251,20 @@ The basic syntax is the following, the `<...>` means optional parameters: * `quote =` - *Optional*, default value is blank, a quotation 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: #################################################### **EXAMPLE 1.** A list of all variables from the @@ -454,6 +468,30 @@ run; %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: <<< ####################### diff --git a/packages/baseplus.zip b/packages/baseplus.zip index a080d6f..80c949c 100644 Binary files a/packages/baseplus.zip and b/packages/baseplus.zip differ