SORT-MERGE/XL General User's Guide (32650-90883)
Chapter 3 39
Using SORT/XL Interactively
Saving Selected Key Data Only
6 ZIMMER ANDREW ENGINEER 5739
7 ADAMS JERROLD INSPECTOR 8044
8 MATHEWS EDDY PLANNER 8045
9 ANDERSON CHARLES PRESIDENT 0247
10 JOHNSON FRANCES RECEPTIONIST 7943
11 ANDERSON CHARLES SALES REP 3456
12 TAYLOR HEATHER SECRETARY 7272
13 FISHER TOM SHIPPING CLERK 7309
14 CARLSON ROBERTA TREASURER 3586
The two files (EMPLOYEE and NEWHIRES) are sorted and merged in the same SORT/XL
operation and the output file COMPANY is created.
Saving Selected Key Data Only
It is possible to create an output file containing only those key data items you need rather
than the entire file. To do this you use the KEY parameter of the >OUTPUT command.
For example, if you want a listing of all employees, showing their last names only, enter
the following sequence of commands:
:SORT
HP32214A.01.00 SORT/3000 WED, JUN 3, 1987, 9:13 AM
© HEWLETT-PACKARD CO. 1986
>INPUT EMPLOYEE
>OUTPUT COMPANY, KEY
>KEY 1, 11
>END
<<The SORT Statistics Appear Here>>
END OF PROGRAM
:EDITOR
HP32201A.07.17 EDIT/3000 WED, JUN 3, 1987, 9:14 AM
© HEWLETT-PACKARD CO. 1985
/TEXT COMPANY
FILE UNNUMBERED
/LIST ALL
12345678901
1 ANDERSON
2 ANDERSON
3 ANDERSON