March 30, 1979
indicates a location toward the end of the file (the last record). You use the EDIT subcommands UP and DOWN to move the line pointer up or down
one or more lines. For example:
up 5
meves the current line pointer to a line five lines closer to the
beginning of the file, and:
down
moves the pointer to point at the next sequential record in the file. You can also request that
beginning, or top of the file, When you issue the subcommand:
top
you receive the message: TOF: the line
or at the
pointer be placed at the
end, or bottom of the file.
and the line pointer is positioned at a null line that is always at the
top of the file. This null line exists only during your editing session;
it is not filed on disk when you end the editing session. When you issue the subcommand:
bottom
the current line pointer is positioned at the last record in the file.
If you now enter input mode, all lines that you enter are appended to
the end of the file.
If the current line pointer is at the bottom of the file and you
issue the DOWN subcommand, you receive the message: EOF: and the current line pointer is positioned at the end of file, following
the last record. When you are adding records to your file, the current line pointer is
always pOinting at the line you last entered. When you delete a line
from a file, the line pointer moves down to point to the next line down
in the file.
Going from edit mode to input mode does not change the current line
pointer. If you are creating a new file and, every 30 lines or so, you
move the current line pointer to make corrections to the lines that you
have entered, you must issue the BOTTOM subcommand to begin entering
more lines at the end of the file.
The current line pointer is also moved as the result of the LOCATE and FIND subcommands. You use the FIND subcommand to get to a line when
you know the characters at the beginning of the line. For example, if
you want to change the line: BAXTER J.F. 065941 ACCNTNT
you could first locate it by using the subcommand:
find baxter
66 IBM VM/370 eMS User's Guide
If you do not know the first characters on a line, you can issue the LOCATE subcommand:
locate laccntntl
Both of these sutcommands work only in a top-to-bottom direction: you
cannot use them to position the line pointer above the current line. If
you use the FIND or LOCATE subcommands and the target (the character
string you seek) is not found, the editor displays a message, and
positions the line pointer at the end of the file. Subsequently, if you
reissue the subcommand, the editor starts searching at the top of the
file.
In a situation like that above, or in a case where you are
repetitively entering the same LOCATE or FIND subcommand (if, for
example, there are many occurrences of the same character string, but
you seek a particular occurrence) you can use the = (REUSE) subcommand.
To use the example above, you are looking for a line that contains the
string ONCE UPON A TIME, but you do not know that it is above the
current line. When you issue the subcommand:
locate lonce upon a timel
the editor does not locate the line, and responds: NOT FOUND EOF: If you enter:
=
the editor searches again for the same string, beginning this time at
the top of the file, and locates the line: "ONCE UPON A TIME" IS A COMMON This may still not be the line you are looking for. You can, again,
enter:
The LOCATE subcommand is executed again.
locate the line:
A STORY THAT STARTED ONCE UPON A TIME
This time, the editor might
Figure 5 illustrates a simple CMS file, and indicates how the current
line pointer would be positioned following a sequence of EDIT
subcommands. Some fixed-length files are suitable for editing by
referencing line numbers instead of character strings. The EDIT
subcommands that allow you to change the line pcinter position by line
number are discussed under "Line-Number Editing." Section 5. The CMS Editor 67
Previous Page Next Page