Search notes:

SAS automatic macro variable: syslibrc

&syslibrc stores the return code of the most recent libname statement.
%macro connect_lib(nam, path);

  libname &nam "&path";
  %if &syslibrc ne 0
      %then %put "Could not connect to &path";
      %else %put "Successfully connect &nam to %path";

%mend conect_lib;

%connect_lib(lib_one, %str(p:\ath\to\a\directory));
%connect_lib(lib_two, %str(c:\does\not\exist));

libname lib_one clear;
Github repository about-SAS, path: /macro-processor/variables/automatic/syslibrc.sas

See also

automatic macro variables

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...', 1745844174, '18.116.242.144', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Companies-Products/SAS/programming/macros/variables/automatic/syslibrc(53): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78