HPlogo SORT-MERGE/XL General User's Guide > Chapter 3 Using SORT/XL Interactively

Creating an Editor File

MPE documents

Complete PDF
Table of Contents
Index
Glossary

The SORT/XL subsystem sorts information contained in records within a file. 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 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,  8:10 AM
  (C) HEWLETT-PACKARD CO. 1985
  /

The following example shows how to create a file named EMPLOYEE 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 sorting 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 file to be created. In this example the exclamation point (!) is used as the tab character and the tabs are set at 12, 23, and 42:

  /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 begin entering data. Enter the data in the following format:

  /A
    1     FISHER!TOM!SHIPPING CLERK!7309
    2     TAYLOR!HEATHER!SECRETARY!7272
    3     ANDERSON!MARY!ACCOUNTANT!6345
    4     LANGE!ROBERT!ENGINEER!3235
    5     ANDERSON!CHARLES!SALES REP!3456
    6     ANDERSON!CHARLES!PRESIDENT!0247
    7     ZIMMER!ANDREW!ENGINEER!5739
    8     SMITH!HOWARD!DESIGNER!6794
    9     CARLSON!ROBERTA!TREASURER!3586
   10     JOHNSON!FRANCES!RECEPTIONIST!7943
   11     //

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 using 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 for specifying 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      FISHER     TOM        SHIPPING CLERK     7309
    2      TAYLOR     HEATHER    SECRETARY          7272
    3      ANDERSON   MARY       ACCOUNTANT         6345
    4      LANGE      ROBERT     ENGINEER           3235
    5      ANDERSON   CHARLES    SALES REP          3456
    6      ANDERSON   CHARLES    PRESIDENT          0247
    7      ZIMMER     ANDREW     ENGINEER           5739
    8      SMITH      HOWARD     DESIGNER           6794
    9      CARLSON    ROBERTA    TREASURER          3586
   10      JOHNSON    FRANCES    RECEPTIONIST       7943

The data is now aligned with the last names beginning in position (column) 1 of the record, first names in position 12, job titles in position 23, and employee numbers in position 42.

Keep (save) the file and give it the unique name EMPLOYEE by entering KEEP EMPLOYEE, UNNUMBERED. To sort a file using SORT/XL it is necessary to keep the file in an UNNUMBERED state. UNNUMBERED does not refer to the line numbers that appear on the screen. These will continue to be displayed for your convenience in editing your files.

  /KEEP EMPLOYEE, 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

The file EMPLOYEE has been created. You can now add, modify, or delete information in the file with EDIT/V, or use the file with the SORT/XL subsystem to arrange the information in different orders. The remainder of this chapter illustrates how to manipulate this data in ways useful to a Personnel Department.

If you need additional information on creating, modifying, and keeping (saving) files refer to the EDIT/3000 Reference Manual.




Determining the File Format


Initiating a SORT/XL Interactive Session