Compare commits

...

4 Commits

Author SHA1 Message Date
Bart Jablonski
79bd3d0c0a Update README.md 2025-08-07 18:49:17 +02:00
Bart Jablonski
f01ac518a6 The BasePlus package [ver. 2.4.0]
The BasePlus package [ver. 2.4.0]

Changes:
- new parameter `backslashSens=` added to the `%dirsAndFiles()` macro.

- File SHA256: `F*19FE220C82DE4B9990B4AC352A9D9DEF5FAF2FD601BE756B2F3A2AC39CDAF381` for this version
- Content SHA256: `C*83DEF0C93481B1C77494531E5CE9F8EB8E4C15AB3CC48D1E9C0223C13A84DB3F` for this version
2025-08-07 18:26:26 +02:00
Bart Jablonski
62b7c64063 The BasePlus package [ver. 2.3.1]
The BasePlus package [ver. 2.3.1]

Changes:
Fix in log notes produced by `%getVars()` and `%QgetVars()`.

- File SHA256: `F*B2D318DD9708D74E5A7C419F7CAE1BF46D662B7F6AEE7E6B1B9D9B6858A5C41A` for this version
- Content SHA256: `C*C34B47FDC4A22C5F5EACA087FA5308B97C367E8B7C32C5B28D37B491C6DAA9A3` for this version
2025-08-05 20:18:11 +02:00
Bart Jablonski
ef3afe837d The BasePlus package [ver. 2.3.0]
# The BasePlus package [ver. 2.3.0]

- File SHA256: `F*71DC1AFA709B2977E8AEA452721776F62EEC8240ABD658AC83AA6D4310FC49B6` for this version
- Content SHA256: `C*9CEDE8C64D2C619EBC27AC85B4904D2CE2423C832C6C313E526946FC1417EFD1` for this version

---

### Changes:

Update in macros:
- `%getVars()` and `%QgetVars()`

    - New *optional* parameter `nlit=`. Introduced to improve `validvarname=ANY` handling. Indicates if the `NLITERAL()` function should be executed to cover spacial characters. Default value is `0`.
    - Code simplification for the `mcArray=` parameter case.
    - Situation when the `%getVars()` macro is called with `mcArray=` in `%put` or `%let` statements is handled more gracefully.

- `%zipEvalf()` and `%QzipEvalf()`

    - If the list contains quoted blanks, they are respected now, i.e. `a "b c"` are considered 2 strings, `a` and `b c`.

See documentation for details.

---
2025-08-04 15:45:33 +02:00
5 changed files with 92 additions and 18 deletions

View File

@@ -221,6 +221,7 @@ The SAS Packages Framework [(short) documentation](https://github.com/yabwon/SAS
This is a list of locations where the SAS Packages Framework is used: This is a list of locations where the SAS Packages Framework is used:
- Warsaw (Poland) - Warsaw (Poland)
- Osaka (Japan) - Osaka (Japan)
- Kyoto (Japan)
If you want to share that you are using the SPF let me know and I'll update the list. If you want to share that you are using the SPF let me know and I'll update the list.

View File

@@ -86,7 +86,7 @@ SHA256 digest for macroArray: F*3F3893F1FCD78719543703E4353F4CC19811D247C016F220
--- ---
- **BasePlus**\[2.1.0\] adds a bunch of functionalities I am missing in BASE SAS, such as: - **BasePlus**\[2.4.0\] adds a bunch of functionalities I am missing in BASE SAS, such as:
```sas ```sas
call arrMissToRight(myArray); call arrMissToRight(myArray);
call arrFillMiss(17, myArray); call arrFillMiss(17, myArray);
@@ -118,7 +118,7 @@ format x bool.;
%put #%expandDataSetsList(lib=sashelp,datasets=_all_)#; %put #%expandDataSetsList(lib=sashelp,datasets=_all_)#;
``` ```
SHA256 digest for BasePlus: F*DFA83F8E0D7424DEB63D49620392068BC68D766552E2804CB6B01DE8E5A87769 SHA256 digest for BasePlus: F*19FE220C82DE4B9990B4AC352A9D9DEF5FAF2FD601BE756B2F3A2AC39CDAF381
[Documentation for BasePlus](https://github.com/SASPAC/blob/main/baseplus.md "Documentation for BasePlus") [Documentation for BasePlus](https://github.com/SASPAC/blob/main/baseplus.md "Documentation for BasePlus")

View File

@@ -1,3 +1,12 @@
/* 20250807 */
BasePlus: F*19FE220C82DE4B9990B4AC352A9D9DEF5FAF2FD601BE756B2F3A2AC39CDAF381
/* 20250805 */
BasePlus: F*B2D318DD9708D74E5A7C419F7CAE1BF46D662B7F6AEE7E6B1B9D9B6858A5C41A
/* 20250804 */
BasePlus: F*71DC1AFA709B2977E8AEA452721776F62EEC8240ABD658AC83AA6D4310FC49B6
/* 20240909 */ /* 20240909 */
BasePlus: F*DFA83F8E0D7424DEB63D49620392068BC68D766552E2804CB6B01DE8E5A87769 BasePlus: F*DFA83F8E0D7424DEB63D49620392068BC68D766552E2804CB6B01DE8E5A87769

View File

@@ -9,22 +9,22 @@
### Version information: ### Version information:
- Package: BasePlus - Package: BasePlus
- Version: 2.1.0 - Version: 2.4.0
- Generated: 2024-09-09T12:55:04 - Generated: 2025-08-07T17:06:16
- Author(s): Bartosz Jablonski (yabwon@gmail.com), Quentin McMullen (qmcmullen@gmail.com) - Author(s): Bartosz Jablonski (yabwon@gmail.com), Quentin McMullen (qmcmullen@gmail.com)
- Maintainer(s): Bartosz Jablonski (yabwon@gmail.com) - Maintainer(s): Bartosz Jablonski (yabwon@gmail.com)
- License: MIT - License: MIT
- File SHA256: `F*DFA83F8E0D7424DEB63D49620392068BC68D766552E2804CB6B01DE8E5A87769` for this version - File SHA256: `F*19FE220C82DE4B9990B4AC352A9D9DEF5FAF2FD601BE756B2F3A2AC39CDAF381` for this version
- Content SHA256: `C*AB16F5B6538515607C3C254E401DC1ACA7293AB36990227F6E7792145CEEAB87` for this version - Content SHA256: `C*83DEF0C93481B1C77494531E5CE9F8EB8E4C15AB3CC48D1E9C0223C13A84DB3F` for this version
--- ---
# The `BasePlus` package, version: `2.1.0`; # The `BasePlus` package, version: `2.4.0`;
--- ---
# The BasePlus package [ver. 2.1.0] <a name="baseplus-package"></a> ############################################### # The BasePlus package [ver. 2.4.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.
@@ -403,7 +403,7 @@ localization (only if additional content was deployed during the installation pr
-------------------------------------------------------------------- --------------------------------------------------------------------
*SAS package generated by SAS Package Framework, version `20240711`* *SAS package generated by SAS Package Framework, version `20250729`*
-------------------------------------------------------------------- --------------------------------------------------------------------
@@ -838,6 +838,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
<,longFormat=> <,longFormat=>
<,fileExt=> <,fileExt=>
<,maxDepth=> <,maxDepth=>
<,backslashSens=>
) )
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
@@ -868,6 +869,11 @@ The basic syntax is the following, the `<...>` means optional parameters:
* `maxDepth=0` - *Optional*, if not zero then indicates * `maxDepth=0` - *Optional*, if not zero then indicates
maximum depth of search in the root path. maximum depth of search in the root path.
* `backslashSens=0` - *Optional*, if not zero then it indicates
that backslash(`\`) symbol in files and dirs
names is detectable under Linux. Accepted
values: `0` and `1`. Ignored under Windows.
### EXAMPLES AND USECASES: #################################################### ### EXAMPLES AND USECASES: ####################################################
@@ -989,7 +995,12 @@ The QgetVars() returns quoted value [by %superq()].
See examples below for the details. See examples below for the details.
The `%getVars()` macro executes like a pure macro code. When `mcArray=` is not used the `%getVars()` macro executes like
a pure macro code. When `mcArray=` is not null (creation of a
macro variable array is requested) them a single semicolon is returned.
When `validvarname=ANY` in set special care should be kept.
See dedicated examples below.
### SYNTAX: ################################################################### ### SYNTAX: ###################################################################
@@ -1003,6 +1014,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
<,quote=> <,quote=>
<,mcArray=> <,mcArray=>
<,ignoreCases> <,ignoreCases>
<,nlit=>
) )
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
@@ -1025,23 +1037,32 @@ The basic syntax is the following, the `<...>` means optional parameters:
* `mcArray=` - *Optional*, default value is blank. * `mcArray=` - *Optional*, default value is blank.
1) When *null* - the macro behaves like a macro function 1) When *null* - the macro behaves like a macro function
and returns a text string with variables list. and ban be used in the `%put` or `%let=` statements.
2) When *not null* - behaviour of the macro is altered. The returned text is a string with variables list.
2) When *not null* - behavior of the macro is altered.
In such case a macro array of selected variables, named In such case a macro array of selected variables, named
with `mcArray` value as a prefix, is created. with `mcArray` value as a prefix, is created.
Furthermore a macro named as `mcArray` value is generated. Furthermore a macro named as `mcArray` value is generated.
(see the macroArray package for the details). (see the macroArray package for the details).
When `mcArray=` parameter is active the `getVars` macro When `mcArray=` parameter is active the `getVars` macro
cannot be called within the `%put` statement. Execution like: should not be called within the `%put` or `%let=` statements.
`%put %getVars(..., mcArray=XXX);` will result with A single semicolon is produced as the macro result, hence
an Explicit & Radical Refuse Of Run (aka ERROR). execution like: `%put %getVars(..., mcArray=XXX) some text;`
will result with an Explicit & Radical Refuse Of Run (aka ERROR).
* `ignoreCases=` - *Optional*, default value is 1. * `ignoreCases=` - *Optional*, default value is 1.
Indicates if search should be case insensitive. Indicates if search should be case insensitive.
* `nlit=` - *Optional*, default value is 0.
Introduced to improve `validvarname=ANY` handling.
Indicates if the `NLITERAL()` function should be
executed to cover spacial characters.
### EXAMPLES AND USECASES: #################################################### ### EXAMPLES AND USECASES: ####################################################
**When `validvarname=` option is _not_ `ANY`.**
**EXAMPLE 1.** A list of all variables from the **EXAMPLE 1.** A list of all variables from the
sashelp.class dataset: sashelp.class dataset:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
@@ -1267,6 +1288,44 @@ run;
%put %do_over(XYZ); %put %do_over(XYZ);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**When the `validvarname=ANY` option is set.**
**EXAMPLE 12.** Get all variables and handle special characters.
Without `nlit=1` the code will fail.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
options validvarname = any;
data varnameANY;
set sashelp.class(obs=3);
'A&B'n=42;
'space name'n=101;
'2025-08'n=234;
'2025%09'n=235;
"2025'10"n=236;
'2025"11'n=237;
run;
%put %getVars(varnameANY, nlit=1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 13.** Create macro variable array ABC for all variables.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%getVars(varnameANY, mcArray=ABC, nlit=1);
%put %ABC(1) %ABC(6) %ABC(7) %ABC(11);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 14.** Get only variables with illegal characters in names.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%let notV7compliant = %getVars(varnameANY, pattern=[^a-z0-9_], nlit=1);
%put &notV7compliant.;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 14.** Print variables starting with a digit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %getVars(varnameANY, pattern=^\d, nlit=1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- ---
@@ -1929,6 +1988,11 @@ The basic syntax is the following, the `<...>` means optional parameters:
* `ignoreCases=` - *Optional*, default value is 1. * `ignoreCases=` - *Optional*, default value is 1.
Indicates if search should be case insensitive. Indicates if search should be case insensitive.
* `nlit=` - *Optional*, default value is 0.
Introduced to improve `validvarname=ANY` handling.
Indicates if the `NLITERAL()` function should be
executed to cover spacial characters.
### EXAMPLES AND USECASES: #################################################### ### EXAMPLES AND USECASES: ####################################################
@@ -6395,7 +6459,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
3. `false` - *Required*, value returned when condition is false. 3. `false` - *Required*, value returned when condition is false.
4 `v=` - *Optional*, v for verbose. If set to `1` extra notes * `v=` - *Optional*, v for verbose. If set to `1` extra notes
are printed. are printed.
--- ---
@@ -7598,7 +7662,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
# License <a name="license"></a> ###### # License <a name="license"></a> ######
Copyright (c) 2020 - 2024 Bartosz Jablonski Copyright (c) 2020 - 2025 Bartosz Jablonski
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

Binary file not shown.