BATCH


 

The BATCH instruction initiates the specified command line as a background task and immediately resumes processing without waiting for the result. For concurrent PL/B processing, the FORK instruction is suggested. BATCH uses the following format:

 

 

[label]

BATCH

{command}[,[{in}][,{out}]]

 

Where:

label

Optional. A Program Execution Label.

command

Required. A previously defined Character String Variable or a string Literal containing the command line that is executed.

in

Required. A previously defined Character String Variable or a string Literal indicating the standard input (stdin) redirection.

out

Required. A previously defined Character String Variable or a string Literal indicating the standard output (stdout) redirection.

Flags Affected: ZERO

Note the following:

  1. If {command} is a string variable, only the Logical String is used. Prior to runtime version 10.3A, the {command} string maximum length is 512 characters. Starting with version 10.3A, the {command} string maximum length is 4096 characters.

  2. If {command} contains input or output redirection, it supersedes the corresponding {in} and/or {out} specification(s).

  3. If {in} is omitted or null, standard input (stdin) is closed and {command} must be capable of executing without input, unless {command} explicitly redirects the input.

  4. {out} is appended to, not overwritten. If omitted or null, standard output (stdout) is unchanged and appears in the stdout of the initiating program unless changed in {command}. If "/dev/null" (Linux) or "null" (WINDOWS) is desired, it must be provided explicitly.

  5. The destination of the shell standard error (stderr) messages remains unchanged, unless explicitly redirected within {command}. (Note: PL/B errors use stdout, not stderr.)

  6. If {command} is null or insufficient system resources exist to initiate BATCH, the ZERO flag is set.

  7. If the command fails to execute when using PLBWIN or SUNDB86A, BATCH automatically attempts to execute the command using the current COMSPEC keyword if available.

  8. The BATCH instruction is available with the PLBCON, PLBLinux, and PLBWIN runtimes.

  9. Under PLBCON, the BATCH statement performs the same functions as an EXECUTE instruction.

  10. When using the BATCH instruction in a PLBCLIENT/PLBSERVE application, this instruction does not execute at the client and does not show any command shell windows at the client. In this case, the BATCH instruction is only executed at the Application Server.

 

 

See Also: Example Code, EXECUTE, FORK, ROLLOUT, SHUTDOWN, System Interface Instructions

 



PL/B Language Reference ALERT CLEARADR