mirror of
https://github.com/SASPAC/baseplus.git
synced 2026-01-03 16:10:05 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5012092072 | ||
|
|
5492c49ad4 | ||
|
|
598fe97c74 | ||
|
|
13a9585ae3 | ||
|
|
827362b8e7 | ||
|
|
0c2be8d0d7 | ||
|
|
4337aeed24 | ||
|
|
29e37b4b79 | ||
|
|
5d914da02d | ||
|
|
a2d9c6ce9f | ||
|
|
4fb506753c | ||
|
|
ff0a008142 | ||
|
|
505f501892 |
22
README.md
22
README.md
@@ -25,10 +25,30 @@ format x bool.;
|
|||||||
%bpPIPE(ls -la ~/)
|
%bpPIPE(ls -la ~/)
|
||||||
|
|
||||||
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result)
|
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result)
|
||||||
|
|
||||||
|
%put %repeatTxt(#,15,s=$) HELLO SAS! %repeatTxt(#,15,s=$);
|
||||||
|
|
||||||
|
%put %intsList(42);
|
||||||
|
%put %letters(1:26:1);
|
||||||
|
|
||||||
|
%splitDSIntoBlocks(5, sashelp.class, classBlock)
|
||||||
|
|
||||||
|
%splitDSIntoParts(7, sashelp.cars, carsPart)
|
||||||
|
|
||||||
|
filename f temp;
|
||||||
|
%put %filePath(f);
|
||||||
|
|
||||||
|
%put %libPath(WORK);
|
||||||
|
|
||||||
|
libname NEW "%workPath()/new";
|
||||||
|
|
||||||
|
%put %translate(%str("A", "B", "C"),%str(%",),%str(%' ));
|
||||||
|
|
||||||
|
%put %tranwrd(Miss Joan Smith,Miss,Ms.);
|
||||||
```
|
```
|
||||||
and more.
|
and more.
|
||||||
|
|
||||||
SHA256 digest for the latest version of `BasePlus`: F*AD0B78F94A6FD1C394999CBBC8DD16017FB06DFC3FA1F51AC17B43AC8F517432
|
SHA256 digest for the latest version of `BasePlus`: F*2A4F3953EC56DB914024457F74286D565C23DCF220FF151040BDB704FD8DDB06
|
||||||
|
|
||||||
[**Documentation for BasePlus**](./baseplus.md "Documentation for BasePlus")
|
[**Documentation for BasePlus**](./baseplus.md "Documentation for BasePlus")
|
||||||
|
|
||||||
|
|||||||
883
baseplus.md
883
baseplus.md
@@ -51,12 +51,23 @@
|
|||||||
* [`%LVarNmLab()` macro](#lvarnmlab-macro)
|
* [`%LVarNmLab()` macro](#lvarnmlab-macro)
|
||||||
* [`%bpPIPE()` macro](#bppipe-macro)
|
* [`%bpPIPE()` macro](#bppipe-macro)
|
||||||
* [`%dirsAndFiles()` macro](#dirsandfiles-macro)
|
* [`%dirsAndFiles()` macro](#dirsandfiles-macro)
|
||||||
|
* [`%repeatTxt()` macro](#repeattxt-macro)
|
||||||
|
* [`%intsList()` macro](#intslist-macro)
|
||||||
|
* [`%letters()` macro](#letters-macro)
|
||||||
|
* [`%splitDSIntoBlocks()` macro](#splitdsintoblocks-macro)
|
||||||
|
* [`%splitDSIntoParts()` macro](#splitdsintoparts-macro)
|
||||||
|
* [`%filePath()` macro](#filepath-macro)
|
||||||
|
* [`%libPath()` macro](#libpath-macro)
|
||||||
|
* [`%workPath()` macro](#workpath-macro)
|
||||||
|
* [`%translate()` macro](#translate-macro)
|
||||||
|
* [`%tranwrd()` macro](#tranwrd-macro)
|
||||||
|
|
||||||
|
|
||||||
* [License](#license)
|
* [License](#license)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# The BasePlus package [ver. 1.19.0] <a name="baseplus-package"></a> ###############################################
|
# The BasePlus package [ver. 1.24.2] <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.
|
||||||
@@ -198,7 +209,6 @@ Recording from the SAS Explore 2022 conference: [A BasePlus Package for SAS](htt
|
|||||||
%rainCloudPlot(sashelp.cars,DriveTrain,Invoice)
|
%rainCloudPlot(sashelp.cars,DriveTrain,Invoice)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
**Example 10**: Zip SAS library.
|
**Example 10**: Zip SAS library.
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
%zipLibrary(sashelp, libOut=work)
|
%zipLibrary(sashelp, libOut=work)
|
||||||
@@ -231,69 +241,105 @@ run;
|
|||||||
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result)
|
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**EXAMPLE 14** Text repetition:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %repeatTxt(#,15,s=$) HELLO SAS! %repeatTxt(#,15,s=$);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**EXAMPLE 15** Integer list:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %intsList(42);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**EXAMPLE 16** Split dataset into blocks of 5 observations:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%splitDSIntoBlocks(5, sashelp.class, classBlock)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**EXAMPLE 17** Split dataset into 7 parts:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%splitDSIntoParts(7, sashelp.cars, carsPart)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**EXAMPLE 18** Return path to temporary file:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
filename f temp;
|
||||||
|
%put %filePath(f);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Package contains:
|
Package contains:
|
||||||
1. macro bppipe
|
1. macro bppipe
|
||||||
2. macro deduplistc
|
2. macro deduplistc
|
||||||
3. macro deduplistp
|
3. macro deduplistp
|
||||||
4. macro deduplists
|
4. macro deduplists
|
||||||
5. macro deduplistx
|
5. macro deduplistx
|
||||||
6. macro dirsandfiles
|
6. macro dirsandfiles
|
||||||
7. macro functionexists
|
7. macro functionexists
|
||||||
8. macro getvars
|
8. macro getvars
|
||||||
9. macro ldsn
|
9. macro intslist
|
||||||
10. macro ldsnm
|
10. macro ldsn
|
||||||
11. macro lvarnm
|
11. macro ldsnm
|
||||||
12. macro lvarnmlab
|
12. macro lvarnm
|
||||||
13. macro qdeduplistx
|
13. macro lvarnmlab
|
||||||
14. macro qgetvars
|
14. macro qdeduplistx
|
||||||
15. macro qzipevalf
|
15. macro qgetvars
|
||||||
16. macro raincloudplot
|
16. macro qzipevalf
|
||||||
17. macro symdelglobal
|
17. macro raincloudplot
|
||||||
18. macro unziplibrary
|
18. macro repeattxt
|
||||||
19. macro zipevalf
|
19. macro splitdsintoblocks
|
||||||
20. macro ziplibrary
|
20. macro splitdsintoparts
|
||||||
21. format bool
|
21. macro symdelglobal
|
||||||
22. format boolz
|
22. macro unziplibrary
|
||||||
23. format ceil
|
23. macro zipevalf
|
||||||
24. format floor
|
24. macro ziplibrary
|
||||||
25. format int
|
25. format bool
|
||||||
26. functions arrfill
|
26. format boolz
|
||||||
27. functions arrfillc
|
27. format ceil
|
||||||
28. functions arrmissfill
|
28. format floor
|
||||||
29. functions arrmissfillc
|
29. format int
|
||||||
30. functions arrmisstoleft
|
30. function arrfill
|
||||||
31. functions arrmisstoleftc
|
31. function arrfillc
|
||||||
32. functions arrmisstoright
|
32. function arrmissfill
|
||||||
33. functions arrmisstorightc
|
33. function arrmissfillc
|
||||||
34. functions bracketsc
|
34. function arrmisstoleft
|
||||||
35. functions bracketsn
|
35. function arrmisstoleftc
|
||||||
36. functions catxfc
|
36. function arrmisstoright
|
||||||
37. functions catxfi
|
37. function arrmisstorightc
|
||||||
38. functions catxfj
|
38. function bracketsc
|
||||||
39. functions catxfn
|
39. function bracketsn
|
||||||
40. functions deldataset
|
40. function catxfc
|
||||||
41. functions semicolonc
|
41. function catxfi
|
||||||
42. functions semicolonn
|
42. function catxfj
|
||||||
43. format brackets
|
43. function catxfn
|
||||||
44. format semicolon
|
44. function deldataset
|
||||||
45. proto qsortincbyprocproto
|
45. function semicolonc
|
||||||
46. functions frommissingtonumberbs
|
46. function semicolonn
|
||||||
47. functions fromnumbertomissing
|
47. format brackets
|
||||||
48. functions quicksort4notmiss
|
48. format semicolon
|
||||||
49. functions quicksorthash
|
49. proto qsortincbyprocproto
|
||||||
50. functions quicksorthashsddv
|
50. function frommissingtonumberbs
|
||||||
51. functions quicksortlight
|
51. function fromnumbertomissing
|
||||||
|
52. function quicksort4notmiss
|
||||||
|
53. function quicksorthash
|
||||||
|
54. function quicksorthashsddv
|
||||||
|
55. function quicksortlight
|
||||||
|
56. macro filepath
|
||||||
|
57. macro letters
|
||||||
|
58. macro libpath
|
||||||
|
59. macro translate
|
||||||
|
60. macro tranwrd
|
||||||
|
61. macro workpath
|
||||||
|
|
||||||
Package contains additional content, run: %loadPackageAddCnt(BasePlus) to load it
|
Package contains additional content, run: %loadPackageAddCnt(BasePlus) to load it
|
||||||
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 20230207 *
|
* SAS package generated by generatePackage, version 20230520 *
|
||||||
|
|
||||||
The SHA256 hash digest for package BasePlus:
|
The SHA256 hash digest for package BasePlus:
|
||||||
`F*AD0B78F94A6FD1C394999CBBC8DD16017FB06DFC3FA1F51AC17B43AC8F517432`
|
`F*2A4F3953EC56DB914024457F74286D565C23DCF220FF151040BDB704FD8DDB06`
|
||||||
|
|
||||||
---
|
---
|
||||||
# Content description ############################################################################################
|
# Content description ############################################################################################
|
||||||
@@ -3066,13 +3112,17 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
<,xLabels=>
|
<,xLabels=>
|
||||||
<,catLabelPos=>
|
<,catLabelPos=>
|
||||||
<,xLabelPos=>
|
<,xLabelPos=>
|
||||||
|
<,catLabelAttrs=>
|
||||||
|
<,xLabelAttrs=>
|
||||||
<,formated=>
|
<,formated=>
|
||||||
<,y2axis=>
|
<,y2axis=>
|
||||||
<,y2axisLevels=>
|
<,y2axisLevels=>
|
||||||
<,y2axisValueAttrs=>
|
<,y2axisValueAttrs=>
|
||||||
<,xaxisValueAttrs=>
|
<,xaxisValueAttrs=>
|
||||||
<,xaxisTickstyle=>
|
<,xaxisTickstyle=>
|
||||||
|
<,sganno=>
|
||||||
|
<,odsGraphicsOptions=>
|
||||||
|
<,sgPlotOptions=>
|
||||||
|
|
||||||
<,VSCALE=>
|
<,VSCALE=>
|
||||||
<,KERNEL_K=>
|
<,KERNEL_K=>
|
||||||
@@ -3114,7 +3164,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
granularity level, e.g. for data with value
|
granularity level, e.g. for data with value
|
||||||
around `1e-8` should be decreased.
|
around `1e-8` should be decreased.
|
||||||
|
|
||||||
* `rainDropSiz` - *Optional*, default value `5px`.
|
* `rainDropSize` - *Optional*, default value `5px`.
|
||||||
Size of data points in the "rain" plot.
|
Size of data points in the "rain" plot.
|
||||||
|
|
||||||
* `boxPlotSymbolSize` - *Optional*, default value `8px`.
|
* `boxPlotSymbolSize` - *Optional*, default value `8px`.
|
||||||
@@ -3157,11 +3207,19 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
Indicates position of the label on data axix (horizontal).
|
Indicates position of the label on data axix (horizontal).
|
||||||
Allowed values are `LEFT`, `CENTER`, `DATACENTER`, and `RIGHT`.
|
Allowed values are `LEFT`, `CENTER`, `DATACENTER`, and `RIGHT`.
|
||||||
|
|
||||||
|
* `catLabelAttrs` - *Optional*, default value is empty.
|
||||||
|
List of attributes for group axix labels (vertical).
|
||||||
|
For details see notes below.
|
||||||
|
|
||||||
|
* `xLabelAttrs` - *Optional*, default value is empty.
|
||||||
|
List of attributes for data variable axix labels (horizontal).
|
||||||
|
For details see notes below.
|
||||||
|
|
||||||
* `formated` - *Optional*, default value `0`.
|
* `formated` - *Optional*, default value `0`.
|
||||||
Indicates if values of the grouping variable should be formated.
|
Indicates if values of the grouping variable should be formated.
|
||||||
|
|
||||||
* `y2axis` - *Optional*, default value `1`.
|
* `y2axis` - *Optional*, default value `1`.
|
||||||
Indicates if the righ vertical axix should be displayed.
|
Indicates if the right vertical axix should be displayed.
|
||||||
|
|
||||||
* `y2axisLevels` - *Optional*, default value `4`.
|
* `y2axisLevels` - *Optional*, default value `4`.
|
||||||
Indicates if the number of expected levels of values printed
|
Indicates if the number of expected levels of values printed
|
||||||
@@ -3178,6 +3236,19 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
Allowed values are `OUTSIDE`, `INSIDE`, `ACROSS`, and `INBETWEEN`.
|
Allowed values are `OUTSIDE`, `INSIDE`, `ACROSS`, and `INBETWEEN`.
|
||||||
*For SAS previous to* **9.4M5** *set to missing!*
|
*For SAS previous to* **9.4M5** *set to missing!*
|
||||||
|
|
||||||
|
* `sganno` - *Optional*, default value is empty.
|
||||||
|
keeps name of a data set for the `sganno=` option
|
||||||
|
of the SGPLOT procedure.
|
||||||
|
|
||||||
|
* `sgPlotOptions` - *Optional*, default value is `noautolegend noborder`.
|
||||||
|
List of additional options values for SGPLOT procedure.
|
||||||
|
|
||||||
|
* `odsGraphicsOptions` - *Optional*, default value is empty.
|
||||||
|
List of additional options values for `ODS Graphics` statement.
|
||||||
|
By default only the: `width=`, `height=`, and `antialiasmax=`
|
||||||
|
are modified.
|
||||||
|
|
||||||
|
|
||||||
***Stat related options***:
|
***Stat related options***:
|
||||||
|
|
||||||
* `VSCALE` - *Optional*, default value `Proportion`.
|
* `VSCALE` - *Optional*, default value `Proportion`.
|
||||||
@@ -3218,6 +3289,9 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
* The `catLabels` and `xLabels` should be quoted comma separated lists enclosed with brackets,
|
* The `catLabels` and `xLabels` should be quoted comma separated lists enclosed with brackets,
|
||||||
e.g. `catLabels=("Continent of Origin", "Car Type")`, see Example below.
|
e.g. `catLabels=("Continent of Origin", "Car Type")`, see Example below.
|
||||||
|
|
||||||
|
* The `catLabelAttrs` and `xLabelAttrs` should be space separated lists of `key=value` pairs,
|
||||||
|
e.g. `xLabelAttrs=size=12 color=Pink weight=bold`, see Example below.
|
||||||
|
|
||||||
* Kernel density estimates and basic statistics are calculated with `PROC UNIVARIATE`.
|
* Kernel density estimates and basic statistics are calculated with `PROC UNIVARIATE`.
|
||||||
|
|
||||||
* Plot is generated by `PROC SGPLOT` with `BAND`, `SCATTE`, and `POLYGON` plots.
|
* Plot is generated by `PROC SGPLOT` with `BAND`, `SCATTE`, and `POLYGON` plots.
|
||||||
@@ -3299,6 +3373,7 @@ The output:
|
|||||||
, y2axisLevels=3
|
, y2axisLevels=3
|
||||||
, catLabels=("Continent of Origin", "Car Type")
|
, catLabels=("Continent of Origin", "Car Type")
|
||||||
, xLabels="Invoice, [$]"
|
, xLabels="Invoice, [$]"
|
||||||
|
, xLabelAttrs=size=12 color=Pink weight=bold
|
||||||
)
|
)
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@@ -3308,6 +3383,60 @@ The output:
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 3.** Rain Cloud plot with formatted groups
|
||||||
|
and annotations.
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
|
||||||
|
data annotation;
|
||||||
|
function="text";
|
||||||
|
label="This graph is full(*ESC*){sup '2'} of annotations!";
|
||||||
|
drawspace="graphpercent";
|
||||||
|
rotate=30;
|
||||||
|
anchor="center";
|
||||||
|
textsize=32;
|
||||||
|
x1=50;
|
||||||
|
y1=50;
|
||||||
|
textcolor="red";
|
||||||
|
justify="center";
|
||||||
|
textweight="bold";
|
||||||
|
width=100;
|
||||||
|
widthunit="percent";
|
||||||
|
run;
|
||||||
|
|
||||||
|
proc format;
|
||||||
|
value system
|
||||||
|
1="Windows"
|
||||||
|
2="MacOS"
|
||||||
|
3="Linux"
|
||||||
|
;
|
||||||
|
run;
|
||||||
|
|
||||||
|
data test;
|
||||||
|
do system = 1 to 3;
|
||||||
|
do i = 1 to 50;
|
||||||
|
x = rannor(123)/system;
|
||||||
|
output;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
format system system.;
|
||||||
|
run;
|
||||||
|
|
||||||
|
|
||||||
|
%RainCloudPlot(test, system, x
|
||||||
|
, colorslist=CX88CCEE CX44AA99 CX117733
|
||||||
|
, formated=1
|
||||||
|
, sganno=annotation
|
||||||
|
, sgPlotOptions=noborder
|
||||||
|
, WidthPX=1000
|
||||||
|
, HeightPX=320
|
||||||
|
)
|
||||||
|
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
The output:
|
||||||
|

|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## >>> `%zipLibrary()` macro: <<< <a name="ziplibrary-macro"></a> #######################
|
## >>> `%zipLibrary()` macro: <<< <a name="ziplibrary-macro"></a> #######################
|
||||||
@@ -4123,10 +4252,648 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
%dirsAndFiles(%sysfunc(pathname(WORK))/noSuchDir,ODS=work.result12,details=1)
|
%dirsAndFiles(%sysfunc(pathname(WORK))/noSuchDir,ODS=work.result12,details=1)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## >>> `%repeatTxt()` macro: <<< <a name="repeattxt-macro"></a> #######################
|
||||||
|
|
||||||
|
The repeatTxt() macro function allows to repeat `n`
|
||||||
|
times a `text` string separated by string `s=`.
|
||||||
|
|
||||||
|
The repeatTxt() returns unquoted value [by %unquote()].
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
The `%repeatTxt()` macro executes like a pure macro code.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%repeatTxt(
|
||||||
|
text
|
||||||
|
<,n>
|
||||||
|
<,s=>
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
1. `text` - *Required*, a text to be repeated.
|
||||||
|
|
||||||
|
2. `n` - *Required/Optional*, the number of repetitions.
|
||||||
|
If missing then set to `1`;
|
||||||
|
|
||||||
|
* `s = %str( )` - *Optional*, it is a separator between
|
||||||
|
repeated elements. Default value is space.
|
||||||
|
---
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Simple repetition of dataset name:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
options mprint;
|
||||||
|
data work.test5;
|
||||||
|
set
|
||||||
|
%repeatTxt(sashelp.cars, 5)
|
||||||
|
;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 2.** Simple repetition of data step:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
options mprint;
|
||||||
|
%repeatTxt(data _null_; set sashelp.cars; run;, 3)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 3.** "Nice" output:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %repeatTxt(#,15,s=$) HELLO SAS! %repeatTxt(#,15,s=$);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 4.** Macroquote a text with commas:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%repeatTxt(
|
||||||
|
%str(proc sql; create table wh as select weight,height from sashelp.class; quit;)
|
||||||
|
,3
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**EXAMPLE 5.** Empty `n` repeats `text` one time:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
options mprint;
|
||||||
|
data work.test1;
|
||||||
|
set
|
||||||
|
%repeatTxt(sashelp.cars)
|
||||||
|
;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**EXAMPLE 6.** Dynamic "formatting":
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%macro printWork();
|
||||||
|
%let work=%sysfunc(pathname(work));
|
||||||
|
%put +%repeatTxt(~,%length(&work.)+5,s=)+;
|
||||||
|
%put {&=work.};
|
||||||
|
%put +%repeatTxt(~,%length(&work.)+5,s=)+;
|
||||||
|
%mend printWork;
|
||||||
|
|
||||||
|
%printWork()
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## >>> `%intsList()` macro: <<< <a name="intslist-macro"></a> #######################
|
||||||
|
|
||||||
|
The intsList() macro function allows to print a list of
|
||||||
|
integers starting from `start` up to `end` incremented by `by`
|
||||||
|
and separated by `sep=`.
|
||||||
|
|
||||||
|
If `start`, `end` or `by` are non-integers the are converted to integers.
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
The `%intsList()` macro executes like a pure macro code.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%intsList(
|
||||||
|
start
|
||||||
|
<,end>
|
||||||
|
<,by>
|
||||||
|
<,sep=>
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
1. `start` - *Required*, the first value of the list.
|
||||||
|
If `end` is missing then the list is generated
|
||||||
|
from 1 to `start` by 1.
|
||||||
|
|
||||||
|
2. `end` - *Required/Optional*, the last value of the list.
|
||||||
|
|
||||||
|
3. `by` - *Required/Optional*, the increment of the list.
|
||||||
|
If missing then set to `1`.
|
||||||
|
*Cannot* be equal to `0`.
|
||||||
|
|
||||||
|
* `s = %str( )` - *Optional*, it is a separator between
|
||||||
|
elements of the list. Default value is space.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Simple list of integers from 1 to 10 by 1:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %intsList(10);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 2.** Ten copies of `sashelp.class` in `test11` to `test20`:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data
|
||||||
|
%zipEvalf(test, %intsList(11,20))
|
||||||
|
;
|
||||||
|
set sashelp.class;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 3.** Non-integers are converted to integers, the list is `1 3 5`:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %intsList(1.1,5.2,2.3);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 4.** A list with a separator:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %intsList(1,5,2,sep=+);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## >>> `%letters()` macro: <<< <a name="letters-macro"></a> #######################
|
||||||
|
|
||||||
|
The letters() macro function allows to print a list of Roman
|
||||||
|
letters starting from `start` up to `end` incremented by `by`.
|
||||||
|
The letters list can be uppercases or lowercase (parameter `c=U` or `c=L`),
|
||||||
|
can be quoted (e.g. `q=""` or `q=[]`), and can be separated by `s=`.
|
||||||
|
|
||||||
|
Values of `start`, `end`, and `by` have to be integers in range between 1 ad 26.
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
The `%letters()` macro executes like a pure macro code.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%letters(
|
||||||
|
range
|
||||||
|
<,c=>
|
||||||
|
<,q=>
|
||||||
|
<,s=>
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
1. `range` - *Required*, letters selector in form `start:end:by`.
|
||||||
|
Lists letters from `start` to `end` by `by`.
|
||||||
|
Values of `start`, `end`, and `by` are separated by
|
||||||
|
colon and must be between 1 ad 26.
|
||||||
|
If value is outside range it is set to
|
||||||
|
`start=1`, `en=26`, and `by=1`. If `end` is missing
|
||||||
|
then is set to value of `start`.
|
||||||
|
If `end` is smaller than `start` list is reversed
|
||||||
|
|
||||||
|
* `c = U` - *Optional*, it is a lowercase letters indicator.
|
||||||
|
Select `L` or `l`. Default value is `U` for upcase.
|
||||||
|
|
||||||
|
* `q = ` - *Optional*, it is a quite around elements of the list.
|
||||||
|
Default value is empty. Use `%str()` for one quote symbol.
|
||||||
|
If there are multiple symbols, only the first and the
|
||||||
|
second are selected as a preceding and trailing one,
|
||||||
|
e.g. `q=[]` gives `[A] [B] ... [Z]`.
|
||||||
|
|
||||||
|
* `s = %str( )` - *Optional*, it is a separator between
|
||||||
|
elements of the list. Default value is space.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Space separated list of capital letters from A to Z:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %letters(1:26:1);
|
||||||
|
|
||||||
|
%put %letters();
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 2.** First, thirteenth, and last letter:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %letters(1) %letters(13) %letters(26);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 3.** Every third lowercase letter, i.e. `a d g j m p s v y`:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %letters(1:26:3,c=L);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 4.** Lists with separators:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %letters(1:26:2,s=#);
|
||||||
|
%put %letters(1:26:3,s=%str(;));
|
||||||
|
%put %letters(1:26:4,s=%str(,));
|
||||||
|
%put %letters(1:26,s=);
|
||||||
|
%put %letters(1:26,s==);
|
||||||
|
%put %letters(1:26,s=/);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 5.** Every second letter with quotes:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %letters(1:26:2,q=%str(%'));
|
||||||
|
%put %letters(2:26:2,q=%str(%"));
|
||||||
|
|
||||||
|
%put %letters(1:26:2,q='');
|
||||||
|
%put %letters(2:26:2,q="");
|
||||||
|
|
||||||
|
%put %letters(1:26:2,q=<>);
|
||||||
|
%put %letters(2:26:2,q=\/);
|
||||||
|
|
||||||
|
%put %letters(1:26:2,q=());
|
||||||
|
%put %letters(2:26:2,q=][);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 6.** Mix of examples 4, 5, and 6:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %letters(1:26,c=L,q='',s=%str(, ));
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 7.** If `end` is smaller than `start` list is reversed:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %letters(26:1:2,q='');
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## >>> `%splitDSIntoBlocks()` macro: <<< <a name="splitdsintoblocks-macro"></a> #######################
|
||||||
|
|
||||||
|
The splitDSIntoBlocks() macro allows to split the `set` dataset into blocks
|
||||||
|
of size `blockSize` in datasets: `prefix1` to `prefixN`.
|
||||||
|
|
||||||
|
The last dataset may have less observations then the `blockSize`.
|
||||||
|
|
||||||
|
Macro covers `BASE` engine (`v9`, `v8`, `v7`, `v6`) and `SPDE` engine datasets.
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%splitDSIntoBlocks(
|
||||||
|
blockSize
|
||||||
|
<,set>
|
||||||
|
<,prefix>
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
1. `blockSize` - *Required*, the size of the block of data,
|
||||||
|
in other words number of observations in
|
||||||
|
one block of split data.
|
||||||
|
Block size must be positive integer.
|
||||||
|
|
||||||
|
2. `set` - *Required/Optional*, the name of the dataset to split.
|
||||||
|
If empty then `&syslast.` is used.
|
||||||
|
|
||||||
|
3. `prefix` - *Required/Optional*, the name-prefix for new datasets.
|
||||||
|
If missing then set to `part`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Split `sashelp.class` into 5 elements datasets ABC1 to ABC4:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%splitDSIntoBlocks(5,sashelp.class,ABC)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 2.** By default splits the `_last_` dataset into `part1` to `partN` datasets:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data lastData;
|
||||||
|
set sashelp.cars;
|
||||||
|
run;
|
||||||
|
|
||||||
|
%splitDSIntoBlocks(123)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 3.** Works with `SPDE` engine too:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
options dlcreatedir;
|
||||||
|
libname test "%sysfunc(pathname(work))/testSPDE";
|
||||||
|
libname test;
|
||||||
|
libname test SPDE "%sysfunc(pathname(work))/testSPDE";
|
||||||
|
|
||||||
|
data test.test;
|
||||||
|
set sashelp.cars;
|
||||||
|
run;
|
||||||
|
|
||||||
|
%splitDSIntoBlocks(100,test.test,work.spde)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## >>> `%splitDSIntoParts()` macro: <<< <a name="splitdsintoparts-macro"></a> #######################
|
||||||
|
|
||||||
|
The splitDSIntoParts() macro allows to split the `set` dataset into `parts` parts
|
||||||
|
of approximately `NOBS/parts` size in datasets: `prefix1` to `prefixN`.
|
||||||
|
|
||||||
|
The splitDSIntoParts() macro internally runs the splitDSIntoBlocks() macro.
|
||||||
|
|
||||||
|
Macro covers `BASE` engine (`v9`, `v8`, `v7`, `v6`) and `SPDE` engine datasets.
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%splitDSIntoParts(
|
||||||
|
parts
|
||||||
|
<,set>
|
||||||
|
<,prefix>
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
1. `parts` - *Required*, the number of parts to split data into.
|
||||||
|
Number of parts must be positive integer.
|
||||||
|
|
||||||
|
2. `set` - *Required/Optional*, the name of the dataset to split.
|
||||||
|
If empty then `&syslast.` is used.
|
||||||
|
|
||||||
|
3. `prefix` - *Required/Optional*, the name-prefix for new datasets.
|
||||||
|
If missing then set to `part`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Split `sashelp.cars` into 7 parts: datasets carsInParts1 to carsInParts7:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%splitDSIntoParts(7,sashelp.cars, carsInParts)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 2.** By default splits the `_last_` dataset into `part1` to `part3` datasets:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data lastData;
|
||||||
|
set sashelp.cars;
|
||||||
|
run;
|
||||||
|
|
||||||
|
%splitDSIntoBlocks(3)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 3.** Works with `SPDE` engine too:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
options dlcreatedir;
|
||||||
|
libname test "%sysfunc(pathname(work))/testSPDE";
|
||||||
|
libname test;
|
||||||
|
libname test SPDE "%sysfunc(pathname(work))/testSPDE";
|
||||||
|
|
||||||
|
data test.test;
|
||||||
|
set sashelp.cars;
|
||||||
|
run;
|
||||||
|
|
||||||
|
%splitDSIntoParts(3,test.test,work.spde)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## >>> `%filePath()` macro: <<< <a name="filepath-macro"></a> #######################
|
||||||
|
|
||||||
|
The filePath() macro function returns path to a file,
|
||||||
|
it is a wrapper to `pathname()` function for files.
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
The `%filePath()` macro executes like a pure macro code.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%filePath(
|
||||||
|
fileref
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
1. `fileref` - *Required*, a fileref from the `filename` statement.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Return path to temporary file:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
filename f temp;
|
||||||
|
%put %filePath(f);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## >>> `%libPath()` macro: <<< <a name="libpath-macro"></a> #######################
|
||||||
|
|
||||||
|
The libPath() macro function returns path to a library,
|
||||||
|
it is a wrapper to `pathname()` function for libraries.
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
The `%libPath()` macro executes like a pure macro code.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%libPath(
|
||||||
|
libref
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
1. `libref` - *Required*, a libref from the `libname` statement.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Return path to `WORK` library:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %libPath(WORK);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 2.** Return path to `SASHELP` library:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %libPath(SASHELP);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## >>> `%workPath()` macro: <<< <a name="workpath-macro"></a> #######################
|
||||||
|
|
||||||
|
The workPath() macro function returns path to the `WORK` library,
|
||||||
|
it is a wrapper to `pathname("work", "L")` function.
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
The `%workPath()` macro executes like a pure macro code.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%workPath()
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
*) No arguments.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Create new library inside `WORK` library:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
options dlCreateDir;
|
||||||
|
libname NEW "%workPath()/new";
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## >>> `%translate()` macro: <<< <a name="translate-macro"></a> #######################
|
||||||
|
|
||||||
|
The translate() macro function allows to replace bytes with bytes in text string.
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
The `%translate()` macro executes like a pure macro code.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%translate(
|
||||||
|
string
|
||||||
|
,from
|
||||||
|
,to
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
1. `string` - *Required*, string to modify.
|
||||||
|
|
||||||
|
2. `from` - *Required*, list of bytes to be replaced with
|
||||||
|
corresponding bytes from `to`.
|
||||||
|
|
||||||
|
3. `to` - *Required*, list of bytes replacing
|
||||||
|
corresponding bytes from `from`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Replace quotes and commas with apostrophes and spaces:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %translate(%str("A", "B", "C"),%str(%",),%str(%' ));
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 2.** Unify all brackets;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %translate(%str([A] {B} (C) <D>),{[(<>)]},(((()))));
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 3.** Replace all digits with `*`:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %translate(QAZ1WSSX2EDC3RFV4TGB5YHN6UJM7IK8OL9P0,1234567890,**********);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 4.** Letters change:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %translate(%str(A=B),AB,BA);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## >>> `%tranwrd()` macro: <<< <a name="tranwrd-macro"></a> #######################
|
||||||
|
|
||||||
|
The tranwrd() macro function allows to replace substrings
|
||||||
|
with other substrings in text string.
|
||||||
|
|
||||||
|
Returned string is unquoted by `%unquote()`.
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
The `%tranwrd()` macro executes like a pure macro code.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%tranwrd(
|
||||||
|
string
|
||||||
|
,from
|
||||||
|
,to
|
||||||
|
<,repeat>
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
1. `string` - *Required*, string to modify.
|
||||||
|
|
||||||
|
2. `from` - *Required*, substring replaced with
|
||||||
|
corresponding string from `to`.
|
||||||
|
|
||||||
|
3. `to` - *Required*, substring replacing
|
||||||
|
corresponding substring from `from`.
|
||||||
|
|
||||||
|
4. `repeat` - *Optional*, number of times the replacing
|
||||||
|
should be repeated, default is 1.
|
||||||
|
Useful while removing multiple adjacent
|
||||||
|
characters, e.g. compress all multiple
|
||||||
|
spaces (see example 2).
|
||||||
|
---
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Simple text replacement:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %tranwrd(Miss Joan Smith,Miss,Ms.);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 2.** Delete multiple spaces;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %tranwrd(%str(A B C),%str( ),%str( ),5);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 3.** Remove substring:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %tranwrd(ABCxyzABCABCxyzABC,ABC);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
BIN
baseplus.zip
BIN
baseplus.zip
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 47 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 62 KiB |
BIN
baseplus_RainCloudPlot_Ex3.png
Normal file
BIN
baseplus_RainCloudPlot_Ex3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
BIN
hist/1.19.1/baseplus.zip
Normal file
BIN
hist/1.19.1/baseplus.zip
Normal file
Binary file not shown.
BIN
hist/1.20.0/baseplus.zip
Normal file
BIN
hist/1.20.0/baseplus.zip
Normal file
Binary file not shown.
BIN
hist/1.23.0/baseplus.zip
Normal file
BIN
hist/1.23.0/baseplus.zip
Normal file
Binary file not shown.
BIN
hist/1.24.0/baseplus.zip
Normal file
BIN
hist/1.24.0/baseplus.zip
Normal file
Binary file not shown.
4904
hist/1.24.1/baseplus.md
Normal file
4904
hist/1.24.1/baseplus.md
Normal file
File diff suppressed because it is too large
Load Diff
BIN
hist/1.24.1/baseplus.zip
Normal file
BIN
hist/1.24.1/baseplus.zip
Normal file
Binary file not shown.
4922
hist/1.24.2/baseplus.md
Normal file
4922
hist/1.24.2/baseplus.md
Normal file
File diff suppressed because it is too large
Load Diff
BIN
hist/1.24.2/baseplus.zip
Normal file
BIN
hist/1.24.2/baseplus.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user