ibm-information-center/dist/eclipse/plugins/i5OS.ic.rbam6_5.4.0.1/doptq.htm

107 lines
5.6 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="task" />
<meta name="DC.Title" content="Example: Display an output queue" />
<meta name="abstract" content="This example shows how to define and create a command that displays an output queue." />
<meta name="description" content="This example shows how to define and create a command that displays an output queue." />
<meta name="DC.subject" content="example, creating, command to display output queue, command definition, creating a command to display an output queue" />
<meta name="keywords" content="example, creating, command to display output queue, command definition, creating a command to display an output queue" />
<meta name="DC.Relation" scheme="URI" content="exdcc.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/crtcmd.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="doptq" />
<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: Display an output queue</title>
</head>
<body id="doptq"><a name="doptq"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: Display an output queue</h1>
<div><p>This example shows how to define and create a command that displays
an output queue.</p>
<div class="section"> <p>You can create a command to display an output queue that defaults
to display the output queue PGMR. The following command, <span class="cmdname">Display
Output Queue (DSPOQ)</span>, also allows the display station user to display
any queue on the library list and provides a print option.</p>
<p>The command
definition statements for the <span class="cmdname">Display Output Queue (DSPOQ)</span> command
are: </p>
<pre>CMD PROMPT('WRKOUTQ.-Default to PGMR')
PARM KWD(OUTQ) TYPE(*NAME) LEN(10) DFT(PGMR) +
PROMPT('Output queue')
PARM KWD(OUTPUT) TYPE(*CHAR) LEN(6) DFT(*) RSTD(*YES)
VALUES(* *PRINT) PROMPT('Output')</pre>
<p>The RSTD parameter on the second PARM statement specifies that
the entry can only be one of the list of values.</p>
<p>The command processing
program for the <span class="cmdname">Display Output Queue (DSPOQ)</span> command is:
</p>
<pre>PGM PARM(&amp;OUTQ &amp;OUTPUT)
DCL &amp;OUTQ TYPE(*CHAR) LEN(10)
DCL &amp;OUTPUT TYPE(*CHAR) LEN(6)
WRKOUTQ OUTQ(*LIBL/&amp;OUTQ) OUTPUT(&amp;OUTPUT)
ENDPGM</pre>
<p>The <span class="cmdname">Create Command (CRTCMD)</span> command is:
</p>
<pre>CRTCMD CMD(DSPOQ) PGM(DSPOQ) SRCMBR(DSPOQ)</pre>
<p>The following command, DSPOQ1, is a variation of the preceding
command. This command allows the workstation user to enter a qualified name
for the output queue name, and the command defaults to *LIBL for the library
name.</p>
<p>The command definition statements for the DSPOQ1 command are:
</p>
<pre> CMD PROMPT('WRKOUTQ.-Default to PGMR')
PARM KWD(OUTQ) TYPE(QUAL1) +
PROMPT('Output queue:')
PARM KWD(OUTPUT) TYPE(*CHAR) LEN(6) RSTD(*YES) +
VALUES(* *PRINT) DFT(*) +
PROMPT('Output')
QUAL1: QUAL TYPE(*NAME) LEN(10) DFT(PGMR)
QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) +
SPCVAL(*LIBL)</pre>
<p>The QUAL statements are used to define the qualified name that
the user can enter for the OUTQ parameter. If the user does not enter a name,
*LIBL/PGMR is used. The SPCVAL parameter is used because any library name
must follow the rules for a valid name (for example, begin with A through
Z), and the value *LIBL breaks these rules. The SPCVAL parameter specifies
that if *LIBL is entered, i5/OS™ is to ignore the name validation rules.</p>
<p>The
command processing program for the DSPOQ1 command is: </p>
<pre>PGM PARM(&amp;OUTQ &amp;OUTPUT)
DCL &amp;OUTQ TYPE(*CHAR) LEN(20)
DCL &amp;OBJNAM TYPE(*CHAR) LEN(10)
DCL &amp;LIB TYPE(*CHAR) LEN(10)
DCL &amp;OUTPUT TYPE(*CHAR) LEN(6)
CHGVAR &amp;OBJNAM %SUBSTRING(&amp;OUTQ 1 10)
CHGVAR &amp;LIB %SUBSTRING(&amp;OUTQ 11 10)
WRKOUTQ OUTQ(&amp;LIB/&amp;OBJNAM) OUTPUT(&amp;OUTPUT)
ENDPGM</pre>
<p>Because a qualified name is passed from a command as a 20-character
variable, the substring built-in function (%SUBSTRING or %SST) must be used
in this program to put the qualified name in the proper CL syntax.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="exdcc.htm" title="This contains examples of defining and creating commands.">Examples: Define and create commands</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../cl/crtcmd.htm">Create Command (CRTCMD) command</a></div>
</div>
</div>
</body>
</html>