mirror of
https://github.com/yabwon/SAS_PACKAGES.git
synced 2026-06-08 19:30:20 +00:00
The SQLinDS package [ver. 2.4.0]
The SQLinDS package [ver. 2.4.0] You can use Proc SQL to populate hash table. Call to `%SQL()` has to be in double-quotes. - File SHA256: `F*A3DC9400DEF1403DC9E191611790244A8B0FB23303D3A98D29777E46A1D4E8B4` for this version - Content SHA256: `C*4A49F365C4EF8C5523393FDC1E11C344B023F449B3F1759BA27CFC6C1293A499` for this version
This commit is contained in:
+2
-2
@@ -10,7 +10,7 @@ Packages:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- **SQLinDS**\[2.3.3\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g.
|
- **SQLinDS**\[2.4.0\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g.
|
||||||
```sas
|
```sas
|
||||||
data class;
|
data class;
|
||||||
set %SQL(
|
set %SQL(
|
||||||
@@ -22,7 +22,7 @@ data class;
|
|||||||
WH = weight + height;
|
WH = weight + height;
|
||||||
run;
|
run;
|
||||||
```
|
```
|
||||||
SHA256 digest for SQLinDS: F*6CC51325BDCE164B2E811896DD1C3A6D44242F50CC313D0721350CA49975F628
|
SHA256 digest for SQLinDS: F*A3DC9400DEF1403DC9E191611790244A8B0FB23303D3A98D29777E46A1D4E8B4
|
||||||
|
|
||||||
[Documentation for SQLinDS](https://github.com/SASPAC/sqlinds/blob/main/sqlinds.md "Documentation for SQLinDS")
|
[Documentation for SQLinDS](https://github.com/SASPAC/sqlinds/blob/main/sqlinds.md "Documentation for SQLinDS")
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
/* 20260511 */
|
||||||
|
SQLinDS: F*A3DC9400DEF1403DC9E191611790244A8B0FB23303D3A98D29777E46A1D4E8B4
|
||||||
|
|
||||||
/* 20260217 */
|
/* 20260217 */
|
||||||
BasePlus: F*BD248E5F8CBD94B5F45467B723A73D97D646CD665BA98679F87C7A03A484E83E
|
BasePlus: F*BD248E5F8CBD94B5F45467B723A73D97D646CD665BA98679F87C7A03A484E83E
|
||||||
DFA: F*C1E5126D8EDE050A758BCB5DCCA56A37125B3646CE75F1CF41EDE00890901AD9
|
DFA: F*C1E5126D8EDE050A758BCB5DCCA56A37125B3646CE75F1CF41EDE00890901AD9
|
||||||
|
|||||||
+27
-11
@@ -9,17 +9,17 @@
|
|||||||
### Version information:
|
### Version information:
|
||||||
|
|
||||||
- Package: SQLinDS
|
- Package: SQLinDS
|
||||||
- Version: 2.3.3
|
- Version: 2.4.0
|
||||||
- Generated: 2026-02-17T08:25:24
|
- Generated: 2026-05-11T14:15:07
|
||||||
- Author(s): Mike Rhoads (RhoadsM1@Westat.com), contributor Bartosz Jablonski
|
- Author(s): Mike Rhoads (RhoadsM1@Westat.com), contributor Bartosz Jablonski
|
||||||
- Maintainer(s): Bartosz Jablonski (yabwon@gmail.com)
|
- Maintainer(s): Bartosz Jablonski (yabwon@gmail.com)
|
||||||
- License: MIT
|
- License: MIT
|
||||||
- File SHA256: `F*6CC51325BDCE164B2E811896DD1C3A6D44242F50CC313D0721350CA49975F628` for this version
|
- File SHA256: `F*A3DC9400DEF1403DC9E191611790244A8B0FB23303D3A98D29777E46A1D4E8B4` for this version
|
||||||
- Content SHA256: `C*776741E40EB6DCD907640ACA674F092BFAF0F7DE031519B6B453D37F6D6959D9` for this version
|
- Content SHA256: `C*4A49F365C4EF8C5523393FDC1E11C344B023F449B3F1759BA27CFC6C1293A499` for this version
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# The `SQLinDS` package, version: `2.3.3`;
|
# The `SQLinDS` package, version: `2.4.0`;
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -75,9 +75,9 @@ localization (only if additional content was deployed during the installation pr
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
*SAS package generated by SAS Package Framework, version `20260216`,*
|
*SAS package generated by SAS Package Framework, version `20260411`,*
|
||||||
*under `WIN`(`X64_10PRO`) operating system,*
|
*under `WIN`(`X64_10PRO`) operating system,*
|
||||||
*using SAS release: `9.04.01M9P06042025`.*
|
*using SAS release: `9.04.01M9P06052025`.*
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -155,18 +155,18 @@ Copy of the article can also be found in *additional content* directory.
|
|||||||
%sql(<nonempty Proc SQL query code>)
|
%sql(<nonempty Proc SQL query code>)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The THE query code is limited to approximately *32000* bytes.
|
The query code is limited to approximately *32000* bytes.
|
||||||
|
|
||||||
### EXAMPLES: #################################################################
|
### EXAMPLES: #################################################################
|
||||||
|
|
||||||
**EXAMPLE 1**: simple SQL query
|
**EXAMPLE 1**: A simple SQL query.
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
data class_subset;
|
data class_subset;
|
||||||
set %SQL(select name, sex, height from sashelp.class where age > 12);
|
set %SQL(select name, sex, height from sashelp.class where age > 12);
|
||||||
run;
|
run;
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**EXAMPLE 2**: query with dataset options
|
**EXAMPLE 2**: A query with dataset options.
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
data renamed;
|
data renamed;
|
||||||
set %SQL(select name, age from sashelp.class
|
set %SQL(select name, age from sashelp.class
|
||||||
@@ -175,12 +175,28 @@ data renamed;
|
|||||||
run;
|
run;
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**EXAMPLE 3**: Proc SQL dictionaries in the data step
|
**EXAMPLE 3**: Proc SQL dictionaries in the data step.
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
data dictionary;
|
data dictionary;
|
||||||
set %SQL(select dict.* from dictionary.macros as dict);
|
set %SQL(select dict.* from dictionary.macros as dict);
|
||||||
run;
|
run;
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**EXAMPLE 4**: Use Proc SQL to populate hash table.
|
||||||
|
Call to `%SQL()` has to be in double-quotes.
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data _null_;
|
||||||
|
if 0 then set %SQL(SELECT name, age FROM sashelp.class);
|
||||||
|
|
||||||
|
declare hash H (dataset: "%SQL(SELECT name, age FROM sashelp.class)") ;
|
||||||
|
H.defineKey("age");
|
||||||
|
H.defineKey("name");
|
||||||
|
H.defineDone();
|
||||||
|
|
||||||
|
H.output(dataset:"output");
|
||||||
|
stop;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user