16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BPXBATCH<br />

BPXBATCH — Run shell commands, shell scripts, or executable files<br />

Format<br />

Description<br />

BPXBATCH SH|PGM shell_command|program_name<br />

BPXBATCH makes it easy for you to run, from your TSO/E session, shell scripts or<br />

z/<strong>OS</strong> C executable files that reside in z/<strong>OS</strong> <strong>UNIX</strong> files.<br />

Note: For additional information on using BPXBATCH in order to run shell scripts<br />

and executable files that reside in z/<strong>OS</strong> <strong>UNIX</strong> files through the MVS job<br />

control language (JCL), see Appendix D, “Running shell scripts or executable<br />

files under MVS environments.”<br />

With BPXBATCH, you can allocate the MVS standard file stdin only as z/<strong>OS</strong> <strong>UNIX</strong><br />

files for passing input. You can allocate the MVS standard files stdout, stderr or<br />

stdenv as MVS data sets or z/<strong>OS</strong> <strong>UNIX</strong> text files. The stdenv file for containing<br />

environment variables or the stderr and stdout files for saving job output can be<br />

allocated as SYSOUT, PDSE, PDS or sequential data sets. If you do not allocate<br />

them, stdin, stdout, stderr, and stdenv default to /dev/null. Allocate the standard<br />

files using the data definition PATH keyword options, or standard data definition<br />

options for MVS data sets, for stdenv, stdout and stderr. For more information<br />

about BPXBATCH, see Appendix D, “Running shell scripts or executable files under<br />

MVS environments.”<br />

In addition to using BPXBATCH, a user who wants to perform a local spawn without<br />

being concerned about environment setup (that is, without having to set specific<br />

environment variables which could be overwritten if they are also set in the user’s<br />

profile) can use BPXBATSL. BPXBATSL provides users with an alternate entry point<br />

into BPXBATCH, and forces a program to run using a local spawn instead of<br />

fork/exec as BPXBATCH does. This ultimately allows a program to run faster.<br />

The following example contains DD statements that are accessible to a program<br />

that was given control from BPXBATSL:<br />

//jobname JOB ...<br />

//stepname EXEC PGM=BPXBATSL,PARM=’PGM program_name’<br />

/* The following 2 DDs are still available in the program which gets<br />

/* control from BPXBATSL.<br />

//DD1 DD DSN=MVSDSN.FOR.APPL1,DISP=SHR<br />

//DD2 DD DSN=MVSDSN.FOR.APPL2,DISP=SHR<br />

/* The following DDs are processed by BPXBATSL to create file descriptors<br />

/* for stdin, stdout, stderr<br />

//STDIN DD PATH=’/stdin-file-pathname’,PATHOPTS=(ORDONLY)<br />

//STDOUT DD PATH=’/stdout-file-pathname’,PATHOPTS=(OWRONLY,OCREAT,OTRUNC<br />

// PATHMODE=SIRWXU<br />

//STDERR DD PATH=’/stderr-file-pathname’,PATHOPTS=(OWRONLY,OCREAT,OTRUNC<br />

// PATHMODE=SIRWXU<br />

BPXBATSL is also useful when the user wants to perform a local spawn of their<br />

program, but also needs subsequent child processes to be fork/exec’ed. Formerly,<br />

with BPXBATCH, this could not be done since BPXBATCH and the requested<br />

program shared the same environment variables.<br />

BPXBATSL is an alias of BPXBATCH.<br />

826 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!