From 21827e7ffa19990aabec49a255e5365444a5f3b6 Mon Sep 17 00:00:00 2001 From: yabwon Date: Thu, 30 Jul 2020 19:02:34 +0200 Subject: [PATCH] version 20200730 example added --- packages/README.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/packages/README.md b/packages/README.md index 5773dc0..3234d34 100644 --- a/packages/README.md +++ b/packages/README.md @@ -4,11 +4,43 @@ Currently the following packages are available: - **SQLinDS**\[2.1\], 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. ``` data class; - set %SQL(select * from sashelp.class order by age); + set %SQL( + select age, name, weight, height + from sashelp.class + order by age + ); + + WH = weight + height; run; ``` - **DFA** (Dynamic Function Arrays)\[0.2\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples. +``` +%createDFArray(ArrDynamic, resizefactor=17); + +data _null_; + call ArrDynamic("Allocate", -2, 2); + + do i = -2 to 2; + call ArrDynamic("Input", i, 2**i); + end; + + L = .; H = .; + call ArrDynamic("Dim", L, H); + put L= H=; + + call ArrDynamic("+", 3, 8); + call ArrDynamic("+",-3, 0.125); + call ArrDynamic("Dim", L, H); + put L= H=; + + Value = .; + do i = L to H; + call ArrDynamic("O", i, Value); + put i= Value=; + end; +run; +``` - **macroArray**\[0.3\], implementation of an array concept in a macrolanguage, e.g. ``` @@ -42,4 +74,3 @@ format x bool.; - **dynMacroArray**\[0.2\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA) -### ======