Search notes:

SAS: proc printto

proc printto can be used to redirect log output and procedure output to files etc.
%let printto_path=p:\ath\to\some\directory;

options pagesize=max;
options nonotes;

/* Only write source lines with errors to the log: */
   options nosource;


proc printto
  /* Redirect output to print.txt and log.txt */
     print = "&printto_path\print.txt"
     log   = "&printto_path\log.txt"
     new;   /* new: force creation of new file rather than appending to existing one */
run;


%put Put something into log.txt;
%put ;
%put The automatic macro variable sysprinttolog contains;
%put the destination path for the log file set by;
%put the printto procedure; 
%put    sysprinttolog = &sysprinttolog;


%macro tq84_check_pagesize;
/* This macro writes 500 lines to demonstrate
   the effect of the pagesize option */
   %do i = 1 %to 500;
       %put checking pagesize (i = &i);
   %end;
%mend;
%tq84_check_pagesize;


proc printto;
/*   Restore redirection */
run;
Github repository about-SAS, path: /programming/proc/printto/basic.sas

See also

tail -f sas-log
SAS programming: proc
macro: redirectLog(…).
logparm

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