SORT-MERGE/XL General User's Guide (32650-90883)

38 Chapter3
Using SORT/XL Interactively
Sorting and Merging Multiple Files
Sorting and Merging Multiple Files
SORT-MERGE/XL allows you to sort and merge multiple files in a single operation. This is
done by placing the names of the files to be sorted and then merged within parentheses
when entering the >INPUT command. Below, the files EMPLOYEE (shown in the previous
example) and NEWHIRES (shown below) are sorted by job title and then merged into the file
COMPANY in a single operation. The file NEWHIRES contains the following four records:
1 2 3 4
123456789012345678901234567890123456789012345
1 CARLSON PETER BUYER 8043
2 ADAMS JERROLD INSPECTOR 8044
3 MATHEWS EDDY PLANNER 8045
4 CLARK STEVE ASSEMBLER 8046
To sort, and then merge, these two files in a single operation, enter the following
commands:
:SORT
HP32214A.01.00 SORT/3000 WED, JUN 3, 1987, 9:11 AM
© HEWLETT-PACKARD CO. 1986
>INPUT (EMPLOYEE, NEWHIRES)
>OUTPUT COMPANY
>KEY 23, 19
>END
>PURGE OLDOUTPUT FILE COMPANY.GROUP.ACCOUNT? Y
<<The SORT Statistics Appear Here>>
:EDITOR
HP32201A.07.17 EDIT/3000 WED, JUN 3, 1987, 9:12 AM
© HEWLETT-PACKARD CO. 1985
/TEXT COMPANY
FILE UNNUMBERED
/LIST ALL
1 2 3 4
123456789012345678901234567890123456789012345
1 ANDERSON MARY ACCOUNTANT 6345
2 CLARK STEVE ASSEMBLER 8046
3 CARLSON PETER BUYER 8043
4 SMITH HOWARD DESIGNER 6794
5 LANGE ROBERT ENGINEER 3235