|
|
The MERGE/XL subsystem merges information contained in records
from two or more files. The example files used in this manual were
created using EDIT/V, which is supplied as a subsystem of MPE XL
on the 900 Series HP 3000. SORT-MERGE/XL can also manipulate files
created with other editors such as Text and Document Processing/V (TDP/V).
Check with your System Manager to determine which editors are available
on your system.
To access EDIT/V, at the MPE XL colon prompt (:), enter:
:EDITOR
The EDIT/V banner appears, followed by the subsystem slash prompt (/):
HP32201A.07.17 EDIT/3000 WED, JUN 3, 1987, 11:20 AM
(C) HEWLETT-PACKARD CO. 1985
/
The following example shows how to create a file named NEWHIRES using
the EDIT/V SET command tab function. The tab locations you establish
can then be used to designate the location of key data items with
the >KEY command when merging files. Tabs automatically align
the data in the file for you.
After you access the EDIT/V subsystem, establish the tab character and the tabs
for the file to be created. To merge the new file NEWHIRES with the
existing file EMPLOYEE, the key data items must be located in the same
positions (columns) in both files. Therefore, set the tabs for the file
NEWHIRES the same as those established for the file EMPLOYEE
(12, 23, 42) in Chapter 3. The exclamation point (!) is used as the
tab character in this example.
/SET TABCHAR="!", TABS=(12, 23, 42)
To verify that the tab character and tabs are set correctly, enter:
/VERIFY TABCHAR, TABS
The system displays the message:
TAB CHARACTER = "!"
TABS = ( 12, 23, 42)
After establishing the tab character and tabs, create a new file using EDIT/V.
To do so, enter an A (for ADD) at the slash prompt
(/) and press the Return key. In response, a 1
followed by a blinking cursor appears on the terminal screen:
/A
1 _ (blinking cursor)
The 1 represents the first line in your file and indicates the editor
is ready for you to enter data. As each line becomes full, or when you press
the Return key, a new line number appears. The blinking cursor indicates
where you enter data.
For the purposes of this example, assume four new employees
were hired. To create a file containing data on these new employees
use the following format:
/A
1 CARLSON!PETER!BUYER!8043
2 ADAMS!JERROLD!INSPECTOR!8044
3 MATHEWS!EDDY!PLANNER!8045
4 CLARK!STEVE!ASSEMBLER!8043
5 //
Tell the system you are finished adding data by entering two slashes (//) as
the first two characters on a new line. The system responds by displaying three
dots and then the subsystem slash prompt:
...
/
At the slash prompt enter /LIST ALL to display the data aligned
according to the tabs you set.
|
NOTE: The examples in this chapter contain two extra lines of data
containing numbers (for example, 123456...5). These two lines are
included to show that the data is aligned in the columns established as tabs
which are then used to specify key data items with the >KEY
command. These two extra lines will not appear in your file.
|
/LIST ALL
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
The data is now aligned with the last names appearing in position
(column) 1 of the record, first names in position 12, job titles
in position 23, and employee numbers in position 42. This alignment
corresponds to the location of key data items in the file EMPLOYEE.
Keep (save) the file and give it the unique name NEWHIRES by entering
KEEP NEWHIRES, UNNUMBERED. To merge files using MERGE/XL it is
necessary to keep the files in an UNNUMBERED state.
UNNUMBERED does not refer to the line numbers that appear
on the screen. These continue to be displayed for your convenience
in editing your files. To keep the file, enter:
/KEEP NEWHIRES, UNNUMBERED
To ensure the file has been successfully created, exit EDIT/V by entering
E (for END) at the slash prompt (/). Then at the
MPE XL colon prompt (:), enter LISTF:
/E
END OF SUBSYSTEM
:LISTF
FILENAME
EMPLOYEE NEWHIRES
The file NEWHIRES has been created and is listed along with the
existing file EMPLOYEE. You can now add, modify, or delete information
in the file with EDIT/V, or sort the data so it can be merged with other files
containing similar information.
If you need additional information on creating, modifying, and keeping (saving)
files, refer to the EDIT/3000 Reference Manual.
|