matthewstorey.co.uk
In this section Introduction to USS | BPXBATCH | Using COBOL | USS Commands | Using Java

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:

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=*
//*

Back to top