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

124 lines
6.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="Example: Passing in parameter values as XPCML" />
<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="rzahhxpcmlexmplregpass" />
<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>Example: Passing in parameter values as XPCML</title>
</head>
<body id="rzahhxpcmlexmplregpass"><a name="rzahhxpcmlexmplregpass"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: Passing in parameter values as XPCML</h1>
<div><div class="section"><p>Program parameter values can be set in the XPCML source file.
When the XPCML is read in and parsed, the ProgramCallDocument setValue method
is called automatically for each parameter whose value has been passed in
as XPCML. This relieves the user from having to write Java™ code
to set the values of complicated structures and arrays.</p>
<p>In the following
examples, the XPCML calls two different programs, prog1 and prog2. Both programs
use the input parameter s1Ref. The first example sets different values for
s1Ref for each program call. The second example specifies the same value for
s1Ref for each program call, which illustrates a useful way to set constant
data values for input parameters.</p>
</div>
<div class="section"><h4 class="sectiontitle">Example: Passing in different values for input paramters</h4><p>In
the following example, after the XML parser reads in and parses the document,
the value of element prog1.s1Ref.s2Ref.s2p1[0] is prog1Val_1 and the value
of element prog1.s1Ref.s2Ref.s2p1[1] is prog1Val_2.</p>
<pre> &lt;xpcml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="xpcml.xsd" version="4.0"&gt;
&lt;struct name="s1"&gt;
&lt;stringParm name="s1p1"/&gt;
&lt;structParm name="s2Ref" struct="s2"/&gt;
&lt;/struct&gt;
&lt;struct name="s2"&gt;
&lt;stringParm name="s2p1" length="10"/&gt;
&lt;arrayOfStringParm name="parm1" count="2"/&gt;
&lt;/struct&gt;
&lt;program name="prog1" path="/QSYS.LIB/W95LIB.LIB/PROG1.PGM"&gt;
&lt;parameterList&gt;
&lt;structParm name="s1Ref" struct="s1" passDirection="in" &gt;
&lt;stringParm name="s1p1"&gt;prog1Val&lt;/stringParm&gt;
&lt;structParm name="s2Ref" struct="s2"&gt;
&lt;stringParm name="s2p1" length="10"&gt;prog1Val&lt;/stringParm&gt;
&lt;arrayOfStringParm name="parm1" count="2"&gt;
&lt;i&gt;prog1Val_1&lt;/i&gt;
&lt;i&gt;prog1Val_2&lt;/i&gt;
&lt;/arrayOfStringParm&gt;
&lt;/structParm&gt;
&lt;/structParm&gt;
&lt;/parameterList&gt;
&lt;/program&gt;
&lt;program name="prog2" path="/QSYS.LIB/W95LIB.LIB/PROG1.PGM"&gt;
&lt;parameterList&gt;
&lt;structParm name="s1Ref" struct="s1" passDirection="in" &gt;
&lt;stringParm name="s1p1"&gt;prog2Val&lt;/stringParm&gt;
&lt;structParm name="s2Ref" struct="s2"&gt;
&lt;stringParm name="s2p1" length="10"&gt;prog2Val&lt;/stringParm&gt;
&lt;arrayOfStringParm name="parm1" count="2"&gt;
&lt;i&gt;prog2Val_1&lt;/i&gt;
&lt;i&gt;prog2Val_2&lt;/i&gt;
&lt;/arrayOfStringParm&gt;
&lt;/structParm&gt;
&lt;/structParm&gt;
&lt;/parameterList&gt;
&lt;/program&gt;
&lt;/xpcml&gt;</pre>
</div>
<div class="section"><h4 class="sectiontitle">Example: Passing in constant values for input paramters</h4><p>In
the following example, after the XML parser reads in and parses the document,
the value of element prog1.s1Ref.s2Ref.s2p1[0] is constantVal_1 and the value
of element prog1.s1Ref.s2Ref.s2p1[1] is constantVal_2.</p>
<pre> &lt;xpcml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="xpcml.xsd" version="4.0"&gt;
&lt;struct name="s1" &gt;
&lt;stringParm name="s1p1"&gt;constantVal&lt;/stringParm&gt;
&lt;structParm name="s2Ref" struct="s2"/&gt;
&lt;/struct&gt;
&lt;struct name="s2"&gt;
&lt;stringParm name="s2p1" length="10"&gt;constantVal&lt;/stringParm&gt;
&lt;arrayOfStringParm name="parm1" count="2"&gt;
&lt;i&gt;constantVal_1&lt;/i&gt;
&lt;i&gt;constantVal_2&lt;/i&gt;
&lt;/arrayOfStringParm&gt;
&lt;/struct&gt;
&lt;program name="prog1" path="/QSYS.LIB/W95LIB.LIB/PROG1.PGM"&gt;
&lt;parameterList&gt;
&lt;structParm name="s1Ref" struct="s1" passDirection="in" /&gt;
&lt;/parameterList&gt;
&lt;/program&gt;
&lt;program name="prog2" path="/QSYS.LIB/W95LIB.LIB/PROG1.PGM"&gt;
&lt;parameterList&gt;
&lt;structParm name="s1Ref" struct="s1" passDirection="in" /&gt;
&lt;/parameterList&gt;
&lt;/program&gt;
&lt;/xpcml&gt;</pre>
</div>
</div>
</body>
</html>