136 lines
6.3 KiB
HTML
136 lines
6.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="reference" />
|
|
<meta name="DC.Title" content="Example in ILE RPG: Accessing the HOLD attribute" />
|
|
<meta name="abstract" content="This program retrieves the HOLD value from a job description and then prints the value. 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 and then prints the value. 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="cmnAccessRPG.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="cmnAccessRPG.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="cmnAccessILERPG" />
|
|
<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: Accessing the HOLD attribute</title>
|
|
</head>
|
|
<body id="cmnAccessILERPG"><a name="cmnAccessILERPG"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Example in ILE RPG: Accessing the HOLD attribute</h1>
|
|
<div><p>This program retrieves the HOLD value from a job description and
|
|
then prints the value. 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: Accessing the HOLD
|
|
attribute for the original example.</p>
|
|
<pre> F***************************************************************
|
|
F***************************************************************
|
|
F*
|
|
F* Program Name: JOBDAPI
|
|
F*
|
|
F* Programming Language: ILE RPG
|
|
F*
|
|
F* Description: This program retrieves the HOLD value from
|
|
F* a job description and then prints the value.
|
|
F* It expects errors to be returned via the
|
|
F* error code parameter.
|
|
F*
|
|
F* Header Files Included: QUSEC - Error Code Parameter
|
|
F* QWDRJOBD - Retrieve Job Description API
|
|
F*
|
|
F***************************************************************
|
|
F***************************************************************
|
|
F*
|
|
FQPRINT O F 132 PRINTER OFLIND(*INOF)
|
|
D*
|
|
D* Error Code parameter include
|
|
D*
|
|
D/COPY QSYSINC/QRPGLESRC,QUSEC
|
|
D*
|
|
D* Retrieve Job Description API Include
|
|
D*
|
|
D/COPY QSYSINC/QRPGLESRC,QWDRJOBD
|
|
D*
|
|
D* Miscellaneous data structure
|
|
D*
|
|
DRCVLEN S 9B 0 INZ(%SIZE(QWDD0100))
|
|
DFORMAT S 8 INZ('JOBD0100')
|
|
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)
|
|
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* If no bytes available, API was successful; print HOLD value
|
|
C*
|
|
C IF QUSBAVL = 0
|
|
C EXCEPT GOOD
|
|
C ELSE
|
|
C*
|
|
C* If some bytes available, API failed; print Error message ID
|
|
C*
|
|
C IF QUSBAVL > 0
|
|
C EXCEPT BAD
|
|
C END
|
|
C END
|
|
C*
|
|
C* End of program
|
|
C*
|
|
C EVAL *INLR = '1'
|
|
C RETURN
|
|
C*
|
|
C* End of MAINLINE
|
|
C***************************************************************
|
|
O*
|
|
OQPRINT E GOOD 1 6
|
|
O 'HOLD value - '
|
|
O QWDHJQ
|
|
OQPRINT E BAD 1 6
|
|
O 'Failed. Error ID - '
|
|
O QUSEI</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="cmnAccessRPG.htm" title="The following program prints out the name of the job description or prints an error if the API could not find the job description name specified.">Example in OPM RPG: Accessing the HOLD attribute</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |