HPlogo SORT-MERGE/XL General Users Guide: HP 3000 MPE/iX Computer Systems > Chapter 4 Using MERGE/XL Interactively

Merging Files Using Multiple Keys

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

You can combine files based on more than one key. The files must contain the same data format, and the key data items must start at the same character position (column) and be the same length.

To combine EMPLOYEE and NEWHIRES into a new file named COMPANY by last name, first name, and job title, enter the following sequence of commands:

     :MERGE  



     HP32214A.01.00  MERGE/3000 WED, JUN  3, 1987, 12:15 PM 

     © HEWLETT-PACKARD CO. 1986 



     >INPUT EMPLOYEE, NEWHIRES  

     >OUTPUT COMPANY  

     >KEY 1, 11; 12, 11; 23, 19  

     >END  

This would arrange the two CARLSON entries in their proper alphabetical order with regard to their first names. Only the two CARLSON entries are shown in the following example:

     :EDITOR  



     HP32201A.07.17 EDIT/3000 WED, JUN  3, 1987, 12:30 PM 

     © HEWLETT-PACKARD CO. 1985 

     /TEXT NEWHIRES  

     FILE UNNUMBERED 

     /LIST 5/6  

                     1         2         3         4 

            1234567890123456789012345678901234567890123456789 



     5      CARLSON    PETER      BUYER              8043 

     6      CARLSON    ROBERTA    TREASURER          3586 
Feedback to webmaster