4 Commits

Author SHA1 Message Date
SASPAC - SAS Packages Archive
696bceb913 Merge pull request #22 from SASPAC/dev
The BasePlus package [ver. 1.30.0]
2023-09-19 17:53:50 +02:00
Bart Jablonski
0c1e5c7d3a The BasePlus package [ver. 1.30.0]
The BasePlus package [ver. 1.30.0]

- new macro `%repList()` added
- doc. updated

SHA256 digest: `F*B91771D45C781B6806DBB44A3B491A0784D7698B9F3BBBE1A86EE5594834315F`
2023-09-19 17:44:00 +02:00
SASPAC - SAS Packages Archive
8b4b5e721d Merge pull request #21 from SASPAC/dev
The BasePlus package [ver. 1.29.1]
2023-09-04 16:47:35 +02:00
Bart Jablonski
b37f716731 The BasePlus package [ver. 1.29.0]
The BasePlus package [ver. 1.29.0]

Package regenerated with the latest version of the SAS Packages Framework (20230904).

SHA256 digest for the latest version of `BasePlus`: F*2FE68DD9B3692B9D46EF85B82F63C7E65010BF9E89D670FD1779F4670FA03F31
2023-09-04 16:35:24 +02:00
7 changed files with 11287 additions and 7 deletions

View File

@@ -48,7 +48,7 @@ libname NEW "%workPath()/new";
``` ```
and more. and more.
SHA256 digest for the latest version of `BasePlus`: F*9EEE4F4B99EA725B60141645AB6A50BFEBA32CE54848593F8D832D907D63CAD7 SHA256 digest for the latest version of `BasePlus`: F*B91771D45C781B6806DBB44A3B491A0784D7698B9F3BBBE1A86EE5594834315F
[**Documentation for BasePlus**](./baseplus.md "Documentation for BasePlus") [**Documentation for BasePlus**](./baseplus.md "Documentation for BasePlus")

View File

@@ -52,6 +52,7 @@
* [`%bpPIPE()` macro](#bppipe-macro) * [`%bpPIPE()` macro](#bppipe-macro)
* [`%dirsAndFiles()` macro](#dirsandfiles-macro) * [`%dirsAndFiles()` macro](#dirsandfiles-macro)
* [`%repeatTxt()` macro](#repeattxt-macro) * [`%repeatTxt()` macro](#repeattxt-macro)
* [`%repList()` macro](#replist-macro)
* [`%intsList()` macro](#intslist-macro) * [`%intsList()` macro](#intslist-macro)
* [`%letters()` macro](#letters-macro) * [`%letters()` macro](#letters-macro)
* [`%splitDSIntoBlocks()` macro](#splitdsintoblocks-macro) * [`%splitDSIntoBlocks()` macro](#splitdsintoblocks-macro)
@@ -72,7 +73,7 @@
--- ---
# The BasePlus package [ver. 1.29.0] <a name="baseplus-package"></a> ############################################### # The BasePlus package [ver. 1.30.0] <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.
@@ -309,6 +310,33 @@ run;
run; run;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 22** Repeating texts and lists:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
options mprint;
data work.A;
x=17;
data work.B;
x=42;
data work.C;
x=303;
run;
data work.test5;
set
%repeatTxt(work.A work.B work.C, 5)
;
run;
data Times2_A3B4C5;
set
%repList(work.A work.B work.C, times = 2, each = 3 4 5)
;
run;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- ---
Package contains: Package contains:
@@ -375,9 +403,11 @@ Package contains:
61. macro letters 61. macro letters
62. macro libpath 62. macro libpath
63. macro minclude 63. macro minclude
64. macro translate 64. macro replist
65. macro tranwrd 65. macro translate
66. macro workpath 66. macro tranwrd
67. macro workpath
@@ -385,10 +415,10 @@ Package contains additional content, run: %loadPackageAddCnt(BasePlus) to load
or look for the baseplus_AdditionalContent directory in the Packages fileref or look for the baseplus_AdditionalContent directory in the Packages fileref
localization (only if additional content was deployed during the installation process). localization (only if additional content was deployed during the installation process).
* SAS package generated by generatePackage, version 20230520 * * SAS package generated by generatePackage, version 20230905 *
The SHA256 hash digest for package BasePlus: The SHA256 hash digest for package BasePlus:
`F*9EEE4F4B99EA725B60141645AB6A50BFEBA32CE54848593F8D832D907D63CAD7` `F*B91771D45C781B6806DBB44A3B491A0784D7698B9F3BBBE1A86EE5594834315F`
--- ---
# Content description ############################################################################################ # Content description ############################################################################################
@@ -4399,6 +4429,118 @@ run;
--- ---
## >>> `%repList()` macro: <<< <a name="replist-macro"></a> #######################
The repList() macro function allows to repeat `T`
times elements of a `L` list, possibly `E` times each element,
separated by string `S`.
See examples below for the details.
The `%repList()` macro executes like a pure macro code.
### SYNTAX: ###################################################################
The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~sas
%repList(
list
<,times=>
<,each=>
<,lenghtOut=>
<,sep=>
)
~~~~~~~~~~~~~~~~~~~~~~~
**Arguments description**:
1. `list` - *Required*, a list of elements to be repeated.
List can be space or comma separated.
Elements can be in quotes.
For comma separated list add brackets
e.g., `%repList((A,B,C,D),times=5)`.
The list separators are: `<{[( ,;)]}>`.
* `times=` - *Optional*, An integer indicating
the number of repetitions.
By default set to `1`.
* `each=` - *Optional*, A list of integers indicating
the number of repetitions of each element of the list
e.g., for a list `A B C` and the `each=2 4` the result
is `A A B B B B C C`. If the number of integers is less
then the length of the list values are recycled from
the beginning.
By default set to `1`.
* `lenghtOut=` - *Optional*, An integer indicating
after what the number of repetitions process will stop.
By default set to `0` which means "do not stop".
* `sep=` - *Optional*, it is a separator printed between
repeated elements. Mnemonics for *space* is `s`,
for *comma* is `c`, and for semicolon in `q`.
Default value is a single space.
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Simple repetition of all elements:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %repList((A,B,C,D), times=3);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 2.** Simple repetition of each element:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %repList(("A",'B',"C",'D'), each=3);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 3.** Simple repetition with a separator:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %repList(A10;B20;C30, times=3, each=2, sep=Q);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 4.** Recycle elements up to 8 with a comma as a separator:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %repList(1 2 3, lenghtOut=8, sep=c);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 5.** Separate number of repetitions for each element:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put [%repList([D][C][B][A], each = 2 3 5 7, sep=] [)];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 6.** "ASCII art" butterflies:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put {>%repList(! $ |, times = 2, each =2 1, sep=<} ... {>)<};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 7.** Data repeating:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
data A;
x=17;
data B;
x=42;
data C;
x=303;
run;
data Times2_A10B11C12;
set
%repList(A B C, times = 2, each =10 11 12)
;
run;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
## >>> `%intsList()` macro: <<< <a name="intslist-macro"></a> ####################### ## >>> `%intsList()` macro: <<< <a name="intslist-macro"></a> #######################
The intsList() macro function allows to print a list of The intsList() macro function allows to print a list of

Binary file not shown.

5498
hist/1.29.1/baseplus.md Normal file

File diff suppressed because it is too large Load Diff

BIN
hist/1.29.1/baseplus.zip Normal file

Binary file not shown.

5640
hist/1.30.0/baseplus.md Normal file

File diff suppressed because it is too large Load Diff

BIN
hist/1.30.0/baseplus.zip Normal file

Binary file not shown.