Search notes:

SAS programming, function rename

Renaming a file

In order to move (mv) a file in a file system, the rename function must be passed file as third argument:
%let dir_top = p:\ath\to\a\directory;
%let dir_a = &dir_top\dir_a;
%let dir_b = &dir_top\dir_b;

data _null_;

  file "&dir_a\file.txt";

  put "foo" "bar" "baz";
  put "one" "two" "three";
  put "x" "y" "z";

run;


%let rc = %sysfunc(rename(&dir_a\file.txt, &dir_b\renamed-and-moved.txt, file));
%put rc = &rc; /* rc = 0 */
Github repository about-SAS, path: /programming/functions/rename/file.sas

See also

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