z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


_BPX_BATCH_SPAWN and _BPX_BATCH_UMASK environment variables

z/OS UNIX System Services User's Guide
SA23-2279-00

BPXBATCH uses two environment variables for execution that are specified by STDENV:
  • _BPX_BATCH_UMASK=0755
  • _BPX_BATCH_SPAWN=YES|NO

_BPX_BATCH_UMASK allows the user the flexibility of modifying the permission bits on newly created files instead of using the default mask (when PGM is specified).

Valid characters for the mask value are the octal digits 0 to 7, inclusive. If an invalid character is found, that character and all subsequent characters to the right are ignored. For example, 0348 is interpreted as 0034 and 0586 is interpreted as 0005.

Note: This variable will be overridden by umask (usually set from within /etc/profile) if BPXBATCH is invoked with the SH option (SH is the default). SH causes BPXBATCH to execute a login shell which runs the /etc/profile script (and runs the user's .profile) and which may set the umask before execution of the intended program.

_BPX_BATCH_SPAWN causes BPXBATCH to use spawn instead of fork/exec and allows data definitions to be carried over into the spawned process. When _BPX_BATCH_SPAWN is set to YES, spawn will be used. If it is set to NO, which is equivalent to the default behavior, fork/exec will be used to execute the program.

If _BPX_BATCH_SPAWN is set to YES, you must consider two other environment variables that affect spawn (BPX1SPN):
  • _BPX_SHAREAS=YES|NO|REUSE
    When _BPX_SHAREAS is YES or REUSE, the child process created by spawn will run in the same address space as the parent's under these conditions:
    • The child process is not setuid or setgid to a value different from the parent
    • The spawned file name is not an external link or a sticky bit file
    • The parent has enough resources to allow the child process to reside in the same address space
    • The NOSHAREAS extended attribute is not set

    When _BPX_SHAREAS is NO, the child and parent run in separate address spaces.

  • _BPX_SPAWN_SCRIPT=YES

    When _BPX_SPAWN_SCRIPT is YES, the spawn will treat the specified file as a shell script and will invoke the shell to run the shell script.

Setting _BPX_SPAWN_SCRIPT=YES improves shell script performance. See Improving the performance of shell scripts for more information. For more information about spawn, see spawn (BPX1SPN, BPX4SPN) — Spawn a process in z/OS UNIX System Services Programming: Assembler Callable Services Reference.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014