Search notes:

SAS statements: systask

systask command

Unlike the x statement, systask writes the output of a shell command to the log file.
systask
  command "ls -l %sysfunc(getoption(work))"
  status  = rc_ls
  wait;

%put &=rc_ls; /* RC_LS=0 */

systask
  command "touch /cannot/touch/this/file/because/directory/does/not/exist"
  status  = rc_ls
  wait;

%put &=rc_ls; /* RC_LS=1 */
Github repository about-SAS, path: /programming/statements/systask/command/status.sas
It seems that for redirection to work, the entire command (inclusive redirection) must be enclosed in something like bash -c 'command > dest-file or alternatively the shell=… parameter can be used.
%let dest=/tmp/tq84.txt;
%let cmd=echo abc def ghi>&dest;

systask command "&cmd"       wait;
systask command "cat &dest"  wait;
/* cat: /tmp/tq84.txt: No such file or directory */

systask command "bash -c '&cmd'" wait;
systask command "cat &dest"      wait;
/* > abc def thi */

systask command "rm &dest"       wait;
systask command "&cmd"           wait shell='bash';
systask command "cat &dest"      wait;
/* > abc def thi */
Github repository about-SAS, path: /programming/statements/systask/command/redirection.sas

systask list

Show all active tasks in the system:
systask list;

See also

SAS statements
shellCmd

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