Search notes:

SAS macro: shellCmd

tq84_shellCmd can be used to execute to execute a shell command and print its result in the log file.
%macro tq84_shellCmd(cmd);
  filename tq84_sh pipe "&cmd";
  data _null_;
    infile tq84_sh truncover;
    input  line $256.;
    put    line;
  run;
%mend  tq84_shellCmd;
Github repository about-SAS, path: /macros/shellCmd.sas

Example

The following example uses tq84_opt to determine the work directory and then lists the directories contents with ls -ltr (ordering from oldest to newest):
%macro tq84_shellCmd(cmd);
  filename tq84_sh pipe "&cmd";
  data _null_;
    infile tq84_sh truncover;
    input  line $256.;
    put    line;
  run;
%mend  tq84_shellCmd;
Github repository about-SAS, path: /macros/shellCmd.sas

See also

filename pipe
The systask statement might be better suited for such a task.
macros

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