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.
Note: - If you specify data sets in a STEPLIB DD statement, all the data
sets should be cataloged.
- 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.
- 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.
- 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'