Search notes:

SAS programming, function vname

vname(var) returns the name of the variable var. This seems especially useful for arrays:
data _null_;
  
  foo = 'one';
  bar = 'two';
  baz = 'three';
  
  array ary(3) foo bar baz;
  
  vnam_1 = vname(ary(1));
  vnam_2 = vname(ary(2));
  vnam_3 = vname(ary(3));
  
  vnam_foo = vname(foo);
  
  put 'ary(1)is in fact: ' vnam_1; /* ary(1)is in fact: foo */
  put 'ary(2)is in fact: ' vnam_2; /* ary(2)is in fact: bar */
  put 'ary(3)is in fact: ' vnam_3; /* ary(3)is in fact: baz */
 
  put 'foo is, of course: ' vnam_foo; /* foo is, of course: foo */

run;
Github repository about-SAS, path: /programming/functions/vname.sas

See also

Compare with varname which returns the name of a variable in a data set.
functions

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