> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Robert Pelletier
> Sent: Tuesday, March 20, 2007 8:57 AM
> To: [email protected]
> Subject: JAVA Support for a Novice
> 
> 
> Hi All. Would anyone have a batch example of a JAVA compile and run of
> HELLO WORLD (or anything simple) they would be willing to 
> share with me
> or point me to a manual I could find it in? Thanks once again all. 
> 
> 
> Have a Nice Day !
>  
> Bob Pelletier

First, before doing anything else, get JZOS. It is fantastic and makes
running Java in Batch almost simple. It comes bundled with the current
IBM Java 1.5, 64-bit SDK. If you don't have that, then go to:

http://www-03.ibm.com/servers/eserver/zseries/software/java/jzos/overvie
w.html


Now, to compile Java, you must have the .java files in a UNIX file. It
cannot be in a sequential file, or member of a PDS, or anything like
that (at least as best as I can figure out). Of course, you could keep
it in a PDS and OCOPY it to an intermediate UNIX file in order to
compile. But the resultant .class file must remain in a UNIX file. You
cannot execute Java from a z/OS legacy dataset of any type (if somebody
has done this, I would love to know how!).

JCL for a compile:

// SET CMD1='SH . /etc/profile; . ~/.profile; javac helloWorld.java'
//PS001   EXEC PGM=BPXBATCH,REGION=6M,
// PARM='&CMD1 '
//STDOUT DD PATH='/tmp/TSH009.stdout',
// FILEDATA=TEXT,
// PATHOPTS=(OCREAT,OAPPEND,OWRONLY,OEXCL),PATHMODE=SIRWXU
//STDERR DD PATH='/tmp/TSH009.stderr',
// FILEDATA=TEXT,
// PATHOPTS=(OCREAT,OAPPEND,OWRONLY,OEXCL),PATHMODE=SIRWXU
//STDIN DD PATH='/dev/null',
// PATHOPTS=(ORDONLY)
//*
//PRINT EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//HFSERR   DD PATH='/tmp/TSH009.stdout',PATHDISP=(DELETE,DELETE)
//HFSOUT   DD PATH='/tmp/TSH009.stdout',PATHDISP=(DELETE,DELETE)
//STDERR   DD SYSOUT=*,DCB=(RECFM=VB,LRECL=4096)
//STDOUT   DD SYSOUT=*,DCB=(RECFM=VB,LRECL=4096)
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
OCOPY INDD(HFSERR) OUTDD(STDERR)
OCOPY INDD(HFSOUT) OUTDD(STDOUT)

Change the PATH= on the STDOUT and STDERR as you need to. I used those
names simply as an example. BPXBATCH on z/OS 1.6 cannot write directly
to JES SYSOUT, unfortunately. The OEXCL will cause a JCL error if the
files exist. You can remove it if you want to overwrite the files, if
they exist and you have the authority to overwrite them.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to