You delete lines from a file with the DELETE subcommand; to delete more than one line, specify the number of lines:
delete 6 Or, if you want to delete all the lines from the current line to the end
of the file, use an asterisk (*):
delete *
If you want to delete an undetermined number of lines, up to a
particular character string, you can use the DSTRING subcommand:
dstring /weather/ When this subcommand is entered, all the lines from and including the
current line down to and including the line just above the line
containing the character string "WEATHER" are deleted. The current line
Fointer is positioned at the line that has "WEATHER" on it.
If you want to replace a line with another line, you can use the
REPLACE subcommand:
replace *******
The current line is deleted and the line "*******" is inserted in its
place. The current line pointer is not moved.
To replace an existing line with many new lines, you can issue the
REPLACE subcommand with no new data line:
replace
The editor deletes the current line and enters input mode. You can insert a single line of data between existing lines using the INPUT subcommand followed by the line of data you want inserted. For
example:
input * this subroutine is for testing only
inserts a single line following the current line. If you want to insert
many lines, you can issue the INPUT subcommand to enter input mode. You can also add new lines to a file by using the GETFILE subcommand.
This allows you to copy lines from other files to include in the file
you are editing or creating. For example:
getfile single items c
inserts all the lines in the file SINGLE ITEMS C immediately following
the current line pointer. The line pointer is positioned at the last
line that was read in.
72 IBM VM/370 eMS User's Guide
You could also specify:
getfile double items c 10 25
to copy 25 lines, beginning with the tenth line, from the file DOUBLE ITEMS C.
The $MOVE and $DUP EDIT macros provide two additional ways of adding
lines into a file in a particular position. The $MOVE macro moves lines
from one place in a file to another, and deletes them from their former
position. For example, if you want to move 10 lines, beginning with the
current line, to follow a line 9 lines above the current line, you can
enter:
$move 10 up 8
The $DUP macro duplicates the current line a specified number of
times, and inserts the new lines immediately following the current line.
For example:
$dup 3
creates 3 copies of the current line, and leaves the current line
pointer positioned at the last copy.
Describing Data File Characteristics When you issue the EDIT command to create a new file, the editor checks
the filetype. If it is one of the reserved filetypes, the editor may
assign particular attributes to it, which can simplify the editing
process for you. The default attributes assigned to most filetypes are
as follows: • Fixed-length, 80-character records • All alphabetic characters are translated to uppercase, regardless of
how they are entered • Input lines are truncated in column 80 • Tab settings are in columns 1, 6, 11, 16, 21, ••• 51, 61, and so on,
and the tab characters are expanded to blanks • Records are not serialized
The filetypes for some CMS commands and for the language processors
deviate from these default values. Some of the attributes assigned to
files and how you can adjust them to suit your needs are discussed
below. RECORD LENGTH You can specify the logical record length of a file you are creating on
the EDIT command line:
edit new file (lrecl 130 Section 5. The CMS Editor 73
Previous Page Next Page