Available Operating Systems: UNIX
Available Languages: reporting
The SPAWN function creates a subprocess from a procedure that executes a system command without terminating the current procedure.
Limit: On UNIX, you can invoke this function only from a COMPUTE or DEFINE command.
SPAWN(inlength, command, outcode)
Is the length, in characters, of command.
Is a UNIX command, or a .COM file you want to execute.
Is the return code specifying whether or not the spawn was successful, or the format of the output value enclosed in single quotation marks. Zero indicates a successful spawn; a non-zero value indicates an unsuccessful spawn.
SPAWN executes the echo command, which displays Hello at the beginning of the procedure:
MODIFY FILE EMPLOYEE PROMPT EMP_ID MATCH EMP_ID ON MATCH DELETE CASE AT START COMPUTE MESSAGE/38=SPAWN (10, 'echo Hello', 'D8'); ENDCASE DATA