Files
SAS_PACKAGES/packages
yabwon 73e8d10200 macroArray, version 0.5
macroArray, version 0.5
- documentation updated
- the do_overs automatically unquote `betwee=` parameter
2020-09-14 22:29:48 +02:00
..
2020-07-30 14:45:19 +02:00
2020-09-11 13:51:19 +02:00
2020-09-11 13:51:19 +02:00
2020-09-11 13:51:19 +02:00
2020-09-14 22:29:48 +02:00
2020-09-14 22:16:37 +02:00
2020-09-14 22:16:37 +02:00
2020-09-14 17:07:11 +02:00
2020-09-14 17:07:11 +02:00

SAS Packages:

To get started with SAS Packages try this Getting Started with SAS Packages presentation (see the ./SPF/Documentation directory).

Available packages:

Currently the following packages are available:

  • SQLinDS[2.2], 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 age, name, weight, height 
    from sashelp.class 
    order by age
    );
    
    WH = weight + height;
run;

SHA256 digest for SQLinDS: DD5E319EB5AA29C7054EC428072F987E77C29D36874DED1AE5C62E4B300845EB

  • 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;

SHA256 digest for DFA: BB8768E977D62429368CFF2E5338A6553C35C998AEC09AF24088BA713BB54DDA

  • macroArray[0.5], implementation of an array concept in a macrolanguage, e.g.
  %array(ABC[17] (111:127), macarray=Y); 
  
  %macro test();
    %do i = 1 %to 17; 
      %put &i.) %ABC(&i.); 
    %end;
  %mend;
  %test() 
  
  %let %ABC(13,i) = 99999; /* i = insert */

  %do_over(ABC, phrase=%nrstr( 
      %put &_i_.%) %ABC(&_i_.); 
      ),
      which = 1:H:2
  );

SHA256 digest for macroArray: 69F6CF496F921D0E21F3524FC7FD130B4B8290C1E0B9BB3ABEA212B734EBE8A1

  • BasePlus[0.62] adds a bunch of functionalities I am missing in BASE SAS, such as:
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_);

SHA256 digest for BasePlus: 278621A6D8BBBB791DEA4C215D4261F2CB8F8B76B1397F7FA9B2E4219E77CB5A

  • dynMacroArray[0.2], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA) SHA256 digest for dynMacroArray: 066186B94B2976167C797C6A6E6217E361E8DEB10F2AB81906E0A325E5243084