ibm-information-center/dist/eclipse/plugins/i5OS.ic.apiref_5.4.0.1/listDBFileMembers.htm

83 lines
5.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: List database file members with a CL program" />
<meta name="abstract" content="This program generates a list of members that start with M, and places the list into a user space named example in Library QGPL." />
<meta name="description" content="This program generates a list of members that start with M, and places the list into a user space named example in Library QGPL." />
<meta name="DC.Relation" scheme="URI" content="listUserSpace.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="listDBFileMembers" />
<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: List database file members with a CL program</title>
</head>
<body id="listDBFileMembers"><a name="listDBFileMembers"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: List database file members with a CL program</h1>
<div><p>This program generates a list of members that start with M, and
places the list into a user space named example in Library QGPL.</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>To generate a list of members that start with <strong>M</strong> and
are in file QCLSRC in library QGPL, specify the following:</p>
<pre>
/****************************************************************/
/* */
/* PROGRAM: LSTMBR2 */
/* */
/* LANGUAGE: CL */
/* */
/* DESCRIPTION: THIS PROGRAM WILL GENERATE A LIST OF MEMBERS, */
/* THAT START WITH M, AND PLACE THE LIST INTO A */
/* USER SPACE NAMED EXAMPLE IN LIBRARY QGPL. */
/* */
/* APIs USED: QUSCRTUS, QUSLMBR */
/* */
/****************************************************************/
PGM
/****************************************************************/
/* CREATE A *USRSPC OBJECT TO PUT THE LIST INFORMATION INTO. */
/****************************************************************/
CALL QUSCRTUS +
('EXAMPLE QGPL ' /* USER SPACE NAME AND LIB */ +
'EXAMPLE ' /* EXTENDED ATTRIBUTE */ +
X'0000012C' /* SIZE OF USER SPACE */ +
' ' /* INITIALIZATION VALUE */ +
'*CHANGE ' /* AUTHORITY */ +
'USER SPACE FOR QUSLMBR EXAMPLE ')
/****************************************************************/
/* LIST THE MEMBERS BEGINNING WITH "M" OF A FILE CALLED */
/* QCLSRC FROM LIBRARY QGPL USING THE OUTPUT FORMAT MBRL0200. */
/* OVERRIDE PROCESSING SHOULD OCCUR. */
/****************************************************************/
CALL QUSLMBR +
('EXAMPLE QGPL ' /* USER SPACE NAME AND LIB */ +
'MBRL0200' /* FORMAT NAME */ +
'QCLSRC QGPL ' /* DATABASE FILE AND LIBRARY */ +
'M* ' /* MEMBER NAME */ +
'1') /* OVERRIDE PROCESSING */
ENDPGM
</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="listUserSpace.htm" title="The list APIs require a user space for returning information.">User spaces for list APIs</a></div>
</div>
</div>
</body>
</html>