Search notes:

SAS statements: array with _numeric_ and _character_

In the following two examples, two arrays are declared that refer to the numeric and character variables using the special variable lists _numeric_ and _character_.

_character_

data _null_;

   var_foo  =  42;
   var_bar  = 999;
   var_baz  =  17;
   var_chr1 ='foo';
   var_chr2 ='bar';
   var_chr3 ='baz';



/* All non-temporary character variables can be referenced
   with _character_: */
   array ary{*} _character_;

   do i=1 to dim(ary);
      put 'ary ' i ': ' ary[i];
   end;
/* The put statement puts:
       ary 1 : foo
       ary 2 : bar
       ary 3 : baz
*/

run;
Github repository about-SAS, path: /programming/statements/array/_character_.sas

_numeric_

data _null_;

   var_foo  =  42;
   var_bar  = 999;
   var_baz  =  17;
   var_char ='foo bar baz';

/* All non-temporary numeric variables can be referenced
   with _numeric_: */
   array ary{*} _numeric_;

   do i=1 to dim(ary);
      put 'ary ' i ': ' ary[i];
   end;
/* The put statement puts:
     ary 1 : 42
     ary 2 : 999
     ary 3 : 17
*/

run;
Github repository about-SAS, path: /programming/statements/array/_numeric_.sas

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...', 1759422899, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Companies-Products/SAS/programming/statements/array/numeric-character(89): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78