73 lines
5.3 KiB
HTML
73 lines
5.3 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="task" />
|
||
|
<meta name="DC.Title" content="Run Java in a batch job" />
|
||
|
<meta name="abstract" content="Java programs run in a batch job by using the Submit Job (SBMJOB) command. In this mode, the Java Qshell Command Entry display is not available to handle the System.in, System.out, nor System.err streams." />
|
||
|
<meta name="description" content="Java programs run in a batch job by using the Submit Job (SBMJOB) command. In this mode, the Java Qshell Command Entry display is not available to handle the System.in, System.out, nor System.err streams." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="advtopic.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="clpckdir.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="classifs.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="fileauth.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="runbatch" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Run Java in a batch job</title>
|
||
|
</head>
|
||
|
<body id="runbatch"><a name="runbatch"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Run Java in a batch job</h1>
|
||
|
<div><p>Java™ programs run in a batch job by using the Submit
|
||
|
Job (SBMJOB) command. In this mode, the Java Qshell Command Entry display is not
|
||
|
available to handle the System.in, System.out, nor System.err streams.</p>
|
||
|
<div class="section"><p>You may redirect these streams to other files. Default handling
|
||
|
sends the System.out and System.err streams to a spooled file. The batch job,
|
||
|
which results in an input and output exception for read requests from System.in,
|
||
|
owns the spooled file. You can redirect System.in, System.out, and System.err
|
||
|
within your Java program. You can also use the os400.stdin, os400.stdout,
|
||
|
and os400.stderr system properties to redirect System.in, System.out, and
|
||
|
System.err.</p>
|
||
|
<div class="note"><span class="notetitle">Note:</span> SBMJOB sets the current working directory (CWD) to the
|
||
|
HOME directory that is specified in the user profile.</div>
|
||
|
<p><strong>Example:</strong> Running Java in
|
||
|
a Batch Job</p>
|
||
|
<p><samp class="codeph">SBMJOB CMD(JAVA Hello OPTION(*VERBOSE)) CPYENVVAR(*YES)</samp></p>
|
||
|
<p>Running
|
||
|
the JAVA command in the previous example spawns a second job. Therefore, the
|
||
|
subsystem that the batch job runs in must be capable of running more than
|
||
|
one job.</p>
|
||
|
<p>You can verify that your batch job is capable of running more
|
||
|
than one job by following these steps:</p>
|
||
|
</div>
|
||
|
<ol><li><span>On the CL command line, enter <samp class="codeph">DSPSBSD(MYSBSD)</samp>,
|
||
|
where <samp class="codeph">MYSBSD</samp> is the subsystem description of your batch job.</span></li>
|
||
|
<li><span>Choose option 6, Job queue entries.</span></li>
|
||
|
<li><span>Look at the Max Active field for your job queue.</span></li>
|
||
|
</ol>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="advtopic.htm" title="This topic provides instructions on how to run Java in a batch job and describes the Java file authorities required in the integrated file system to display, run, or debug a Java program.">Advanced topics</a></div>
|
||
|
</div>
|
||
|
<div class="relconcepts"><strong>Related concepts</strong><br />
|
||
|
<div><a href="clpckdir.htm" title="Each Java class is part of a package. The first statement in a Java source file indicates which class is in what package. If the source file does not contain a package statement, the class is part of an unnamed default package.">Java classes, packages, and directories</a></div>
|
||
|
<div><a href="classifs.htm" title="The integrated file system stores Java-related class, source, ZIP, and JAR files in a hierarchical file structure. IBM Developer Kit for Java supports using the threadsafe file systems in the integrated file system to store and work with your Java-related class files, source files, ZIP files, and JAR files.">Files in the integrated file system</a></div>
|
||
|
<div><a href="fileauth.htm" title="To run or debug a Java program, the class file, JAR file, or ZIP file needs to have read authority (*R). Any directories need read and execute authorities (*RX).">Java file authorities in the integrated file system</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|