96 lines
4.8 KiB
HTML
96 lines
4.8 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: Use RTVJOBA" />
|
||
|
<meta name="abstract" content="This is an example of retrieving job attributes." />
|
||
|
<meta name="description" content="This is an example of retrieving job attributes." />
|
||
|
<meta name="DC.subject" content="command, CL, RTVJOBA (Retrieve Job Attributes), Retrieve Job Attributes (RTVJOBA), job attribute, retrieving, job attribute, example" />
|
||
|
<meta name="keywords" content="command, CL, RTVJOBA (Retrieve Job Attributes), Retrieve Job Attributes (RTVJOBA), job attribute, retrieving, job attribute, example" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="retja.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="rtvjo" />
|
||
|
<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: Use RTVJOBA</title>
|
||
|
</head>
|
||
|
<body id="rtvjo"><a name="rtvjo"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Example: Use RTVJOBA</h1>
|
||
|
<div><p>This is an example of retrieving job attributes.</p>
|
||
|
<div class="section"><p>Assume in the following CL procedure, an interactive job submits
|
||
|
a program including the CL procedure to batch. A <span class="cmdname">Retrieve Job Attribute
|
||
|
(RTVJOBA)</span> command retrieves the name of the message queue to which
|
||
|
the job's completion message is sent, and uses that message queue to communicate
|
||
|
with the user who submitted the job. </p>
|
||
|
<pre>PGM
|
||
|
DCL &MSGQ *CHAR 10
|
||
|
DCL &MSGQLIB *CHAR 10
|
||
|
DCL &MSGKEY *CHAR 4
|
||
|
DCL &REPLY *CHAR 1
|
||
|
DCL &ACCTNO *CHAR 6
|
||
|
.
|
||
|
.
|
||
|
.
|
||
|
RTVJOBA SBMMSGQ(&MSGQ) SBMMSGQLIB(&MSGQLIB)
|
||
|
IF (&MSGQ *EQ '*NONE') THEN(DO)
|
||
|
CHGVAR &MSGQ 'QSYSOPR'
|
||
|
CHGVAR &MSGQLIB 'QSYS'
|
||
|
ENDDO
|
||
|
.
|
||
|
.
|
||
|
.
|
||
|
IF (. . . ) THEN(DO)
|
||
|
SNDMSG:SNDPGMMSG MSG('Account number ' *CAT &ACCTNO *CAT 'is +
|
||
|
not valid. Do you want to cancel the update +
|
||
|
(Y or N)?') TOMSGQ(&MSGQLIB/&MSGQ) MSGTYPE(*INQ) +
|
||
|
KEYVAR(&MSGKEY)
|
||
|
RCVMSG MSGQ(*PGMQ) MSGTYPE(*RPY) MSGKEY(&MSGKEY) +
|
||
|
MSG(&REPLY) WAIT(*MAX)
|
||
|
IF (&REPLY *EQ 'Y') THEN(RETURN)
|
||
|
ELSE IF (&REPLY *NE 'N') THEN(GOTO SNDMSG)
|
||
|
ENDDO
|
||
|
.
|
||
|
.
|
||
|
.</pre>
|
||
|
</div>
|
||
|
<div class="section"><p>Two variables, &MSGQ and &MSGQLIB, are declared to receive
|
||
|
the name and library of the message queue to be used. The <span class="cmdname">Retrieve
|
||
|
Job Attribute (RTVJOBA)</span> command is used to retrieve the message
|
||
|
queue name and library name. Because it is possible that a message queue
|
||
|
is not specified for the job, the message queue name is compared to the value
|
||
|
*NONE. If the comparison is equal, no message queue is specified, and the
|
||
|
variables are changed so that message queue QSYSOPR in library QSYS is used.
|
||
|
Later in the procedure, when an error condition is detected, an inquiry message
|
||
|
is sent to the specified message queue and the reply is received and processed.
|
||
|
Some of the other possible uses of the <span class="cmdname">Retrieve Job Attribute (RTVJOBA)</span> command
|
||
|
are: </p>
|
||
|
<ul><li>Retrieve one or more of the job attributes (such as output queue, library
|
||
|
list) so that they can be changed temporarily and later restored to their
|
||
|
original values.</li>
|
||
|
<li>Retrieve one or more of the job attributes for use in the <span class="cmdname">Submit
|
||
|
Job (SBMJOB)</span> command, so that the submitted job will have the same
|
||
|
attributes as the submitting job.</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="retja.htm" title="You can retrieve the job attributes and place their values in a CL variable to control your applications.">Retrieve job attributes</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|