155 lines
7.1 KiB
HTML
155 lines
7.1 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="reference" />
|
|
<meta name="DC.Title" content="Example in ILE RPG: Retrieving the HOLD parameter (error code structure)" />
|
|
<meta name="abstract" content="This program retrieves the HOLD value from a job description. It expects errors to be returned via the error code parameter." />
|
|
<meta name="description" content="This program retrieves the HOLD value from a job description. It expects errors to be returned via the error code parameter." />
|
|
<meta name="DC.Relation" scheme="URI" content="opmScenario.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnRetrieveRPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnRetrieveRPG.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="cmnRetrieveILERPG" />
|
|
<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 in ILE RPG: Retrieving the HOLD parameter (error code structure)</title>
|
|
</head>
|
|
<body id="cmnRetrieveILERPG"><a name="cmnRetrieveILERPG"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Example in ILE RPG: Retrieving the HOLD parameter (error code structure)</h1>
|
|
<div><p>This program retrieves the HOLD value from a job description.
|
|
It expects errors to be returned via the error code parameter.</p>
|
|
<div class="section"><div class="note"><span class="notetitle">Note:</span> Read the <a href="codedisclaimer.htm">Code license and disclaimer information</a> for important
|
|
legal information.</div>
|
|
<p>Refer to Example in OPM RPG: Retrieving the HOLD
|
|
parameter (error code structure) for the original example.</p>
|
|
<pre> D***************************************************************
|
|
D***************************************************************
|
|
D*
|
|
D* Program Name: JOBDAPI
|
|
D*
|
|
D* Programming Language: ILE RPG
|
|
D*
|
|
D* Description: This program retrieves the HOLD value from
|
|
D* a job description. It expects errors to be
|
|
D* returned via the error code parameter.
|
|
D*
|
|
D* Header Files Included: QUSEC - Error Code Parameter
|
|
D* QWDRJOBD - Retrieve Job Description API
|
|
D*
|
|
D***************************************************************
|
|
D***************************************************************
|
|
D*
|
|
D* Error Code parameter include
|
|
D*
|
|
D/COPY QSYSINC/QRPGLESRC,QUSEC <span class="uicontrol">(1)</span>
|
|
D*
|
|
D* Retrieve Job Description API Include
|
|
D*
|
|
D/COPY QSYSINC/QRPGLESRC,QWDRJOBD
|
|
D*
|
|
D* Command string data structure
|
|
D*
|
|
DCMD_STRING DS
|
|
D 26 INZ('SNDMSG MSG(''HOLD value is ')
|
|
D HOLD 10
|
|
D 15 INZ(''') TOUSR(QPGMR)')
|
|
DCMD_STR2 DS
|
|
D 43 INZ('SNDMSG MSG(''Program failed -
|
|
D with message ID ')
|
|
D MSG_ID 7
|
|
D 15 INZ(''') TOUSR(QPGMR)')
|
|
D*
|
|
D* Miscellaneous data structure
|
|
D*
|
|
DRCVLEN S 9B 0 INZ(%SIZE(QWDD0100))
|
|
DFORMAT S 8 INZ('JOBD0100')
|
|
DLENSTR S 15 5 INZ(%SIZE(CMD_STRING))
|
|
DLENSTR2 S 15 5 INZ(%SIZE(CMD_STR2))
|
|
C*
|
|
C* Beginning of mainline
|
|
C*
|
|
C* Two parameters are being passed into this program
|
|
C*
|
|
C *ENTRY PLIST
|
|
C PARM JOBD 10
|
|
C PARM JOBD_LIB 10
|
|
C*
|
|
C* Move the two parameters passed into LFNAM
|
|
C*
|
|
C JOBD CAT JOBD_LIB LFNAM 20
|
|
C*
|
|
C* Error Code Bytes Provided is set to 16
|
|
C*
|
|
C EVAL QUSBPRV = %SIZE(QUSEC) <span class="uicontrol">(3)</span>
|
|
C*
|
|
C* Call the API.
|
|
C*
|
|
C CALL QWDRJOBD
|
|
C PARM QWDD0100
|
|
C PARM RCVLEN
|
|
C PARM FORMAT
|
|
C PARM LFNAM
|
|
C PARM QUSEC
|
|
C*
|
|
C* Test for an error on the API call
|
|
C*
|
|
C IF QUSBAVL > 0 <span class="uicontrol">(2)</span>
|
|
C*
|
|
C* If there was an error, exit to ERROR subroutine
|
|
C*
|
|
C EXSR ERROR
|
|
C*
|
|
C* Else, process the HOLD value
|
|
C*
|
|
C ELSE
|
|
C MOVEL QWDHJQ HOLD
|
|
C*
|
|
C* Let's tell everyone what the hold value was for this job
|
|
C*
|
|
C CALL 'QCMDEXC'
|
|
C PARM CMD_STRING
|
|
C PARM LENSTR
|
|
C END
|
|
C*
|
|
C EVAL *INLR = '1'
|
|
C RETURN
|
|
C*
|
|
C* End of MAINLINE
|
|
C*
|
|
C* Subroutine to handle errors received on the CALL
|
|
C*
|
|
C ERROR BEGSR
|
|
C*
|
|
C* Process errors returned from the API
|
|
C*
|
|
C MOVEL QUSEI MSG_ID
|
|
C CALL 'QCMDEXC'
|
|
C PARM CMD_STR2
|
|
C PARM LENSTR2
|
|
C ENDSR</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="opmScenario.htm" title="This scenario demonstrates the use of an original program model (OPM) API in several different programs.">Scenario: Original Program Model (OPM) API</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="cmnRetrieveRPG.htm" title="This sample program shows exceptions being returned in the error code parameter.">Example in OPM RPG: Retrieving the HOLD parameter (error code structure)</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |