Search notes:

SAS statements: do over

Apparently, the do over statement is not documented anymore.
The do over statement only works with implicitly subsripted arrays.
data _null_;

  txt_1 = 'one';
  txt_2 = 'two';
  txt_3 = 'three';
  txt_4 = 'four';

  length res_1 - res_4 $20;

  array ar_txt txt_1 - txt_4;
  array ar_res res_1 - res_4;

  do over ar_txt;
  /* perform operation on each element on ar_txt
     and assign result to respective element on ar_res; */
     ar_res = cat(ar_txt, ' -> ', upcase(ar_txt));
  end;

  put res_1; /* one -> ONE      */
  put res_2; /* two -> TWO      */
  put res_3; /* three -> THREE  */
  put res_4; /* four -> FOUR    */

run;
Github repository about-SAS, path: /programming/statements/do/over/first.sas

See also

SAS statements

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Companie...', 1759415638, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Companies-Products/SAS/programming/statements/do/over(67): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78