BPXBATCH
BPXBATCH is a program that allows JCL written and run under TSO to access USS programs and files.
With BPXBATCH you can allocate the MVS standard files "STDIN", "STDOUT" and "STDERR", but these must be HFS files. You can also allocate a dataset or HFS file containing environment variables ("STDENV"). If you do not allocate any of these files, they default to "/dev/null".
There are to options when running BPXBATCH:
- SH
Starts up USS, runs any logon scripts then runs the shell command, shell script or program specified in the "PARM" option or the "STDIN" dataset. - PGM
Runs the program specified using any environment variables read from the "STDENV" file. in the "PARM" option or the "STDIN" dataset.
A complete reference on BPXBATCH can be found in the IBM 'Unix System Services Command Reference' book listed on the index page.
Basic BPXBATCH JCL
The following JCL runs the Java program 'hello' sending the output to "/u/auser/stdout/" and any errors to "/u/auser/stderr".
//Place jobcard here //* //JAVATEST EXEC PGM=BPXBATCH,PARM='SH java hello' //STDOUT DD PATH='/u/auser/stdout', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC), // PATHMODE=SIRWXU //STDERR DD PATH='/u/auser/stderr', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC), // PATHMODE=SIRWXU //*
Complex BPXBATCH JCL
The following JCL runs the same Java program 'hello', but this time it sends the output to "/tmp/<TSO USERID>.out" and any errors to "/tmp/<TSO USERID>.err". The extra step copies the output from the HFS files into your job output.
//Place jobcard here //* //JAVATEST EXEC PGM=BPXBATCH,PARM='SH java hello' //STDOUT DD PATH='/tmp/&SYSUID..out', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC), // PATHMODE=SIRWXU //STDERR DD PATH='/tmp/&SYSUID..err', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC), // PATHMODE=SIRWXU //* //COPYOPUT EXEC PGM=IKJEFT01,DYNAMNBR=300 //HFSOUT DD PATH='/tmp/&SYSUID..out' //HFSERR DD PATH='/tmp/&SYSUID..err' //STDOUTL DD SYSOUT=*,DCB=(RECFM=VB,LRECL=133,BLKSIZE=137) //STDERRL DD SYSOUT=*,DCB=(RECFM=VB,LRECL=133,BLKSIZE=137) //SYSTSIN DD * OCOPY INDD(HFSOUT) OUTDD(STDOUTL) OCOPY INDD(HFSERR) OUTDD(STDERRL) /* //SYSPRINT DD SYSOUT=* //SYSTSPRT DD SYSOUT=* //*