18 Commits
1.17 ... 1.19.0

Author SHA1 Message Date
SASPAC - SAS Packages Archive
9e0afd454c Merge pull request #10 from SASPAC/dev
The BasePlus package [ver. 1.19.0]
2023-04-01 22:30:19 +02:00
Bart Jablonski
236d219a9d The BasePlus package [ver. 1.19.0]
The BasePlus package [ver. 1.19.0]

New macro:
The `%dirsAndFiles()` macro allows to extract info about all files and subdirectories of a given `root` directory. The macro is based on Kurt Bremser's "*Talking to Your Host*" article presented at WUSS 2022 conference.
2023-04-01 22:27:56 +02:00
SASPAC - SAS Packages Archive
b40baabfe9 Merge pull request #9 from SASPAC/main
pull request
2022-12-15 22:48:52 +01:00
Bart Jablonski
e930c2eac8 Update README.md 2022-12-15 22:47:11 +01:00
SASPAC - SAS Packages Archive
351fa4f5b1 Merge pull request #8 from SASPAC/dev
The BasePlus package [ver. 1.18.4]
2022-12-15 18:01:40 +01:00
Bartosz Jablonski
df09946ffc The BasePlus package [ver. 1.18.4]
The BasePlus package [ver. 1.18.4]

Package regenerated with the latest version of the SAS Packages Framework.
New macro `%bpPIPE()` added.
2022-12-15 17:56:58 +01:00
SASPAC - SAS Packages Archive
3285ff98cb Merge pull request #7 from SASPAC/dev
The BasePlus package [ver. 1.17.3]
2022-11-27 00:04:55 +01:00
Bartosz Jablonski
a932bd3c74 The BasePlus package [ver. 1.17.3]
The BasePlus package [ver. 1.17.3]

Package regenerated with the latest version of the SAS Packages Framework.
2022-11-27 00:01:11 +01:00
Bart Jablonski
1043d06a99 Merge pull request #6 from SASPAC/dev
BasePlus [1.17.2]
2022-11-21 14:42:57 +01:00
Bartosz Jablonski
76e456c15c BasePlus [1.17.2]
BasePlus [1.17.2]

Package regenerated with the latest version of the SAS Packages Framework.
2022-11-21 14:41:03 +01:00
Bart Jablonski
9be9e8fb4c Merge pull request #5 from SASPAC/main
pull request
2022-11-16 11:40:51 +01:00
Bart Jablonski
8585eac617 Create README.md 2022-11-16 11:36:52 +01:00
Bart Jablonski
0b4581f9c4 Merge pull request #3 from SASPAC/dev
The BasePlus package [ver. 1.17.1]
2022-11-12 17:41:55 +01:00
Bartosz Jablonski
55a27b756d The BasePlus package [ver. 1.17.1]
The BasePlus package [ver. 1.17.1]

Package regenerated with the latest version of the framework (20221112).
2022-11-12 17:38:46 +01:00
Bart Jablonski
0fb4b064e5 Merge pull request #2 from SASPAC/dev
Link to recording from the SAS Explore 2022 conference
2022-11-01 17:46:53 +01:00
Bartosz Jablonski
a56c03ee2e Link to recording from the SAS Explore 2022 conference: "A BasePlus Package for SAS"
Link to recording from the SAS Explore 2022 conference: "A BasePlus Package for SAS"
2022-11-01 17:44:17 +01:00
SASPAC - SAS Packages Archive
fd79234c07 Merge pull request #1 from SASPAC/dev
Update in MD file
2022-09-30 23:24:20 +02:00
Bart Jablonski (yabwon)
2a3a42fd82 Update in MD file
Update in MD file
2022-09-30 23:20:54 +02:00
8 changed files with 289 additions and 56 deletions

35
README.md Normal file
View File

@@ -0,0 +1,35 @@
## `basePlus` - The BASE SAS plus a bunch of functionalities I am missing in BASE SAS :-)
---
The **BasePlus** package adds a bunch of functionalities I am missing in BASE SAS, such as:
```sas
call arrMissToRight(myArray);
call arrFillMiss(17, myArray);
call arrFill(42, myArray);
rc = delDataset("DataSetToDrop");
string = catXFn("date9.", "#", myArray);
format x bool.;
%put %getVars(sashelp.class, pattern = ght$, sep = +, varRange = _numeric_);
%rainCloudPlot(sashelp.cars,DriveTrain,Invoice)
%zipLibrary(sashelp,libOut=work)
%bpPIPE(ls -la ~/)
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result)
```
and more.
SHA256 digest for the latest version of `BasePlus`: F*AD0B78F94A6FD1C394999CBBC8DD16017FB06DFC3FA1F51AC17B43AC8F517432
[**Documentation for BasePlus**](./baseplus.md "Documentation for BasePlus")
To work with a package use the [**SAS Packages Framework**](https://github.com/yabwon/SAS_PACKAGES/blob/main/README.md "SPFinit").

View File

@@ -49,14 +49,14 @@
* [`%LDsNm()` macro](#ldsnm-macro)
* [`%LVarNm()` macro](#lvarnm-macro)
* [`%LVarNmLab()` macro](#lvarnmlab-macro)
* [`%bpPIPE()` macro](#bppipe-macro)
* [`%dirsAndFiles()` macro](#dirsandfiles-macro)
* [License](#license)
---
# The BasePlus package [ver. 1.17] <a name="baseplus-package"></a> ###############################################
# The BasePlus package [ver. 1.19.0] <a name="baseplus-package"></a> ###############################################
The **BasePlus** package implements useful
functions and functionalities I miss in the BASE SAS.
@@ -75,7 +75,10 @@ Kudos to all who inspired me to generate this package:
*Allan Bowe*,
*Anamaria Calai*,
*Michal Ludwicki*,
*Quentin McMullen*.
*Quentin McMullen*,
*Kurt Bremser*.
Recording from the SAS Explore 2022 conference: [A BasePlus Package for SAS](https://communities.sas.com/t5/SAS-Explore-Presentations/A-BasePlus-Package-for-SAS/ta-p/838246 "A BasePlus Package for SAS") (September 27th-29th, 2022).
---
@@ -218,63 +221,79 @@ data MyNextDataset;
run;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**Example 12**: List, to the log, content of `home` directory.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%bpPIPE(ls -la ~/)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 13** Get list of all files and directories from `C:\SAS_WORK\`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
Package contains:
1. macro deduplistc
2. macro deduplistp
3. macro deduplists
4. macro deduplistx
5. macro functionexists
6. macro getvars
7. macro ldsn
8. macro ldsnm
9. macro lvarnm
10. macro lvarnmlab
11. macro qdeduplistx
12. macro qgetvars
13. macro qzipevalf
14. macro raincloudplot
15. macro symdelglobal
16. macro unziplibrary
17. macro zipevalf
18. macro ziplibrary
19. format bool
20. format boolz
21. format ceil
22. format floor
23. format int
24. functions arrfill
25. functions arrfillc
26. functions arrmissfill
27. functions arrmissfillc
28. functions arrmisstoleft
29. functions arrmisstoleftc
30. functions arrmisstoright
31. functions arrmisstorightc
32. functions bracketsc
33. functions bracketsn
34. functions catxfc
35. functions catxfi
36. functions catxfj
37. functions catxfn
38. functions deldataset
39. functions semicolonc
40. functions semicolonn
41. format brackets
42. format semicolon
43. proto qsortincbyprocproto
44. functions frommissingtonumberbs
45. functions fromnumbertomissing
46. functions quicksort4notmiss
47. functions quicksorthash
48. functions quicksorthashsddv
49. functions quicksortlight
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 ldsn
10. macro ldsnm
11. macro lvarnm
12. macro lvarnmlab
13. macro qdeduplistx
14. macro qgetvars
15. macro qzipevalf
16. macro raincloudplot
17. macro symdelglobal
18. macro unziplibrary
19. macro zipevalf
20. macro ziplibrary
21. format bool
22. format boolz
23. format ceil
24. format floor
25. format int
26. functions arrfill
27. functions arrfillc
28. functions arrmissfill
29. functions arrmissfillc
30. functions arrmisstoleft
31. functions arrmisstoleftc
32. functions arrmisstoright
33. functions arrmisstorightc
34. functions bracketsc
35. functions bracketsn
36. functions catxfc
37. functions catxfi
38. functions catxfj
39. functions catxfn
40. functions deldataset
41. functions semicolonc
42. functions semicolonn
43. format brackets
44. format semicolon
45. proto qsortincbyprocproto
46. functions frommissingtonumberbs
47. functions fromnumbertomissing
48. functions quicksort4notmiss
49. functions quicksorthash
50. functions quicksorthashsddv
51. functions quicksortlight
*SAS package generated by generatePackage, version 20220830*
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 20230207 *
The SHA256 hash digest for package BasePlus:
`56B260350FEB7D5118F581B9EFD1B9CE1F0298DCB9A4C000A7654E2FF3F0298C`
`F*AD0B78F94A6FD1C394999CBBC8DD16017FB06DFC3FA1F51AC17B43AC8F517432`
---
# Content description ############################################################################################
@@ -3930,11 +3949,190 @@ The basic syntax is the following, the `<...>` means optional parameters:
)
~~~~~~~~~~~~~~~~~~~~~~~
---
## >>> `%bpPIPE()` macro: <<< <a name="bppipe-macro"></a> #######################
The bpPIPE() [Base Plus PIPE] macro executes OS command
and print to the log output of the execution.
Under the hood it uses `_` filename reference to PIPE device.
### SYNTAX: ###################################################################
The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~sas
%bpPIPE( <OS command goes here> )
~~~~~~~~~~~~~~~~~~~~~~~
**Arguments description**:
* **NO Arguments** - Everything inside brackets is treated as an OS command.
---
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** List, to the log, content of D and C drives:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%bpPIPE(D: & dir & dir "C:\")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 2.** List, to the log, content of `home` directory:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%bpPIPE(ls -halt ~/)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
## >>> `%dirsAndFiles()` macro: <<< <a name="dirsandfiles-macro"></a> #######################
The `%dirsAndFiles()` macro allows to extract info about all files
and subdirectories of a given `root` directory.
The extracted info may be just a list of files and subdirectories or, if
the `details=` parameter is set to 1, additional operating system information
is extracted (information is OSS dependent and gives different results for Linux
and for Windows)
The extracted info can be narrowed down to files (`keepFiles=1`) or to
directories (`keepDirs=1`) if need be.
The extracted info can be presented in wide or long format (`longFormat=1`).
The extracted info for files can be narrowed down to only files with particular
extension, for example: `fileExt=sas7bdat`.
The extracted info can be narrowed down maximal path depth
by setting up the `maxDepth=` parameter.
See examples below for the details.
### REFERENCES: ###################################################################
The macro is based on Kurt Bremser's "*Talking to Your Host*" article
presented at WUSS 2022 conference.
The article is available [here](https://communities.sas.com/t5/SAS-User-Groups-Library/WUSS-Presentation-Talking-to-Your-Host/ta-p/838344)
and also as an additional content of this package.
The paper was awarded the "Best Paper Award - Programming".
### SYNTAX: ###################################################################
The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~sas
%dirsAndFiles(
root
<,ODS=>
<,details=>
<,keepDirs=>
<,keepFiles=>
<,longFormat=>
<,fileExt=>
<,maxDepth=>
)
~~~~~~~~~~~~~~~~~~~~~~~
**Arguments description**:
1. `root` - *Required*, path to be searched
for information.
* `ODS=work.dirsAndFilesInfo` - *Optional*, output data set,
name of a dataset to store information.
* `details=0` - *Optional*, indicates if detailed info
will be collected, `1` = yes, `0` = no.
* `keepDirs=1` - *Optional*, indicates if directories info
will be collected, `1` = yes, `0` = no.
* `keepFiles=1` - *Optional*, indicates if files info
will be collected, `1` = yes, `0` = no.
* `longFormat=0` - *Optional*, indicates if output be
in long format, `1` = yes, `0` = no.
* `fileExt=` - *Optional*, if not missing then indicates
file extension to filter out results.
* `maxDepth=0` - *Optional*, if not zero then indicates
maximum depth of search in the root path.
---
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Get list of files and directories:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 2.** Get detailed info:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result2,details=1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 3.** Get only files info:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result3,keepDirs=0)
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result5,keepDirs=0,details=1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 4.** Get only directories info:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result4,keepFiles=0)
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result6,keepFiles=0,details=1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 5.** Filter out by `sas` extension:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%dirsAndFiles(~/,ODS=work.result7,fileExt=sas)
%dirsAndFiles(~/,ODS=work.result8,fileExt=sas,details=1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 6.** Keep result in the long format:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%dirsAndFiles(~/,ODS=work.result9,details=1,longFormat=1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 7.** Get info for maximum depth of 2:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result10,details=1,maxDepth=2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 8.** How locked/unavailable files are handled:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%dirsAndFiles(%sysfunc(pathname(WORK)),ODS=work.result11,details=1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 9.** Not existing directory:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%dirsAndFiles(%sysfunc(pathname(WORK))/noSuchDir,ODS=work.result12,details=1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
## License ####################################################################
Copyright (c) 2020 Bartosz Jablonski
Copyright (c) since 2020 Bartosz Jablonski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

Binary file not shown.

BIN
hist/1.17.1/baseplus.zip Normal file

Binary file not shown.

BIN
hist/1.17.2/baseplus.zip Normal file

Binary file not shown.

BIN
hist/1.17.3/baseplus.zip Normal file

Binary file not shown.

BIN
hist/1.18.4/baseplus.zip Normal file

Binary file not shown.

BIN
hist/1.19.0/baseplus.zip Normal file

Binary file not shown.