MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Some question about BPXBATH

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Other Technical Topics
View previous topic :: View next topic  
Author Message
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Sun Jan 09, 2005 9:38 pm    Post subject: Some question about BPXBATH Reply with quote

We need to run some USS batch job (Java program)
1. There is a limitation (100 characters) of PARM. How to run a batch JCL if command is longer than 100 chars.

2. It seems that a data set can't be accessed in USS if next step code a DD card using it. How to solve it?


Thanks.


Charlie
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Jan 10, 2005 6:15 am    Post subject: Reply with quote

videlord,

Are you talking about BPXBATCH? If so BPXBATCH launches the Unix shell to run Java under a separate "OMVS" address space, the Java program doesn't have access to DD dataset allocations in the job step.

You need to pre-allocate the stdout and stderr datasets as shown here.

Code:

//BPXBATCH JOB '','USER',CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)
//********************************************************************
//* Cleanup existing HFS output files
//********************************************************************
//STEP1 EXEC PGM=IEFBR14
//STDOUT DD PATH='/tmp/&SYSUID..out',
//             PATHOPTS=(OCREAT,OWRONLY),
//             PATHMODE=SIRWXU,
//             PATHDISP=(DELETE)
//STDERR DD PATH='/tmp/&SYSUID..err',
//             PATHOPTS=(OCREAT,OWRONLY),
//             PATHMODE=SIRWXU,
//             PATHDISP=(DELETE)
//********************************************************************
//* Run Java under a Unix System Service shell
//********************************************************************
//STEP2 EXEC PGM=BPXBATCH,
// PARM='sh java HelloWord'
//STDIN  DD DUMMY
//STDENV DD DUMMY
//STDOUT DD PATH='/tmp/&SYSUID..out',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=SIRWXU
//STDERR DD PATH='/tmp/&SYSUID..err',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=SIRWXU
//*********************************************************************
//* Copy HFS output files to SYSOUT
//*********************************************************************
//STEP3 EXEC PGM=IKJEFT01 ,DYNAMNBR=300,COND=EVEN
//SYSTSPRT DD SYSOUT=*
//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)
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
OCOPY INDD(HFSOUT) OUTDD(STDOUTL)
OCOPY INDD(HFSERR) OUTDD(STDERRL)
/*


If you want to pass more than 100 characters then you can use STDENV dd

Code:

//STDENV DD *
JAVA_HOME=/usr/lpp/java14/J1.4
PATH=$JAVA_HOME:$PATH
CLASSPATH=/u/myuid/:/u/myuid/lib/x.jar:/u/myuid/lib/y.jar:$CLASSPATH
/*


Rather than executing Java as a shell command under Unix System Services, the JZOS batch launcher can be used to invoke the Java JVM directly from a batch job step address space:
Code:

//JZOSBAT  JOB '','USER',CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)
//JAVAJVM  EXEC PGM=JZOSVM14,
//   PARM='com.foo.MyClass'
//STEPLIB  DD DSN=JZOS.LIBRARY,DISP=SHR
//STDENV   DD DUMMY             < shell script to config env
//SYSPRINT DD SYSOUT=*          < System stdout
//SYSOUT   DD SYSOUT=*          < System stderr
//STDOUT   DD SYSOUT=*          < Java System.out
//STDERR   DD SYSOUT=*          < Java System.err


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Other Technical Topics All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group