6 Commits

Author SHA1 Message Date
SASPAC - SAS Packages Archive
ce6f6b56ee Merge pull request #23 from SASPAC/dev
The BasePlus package [ver. 1.31.0]
2023-10-12 17:26:03 +02:00
Bart Jablonski
2e1d9df0c3 The BasePlus package [ver. 1.31.0]
The BasePlus package [ver. 1.31.0]

A bunch of "date & time" macro one-liners added:

```sas
%put %today() %date() %time() %datetime();
```

Doc. updated.
2023-10-12 17:20:51 +02:00
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
9 changed files with 17269 additions and 71 deletions

View File

@@ -45,10 +45,12 @@ libname NEW "%workPath()/new";
%put %translate(%str("A", "B", "C"),%str(%",),%str(%' ));
%put %tranwrd(Miss Joan Smith,Miss,Ms.);
%put %date() %time() %datetime();
```
and more.
SHA256 digest for the latest version of `BasePlus`: F*9EEE4F4B99EA725B60141645AB6A50BFEBA32CE54848593F8D832D907D63CAD7
SHA256 digest for the latest version of `BasePlus`: F*7EF23E80A2C03B29402183D97ECFF608B62BEDD9458848709B52DC362E6201B9
[**Documentation for BasePlus**](./baseplus.md "Documentation for BasePlus")

View File

@@ -52,6 +52,7 @@
* [`%bpPIPE()` macro](#bppipe-macro)
* [`%dirsAndFiles()` macro](#dirsandfiles-macro)
* [`%repeatTxt()` macro](#repeattxt-macro)
* [`%repList()` macro](#replist-macro)
* [`%intsList()` macro](#intslist-macro)
* [`%letters()` macro](#letters-macro)
* [`%splitDSIntoBlocks()` macro](#splitdsintoblocks-macro)
@@ -59,6 +60,10 @@
* [`%filePath()` macro](#filepath-macro)
* [`%libPath()` macro](#libpath-macro)
* [`%workPath()` macro](#workpath-macro)
* [`%date()` macro](#date-macro)
* [`%today()` macro](#today-macro)
* [`%time()` macro](#time-macro)
* [`%datetime()` macro](#datetime-macro)
* [`%translate()` macro](#translate-macro)
* [`%tranwrd()` macro](#tranwrd-macro)
* [`%findDSwithVarVal()` macro](#finddswithvarval-macro)
@@ -72,7 +77,7 @@
---
# The BasePlus package [ver. 1.29.0] <a name="baseplus-package"></a> ###############################################
# The BasePlus package [ver. 1.31.0] <a name="baseplus-package"></a> ###############################################
The **BasePlus** package implements useful
functions and functionalities I miss in the BASE SAS.
@@ -309,86 +314,121 @@ 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;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 23** Date and time one-liners:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %today() %date() %time() %datetime();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
Package contains:
1. macro bppipe
2. macro deduplistc
3. macro deduplistp
4. macro deduplists
5. macro deduplistx
6. macro dirsandfiles
7. macro functionexists
8. macro getvars
9. macro intslist
10. macro ldsn
11. macro ldsnm
12. macro lvarnm
13. macro lvarnmlab
14. macro qdeduplistx
15. macro qgetvars
16. macro qzipevalf
17. macro raincloudplot
18. macro repeattxt
19. macro splitdsintoblocks
20. macro splitdsintoparts
21. macro symdelglobal
22. macro unziplibrary
23. macro zipevalf
24. macro ziplibrary
25. format bool
26. format boolz
27. format ceil
28. format floor
29. format int
30. functions arrfill
31. functions arrfillc
32. functions arrmissfill
33. functions arrmissfillc
34. functions arrmisstoleft
35. functions arrmisstoleftc
36. functions arrmisstoright
37. functions arrmisstorightc
38. functions bracketsc
39. functions bracketsn
40. functions catxfc
41. functions catxfi
42. functions catxfj
43. functions catxfn
44. functions deldataset
45. functions semicolonc
46. functions semicolonn
47. format brackets
48. format semicolon
49. proto qsortincbyprocproto
50. functions frommissingtonumberbs
51. functions fromnumbertomissing
52. functions quicksort4notmiss
53. functions quicksorthash
54. functions quicksorthashsddv
55. functions quicksortlight
56. macro filepath
57. macro finddswithvarval
58. macro fmt
59. macro gettitle
60. macro infmt
61. macro letters
62. macro libpath
63. macro minclude
64. macro translate
65. macro tranwrd
66. macro workpath
1. macro bppipe
2. macro deduplistc
3. macro deduplistp
4. macro deduplists
5. macro deduplistx
6. macro dirsandfiles
7. macro functionexists
8. macro getvars
9. macro intslist
10. macro ldsn
11. macro ldsnm
12. macro lvarnm
13. macro lvarnmlab
14. macro qdeduplistx
15. macro qgetvars
16. macro qzipevalf
17. macro raincloudplot
18. macro repeattxt
19. macro splitdsintoblocks
20. macro splitdsintoparts
21. macro symdelglobal
22. macro unziplibrary
23. macro zipevalf
24. macro ziplibrary
25. format bool
26. format boolz
27. format ceil
28. format floor
29. format int
30. function arrfill
31. function arrfillc
32. function arrmissfill
33. function arrmissfillc
34. function arrmisstoleft
35. function arrmisstoleftc
36. function arrmisstoright
37. function arrmisstorightc
38. function bracketsc
39. function bracketsn
40. function catxfc
41. function catxfi
42. function catxfj
43. function catxfn
44. function deldataset
45. function semicolonc
46. function semicolonn
47. format brackets
48. format semicolon
49. proto qsortincbyprocproto
50. function frommissingtonumberbs
51. function fromnumbertomissing
52. function quicksort4notmiss
53. function quicksorthash
54. function quicksorthashsddv
55. function quicksortlight
56. macro date
57. macro datetime
58. macro filepath
59. macro finddswithvarval
60. macro fmt
61. macro gettitle
62. macro infmt
63. macro letters
64. macro libpath
65. macro minclude
66. macro replist
67. macro time
68. macro today
69. macro translate
70. macro tranwrd
71. macro workpath
Package contains additional content, run: %loadPackageAddCnt(BasePlus) to load it
or look for the baseplus_AdditionalContent directory in the Packages fileref
localization (only if additional content was deployed during the installation process).
* SAS package generated by generatePackage, version 20230520 *
* SAS package generated by generatePackage, version 20231009 *
The SHA256 hash digest for package BasePlus:
`F*9EEE4F4B99EA725B60141645AB6A50BFEBA32CE54848593F8D832D907D63CAD7`
`F*7EF23E80A2C03B29402183D97ECFF608B62BEDD9458848709B52DC362E6201B9`
---
# Content description ############################################################################################
@@ -4399,6 +4439,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> #######################
The intsList() macro function allows to print a list of
@@ -4828,6 +4980,134 @@ The basic syntax is the following, the `<...>` means optional parameters:
---
## >>> `%date()` macro: <<< <a name="date-macro"></a> #######################
The date() macro function is a "lazy typer" wrapping up `%sysfunc(date())`.
See examples below for the details.
The `%date()` macro executes like a pure macro code.
### SYNTAX: ###################################################################
The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~sas
%date()
~~~~~~~~~~~~~~~~~~~~~~~
**Arguments description**:
No arguments.
---
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Get value of `date()`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %date();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
## >>> `%today()` macro: <<< <a name="today-macro"></a> #######################
The today() macro function is a "lazy typer" wrapping up `%sysfunc(today())`.
See examples below for the details.
The `%today()` macro executes like a pure macro code.
### SYNTAX: ###################################################################
The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~sas
%today()
~~~~~~~~~~~~~~~~~~~~~~~
**Arguments description**:
No arguments.
---
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Get value of `today()`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %today();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
## >>> `%time()` macro: <<< <a name="time-macro"></a> #######################
The time() macro function is a "lazy typer" wrapping up `%sysfunc(time())`.
See examples below for the details.
The `%time()` macro executes like a pure macro code.
### SYNTAX: ###################################################################
The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~sas
%time()
~~~~~~~~~~~~~~~~~~~~~~~
**Arguments description**:
No arguments.
---
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Get value of `time()`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %time();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
## >>> `%datetime()` macro: <<< <a name="datetime-macro"></a> #######################
The datetime() macro function is a "lazy typer" wrapping up `%sysfunc(datetime())`.
See examples below for the details.
The `%datetime()` macro executes like a pure macro code.
### SYNTAX: ###################################################################
The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~sas
%datetime()
~~~~~~~~~~~~~~~~~~~~~~~
**Arguments description**:
No arguments.
---
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Get value of `datetime()`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %datetime();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
## >>> `%translate()` macro: <<< <a name="translate-macro"></a> #######################
The translate() macro function allows to replace bytes with bytes in text string.

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.

5778
hist/1.31.0/baseplus.md Normal file

File diff suppressed because it is too large Load Diff

BIN
hist/1.31.0/baseplus.zip Normal file

Binary file not shown.