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


Invoking BPXBATCH in a batch job

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

You can create a batch job that invokes BPXBATCH to run a z/OS UNIX shell command or executable file.

The JCL to invoke BPXBATCH looks like this:
//jobname  JOB ...
//stepname EXEC PGM=BPXBATCH,PARM='SH|PGM program_name [arg1...argN]'
where:
  • When SH is specified, program_name is the name of a shell command or a file containing a shell script. SH is the default; therefore, you can omit the PARM= and use STDIN to define the name of the shell script to be invoked. BPXBATCH invokes the login program to run the shell as a login shell. BPXBATCH always runs the shell found in the user's RACF® OMVS Segment.
  • When PGM is specified, program_name is the name of an executable file that is stored in a z/OS UNIX file. Inadvertent use of a shell script with PGM may result in a process that will not end as expected, and will require use of the kill -9 pid command to force termination.
  • You can supply optional arguments, arg1...argN, to program_name. For SH, the entire string after the SH is passed to the login shell without further parsing. For PGM, the arguments are broken at blanks and passed separately. You cannot use quotes in the parameter to pass arguments that contain blanks.
  • You can omit the PARM= and, instead, place the parameter data in a file or data set defined by STDPARM.
In the job, you can supply DD statements to define any of the resources discussed previously using the following ddnames:
DDname
Description
STDIN
Standard input (see Defining standard input, output, and error streams for BPXBATCH)
STDOUT
Standard output (see Defining standard input, output, and error streams for BPXBATCH)
STDERR
Standard error (see Defining standard input, output, and error streams for BPXBATCH)
STDENV
Environment variable definitions (see Passing environment variables to BPXBATCH)
STDPARM
BPXBATCH parameter data (see Passing parameter data to BPXBATCH)
Note:
  1. If you specify data sets in a STEPLIB DD statement, all the data sets should be cataloged.
  2. UNIT= and VOL=SER= parameters are not propagated to the process that is being executed by BPXBATCH unless the process is run locally by BPXBATCH via the setting of the _BPX_SHAREAS and _BPX_BATCH_SPAWN environment variables: _BPX_SHAREAS=YES and _BPX_BATCH_SPAWN=YES.
  3. If the job needs to run with a group other than your default group, you need to code GROUP=grpname on the job card to specify the group your job needs to run under. For BPXBATCH, the group needs to have an OMVS segment and a GID defined for it.
  4. If your job requires a REGION size greater than the default on your system, you may receive this abend code:
    ABEND 4093 reason code 0000001c
    To fix this, use a larger REGION size.
    Example: The following invokes BPXBATCH with a region size of 8M:
    //SHELLCMD EXEC PGM=BPXBATCH,REGION=8M,PARM='SH shell_command'

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014