HPlogo Task Reference: HP 3000 Series 9X8LX Computer Systems > Chapter 2 Performing Tasks Using MPE/iX Commands

Creating and Editing Files

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

NOTE: The MPE/iX operating system has been enhanced as of Release 4.5 and 5.0 to include additional features that include POSIX compatibility and the hierarchical file system. The hierarchical file system is tree structured and can contain files at many different levels. This organization provides a special kind of file called a directory. Instead of holding data, directories contain lists of files and pointers to those files. For more information on POSIX and the hierarchical file system, refer to the book, New Features of MPE/iX: Using the Hierarchical File System (32650-90351), included in this documentation set. This book includes an overview of the following enhancements of MPE/iX as of Release 4.5 and 5.0:
  • Open systems environment

  • Hierarchical file system (HFS)

  • Expanded file naming syntax

  • New and enhanced commands and utilities

  • MPE/iX Shell and Utilities

  • MPE/iX Developer's Kit

The text editor EDIT/3000 is a Hewlett-Packard subsystem that comes with your HP 3000 system. You can create and edit files using EDIT/3000 or another word processing program. If you are using another program, refer to its instructions to create and modify files. The following task descriptions provide instructions for working within EDIT/3000.

To start the editor

To start the editor, do the following:

  • Type the command EDITOR at the system prompt, and press Return.

    A slash prompt (/) signifies that you are in the EDIT/3000 program.

       :EDITOR Return
    
       /
    

To add text to a file

To create a file using EDIT/3000, specify ADD to begin the file and type lines of text.

  1. At the editor's prompt (/), enter A or ADD.

    When line number 1 displays on the screen, the program is waiting for text for line 1 of the file.

       /ADD Return
    
           1        _
    
  2. Enter the text for the file beginning at line 1. Enter no more than 72 characters on a line.

  3. Press Return to continue on the next line. EDIT/3000 does not automatically wrap text to the next line. You must enter Return to start another line.

  4. When you have finished entering text, press Return to give you a new line.

  5. Enter // Return to signify the end of adding text.

To save a file

When you type the text into a file, it exists only in the editor's workspace. To keep your text permanently, you must save it in a file by using the EDIT/3000's KEEP command.

  1. To save the file, at the editor's prompt (/), enter K or KEEP followed by a file name.

    Select a name for the file that fits the following restrictions.

    • Use no more than eight characters.

    • Use an alphabetic character for the first character.

    • Do not use special characters (such as $, @, &, or *) in the name.

    • Do not use a slash (/) in a file name. This character has a special function in file names. If used incorrectly, you might have difficulty accessing the file later.

    For example, if you want to save the file under the name LETTER1, you would type the following.

       /KEEP LETTER1 Return
    

    If the name that you selected is already in use, you are prompted by the program to overwrite the existing file. Again, using the example of LETTER1, the following prompt would appear on the terminal screen:

       LETTER1 ALREADY EXISTS - RESPOND YES TO PURGE OLD AND KEEP NEW
    
    
    
       PURGE OLD?_
    
  2. If this message appears on the screen, do one of the following:

    • Enter Y to overwrite the existing file.

    • Enter N to end your request. Enter K or KEEP again, using a unique name for the file.

To end the editor

To leave the editor program, use the editor's END, or E, command. This command is typed at the editor's prompt.

  1. Enter END or E.

  2. Press Return.

The message END OF SUBSYSTEM appears on the screen, and you are returned to the system prompt.

Your screen should look like this:

   /END

   END OF SUBSYSTEM

   :_

Editing an EDIT/3000 file

Retrieving a file, adding and deleting lines of text, and modifying words in a text line are described in this section.

To retrieve an existing file

The EDIT/3000 command TEXT, or T, lets you retrieve a file for viewing, printing, or editing. This command brings your file into the EDIT/3000 workspace.

  1. At the editor's prompt, type either TEXT or T followed by the file name that you want to retrieve.

  2. Press Return.

The following example uses the file name MYFILE:

   /TEXT MYFILE Return

If your file is extremely large, it may take several seconds before you again see the editor's prompt (/).

To list a file's contents in the editor

The EDIT/3000 command LIST allows you to view all or any portion of your text file. The tasks described here assume that a file is already in the EDIT/3000 workspace.

  1. From the editor's prompt, enter LIST ALL to display all of the contents of a file.

  2. Press Return.

You can display portions of a file by using special listing commands. For example:

  • To display the first line of the file, use the keyword FIRST:

       /LIST FIRST Return
    
  • To display the first through the twentieth lines of the file, use the keyword FIRST as the beginning of a range and a line number as the end of the range:

       /LIST FIRST/20 Return
    

    Note that the screen can display about twenty lines of a file at a time without scrolling off the screen. Specify a range of twenty or fewer lines so that it will fit the screen.

  • To display a segment of a file, specify a range of line numbers, such as lines 10 through 17:

       /LIST 10/17 Return
    
  • To display only the last line of the file, specify LAST with no line numbers:

       /LIST LAST Return
    
  • To display from a certain line number to the end of the file, use the keyword LAST and a line number:

       /LIST 327/LAST Return
    

To add a line of text

To add a line of text to an existing file, use the editor's ADD, or A, command. A file must be retrieved into the editor's workspace before issuing this command. For example:

  • Enter A or ADD to add text to the end of the file.

       /ADD Return
    
            15
    
  • Enter A or ADD and a line number to add text after the line specified. (Note that the additional line numbers are added as decimals, in this example 32.1, if all whole numbers are in use.)

       /A 32 Return
    
           32.1_
    
  • Enter A or ADD and a decimal number less than 1 to add text to the beginning of the file.

       /ADD 0.5 Return
    
            0.5_

To erase a line of text

To erase a line of text, use the editor's DELETE, or D, command. Type DELETE along with the line number that you wish to erase. The following procedures assume that a file is already in the EDIT/3000 workspace.

  1. From the editor's prompt, type DELETE followed by a line number.

  2. Press Return.

The following example deletes line 15 of the text. Note that the line of text displays on the screen as it is being erased.

   /DELETE 15

       15    wonderful calicos from the early 19th century were used

To erase a range of lines

To delete a series of consecutive lines of text, use the DELETE command and specify the range of lines that you want to erase. The line range is designated by a start number and an end number, separated by a /. For example, 24/85 will erase lines 24 through 85.

  1. Type DELETE, and provide a line range.

  2. Press Return.

In the following example, lines 5 through 7 of the text are deleted. Note that the lines of text appear on the screen as they are erased:

   /DELETE 5/7

       5 The dominant color was blue, symbolizing honor and

       6 tranquility.  Borders were done in a different 

       7 complementary color.

To change or modify a line of text

To change or modify lines of text, use the MODIFY, or M, command and the R, I, or D subcommands.

The following tasks assume that a file is already in the EDIT/3000 workspace.

  1. At the editor's prompt, enter M, or MODIFY, followed by a single line number or a range of line numbers to change text on certain lines. The line or first line of the range is displayed on the screen.

  2. Use the spacebar to move the cursor so that it is under the character or beginning of the phrase that needs to be changed. Use one of the following methods to change the text:

    • To replace text, type an R followed by the new text. The new text overwrites the existing text. If two characters are entered, two characters of the original phrase are overwritten.

         1 Here is a line with a mistar.
      
                                      Rke. Return
      
         1 Here is a line with a mistake.
      
    • To insert text, type an I (for insert) followed by the new text.

         1 Here is a line with a mistake.
      
                              iout Return
      
         1 Here is a line without a mistake.
      
    • To delete single characters that are next to one another, type D (for delete) beneath each character to be deleted:

         1 Here is a line without a mistake.
      
                              ddd Return
      
         1 Here is a line with a mistake.
      
    • To delete a section of text in the middle of a line, type a D under the first letter to delete and another D under the last letter to delete.

         1 Here is a line with a mistake.
      
                     d          d Return
      
         1 Here is a mistake.
      

To renumber lines in a file

The line numbering of the file can become complicated if several lines have been added, deleted, and modified. To renumber your file from the first line to the last using only whole numbers, use the EDIT/3000 GATHER ALL command:

  1. From the command mode of the editor, enter GATHER ALL, and press Return.

       /GATHER ALL Return
    
  2. Use the LIST ALL command to view your file.

       /LIST ALL Return
    

To print your EDIT/3000 file to a printer

You can print the contents of a file by directing the output of the LIST command to the printer. To do this, include the OFFLINE parameter.

Note that the LIST command prints the contents of the file as it would appear in a listing on the screen. It does not format the text as word processors often do.

  • To print the entire file, use the ALL parameter.

       /LIST ALL, OFFLINE Return
    

    The following message appears:

       ***OFF LINE LISTING BEGUN.***
    
  • To print selected lines of the file, enter the range of line numbers desired:

       /LIST 1/10, OFFLINE Return
    
  • To print only the end of a file, specify a range beginning with a line number and ending with the parameter LAST, or specify the beginning of the range as LAST minus a number of lines and the end of the range as the parameter LAST:

       /LIST 170/LAST, OFFLINE Return
    

    or

       /LIST LAST-20/LAST, OFFLINE Return
    

To create command files

If there are commands that you use frequently, you may want to create a command file. At their simplest, command files can shorten or abbreviate what you type at the system prompt.

Creating a command file

Command files can contain MPE/iX commands, program names, and or other command file names. To create a command file, perform the following tasks:

  1. Get into a text editor.

  2. Enter each command that you want to execute on a separate text line.

  3. Save the file under an abbreviated name, and exit the editor.

The following example shows the text of a command file created in the EDIT/3000 text editor. This command file executes the SHOWTIME command when you type ST at the system prompt.

   :EDITOR Return

   /ADD Return

   1  SHOWTIME Return

   2  //

   /KEEP ST Return

   /END Return

   END OF SUBSYSTEM

   :_

The following example creates a command file that executes the EDIT/3000 program when E is typed in at the system prompt:

   :EDITOR Return

   /ADD Return

   1  EDITOR Return

   2  //

   /KEEP E

   /END

   END OF SUBSYSTEM

   :_

The following example creates a command file in EDIT/3000 that executes two command files, ST and E, when SE is typed in at the system prompt:

   :EDITOR Return

   /ADD Return

   1  ST Return

   2  E Return

   3  // Return

   /KEEP SE Return

   /END Return

   END OF SUBSYSTEM

   :_

Any problems?

  • Did the following message appear on the screen when you tried to retrieve a file in the EDIT/3000 program?

       +-F-I-L-E---I-N-F-O-R-M-A-T-I-O-N---D-I-S-P-L-A-Y-+
    
       !  ERROR NUMBER: 52    RESIDUE: 0                 !
    
       !  BLOCK NUMBER: 0            NUMREC: 0           !
    
       +-------------------------------------------------+
    
       *23* FAILURE TO OPEN TEXT FILE    (52)
    
       NONEXISTENT PERMANENT FILE   (FSERR 52)
    

    Verify the spelling of your file name with the LISTFILE command. Retype the command to retrieve a file.

  • In trying to retrieve a file, did the following prompt appear on your screen?

       LOCKWORD: username.groupname.acctname?
    

    This prompt is informing you that a lockword may have been inadvertently assigned to your file. Ask the system administrator to identify the lockword for you. At the lockword prompt, type in the lockword. Keep your file under a different name, making sure that you do not use the "/" character in the new name. Delete the old file name to prevent further occurrences of this problem.

  • Did you get the following error message?

       OUT OF DISC SPACE (FSERR)
    

    This error message indicates that you have run out of disk space allotted to you. To create disk space, delete any files that are not needed with the PURGE command. Have some of your files stored to cassette tape using the STORE command, and then erase those files from the disk. Refer to the "Working with Files" section of this chapter for instructions on the use of these commands.

Feedback to webmaster