ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahh_5.4.0.1/spgcall.htm

80 lines
5.0 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?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="reference" />
<meta name="DC.Title" content="Service program call" />
<meta name="abstract" content="" />
<meta name="description" content="" />
<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="spgcall" />
<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>Service program call</title>
</head>
<body id="spgcall"><a name="spgcall"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1"><strong>Service program call</strong></h1>
<div><p></p>
<div class="section"><p>The <a href="javadoc/com/ibm/as400/access/ServiceProgramCall.html"> ServiceProgramCall</a> class allows you to call an iSeries™ service
program. ServiceProgramCall is a subclass of the <a href="javadoc/com/ibm/as400/access/ProgramCall.html">ProgramCall</a> class that you use to call iSeries programs.
If you want to call an iSeries program, use the ProgramCall class.</p>
</div>
<div class="section"><p>The ServiceProgramCall class makes it possible for you to call
an iSeries service
program, pass data to an iSeries service program through input parameters,
and access data the iSeries service program returns through output parameters.
Using ServiceProgramCall causes the AS400 object to connect to the iSeries. See <a href="mngcon.htm#mngcon">managing connections</a> for information about
managing connections.</p>
</div>
<div class="section"><p>The default behavior is for service programs to run in a separate
server job, even when the Java™ program and the service program are
on the same server. You can override the default behavior and have the service
program run in the Java job using the inherited (from ProgramCall)
<a href="javadoc/com/ibm/as400/access/ProgramCall.html#SETTHREADSAFE(BOOLEAN)">setThreadSafe()</a> method.</p>
</div>
<div class="section"><p><strong>Using the ServiceProgramCall class</strong></p>
</div>
<div class="section"><p>In order to use the ServiceProgramCall class, you must be sure
to meet the following requirements:</p>
</div>
<div class="section"><ul><li>The service program must be on an iSeries</li>
<li>You can pass no more than seven parameters to the service program</li>
<li>The return value of the service program is void or numeric</li>
</ul>
</div>
<div class="section"><p><strong>Working with ProgramParameter objects</strong></p>
</div>
<div class="section"><p>The <a href="javadoc/com/ibm/as400/access/ProgramParameter.html"> ProgramParameter</a> class works with the ServiceProgramCall
class to pass parameter data to and from an iSeries service program. You pass input
data to the iSeries service
program with <a href="javadoc/com/ibm/as400/access/ProgramParameter.html#SETINPUTDATA(BYTE[])">setInputData()</a>.</p>
</div>
<div class="section"><p>You request the amount of output data you want returned with <a href="javadoc/com/ibm/as400/access/ProgramParameter.html#SETOUTPUTDATALENGTH(INT)">setOutputDataLength()</a>. You retrieve the output data
after the service program is finished running with <a href="javadoc/com/ibm/as400/access/ProgramParameter.html#GETOUTPUTDATA()">getOutputData()</a>. In addition to the data itself, ServiceProgramCall
needs to know how to pass parameter data to the service program. The <a href="javadoc/com/ibm/as400/access/ProgramParameter.html#SETPARAMETERTYPE(INT)">setParameterType()</a> method of ProgramParameter is used
to supply this information. The type indicates if the parameter is pass by
value or pass by reference. In either case, data is sent from the client
to the server. Once the data is on the iSeries, the server uses the parameter
type to correctly call the service program.</p>
</div>
<div class="section"><p>All parameters will be in the form of a byte array. Therefore,
to convert between iSeries and Java formats, you use the <a href="dtad.htm#dtad">data
conversion and description</a> classes.</p>
</div>
</div>
</body>
</html>