HPlogo Using HP 3000 MPE/iX: Fundamental Skills Tutorial: HP 3000 MPE/iX Computer Systems > Chapter 4 Creating Text Files

Lesson 1 Using EDIT/3000

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Lesson 1 presents

  • the EDIT/3000 editing program

  • the command to start the EDIT/3000 program: EDITOR' the EDIT/3000 command to end the EDIT/3000 program: END

  • the EDIT/3000 command to start writing: ADD

  • the EDIT/3000 command to stop writing: //

  • what the EDIT/3000 prompt tells you

  • the EDIT/3000 command to save a text file: KEEP

What is EDIT/3000?

The text editor EDIT/3000 is a Hewlett-Packard subsystem that comes bundled with your MPE/iX operating system. It is devoted to the general task of creating and editing text files. the editor has its own special set of commands and subcommands that give you considerable flexibility in your work.

At work you may hear the terms application, subsystem, utility, and program. They are all basically programs, but with subtle differences between them. Those differences are not especially significant to the general user.

Why use EDIT/3000?

EDIT/3000 is available to everyone who uses your MPE/iX system. The fundamentals of EDIT/3000 are easy to learn. EDIT/3000 produces text that is fully compatible with all MPE/iX operations.

EDIT/3000 allows you to create any kind of file that you might need with MPE/iX.

  • You will use EDIT/3000 to create text files in this and other Hewlett-Packard training courses.

  • You will use EDIT/3000 to create command files in module 6 of this training course.

  • You will use EDIT/3000 to create user-defined commands (UDCs) and job files in more advanced Hewlett-Packard training courses.

NOTE: More advanced users:

The editor creates a line-oriented ASCII text file with embedded carriage controls.

Starting EDIT/3000: EDITOR

Starting the editor is simple. Just type the command name and press Return.

Enter:

   EDITORReturn
NOTE: If this way of starting the editor does not work, it means that someone has modified the path. The path is an advanced topic covered in the 900 Series HP 3000: Advanced Skills course.

In such a case, enter:

   RUN EDITOR.PUB.SYS

When the editor starts, your screen should look something like this:

   :EDITOR

   HP32201A.07.17 EDIT/3000 THU, SEP 15, 1988,  3:34 PM

   (C) HEWLETT-PACKARD CO. 1985

   /_

Notice that the MPE/iX system prompt has disappeared. Instead, the editor provides its own prompt, the slash (/).

When the editor prompt ( / ) and the cursor are alone on a blank line, the editor is in command mode. In command mode, you can issue EDIT/3000 commands, but you cannot create lines of text.

Leaving the editor: END

To get out of the editor program, use the END, EXIT, or E command.

Enter:

   ENDReturn

Get out of the editor program now.

Your screen should look like this:

   /END

   END OF SUBSYSTEM

   :_

The computer once again displays the MPE/iX system prompt.

NOTE: Recall that the system prompt can be anything your system operations personnel decide to use.

Writing in the editor: ADD

Get into the editor again.

Enter:

   EDITORReturn

Do you have the editor slash prompt on your screen? If you do, you are in command mode.

The command to start writing in the editor is ADD or A. Commands must be entered when the editor is in the command mode. You can enter commands in all uppercase letters, all lowercase letters, or a combination of uppercase and lowercase letters.

Enter:

   ADDReturn

It should look like this on your screen:

   /ADD

       1     _

ADD puts the editor in edit mode. Now you can enter text.

NOTE: You cannot enter EDIT/3000 commands again until you return to the command mode. That comes a little later, in the section called “Stop Writing (//)”(//).

The editor provides the number of the next line that you type. Since you have started a new file, the first line number is 1.

Typing lines

You are now ready to begin typing. When typing in text, remember the following:

  • Type the way that you would on a typewriter.

  • EDIT/3000 will accept up to 72 characters on a line.

  • To start a new line, press Return

  • Every time that you press Return, the editor gives you a new line, with a new number.

NOTE: The EDIT/3000 program limits the number of characters accepted per line to 72 characters. More experienced users can alter this limit.

Type this:

EDIT/3000 is a hard-working program.  Your operator wouldReturn

Does your screen look like this?

   /ADD

       1     EDIT/3000 is a hard-working program.  Your operator would

       2     _

Notice what happens:

  • The editor labels the first line 1.

  • Every time that you press Return, the editor gives you a new line, with the next number in sequence.

NOTE: Advanced Users

EDIT/3000 is a line editor. Unlike many word processors found on a personal computer, the editor requires that you press Return to end one line and start another. It also requires that you indicate explicitly the line number(s) when you edit or manipulate a line or lines, rather than using the direction keys.

Type in the rest of these lines, and notice where the Return key should be pressed:

call it an entire subsystem of your computer operating system.Return

It has dozens of its own commands, some of them quiteReturn

elaborate.  It even uses three REDO subcommands that youReturn

used in module 1.Return

Your file should look like this:

/ADD

    1     EDIT/3000 is a hard-working program.  Your operator would

    2     call it an entire subsystem of your computer operating system.

    3     It has dozens of its own commands, some of them quite

    4     elaborate.  It even uses three REDO subcommands that you

    5     used in module 1.

    6     _

Notice that the cursor is on an empty line. You are now ready to change back to command mode. If you were to change back to command mode while the cursor was at the end of line five, you would lose line five.

Stop Writing (//)

To stop adding lines, enter:

   //Return

It should look like this on your screen:

/ADD

    1     EDIT/3000 is a hard-working program.  Your operator would

    2     call it an entire subsystem of your computer operating system.

    3     It has dozens of its own commands, some of them quite

    4     elaborate.  It even uses three REDO subcommands that you

    5     used in module 1.

    6     //

...

/

The editor is now in command mode. You can now execute EDIT/3000 commands again.

NOTE: Any line that ends in //Return is lost. EDIT/3000 discards that line and waits for your next command.

Looking at your file: LIST

At this point, you may wish to see all of the file you have just written.

To see all of a file on screen, use the LIST or L command.

Enter:

   LIST ALLReturn

You should see all of the file scroll upward on your screen. If it were a long file, you might need to use STOP or CTRLS to stop the scrolling (and then STOP again or CTRLQ to let the scrolling continue).

You can display a single line from a file, too.

Try this:

   LIST 5Return

You should see line 5 scroll up on your screen.

You can display a portion of a file:

Enter:

   LIST 2/4Return

This tells the computer to show you lines 2 through 4. You should see lines 2, 3, and 4 scroll into view.

NOTE: The editor recognizes the words "first" and "last". LIST FIRSTReturn displays the first line of your file. LIST LASTReturn displays the last line of your file.

Saving a file: KEEP

So far your text exists only in the editor's workspace. In order to keep text permanently, you must save the file on disk.

The command to save or keep a file permanently is KEEP. This saves the file on a computer disk.

The editor requires that you give the file a name when you keep it on the disk. Call it DOCUMENT.

Enter:

   KEEP DOCUMENTReturn

You know that your file has been kept when the / prompt reappears.

Keep an existing file

Enter:

   ADDReturn

What happens? You have saved a copy of the file to disk. A copy of the file is still in the editor's workspace, too.

The cursor is now at the beginning of a new line, line number 6.

Add this text at line number 6:

The ADD command adds lines at the end of an existing file.Return

Get out of edit mode (//Return).

By now the screen is a little cluttered. List your file again.

Enter:

    LIST ALL



    1     EDIT/3000 is a hard-working program.  Your operator would

    2     call it an entire subsystem of your computer operating system.

    3     It has dozens of its own commands, some of them quite

    4     elaborate.  It even uses three REDO subcommands that you

    5     used in module 1.

    6     The ADD command adds lines at the end of an existing file.

Keep DOCUMENT once more.

Enter:

   KEEP DOCUMENTReturn

Do you get this message on the screen?

   DOCUMENT ALREADY EXISTS - RESPOND YES TO PURGE OLD AND KEEP NEW

   PURGE OLD?_

The editor knows that a version of DOCUMENT already exists on the computer disk. It assumes that the file you are keeping is a new version of the same file, so it asks: "Do you want to purge (erase) the old version on the disk and replace it with the new version you are keeping?"

In this case, the computer is waiting for you to answer YES or NO to its question.

  • If you answer YES to the PURGE OLD? inquiry, the editor destroys the older version of the file on the disk and replaces it with your new version.

  • If you answer NO to the PURGE OLD? nothing changes. The old file remains, and the file that you just typed is not be saved.

This time, enter:

   NOReturn

This message should appear on the screen:

   PURGE OF OLD FILE NOT CONFIRMED - TEXT NOT KEPT

Is your file still in the workspace?

Enter:

   LIST ALLReturn

You should see your file displayed on the screen.

Leave the editor by entering this:

   ENDReturn

You should see this on the screen:

   IF IT IS OK TO CLEAR RESPOND "YES"

   CLEAR?

The editor knows that you added a line to the original text (line 6). So, it asks whether you want to save this new version of the file before ending the program.

  • If you answer YES, the editor destroys the work file. The older version of the file, still on the disk, remains unchanged.

  • If you answer NO, nothing changes. The old file remains, and the file that you just typed is still in your workspace. You stay in the editor.

This time, enter:

   NOReturn

The following message should appear on your screen:

   CLEAR NOT CONFIRMED - TEXT IS UNCHANGED

To save the file, use:

   KEEP DOCUMENTReturn

Again, you are asked if you want to purge (erase) the old version of the file.

Enter:

   YESReturn

The editor now saves the most recent version of the file (and in doing so destroys the older version). If you want to keep two versions of the file, you have to save one version with one name and the other version with another name.

Finally, exit the editor. Enter:

   ENDReturn
NOTE: You will be using this file, DOCUMENT, again in later lessons.

Getting a listing of files: LISTFILE

Now that you have created and kept a file, how can you keep track of any or all of the files that you save?

The MPE/iX command LISTFILE alphabetically displays file names to your terminal screen.

At the MPE/iX prompt, enter:

   LISTFILEReturn

Your screen should look something like this:

   :LISTFILE



   FILENAME



   DOCUMENT



   :

There may be other files listed on the screen, but for now, check to see if DOCUMENT is there.

Lesson 1 Exercises

  1. Name the text processing subsystem on the HP 3000.

  2. What command do you type at the MPE/iX prompt to start the editor?

  3. What do you type to end the editor?

  4. Which prompt indicates that you are in the editor?

    1. /

    2. :

    3. \

    4. <

  5. What EDIT/3000 subcommand lets you start typing text?

  6. What EDIT/3000 subcommand terminates the ADD subcommand?

  7. Consider the following scenario:

    You have just created a new file, which you try to save under the name MYFILE1. The following message appears on your terminal screen:

    DOCUMENT ALREADY EXISTS - RESPOND YES TO PURGE OLD AND KEEP NEW
    
    PURGE OLD?
    

    Would you answer yes or no to do the following:

    1. Instruct the editor program to write over your old file MYFILE1 and save the one that you have just created.

    2. Instruct the editor to retain the old file and not write over the original MYFILE1.

  8. Which MPE/iX command alphabetically lists files to the terminal screen?

Feedback to webmaster