BPXBATCH SH|PGM shell_command|program_name //jobname JOB ... //stepname EXEC PGM=BPXBATCH,PARM=’PGM program_name’ /* The following 2 DDs are still available in the program which gets /* control from BPXBATCH. //DD1 DD DSN=MVSDSN.FOR.APPL1,DISP=SHR //DD2 DD DSN=MVSDSN.FOR.APPL2,DISP=SHR /* The following DDs are processed by BPXBATCH to create file descriptors /* for stdin, stdout, stderr //STDIN DD PATH=’/stdin-file-pathname’,PATHOPTS=(ORDONLY) //STDOUT DD PATH=’/stdout-file-pathname’,PATHOPTS=(OWRONLY,OCREAT,OTRUNC // PATHMODE=SIRWXU //STDERR DD PATH=’/stderr-file-pathname’,PATHOPTS=(OWRONLY,OCREAT,OTRUNC // PATHMODE=SIRWXU BPXBATSL SH|PGM shell_command|program_name //jobname JOB ... //stepname EXEC PGM=BPXBATSL,PARM=’PGM program_name’ /* The following 2 DDs are still available in the program which gets /* control from BPXBATSL. //DD1 DD DSN=MVSDSN.FOR.APPL1,DISP=SHR //DD2 DD DSN=MVSDSN.FOR.APPL2,DISP=SHR /* The following DDs are processed by BPXBATSL to create file descriptors /* for stdin, stdout, stderr //STDIN DD PATH=’/stdin-file-pathname’,PATHOPTS=(ORDONLY) //STDOUT DD PATH=’/stdout-file-pathname’,PATHOPTS=(OWRONLY,OCREAT,OTRUNC // PATHMODE=SIRWXU //STDERR DD PATH=’/stderr-file-pathname’,PATHOPTS=(OWRONLY,OCREAT,OTRUNC // PATHMODE=SIRWXU
example :
a programe for java compile/run with jcl //JAVAPSMP JOB (ITSO),'wanpc',REGION=0M, // CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID //* ---------------------------------------------------- //* 0).Delete the output file in USS //* ---------------------------------------------------- //SETP0 EXEC PGM=IEFBR14 //STDOUT DD PATH='/u/wanpc/java1.stdout', // PATHOPTS=(OCREAT,OWRONLY), // PATHMODE=SIRWXU, // PATHDISP=(DELETE) //STDERR DD PATH='/u/wanpc/java1.stderr', // PATHOPTS=(OCREAT,OWRONLY), // PATHMODE=SIRWXU, // PATHDISP=(DELETE) //* ---------------------------------------------------- //* 1).Launch a java programe //* ---------------------------------------------------- //STEP1 EXEC PGM=BPXBATCH, //* PARM='SH java /u/wanpc/arsapar/java1 $1 $2..' // PARM='SH /u/wanpc/arsapar/run-javatc' //* ---------------------------------------------------- //* set PATH for ENV //* ---------------------------------------------------- //STDENV DD * PATH=/usr/lpp/java150/J5.0/bin:$PATH //*PATH=/u/wanpc/.profile:$PATH JAVA_HOME=/usr/lpp/java150/J5.0/ /* //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //STDOUT DD PATH='/u/wanpc/arsapar/java1.stdout', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC), // PATHMODE=SIRWXU //STDERR DD PATH='/u/wanpc/arsapar/java1.stderr', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC), // PATHMODE=SIRWXU //STDENV DD DUMMY //* ---------------------------------------------------- //* 2).Copy the output of Java program //* ---------------------------------------------------- /* IF (RC EQ 0) THEN //STEP3 EXEC PGM=IKJEFT1A,DYNAMNBR=300,COND=EVEN //SYSTSPRT DD SYSOUT=* //HFSOUT DD PATH='/u/wanpc/arsapar/java1.stdout' //HFSERR DD PATH='/u/wanpc/arsapar/java1.stderr' //STDOUT DD SYSOUT=*,DCB=(RECFM=VB,LRECL=133,BLKSIZE=137) //STDERR DD SYSOUT=*,DCB=(RECFM=VB,LRECL=133,BLKSIZE=137) //SYSPRINT DD SYSOUT=* //SYSTSIN DD DATA,DLM='/>' ocopy indd(HFSOUT) outdd(STDOUT) ocopy indd(HFSERR) outdd(STDERR) /> /* ENDIF /* //* ---------------------------------------------------- //* 3).Delete the output file in USS //* ---------------------------------------------------- /* IF (RC EQ 0) THEN //SETP3 EXEC PGM=IEFBR14 //STDOUT DD PATH='/u/wanpc/java1.stdout', // PATHOPTS=(OCREAT,OWRONLY), // PATHMODE=SIRWXU, // PATHDISP=(DELETE) //STDERR DD PATH='/u/wanpc/java1.stderr', // PATHOPTS=(OCREAT,OWRONLY), // PATHMODE=SIRWXU, // PATHDISP=(DELETE) /* ENDIF /* addational jcl: //JAVAP1 JOB (ITSO),'wanpc',REGION=3M, // CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID //* ---------------------------------------------------- //* Compile a java programe //* ---------------------------------------------------- //STEP1 EXEC PGM=BPXBATCH,REGION=3M, // PARM='SH javac /u/wanpc/arsapar/sample.java' //* ---------------------------------------------------- //* set PATH for ENV //* ---------------------------------------------------- //STDENV DD * PATH=/usr/lpp/java150/J5.0/bin:$PATH PATH=/u/wanpc/.profile:$PATH JAVA_HOME=/usr/lpp/java150/J5.0/ /* //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //STDOUT DD PATH='/u/wanpc/arsapar/sample.comout', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU //STDERR DD PATH='/u/wanpc/arsapar/sample.comerr', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU //STDENV DD DUMMY //* ---------------------------------------------------- //* Run a java programe //* ---------------------------------------------------- //STEP2 EXEC PGM=BPXBATCH,REGION=3M, // PARM='SH java /u/wanpc/arsapar/sample' //* ---------------------------------------------------- //* set PATH for ENV //* ---------------------------------------------------- //STDENV DD * PATH=/usr/lpp/java150/J5.0/bin:$PATH PATH=/u/wanpc/.profile:$PATH JAVA_HOME=/usr/lpp/java150/J5.0/ /* //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //STDOUT DD PATH='/u/wanpc/arsapar/sample.stdout', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU //STDERR DD PATH='/u/wanpc/arsapar/sample.stderr', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU //STDENV DD DUMMY //* ---------------------------------------------------- //* Copy the output of Java program //* ---------------------------------------------------- //STEP3 EXEC PGM=IKJEFT1A //SYSTSPRT DD SYSOUT=* //HFSOUT DD PATH='/u/wanpc/arsapar/sample.stdout' //HFSERR DD PATH='/u/wanpc/arsapar/sample.stderr' //STDOUTL DD SYSOUT=*,DCB=(RECFM=VB,LRECL=133,BLKSIZE=137) //STDERRL DD SYSOUT=*,DCB=(RECFM=VB,LRECL=133,BLKSIZE=137) //SYSPRINT DD SYSOUT=* //SYSTSIN DD DATA,DLM='/>' ocopy indd(HFSOUT) outdd(STDOUTL) ocopy indd(HFSERR) outdd(STDERRL) /> /*