229 lines
12 KiB
HTML
229 lines
12 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="concept" />
|
||
|
<meta name="DC.Title" content="Arrange key fields using the SRTSEQ parameter" />
|
||
|
<meta name="abstract" content="You can arrange key fields containing character data according to several sorting sequences available with the SRTSEQ parameter." />
|
||
|
<meta name="description" content="You can arrange key fields containing character data according to several sorting sequences available with the SRTSEQ parameter." />
|
||
|
<meta name="DC.subject" content="key field, arranging, changing order with SRTSEQ, changing order with SRTSEQ, field, arranging keys with SRTSEQ, alternative collating sequence, arranging key fields with SRTSEQ" />
|
||
|
<meta name="keywords" content="key field, arranging, changing order with SRTSEQ, changing order with SRTSEQ, field, arranging keys with SRTSEQ, alternative collating sequence, arranging key fields with SRTSEQ" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafoksapa.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="rbafoakfssq" />
|
||
|
<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>Arrange key fields using the SRTSEQ parameter</title>
|
||
|
</head>
|
||
|
<body id="rbafoakfssq"><a name="rbafoakfssq"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Arrange key fields using the SRTSEQ parameter</h1>
|
||
|
<div><p>You can arrange key fields containing character data according
|
||
|
to several sorting sequences available with the SRTSEQ parameter.</p>
|
||
|
<p>Consider the following records.</p>
|
||
|
|
||
|
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
|
||
|
<table cellpadding="4" cellspacing="0" summary="" width="100%" border="0"><thead align="left"><tr><th align="left" valign="top" id="d0e41">Record</th>
|
||
|
<th align="left" valign="top" id="d0e43">Empname</th>
|
||
|
<th align="left" valign="top" id="d0e45">Deptnbr</th>
|
||
|
<th align="left" valign="top" id="d0e47">Empnbr</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td align="left" valign="top" headers="d0e41 ">1</td>
|
||
|
<td align="left" valign="top" headers="d0e43 ">Jones, Marilyn</td>
|
||
|
<td align="left" valign="top" headers="d0e45 ">45</td>
|
||
|
<td align="left" valign="top" headers="d0e47 ">23318</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e41 ">2</td>
|
||
|
<td align="left" valign="top" headers="d0e43 ">Smith, Ron</td>
|
||
|
<td align="left" valign="top" headers="d0e45 ">45</td>
|
||
|
<td align="left" valign="top" headers="d0e47 ">41321</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e41 ">3</td>
|
||
|
<td align="left" valign="top" headers="d0e43 ">JOHNSON, JOHN</td>
|
||
|
<td align="left" valign="top" headers="d0e45 ">53</td>
|
||
|
<td align="left" valign="top" headers="d0e47 ">41322</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e41 ">4</td>
|
||
|
<td align="left" valign="top" headers="d0e43 ">Smith, ROBERT</td>
|
||
|
<td align="left" valign="top" headers="d0e45 ">27</td>
|
||
|
<td align="left" valign="top" headers="d0e47 ">56218</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e41 ">5</td>
|
||
|
<td align="left" valign="top" headers="d0e43 ">JONES, MARTIN</td>
|
||
|
<td align="left" valign="top" headers="d0e45 ">53</td>
|
||
|
<td align="left" valign="top" headers="d0e47 ">62213</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e41 ">6</td>
|
||
|
<td align="left" valign="top" headers="d0e43 ">Jones, Martin</td>
|
||
|
<td align="left" valign="top" headers="d0e45 ">08</td>
|
||
|
<td align="left" valign="top" headers="d0e47 ">29231</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</td></tr></table>
|
||
|
<p>If the <em> Empname</em> field is the key field and is a character field,
|
||
|
the *HEX sequence (the EBCDIC sequence) arranges the records as follows.</p>
|
||
|
|
||
|
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
|
||
|
<table cellpadding="4" cellspacing="0" summary="" width="100%" border="0"><thead align="left"><tr><th align="left" valign="top" id="d0e117">Record</th>
|
||
|
<th align="left" valign="top" id="d0e119">Empname</th>
|
||
|
<th align="left" valign="top" id="d0e121">Deptnbr</th>
|
||
|
<th align="left" valign="top" id="d0e123">Empnbr</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td align="left" valign="top" headers="d0e117 ">1</td>
|
||
|
<td align="left" valign="top" headers="d0e119 ">Jones, Marilyn</td>
|
||
|
<td align="left" valign="top" headers="d0e121 ">45</td>
|
||
|
<td align="left" valign="top" headers="d0e123 ">23318</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e117 ">6</td>
|
||
|
<td align="left" valign="top" headers="d0e119 ">Jones, Martin</td>
|
||
|
<td align="left" valign="top" headers="d0e121 ">08</td>
|
||
|
<td align="left" valign="top" headers="d0e123 ">29231</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e117 ">3</td>
|
||
|
<td align="left" valign="top" headers="d0e119 ">JOHNSON, JOHN</td>
|
||
|
<td align="left" valign="top" headers="d0e121 ">53</td>
|
||
|
<td align="left" valign="top" headers="d0e123 ">41322</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e117 ">5</td>
|
||
|
<td align="left" valign="top" headers="d0e119 ">JONES, MARTIN</td>
|
||
|
<td align="left" valign="top" headers="d0e121 ">53</td>
|
||
|
<td align="left" valign="top" headers="d0e123 ">62213</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e117 ">2</td>
|
||
|
<td align="left" valign="top" headers="d0e119 ">Smith, Ron</td>
|
||
|
<td align="left" valign="top" headers="d0e121 ">45</td>
|
||
|
<td align="left" valign="top" headers="d0e123 ">41321</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e117 ">4</td>
|
||
|
<td align="left" valign="top" headers="d0e119 ">Smith, ROBERT</td>
|
||
|
<td align="left" valign="top" headers="d0e121 ">27</td>
|
||
|
<td align="left" valign="top" headers="d0e123 ">56218</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</td></tr></table>
|
||
|
<p>Notice that with the *HEX sequence, all lowercase characters are sorted
|
||
|
before the uppercase characters. Thus, <samp class="codeph">Smith, Ron</samp> sorts before <samp class="codeph">Smith,
|
||
|
ROBERT,</samp> and <samp class="codeph">JOHNSON, JOHN</samp> sorts between the lowercase
|
||
|
and uppercase Jones. You can use the *LANGIDSHR sort sequence to sort records
|
||
|
when the records were entered using a mixture of uppercase and lowercase.
|
||
|
The *LANGIDSHR sequence, which uses the same collating weight for lowercase
|
||
|
and uppercase characters, results in the following record.</p>
|
||
|
|
||
|
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
|
||
|
<table cellpadding="4" cellspacing="0" summary="" width="100%" border="0"><thead align="left"><tr><th align="left" valign="top" id="d0e199">Record</th>
|
||
|
<th align="left" valign="top" id="d0e201">Empname</th>
|
||
|
<th align="left" valign="top" id="d0e203">Deptnbr</th>
|
||
|
<th align="left" valign="top" id="d0e205">Empnbr</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td align="left" valign="top" headers="d0e199 ">3</td>
|
||
|
<td align="left" valign="top" headers="d0e201 ">JOHNSON, JOHN</td>
|
||
|
<td align="left" valign="top" headers="d0e203 ">53</td>
|
||
|
<td align="left" valign="top" headers="d0e205 ">41322</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e199 ">1</td>
|
||
|
<td align="left" valign="top" headers="d0e201 ">Jones, Marilyn</td>
|
||
|
<td align="left" valign="top" headers="d0e203 ">45</td>
|
||
|
<td align="left" valign="top" headers="d0e205 ">23318</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e199 ">5</td>
|
||
|
<td align="left" valign="top" headers="d0e201 ">JONES, MARTIN</td>
|
||
|
<td align="left" valign="top" headers="d0e203 ">53</td>
|
||
|
<td align="left" valign="top" headers="d0e205 ">62213</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e199 ">6</td>
|
||
|
<td align="left" valign="top" headers="d0e201 ">Jones, Martin</td>
|
||
|
<td align="left" valign="top" headers="d0e203 ">08</td>
|
||
|
<td align="left" valign="top" headers="d0e205 ">29231</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e199 ">4</td>
|
||
|
<td align="left" valign="top" headers="d0e201 ">Smith, ROBERT</td>
|
||
|
<td align="left" valign="top" headers="d0e203 ">27</td>
|
||
|
<td align="left" valign="top" headers="d0e205 ">56218</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e199 ">2</td>
|
||
|
<td align="left" valign="top" headers="d0e201 ">Smith, Ron</td>
|
||
|
<td align="left" valign="top" headers="d0e203 ">45</td>
|
||
|
<td align="left" valign="top" headers="d0e205 ">41321</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</td></tr></table>
|
||
|
<p>Notice that with the *LANGIDSHR sequence, the lowercase and uppercase characters
|
||
|
are treated as equal. Thus, <samp class="codeph">JONES, MARTIN</samp> and <samp class="codeph">Jones,
|
||
|
Martin</samp> are equal and sort in the same sequence they have in the base
|
||
|
file. While this is not incorrect, it would look better in a report if all
|
||
|
the lowercase Jones preceded the uppercase JONES. You can use the *LANGIDUNQ
|
||
|
sort sequence to sort the records when the records were entered using an inconsistent
|
||
|
uppercase and lowercase. The *LANGIDUNQ sequence, which uses different but
|
||
|
sequential collating weights for lowercase and uppercase characters, results
|
||
|
in the following record.</p>
|
||
|
|
||
|
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
|
||
|
<table cellpadding="4" cellspacing="0" summary="" width="100%" border="0"><thead align="left"><tr><th align="left" valign="top" id="d0e278">Record</th>
|
||
|
<th align="left" valign="top" id="d0e280">Empname</th>
|
||
|
<th align="left" valign="top" id="d0e282">Deptnbr</th>
|
||
|
<th align="left" valign="top" id="d0e284">Empnbr</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td align="left" valign="top" headers="d0e278 ">3</td>
|
||
|
<td align="left" valign="top" headers="d0e280 ">JOHNSON, JOHN</td>
|
||
|
<td align="left" valign="top" headers="d0e282 ">53</td>
|
||
|
<td align="left" valign="top" headers="d0e284 ">41322</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e278 ">1</td>
|
||
|
<td align="left" valign="top" headers="d0e280 ">Jones, Marilyn</td>
|
||
|
<td align="left" valign="top" headers="d0e282 ">45</td>
|
||
|
<td align="left" valign="top" headers="d0e284 ">23318</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e278 ">6</td>
|
||
|
<td align="left" valign="top" headers="d0e280 ">Jones, Martin</td>
|
||
|
<td align="left" valign="top" headers="d0e282 ">08</td>
|
||
|
<td align="left" valign="top" headers="d0e284 ">29231</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e278 ">5</td>
|
||
|
<td align="left" valign="top" headers="d0e280 ">JONES, MARTIN</td>
|
||
|
<td align="left" valign="top" headers="d0e282 ">53</td>
|
||
|
<td align="left" valign="top" headers="d0e284 ">62213</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e278 ">4</td>
|
||
|
<td align="left" valign="top" headers="d0e280 ">Smith, ROBERT</td>
|
||
|
<td align="left" valign="top" headers="d0e282 ">27</td>
|
||
|
<td align="left" valign="top" headers="d0e284 ">56218</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" headers="d0e278 ">2</td>
|
||
|
<td align="left" valign="top" headers="d0e280 ">Smith, Ron</td>
|
||
|
<td align="left" valign="top" headers="d0e282 ">45</td>
|
||
|
<td align="left" valign="top" headers="d0e284 ">41321</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</td></tr></table>
|
||
|
<p>The *LANGIDSHR and *LANGIDUNQ sort sequences exist for every language supported
|
||
|
in your system. The LANGID parameter determines which *LANGIDSHR
|
||
|
or *LANGIDUNQ sort sequence to use. Use the SRTSEQ parameter to specify the
|
||
|
sort sequence and the LANGID parameter to specify the language.</p>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafoksapa.htm" title="A keyed sequence access path for database files is based on the contents of the key fields as defined in data description specifications (DDS). This topic describes how the key fields are arranged for the file.">Use a keyed sequence access path for database files</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|