ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/chkobj.htm

309 lines
14 KiB
HTML

<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Check Object (CHKOBJ)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="CHKOBJ.Top_Of_Page"></a>
<h2>Check Object (CHKOBJ)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>Yes
</td>
<td valign="top" align="right">
<a href="#CHKOBJ.PARAMETERS.TABLE">Parameters</a><br>
<a href="#CHKOBJ.COMMAND.EXAMPLES">Examples</a><br>
<a href="#CHKOBJ.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="CHKOBJ"></a>
<p>The Check Object (CHKOBJ) command checks object existence and verifies the user's authority for the object before trying to access it. If the object exists and the user has the proper authority for the object, no error messages are sent to the user. For verification, as many as ten specific authorities can be specified on the command.
</p>
<p>These checks are particularly useful before the user tries to access several objects at the same time. This command is also used to check the validity of object names contained in CL variables and to verify object authorizations under program control.
</p>
<p>When the command runs, the system searches for the specified object. If the object is found, the system verifies that the user is authorized to that object as specified for the <b>Authority (AUT)</b> parameter. If the object is not found or the user does not have the authorities specified for the AUT parameter, an error message is sent to the user.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHKOBJ.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="CHKOBJ.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#CHKOBJ.OBJ"><b>OBJ</b></a></td>
<td valign="top">Object</td>
<td valign="top"><i>Qualified object name</i></td>
<td valign="top" rowspan="3">Required, Positional 1</td>
</tr>
<tr>
<td valign="top">Qualifier 1: Object</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top"><a href="#CHKOBJ.OBJTYPE"><b>OBJTYPE</b></a></td>
<td valign="top">Object type</td>
<td valign="top">*ALRTBL, *AUTL, *BNDDIR, *CFGL, *CHTFMT, *CLD, *CLS, *CMD, *CNNL, *COSD, *CRG, *CRQD, *CSI, *CSPMAP, *CSPTBL, *CTLD, *DEVD, *DOC, *DTAARA, *DTADCT, *DTAQ, *EDTD, *EXITRG, *FCT, *FILE, *FLR, *FNTRSC, *FNTTBL, *FORMDF, *FTR, *GSS, *IGCDCT, *IGCSRT, *IGCTBL, *IMGCLG, *IPXD, *JOBD, *JOBQ, *JOBSCD, *JRN, *JRNRCV, *LIB, *LIND, *LOCALE, *MEDDFN, *MENU, *MGTCOL, *MODD, *MODULE, *MSGF, *MSGQ, *M36, *M36CFG, *NODGRP, *NODL, *NTBD, *NWID, *NWSCFG, *NWSD, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PRDDFN, *PRDLOD, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *RCT, *SBSD, *SCHIDX, *SPADCT, *SQLPKG, *SQLUDT, *SRVPGM, *SSND, *SVRSTG, *S36, *TBL, *TIMZON, *USRIDX, *USRPRF, *USRQ, *USRSPC, *VLDL, *WSCST</td>
<td valign="top">Required, Positional 2</td>
</tr>
<tr>
<td valign="top"><a href="#CHKOBJ.MBR"><b>MBR</b></a></td>
<td valign="top">Member, if data base file</td>
<td valign="top"><i>Name</i>, <b><u>*NONE</u></b>, *FIRST</td>
<td valign="top">Optional, Positional 3</td>
</tr>
<tr>
<td valign="top"><a href="#CHKOBJ.AUT"><b>AUT</b></a></td>
<td valign="top">Authority</td>
<td valign="top">Single values: <b><u>*NONE</u></b>, *ALL, *CHANGE, *USE, *EXCLUDE, *AUTLMGT<br>Other values (up to 10 repetitions): *OBJALTER, *OBJEXIST, *OBJMGT, *OBJOPR, *OBJREF, *ADD, *DLT, *EXECUTE, *READ, *UPD</td>
<td valign="top">Optional, Positional 4</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#CHKOBJ.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="CHKOBJ.OBJ"></a>
<h3>Object (OBJ)</h3>
<p>Specifies the object to be checked.
</p>
<p>This is a required parameter.
</p>
<p><b>Qualifier 1: Object</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the object to be checked.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the thread is searched. If no library is specified as the current library for the thread, the QGPL library is searched.
</dd>
</dl>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHKOBJ.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CHKOBJ.OBJTYPE"></a>
<h3>Object type (OBJTYPE)</h3>
<p>Specifies the object type of the object to be checked.
</p>
<p>To see a complete list of object types when prompting this command, position the cursor on the field for this parameter and press F4 (Prompt). For a description of the object types, see "Object types" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
<p>This is a required parameter.
</p>
<dl>
<dt><b><i>object-type</i></b></dt>
<dd>Specify the type of object to be checked.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHKOBJ.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CHKOBJ.MBR"></a>
<h3>Member, if data base file (MBR)</h3>
<p>Specifies the file member, if a member of a database file is to be checked.
</p>
<p>
<b>Note: </b>The logical file member, and the physical file members on which it is based are checked.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>Database file members are not checked, but the existence and (optionally) the authority for the file are checked. For all other object types (including device files), *NONE is the only valid value for this parameter.
</dd>
</dl>
<dl>
<dt><b>*FIRST</b></dt>
<dd>The first member of the specified file is used.
</dd>
</dl>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify a physical or logical file member to be checked. Values specified for the <b>Object (OBJ)</b> and <b>Object type (OBJTYPE)</b> parameters must identify a database file and the member specified must be a member of the database file specified for the OBJ parameter.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHKOBJ.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CHKOBJ.AUT"></a>
<h3>Authority (AUT)</h3>
<p>Specifies the authority to be checked or specifies an authorization list to be checked. This parameter can be specified as a single value or as a list of one or more elements.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>Authority is not checked.
</dd>
<dt><b>*ALL</b></dt>
<dd>All (*ALL) authority provides the authority needed to perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) authority. You can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. You also can change ownership of the object.
</dd>
<dt><b>*CHANGE</b></dt>
<dd>Change (*CHANGE) authority provides the authority needed to perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. You can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, you cannot add, change, or remove users.
</dd>
<dt><b>*EXCLUDE</b></dt>
<dd>Exclude authority prevents access to the object.
</dd>
<dt><b>*AUTLMGT</b></dt>
<dd>Authorization list management (*AUTLMGT) authority provides the authority needed to add user names to the authorization list, change users' authorities on the authorization list, to remove user names from the authorization list, to rename an authorization list, or to create a duplicate authorization list.
<p>
<b>Note: </b>You must use the object type of *AUTL when you specify *AUTLMGT authority.
</p>
</dd>
</dl>
<p><b>Other values (up to 10 repetitions)</b>
</p>
<dl>
<dt><b>*OBJALTER</b></dt>
<dd>Object alter (*OBJALTER) authority provides the authority needed to alter the attributes of an object. If the user has this authority for a database file, the user can add and remove triggers, add and remove referential and unique constraints, and change the attributes of the database file. If the user has this authority for a SQL package, the user can change the attributes of the SQL package. This authority is currently only used for database files and SQL packages.
</dd>
<dt><b>*OBJEXIST</b></dt>
<dd>Object existence (*OBJEXIST) authority provides the authority needed to control object ownership and existence. These authorities are necessary for a user who wants to delete, free storage, save, restore, or transfer ownership of an object. (If a you have save system (*SAVSYS) special authority, you do not need *OBJEXIST authority.)
</dd>
<dt><b>*OBJMGT</b></dt>
<dd>Object management (*OBJMGT) authority provides the authority needed to specify the security for the object, move or rename the object, and add members to database files.
</dd>
<dt><b>*OBJOPR</b></dt>
<dd>Object operational (*OBJOPR) authority provides the authority needed to look at the description of an object and to use the object as determined by the user's data authority for the object. *OBJOPR authority has no data authorities associated with it.
</dd>
<dt><b>*OBJREF</b></dt>
<dd>Object reference (*OBJREF) authority provides the authority needed to reference an object from another object such that operations on that object may be restricted by the other object. If the user has this authority for a physical file, the user can add a referential constraint in which the physical file is the parent. This authority is currently only used for database files.
</dd>
<dt><b>*ADD</b></dt>
<dd>Add authority (*ADD) provides the authority needed to add entries to an object (for example, job entries to a queue or records to a file).
</dd>
<dt><b>*DLT</b></dt>
<dd>Delete (*DLT) authority provides authority needed to remove entries from an object.
</dd>
<dt><b>*EXECUTE</b></dt>
<dd>Execute (*EXECUTE) authority provides the authority needed to run a program or locate an object in a library or directory.
</dd>
<dt><b>*READ</b></dt>
<dd>Read (*READ) authority provides the authority needed to show the contents of an object.
</dd>
<dt><b>*UPD</b></dt>
<dd>Update (*UPDATE) authority provides authority needed to change the entries in an object.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHKOBJ.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CHKOBJ.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Checking for Existence of a Program</b>
</p>
<p>
<pre>
CHKOBJ OBJ(LIB1/PROG1) OBJTYPE(*PGM)
</pre>
</p>
<p>This command checks for the existence of a program named PROG1 in library LIB1. Your authorities to PROG1 are not checked.
</p>
<p><b>Example 2: Checking for User's Authority to File</b>
</p>
<p>
<pre>
CHKOBJ OBJ(SOURCE1) OBJTYPE(*FILE) MBR(MBR3) AUT(*CHANGE)
</pre>
</p>
<p>This command checks for the existence of file SOURCE1 and for the existence of member MBR3 in file SOURCE1. It also checks to see if you have change (*CHANGE) authority to file SOURCE1.
</p>
<p><b>Example 3: Checking for Your Authority to Program</b>
</p>
<p>
<pre>
CHKOBJ OBJ(LIB1/PROG1) OBJTYPE(*PGM) AUT(*CHANGE)
</pre>
</p>
<p>This command checks the existence of program PROG1 in library LIB1. It also checks to see if you have change (*CHANGE) authority to PROG1.
</p>
<p><b>Example 4: Checking User's Authority to a Logical File Member</b>
</p>
<p>
<pre>
CHKOBJ OBJ(FILEA) OBJTYPE(*FILE) MBR(MBR1) AUT(*USE)
</pre>
</p>
<p>This command checks your authority to use logical file member MBR1, and each physical file member on which MBR1 is based.
</p>
<p><b>Example 5: Checking User's Add and Delete Authority</b>
</p>
<p>
<pre>
CHKOBJ OBJ(FILEA) OBJTYPE(*FILE) MBR(MBR1) AUT(*ADD *DLT)
MONMSG MSGID(CPF9802) EXEC(GOTO ERROR1)
</pre>
</p>
<p>These two commands (CHKOBJ and MONMSG) are used to verify that you have both add (*ADD) and delete (*DLT) authorities for logical file FILEA and each of the physical file members on which the logical file member MBR1 in the logical file FILEA is based. If you do not have data authority for FILEA and each of the physical file members on which FILEA is based, escape message CPF9802 is sent to the program, and control in the program is passed to the command that has the label ERROR1.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHKOBJ.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CHKOBJ.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPF9801</b></dt>
<dd>Object &amp;2 in library &amp;3 not found.
</dd>
<dt><b>CPF9802</b></dt>
<dd>Not authorized to object &amp;2 in &amp;3.
</dd>
<dt><b>CPF9810</b></dt>
<dd>Library &amp;1 not found.
</dd>
<dt><b>CPF9815</b></dt>
<dd>Member &amp;5 file &amp;2 in library &amp;3 not found.
</dd>
<dt><b>CPF9820</b></dt>
<dd>Not authorized to use library &amp;1.
</dd>
<dt><b>CPF9830</b></dt>
<dd>Cannot assign library &amp;1.
</dd>
<dt><b>CPF9899</b></dt>
<dd>Error occurred during processing of command.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHKOBJ.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>