Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
SORT-MERGE/XL Programmer's Guide: HP 3000 MPE/iX Computer Systems > Chapter 1 Introduction

Keys

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

When information is sorted or merged, keys determine the output record sequence. Keys are defined by their beginning position, length, key type, and ordering sequence (ascending or descending).

For example, to sort by last names with the record format below, you would specify a key that begins in column 1 and is 20 characters long, byte (ASCII) type, and ascending sequence.

   Last Name            First Name          Employee Number     Hire Date



   Jackson,             Jonathan            000006              06/06/87



   0         1         2         3         4         5         6

   123456789012345678901234567890123456789012345678901234567890123456789

You can specify the collating sequence, which is the order by which the keys are sorted. You can use a predefined order, like ASCII, EBCDIC, or a Native Language, or you can define your own collating sequence.

You may use multiple keys. The major key determines the part of the record examined first in the sort. As Figure 1-4 “Key Comparing Operations” shows if the major keys of two records are the same, the secondary keys determine the new sequence of the records. If two records have the same first keys and the same second keys, their third keys are compared to determine the sequence. If all the key fields in two or more records are identical, the output file preserves the order of the input records.

Figure 1-4 Key Comparing Operations

Key Comparing Operations

For more information about specifying keys, refer to Chapter 2. For more information about collating sequences, refer to Chapter 4.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.