xcall SUBMIT, rtnvar, stdin, stdout, stderr, ashell'cmd, arg1, arg2 {,...argn}
SUBMIT.SBR allows you to submit a background task to be executed. It is only supported under UNIX versions of A-Shell, and it is primarily considered an internal routine (created to support SUBMIT.LIT). So if you choose to use it, you would be well advised to create a BASIC wrapper for it to make it easier to adapt if we decide to modify the parameters (to add functionality) later. See the SBR option SUBMIT2 in the A-Shell Setup Guide for related information.
Parameters
rtnvar (B2)
will return with the process id number of the child process created to run the task.
stdin
is the (AMOS) filespec of the AUI_CONTROL file containing the input to be forced to the process.
stdout, stderr
are the (AMOS) filespecs to send normal and error output messages to. To mimic the AMOS LOG file behavior, set them both to the same name (typically with an extension of LOG and a base name either matching the control file or the job name).
ashell'cmd
and the subsequent arguments are used to launch the new copy of A-Shell which will run the background process. For example:
xcall SUBMIT, RC, "CMD:TEST.CTL", "TEST.LOG", "TEST.LOG", "ashell"
Comments
Note that there are a number of differences between SUBMIT.SBR under A-Shell and submitting a task to the AMOS Task Manager. First, with SUBMIT.SBR, there is no task manager; instead, the process runs as a child to your current process. Second, there is no queue; the task starts executing immediately (and there is no particular limit to how many tasks you can submit this way with overlapping execution). Third, none of the AMOS embedded control file directives (which contain the $ symbol) are supported under A-Shell. Fourth, although you can use the SUBMIT.LIT program to check on the status of background tasks (and even kill them), under A-Shell, you can only do so for tasks which you have submitted (unless you are the Superuser).