Executes, lists, or terminates asynchronous tasks.
Valid in: | anywhere in a SAS program |
Windows specifics: | all |
executes the operating system command
lists either a specific active task or all of the active tasks in the system.
forces the termination of the specified task(s).
specifies the name of a Windows command (including any command-specific options). Enclose the command in either single or double quotation marks. If the command options require quotation marks, repeat the quotation marks. For example:
systask command "find ""my text"" c:\mydir\myfile.sas"
determines whether SYSTASK COMMAND suspends execution of the current SAS session until the task has completed. NOWAIT is the default. For tasks that are started with the NOWAIT argument, you can use the WAITFOR statement when necessary to suspend execution of the SAS session until the task has finished.
specifies a name that identifies the task. Task names must be unique among all active tasks. A task is active if it is running, or if it has completed and has not been waited for using the WAITFOR statement. Duplicate task names generate an error in the SAS log. If you do not specify a task name, SYSTASK automatically generates a name. If the task name contains a blank character, enclose the task name in quotation marks.
specifies a macro variable in which you want SYSTASK to store the task name that it automatically generated for the task. If you specify both the TASKNAME option and the MNAME option, SYSTASK copies the name that you specified with TASKNAME into the variable that you specified with MNAME.
specifies a macro variable in which you want SYSTASK to store the status of the task. Status variable names must be unique among all active tasks.
specifies that the operating system command should be executed with the operating system shell command. If you specify a shell-command, SYSTASK uses the shell command that you specify to invoke the shell. Otherwise, SYSTASK uses the default shell. Enclose the shell command in quotation marks.
specifies all active tasks in the system.
specifies to display the status of the task, which can be Start Failed, Running, or Complete.
specifies to display the status variable associated with the task. The status variable is the variable that you assigned with the STATUS option in the SYSTASK COMMAND statement.
systask command "copy myprog.sas myprog1.sas" taskname="copyfile" status=copystat;The return code from the
copy
command is saved
in the macro variable COPYSTAT.