ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzakj_5.4.0.1/rzakjprogramexample.htm

156 lines
8.5 KiB
HTML
Raw Permalink 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="task" />
<meta name="DC.Title" content="Example: Code for a standard processing program" />
<meta name="abstract" content="This is an example of using a standard processing program." />
<meta name="description" content="This is an example of using a standard processing program." />
<meta name="DC.Relation" scheme="URI" content="rzakjproccprog.htm" />
<meta name="DC.Relation" scheme="URI" content="rzakjprocflow.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2004, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2004, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzakjprogramexample" />
<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: Code for a standard processing program</title>
</head>
<body id="rzakjprogramexample"><a name="rzakjprogramexample"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: Code for a standard processing program</h1>
<div><p>This is an example of using a standard processing program.</p>
<div class="section">The application shown in the following code example performs as follows:</div>
<ol><li class="stepexpand"><span>The application program receives the user name in a parameter and
uses it with the program name as a unique identifier in the notify object.</span></li>
<li class="stepexpand"><span>The application program passes a request code of R to the standard
commit processing program, which determines if a record exists in the notify
object.</span></li>
<li class="stepexpand"><span>If the standard commit processing program returns a code of 1,
a record was found and the application program presents the information needed
to start again to the user.</span></li>
<li class="stepexpand"><span>The application program proceeds with normal processing.</span></li>
<li class="stepexpand"><span>When a transaction is completed, values are saved for reference
so the workstation user can see what was done for the previous transaction.</span> <p>The information saved is not provided by the notify object because
the notify object is updated only if a job or system failure occurs.</p>
</li>
</ol>
<div class="section"><div class="note"><span class="notetitle">Note:</span> By using the code examples, you agree to the terms
of the <a href="codedisclaimer.htm">Code license and disclaimer information</a>.</div>
<p><strong>Application program
example</strong></p>
<pre>SEQNBR *... ... 1 ... ... 2 ... ... 3 ... ... 4 ... ... 5 ... ... 6 ... ... 7 ..
1.00 FPRDMSTP UF E K DISK KCOMIT
2.00 FPRDLOCP UF E K DISK KCOMIT
3.00 FPRDRCTD CF E WORKSTN
4.00 F*
5.00 F* The following is a compile time array which contains the
6.00 F* restart information used in the next example
7.00 F*
8.00 E RTXT 50 50 1 Restart text
9.00 I*
10.00 I* Data structure used for info passed to notify object
11.00 I*
12.00 ICMTID DS
13.00 I 1 10 USER
14.00 I 11 20 PGMNAM
15.00 I 21 23 PRODCT
16.00 I 24 29 LOCATN
17.00 I 30 49 DESCRP
18.00 I P 50 510QTY
19.00 I 52 170 DUMMY
20.00 I 171 220 RSTART
21.00 C *ENTRY PLIST
22.00 C PARM USER10 10
23.00 C*
24.00 C* Initialize fields used to communicate with std program
25.00 C*
26.00 C MOVE USER10 USER
27.00 C MOVEL'PRDRC2' PGMNAM
28.00 C MOVE 'R' RQSCOD Read Rqs
29.00 C CALL 'STDCMT'
30.00 C PARM RQSCOD 1
31.00 C PARM RTNCOD 1
32.00 C PARM CMTID 220 Data struct
33.00 C RTNCOD IFEQ '1' Restart
34.00 C EXSR MOVLST Move to last
35.00 C SETON 71 Restart
36.00 C END
37.00 C*
38.00 C* Initialize fields used in notify object
39.00 C*
40.00 C MOVEARTXT,1 RSTART Move text
41.00 C*
42.00 C* Basic processing loop
43.00 C*
44.00 C LOOP TAG
45.00 C EXFMTPROMPT
46.00 C 98 GOTO END
47.00 C PRODCT CHAINPRDMSTR 61 Not found
48.00 C 61 GOTO LOOP
49.00 C KEY KLIST
50.00 C KFLD PRODCT
51.00 C KFLD LOCATN</pre>
<pre>SEQNBR *... ... 1 ... ... 2 ... ... 3 ... ... 4 ... ... 5 ... ... 6 ... ... 7 ..
52.00 C KEY CHAINPRDLOCR 62 Not found
53.00 C 62 DO
54.00 C EXCPTRLSMST Release lck
55.00 C GOTO LOOP
56.00 C END
57.00 C ADD QTY ONHAND Add
58.00 C ADD QTY LOCAMT
59.00 C UPDATPRDMSTR Update
60.00 C UPDATPRDLOCR Update
61.00 C*
62.00 C* Commit and move to previous fields
63.00 C*
64.00 C CMTID COMIT
65.00 C EXSR MOVLST Move to last
66.00 C GOTO LOOP
67.00 C* End of program processing
68.00 C*
69.00 C END TAG
70.00 C MOVE 'D' RQSCOD Dlt Rqs
71.00 C CALL 'STDCMT'
72.00 C PARM RQSCOD
73.00 C PARM RTNCOD
74.00 C PARM CMTID
75.00 C SETON LR
76.00 C*
77.00 C* Move to -Last Used- fields for operator feedback
78.00 C*
79.00 C MOVLST BEGSR
80.00 C MOVE PRODCT LSTPRD
81.00 C MOVE LOCATN LSTLOC
82.00 C MOVE DESCRP LSTDSC
83.00 C MOVE QTY LSTQTY
84.00 C ENDSR
85.00 OPRDMSTR E RLSMST
86.00 ** RTXT Restart Text
87.00 Inventory Menu - Receipts Option</pre>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rzakjprocflow.htm">Processing flow</a></strong><br />
This topic shows the processing flow of the processing program.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzakjproccprog.htm" title="A standard processing program is one way to start your application again using one database file as the notify object for all applications. This approach assumes that user profile names are unique by user for all applications using the standard program.">Example: Use a standard processing program to start an application</a></div>
</div>
</div>
</body>
</html>