mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2026-01-16 19:10:04 +00:00
macroArray, version 0.5
macroArray, version 0.5 - documentation updated, macroarray.md created - the do_overs automatically unquote `betwee=` parameter
This commit is contained in:
@@ -98,7 +98,7 @@ SHA256 digest for DFA: BB8768E977D62429368CFF2E5338A6553C35C998AEC09AF24088BA713
|
|||||||
which = 1:H:2
|
which = 1:H:2
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
SHA256 digest for macroArray: ACE3E9374256826AB1E25C2BBDA6CA4CCFB50137B8ACE6E1F11BCDBE7AE24B09
|
SHA256 digest for macroArray: 53C248E1DE3268946C9CEC7E77BC222F652FBB006D9317BE36B86410DA31AE35
|
||||||
|
|
||||||
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/master/packages/macroarray.md "Documentation for macroArray")
|
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/master/packages/macroarray.md "Documentation for macroArray")
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ SHA256 digest for DFA: BB8768E977D62429368CFF2E5338A6553C35C998AEC09AF24088BA713
|
|||||||
which = 1:H:2
|
which = 1:H:2
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
SHA256 digest for macroArray: ACE3E9374256826AB1E25C2BBDA6CA4CCFB50137B8ACE6E1F11BCDBE7AE24B09
|
SHA256 digest for macroArray: 53C248E1DE3268946C9CEC7E77BC222F652FBB006D9317BE36B86410DA31AE35
|
||||||
|
|
||||||
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/master/packages/macroarray.md "Documentation for macroArray")
|
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/master/packages/macroarray.md "Documentation for macroArray")
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* 20200914 */
|
/* 20200914 */
|
||||||
macroArray: ACE3E9374256826AB1E25C2BBDA6CA4CCFB50137B8ACE6E1F11BCDBE7AE24B09
|
macroArray: 53C248E1DE3268946C9CEC7E77BC222F652FBB006D9317BE36B86410DA31AE35
|
||||||
|
|
||||||
/* 20200914 */
|
/* 20200914 */
|
||||||
SQLinDS: DD5E319EB5AA29C7054EC428072F987E77C29D36874DED1AE5C62E4B300845EB
|
SQLinDS: DD5E319EB5AA29C7054EC428072F987E77C29D36874DED1AE5C62E4B300845EB
|
||||||
|
|||||||
@@ -63,12 +63,12 @@ Required SAS Components:
|
|||||||
*SAS package generated by generatePackage, version 20200911*
|
*SAS package generated by generatePackage, version 20200911*
|
||||||
|
|
||||||
The SHA256 hash digest for package macroArray:
|
The SHA256 hash digest for package macroArray:
|
||||||
`ACE3E9374256826AB1E25C2BBDA6CA4CCFB50137B8ACE6E1F11BCDBE7AE24B09`
|
`53C248E1DE3268946C9CEC7E77BC222F652FBB006D9317BE36B86410DA31AE35`
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
# Content description ############################################################################################
|
# Content description ############################################################################################
|
||||||
|
|
||||||
## >>> `%appendArray()` macro: <<< <a name="appendarray-macro"></a> ##############################################
|
## >>> `%appendArray()` macro: <<< <a name="appendarray-macro"></a> ############
|
||||||
|
|
||||||
The `%appendArray()` macro is a macrowrapper
|
The `%appendArray()` macro is a macrowrapper
|
||||||
which allows to concatenate two macroarrays
|
which allows to concatenate two macroarrays
|
||||||
@@ -80,7 +80,7 @@ Dimensions of the first macroarray are extended.
|
|||||||
|
|
||||||
The `%appendArray()` macro executes like a pure macro code.
|
The `%appendArray()` macro executes like a pure macro code.
|
||||||
|
|
||||||
### SYNTAX: ###################################################################
|
### SYNTAX: #####################################################################
|
||||||
|
|
||||||
The basic syntax is the following, the `<...>` means optional parameters:
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
@@ -92,13 +92,14 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
**Arguments description**:
|
**Arguments description**:
|
||||||
|
|
||||||
1. first - *Required*, a name of a macroarray created by the `%array()` macro.
|
1. `first` - *Required*, a name of a macroarray created by the `%array()` macro.
|
||||||
|
|
||||||
2. second - *Required*, a name of a macroarray created by the `%array()` macro.
|
2. `second` - *Required*, a name of a macroarray created by the `%array()` macro.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### EXAMPLES AND USECASES: ####################################################
|
|
||||||
|
### EXAMPLES AND USECASES: ######################################################
|
||||||
|
|
||||||
**EXAMPLE 1.** Append macroarrays LL and MM.
|
**EXAMPLE 1.** Append macroarrays LL and MM.
|
||||||
|
|
||||||
@@ -131,7 +132,8 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## >>> `%appendCell()` macro: <<< <a name="appendcell-macro"></a> ###############################################
|
|
||||||
|
## >>> `%appendCell()` macro: <<< <a name="appendcell-macro"></a> ##############
|
||||||
|
|
||||||
The `%appendCell()` macro allows to append
|
The `%appendCell()` macro allows to append
|
||||||
a macrovariable to a macroarray created by the `%array()` macro.
|
a macrovariable to a macroarray created by the `%array()` macro.
|
||||||
@@ -140,7 +142,7 @@ Dimensions of the macroarray are extended.
|
|||||||
|
|
||||||
The `%appendCell()` macro executes like a pure macro code.
|
The `%appendCell()` macro executes like a pure macro code.
|
||||||
|
|
||||||
### SYNTAX: ###################################################################
|
### SYNTAX: ####################################################################
|
||||||
|
|
||||||
The basic syntax is the following, the `<...>` means optional parameters:
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
@@ -153,15 +155,16 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
**Arguments description**:
|
**Arguments description**:
|
||||||
|
|
||||||
1. first - *required*, a name of a macroarray created by the `%array()` macro.
|
1. `first` - *Required*, a name of a macroarray created by the `%array()` macro.
|
||||||
|
|
||||||
2. second - *required*, a name of a macrovariable to be append to the macroarray.
|
2. `second` - *Required*, a name of a macrovariable to be append to the macroarray.
|
||||||
|
|
||||||
3. hilo - *required*, if `H` macrovariable is appended at the end
|
3. `hilo` - *Required*, if `H` macrovariable is appended at the end
|
||||||
if `L` macrovariable is appended at the beginning
|
if `L` macrovariable is appended at the beginning
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### EXAMPLES AND USECASES: ####################################################
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
**EXAMPLE 1.** Create two macro wrappers.
|
**EXAMPLE 1.** Create two macro wrappers.
|
||||||
@@ -218,7 +221,8 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## >>> `%array()` macro: <<< <a name="array-macro"></a> ####################################################
|
|
||||||
|
## >>> `%array()` macro: <<< <a name="array-macro"></a> #######################
|
||||||
|
|
||||||
The code of a macro was inspired by
|
The code of a macro was inspired by
|
||||||
*Ted Clay's* and *David Katz's* macro `%array()`.
|
*Ted Clay's* and *David Katz's* macro `%array()`.
|
||||||
@@ -264,7 +268,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
**Arguments description**:
|
**Arguments description**:
|
||||||
|
|
||||||
1. `array` - *Mandatory*, an array name and a declaration/definition of an array, <br>
|
1. `array` - *Required*, an array name and a declaration/definition of an array, <br>
|
||||||
e.g. `myArr[*] x1-x3 (4:6)` <br>
|
e.g. `myArr[*] x1-x3 (4:6)` <br>
|
||||||
or `myBrr[*] $ y1-y3 ("a" "b" "c")` <br>
|
or `myBrr[*] $ y1-y3 ("a" "b" "c")` <br>
|
||||||
or `myCrr[3] $ ("d d d" "e,e,e" "f;f;f")` <br>
|
or `myCrr[3] $ ("d d d" "e,e,e" "f;f;f")` <br>
|
||||||
@@ -288,12 +292,12 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
* `after=` - *Optional*, a function or an expression to be added after looping through
|
* `after=` - *Optional*, a function or an expression to be added after looping through
|
||||||
array, e.g. `call sortn(ABC)`.
|
array, e.g. `call sortn(ABC)`.
|
||||||
|
|
||||||
* `vnames=N` - *Optional*, Default value `N`, if set to `Y`/`YES` then macroarray is built based
|
* `vnames=N` - *Optional*, default value `N`, if set to `Y`/`YES` then macroarray is built based
|
||||||
on variables names instead values, e.g.
|
on variables names instead values, e.g.
|
||||||
`%array(myArr[*] x1-x3 (4:6), vnames=Y)`
|
`%array(myArr[*] x1-x3 (4:6), vnames=Y)`
|
||||||
will use `x1`, `x2`, and `x3` as values instead `4`, `5`, and `6`.
|
will use `x1`, `x2`, and `x3` as values instead `4`, `5`, and `6`.
|
||||||
|
|
||||||
* `macarray=N` - *Optional*, Default value `N`, if set to `Y`/`YES` then macro named with array
|
* `macarray=N` - *Optional*, default value `N`, if set to `Y`/`YES` then macro named with array
|
||||||
name is compiled to create convenient envelope for multiple ampersands, e.g.
|
name is compiled to create convenient envelope for multiple ampersands, e.g.
|
||||||
`%array(myArr[*] x1-x3 (4:6), macarray=Y)`
|
`%array(myArr[*] x1-x3 (4:6), macarray=Y)`
|
||||||
will create `%myArr(J)` macro which will allow to extract "data"
|
will create `%myArr(J)` macro which will allow to extract "data"
|
||||||
@@ -303,7 +307,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
value:
|
value:
|
||||||
`%let %myArr(17,i) = 42;`
|
`%let %myArr(17,i) = 42;`
|
||||||
|
|
||||||
* `ds=` - *Optional*, Use a dataset as a basis for a macroarray data,
|
* `ds=` - *Optional*, use a dataset as a basis for a macroarray data,
|
||||||
if used by default overwrites use of the `array` parameter, honors `macarray=`
|
if used by default overwrites use of the `array` parameter, honors `macarray=`
|
||||||
argument, dataset options are allowed, e.g. `sashelp.class(obs=5)`
|
argument, dataset options are allowed, e.g. `sashelp.class(obs=5)`
|
||||||
|
|
||||||
@@ -323,6 +327,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### EXAMPLES AND USECASES: ####################################################
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
|
||||||
@@ -568,7 +573,8 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## >>> `%concatArrays()` macro: <<< <a name="concatarrays-macro"></a> #############################################
|
|
||||||
|
## >>> `%concatArrays()` macro: <<< <a name="concatarrays-macro"></a> ###########
|
||||||
|
|
||||||
The `%concatArrays()` macro allows to concatenate
|
The `%concatArrays()` macro allows to concatenate
|
||||||
two macroarrays created by the `%array()` macro.
|
two macroarrays created by the `%array()` macro.
|
||||||
@@ -579,7 +585,7 @@ Dimensions of the first macroarray are extended.
|
|||||||
|
|
||||||
The `%concatArrays()` macro executes like a pure macro code.
|
The `%concatArrays()` macro executes like a pure macro code.
|
||||||
|
|
||||||
### SYNTAX: ###################################################################
|
### SYNTAX: #####################################################################
|
||||||
|
|
||||||
The basic syntax is the following, the `<...>` means optional parameters:
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
@@ -592,12 +598,13 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
**Arguments description**:
|
**Arguments description**:
|
||||||
|
|
||||||
1. first - *Required*, a name of a macroarray created by the `%array()` macro.
|
1. `first` - *Required*, a name of a macroarray created by the `%array()` macro.
|
||||||
|
|
||||||
2. second - *Required*, a name of a macroarray created by the `%array()` macro.
|
2. `second` - *Required*, a name of a macroarray created by the `%array()` macro.
|
||||||
|
|
||||||
|
* `removeSecond=Y` - *Optional*, default value `Y`, if set to `Y` then
|
||||||
|
the second array is removed.
|
||||||
|
|
||||||
* removeSecond=Y - *Optional*, Default value `Y`, if set to `Y` then
|
|
||||||
the second array is removed.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -634,14 +641,15 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## >>> `%deleteMacArray()` macro: <<< <a name="deletemacarray-macro"></a> ###########################################
|
|
||||||
|
## >>> `%deleteMacArray()` macro: <<< <a name="deletemacarray-macro"></a> #######
|
||||||
|
|
||||||
The `%deleteMacArray()` macro allows to delete
|
The `%deleteMacArray()` macro allows to delete
|
||||||
macroarrays created by the `%array()` macro.
|
macroarrays created by the `%array()` macro.
|
||||||
|
|
||||||
The `%deleteMacArray()` macro executes like a pure macro code.
|
The `%deleteMacArray()` macro executes like a pure macro code.
|
||||||
|
|
||||||
### SYNTAX: ###################################################################
|
### SYNTAX: #####################################################################
|
||||||
|
|
||||||
The basic syntax is the following, the `<...>` means optional parameters:
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
@@ -653,26 +661,27 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
**Arguments description**:
|
**Arguments description**:
|
||||||
|
|
||||||
1. arrs - *Required*, a space separated list of manes
|
1. `arrs` - *Required*, a space separated list of manes
|
||||||
of macroarray created by the `%array()` macro.
|
of macroarray created by the `%array()` macro.
|
||||||
|
|
||||||
* macarray=N - *Optional*, indicator should a macro
|
* `macarray=N` - *Optional*, indicator should a macro
|
||||||
associated with macroarray to be deleted?
|
associated with macroarray to be deleted?
|
||||||
If `Y` or `YES` then the associated macro is deleted.
|
If `Y` or `YES` then the associated macro is deleted.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## >>> `%do_over()` macro: <<< <a name="do-over-macro"></a>################################################
|
|
||||||
|
## >>> `%do_over()` macro: <<< <a name="do-over-macro"></a>######################
|
||||||
|
|
||||||
The code of the macro was inspired by
|
The code of the macro was inspired by
|
||||||
*Ted Clay's* and *David Katz's* macro `%do_over()`.
|
*Ted Clay's* and *David Katz's* macro `%do_over()`.
|
||||||
|
|
||||||
The `%DO_OVER()` macro allows to iterate over macroarray created with the `macarray=Y`
|
The `%DO_OVER()` macro allows to iterate over macroarray created with
|
||||||
parameter of the `%ARRAY()` macro.
|
the `macarray=Y` parameter of the `%ARRAY()` macro.
|
||||||
|
|
||||||
The `%do_over()` macro executes like a pure macro code.
|
The `%do_over()` macro executes like a pure macro code.
|
||||||
|
|
||||||
### SYNTAX: ###################################################################
|
### SYNTAX: #####################################################################
|
||||||
|
|
||||||
The basic syntax is the following, the `<...>` means optional parameters:
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
@@ -686,29 +695,30 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
**Arguments description**:
|
**Arguments description**:
|
||||||
|
|
||||||
1. array - Required, indicates a macroarray which metadata (Lbound, Hbouns)
|
1. `array` - *Required*, indicates a macroarray which metadata (Lbound, Hbouns)
|
||||||
are to be used to loop in the `%do_over()`
|
are to be used to loop in the `%do_over()`
|
||||||
|
|
||||||
* phrase= - *Optional*, Default value `%nrstr(%&array(&_I_.))`,
|
* `phrase=` - *Optional*, Default value `%nrstr(%&array(&_I_.))`,
|
||||||
a statement to be called in each iteration
|
a statement to be called in each iteration
|
||||||
of the internal do_over's loop. Loop iterator is `_I_`,
|
of the internal do_over's loop. Loop iterator is `_I_`,
|
||||||
if you want to use `_I_` or array name
|
if you want to use `_I_` or array name
|
||||||
[e.g. `%myArr(&_I_.)`] *enclose it* in the `%NRSTR()`
|
[e.g. `%myArr(&_I_.)`] *enclose it* in the `%NRSTR()`
|
||||||
macro quoting function.
|
macro quoting function.
|
||||||
|
|
||||||
* between= - *Optional*, Default value `%str( )` (space),
|
* `between=` - *Optional*, default value `%str( )` (space),
|
||||||
a statement to be called in between each
|
a statement to be called in between each
|
||||||
iteration of the internal do_over loop.
|
iteration of the internal do_over loop.
|
||||||
If macroquoted (e.g. `%str( + )`) then the `%unquote()`
|
If macroquoted (e.g. `%str( + )`) then the `%unquote()`
|
||||||
function is automatically applied.
|
function is automatically applied.
|
||||||
|
|
||||||
|
* `which=` - *Optional*, a _SPACE_ separated list of indexes which
|
||||||
|
should be used to iterate over selected macroarray.
|
||||||
|
Possible special characters are `H` and `L` which means
|
||||||
|
*high* and *low* bound of an array, list could be set with
|
||||||
|
colons(`:`) in form of `start:end:by` (*no spaces between!*),
|
||||||
|
if `by` is omitted the default is `1`. If possible use
|
||||||
|
`1:5` rather `1 2 3 4 5` since the firs works faster.
|
||||||
|
|
||||||
* which = - *Optional*, a _SPACE_ separated list of indexes which
|
|
||||||
should be used to iterate over selected macroarray.
|
|
||||||
Possible special characters are `H` and `L` which means
|
|
||||||
*high* and *low* bound of an array, list could be set with
|
|
||||||
colons(`:`) in form of `start:end:by` (*no spaces between!*),
|
|
||||||
if `by` is omitted the default is `1`. If possible use
|
|
||||||
`1:5` rather `1 2 3 4 5` since the firs works faster.
|
|
||||||
|
|
||||||
|
|
||||||
### EXAMPLES AND USECASES: ####################################################
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
@@ -841,17 +851,18 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## >>> `%do_over2()` macro: <<< <a name="do-over2-macro"></a>################################################
|
|
||||||
|
## >>> `%do_over2()` macro: <<< <a name="do-over2-macro"></a>####################
|
||||||
|
|
||||||
The code of the macro was inspired by
|
The code of the macro was inspired by
|
||||||
*Ted Clay's* and *David Katz's* macro `%do_over()`.
|
*Ted Clay's* and *David Katz's* macro `%do_over()`.
|
||||||
|
|
||||||
The `%DO_OVER2()` macro allows to iterate over *two* macroarray created with the `macarray=Y`
|
The `%DO_OVER2()` macro allows to iterate over *two* macroarray created with
|
||||||
parameter of the `%ARRAY()` macro.
|
the `macarray=Y` parameter of the `%ARRAY()` macro.
|
||||||
|
|
||||||
The `%do_over2()` macro executes like a pure macro code.
|
The `%do_over2()` macro executes like a pure macro code.
|
||||||
|
|
||||||
### SYNTAX: ###################################################################
|
### SYNTAX: #####################################################################
|
||||||
|
|
||||||
The basic syntax is the following, the `<...>` means optional parameters:
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
@@ -865,25 +876,26 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
**Arguments description**:
|
**Arguments description**:
|
||||||
|
|
||||||
1. arrayI - Required, indicates the first macroarray which metadata (Lbound, Hbouns)
|
1. `arrayI` - Required, indicates the first macroarray which metadata (Lbound, Hbouns)
|
||||||
are to be used in the outer loop in the `%do_over2()`
|
are to be used in the outer loop in the `%do_over2()`
|
||||||
|
|
||||||
2. arrayJ - Required, indicates the second macroarray which metadata (Lbound, Hbouns)
|
2. `arrayJ` - Required, indicates the second macroarray which metadata (Lbound, Hbouns)
|
||||||
are to be used in the inner loop in the `%do_over2()`
|
are to be used in the inner loop in the `%do_over2()`
|
||||||
|
|
||||||
* phrase= - *Optional*, Default value `%nrstr(%&arrayI(&_I_.) %&arrayJ(&_J_.))`,
|
* `phrase=` - *Optional*, default value `%nrstr(%&arrayI(&_I_.) %&arrayJ(&_J_.))`,
|
||||||
a statement to be called in each iteration
|
a statement to be called in each iteration
|
||||||
of the *inner* loop. The outer loop iterator is `_I_`,
|
of the *inner* loop. The outer loop iterator is `_I_`,
|
||||||
the inner loop iterator is `_J_`,
|
the inner loop iterator is `_J_`,
|
||||||
if you want to use `_I_`, `_J_`, or arrays names
|
if you want to use `_I_`, `_J_`, or arrays names
|
||||||
[e.g. `%myArr(&_I_.)`] *enclose them* in the `%NRSTR()`
|
[e.g. `%myArr(&_I_.)`] *enclose them* in the `%NRSTR()`
|
||||||
macro quoting function.
|
macro quoting function.
|
||||||
|
|
||||||
|
* `between=` - *Optional*, default value `%str( )` (space),
|
||||||
|
a statement to be called in between each
|
||||||
|
iteration of the internal do_over2 loop.
|
||||||
|
If macroquoted (e.g. `%str( + )`) then the `%unquote()`
|
||||||
|
function is automatically applied.
|
||||||
|
|
||||||
* between= - *Optional*, Default value `%str( )` (space),
|
|
||||||
a statement to be called in between each
|
|
||||||
iteration of the internal do_over2 loop.
|
|
||||||
If macroquoted (e.g. `%str( + )`) then the `%unquote()`
|
|
||||||
function is automatically applied.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -932,17 +944,18 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## >>> `%do_over3()` macro: <<< <a name="do-over3-macro"></a>################################################
|
|
||||||
|
## >>> `%do_over3()` macro: <<< <a name="do-over3-macro"></a>####################
|
||||||
|
|
||||||
The code of the macro was inspired by
|
The code of the macro was inspired by
|
||||||
*Ted Clay's* and *David Katz's* macro `%do_over()`.
|
*Ted Clay's* and *David Katz's* macro `%do_over()`.
|
||||||
|
|
||||||
The `%DO_OVER3()` macro allows to iterate over *three* macroarray created with the `macarray=Y`
|
The `%DO_OVER3()` macro allows to iterate over *three* macroarray created with
|
||||||
parameter of the `%ARRAY()` macro.
|
the `macarray=Y` parameter of the `%ARRAY()` macro.
|
||||||
|
|
||||||
The `%do_over3()` macro executes like a pure macro code.
|
The `%do_over3()` macro executes like a pure macro code.
|
||||||
|
|
||||||
### SYNTAX: ###################################################################
|
### SYNTAX: #####################################################################
|
||||||
|
|
||||||
The basic syntax is the following, the `<...>` means optional parameters:
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
@@ -957,28 +970,29 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
**Arguments description**:
|
**Arguments description**:
|
||||||
|
|
||||||
1. arrayI - Required, indicates the first macroarray which metadata (Lbound, Hbouns)
|
1. `arrayI` - *Required*, indicates the first macroarray which metadata (Lbound, Hbouns)
|
||||||
are to be used in the outer loop in the `%do_over3()`
|
are to be used in the outer loop in the `%do_over3()`
|
||||||
|
|
||||||
2. arrayJ - Required, indicates the second macroarray which metadata (Lbound, Hbouns)
|
2. `arrayJ` - *Required*, indicates the second macroarray which metadata (Lbound, Hbouns)
|
||||||
are to be used in the inner loop in the `%do_over3()`
|
are to be used in the inner loop in the `%do_over3()`
|
||||||
|
|
||||||
3. arrayK - Required, indicates the third macroarray which metadata (Lbound, Hbouns)
|
3. `arrayK` - *Required*, indicates the third macroarray which metadata (Lbound, Hbouns)
|
||||||
are to be used in the inner loop in the `%do_over3()`
|
are to be used in the inner loop in the `%do_over3()`
|
||||||
|
|
||||||
* phrase= - *Optional*, Default value `%nrstr(%&arrayI(&_I_.) %&arrayJ(&_J_.) %&arrayK(&_K_.))`,
|
* `phrase=` - *Optional*, default value `%nrstr(%&arrayI(&_I_.) %&arrayJ(&_J_.) %&arrayK(&_K_.))`,
|
||||||
a statement to be called in each iteration
|
a statement to be called in each iteration
|
||||||
of the *inner* loop. The *outer* loop iterator is `_I_`,
|
of the *inner* loop. The *outer* loop iterator is `_I_`,
|
||||||
the *middle* loop iterator is `_J_`, the *inner* loop iterator is `_K_`,
|
the *middle* loop iterator is `_J_`, the *inner* loop iterator is `_K_`,
|
||||||
if you want to use `_I_`, `_J_`, `_K_`, or arrays names
|
if you want to use `_I_`, `_J_`, `_K_`, or arrays names
|
||||||
[e.g. `%myArr(&_I_.)`] *enclose them* in the `%NRSTR()`
|
[e.g. `%myArr(&_I_.)`] *enclose them* in the `%NRSTR()`
|
||||||
macro quoting function.
|
macro quoting function.
|
||||||
|
|
||||||
|
* `between=` - *Optional*, default value `%str( )` (space),
|
||||||
|
a statement to be called in between each
|
||||||
|
iteration of the internal do_over2 loop.
|
||||||
|
If macroquoted (e.g. `%str( + )`) then the `%unquote()`
|
||||||
|
function is automatically applied.
|
||||||
|
|
||||||
* between= - *Optional*, Default value `%str( )` (space),
|
|
||||||
a statement to be called in between each
|
|
||||||
iteration of the internal do_over2 loop.
|
|
||||||
If macroquoted (e.g. `%str( + )`) then the `%unquote()`
|
|
||||||
function is automatically applied.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1008,7 +1022,8 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## >>> `%make_do_over()` macro: <<< <a name="make-do-over-macro"></a> ###########################################
|
|
||||||
|
## >>> `%make_do_over()` macro: <<< <a name="make-do-over-macro"></a> ###########
|
||||||
|
|
||||||
The code of the macro was inspired by
|
The code of the macro was inspired by
|
||||||
*Ted Clay's* and *David Katz's* macro `%do_over()`.
|
*Ted Clay's* and *David Katz's* macro `%do_over()`.
|
||||||
@@ -1018,7 +1033,7 @@ the `%DO_OVER<n>()` macros. It works *only* for *n>3*!
|
|||||||
|
|
||||||
The `%make_do_over()` macro does *not* executes like a pure macro code.
|
The `%make_do_over()` macro does *not* executes like a pure macro code.
|
||||||
|
|
||||||
### SYNTAX: ###################################################################
|
### SYNTAX: #####################################################################
|
||||||
|
|
||||||
The basic syntax is the following, the `<...>` means optional parameters:
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
@@ -1029,14 +1044,15 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
**Arguments description**:
|
**Arguments description**:
|
||||||
|
|
||||||
size - Required, indicates the number of dimensions
|
1. `size` - *Required*, indicates the number of dimensions
|
||||||
(i.e. inner loops) of the `%DO_OVER<n>()` macro.
|
(i.e. inner loops) of the `%DO_OVER<n>()` macro.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### EXAMPLES AND USECASES: ####################################################
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
**EXAMPLE 1.** Code of created "4-loop" %DO_OVER4() macro
|
**EXAMPLE 1.** Code of created "4-loop" `%DO_OVER4()` macro
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
%macro do_over4(
|
%macro do_over4(
|
||||||
@@ -1072,7 +1088,7 @@ size - Required, indicates the number of dimensions
|
|||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
**EXAMPLE 3.** Create a 4-loop `%DO_OVER4()` macro
|
**EXAMPLE 3.** Create a "4-loop" `%DO_OVER4()` macro
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
%make_do_over(4);
|
%make_do_over(4);
|
||||||
@@ -1088,7 +1104,7 @@ size - Required, indicates the number of dimensions
|
|||||||
)*;
|
)*;
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**EXAMPLE 3.** Create a 5-loop `%DO_OVER5()` macro
|
**EXAMPLE 3.** Create a "5-loop" `%DO_OVER5()` macro
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
%make_do_over(5);
|
%make_do_over(5);
|
||||||
@@ -1148,3 +1164,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
---
|
||||||
Binary file not shown.
Reference in New Issue
Block a user