VM/370 Release 6 EDIT Command and Example Reference



The editor included with VM/370 Release 6 is a line mode editor. The editor has two modes. They are command line mode and input mode. When you start the editor by typing EDIT fn ft you are in command line mode. To enter input mode you type INPUT<CR> at the command line. To exit input mode and to return to command line mode press the carriage return or enter key <CR> on a blank line. The following is a reference to editor commands.




EDIT Command

EDIT fn ft [fm]

Enter the editor in command line mode editing the file designated by fn ft and fm



Editor Conventions

Delimiters

Character strings are normally delimited by  the  / character. Other special characters can be used.
change /test file/new file/
change :test file:new / file:
 

Command Names

Command names may be specified in upper or lower case and shortened to the shortest unique value for example:

CHANGE /xxx/yyy zzz/
cha /xxx/yyy zzz/
 

fn

fn represents a one to eight character file name. The file name is not case sensitive, may contain letters and numbers and must begin with a letter for example:

EDIT test file a
 

ft

ft represents a one to eight character file type. The file type is not case sensitive, may contain letters and numbers and must begin with a letter. Certain applications expect their input files to have a specific file type. Example:

ASSEMBLE test assemble a
 

fm

fm represents the file mode of the file. It consists of a letter and a number for example A1. The letter represents the file mode that the mdisk that contains the file is accessed as. The number represents special carastics of a file. Example:

LISTFILE test file A1
 

Optional Operands [ ]

Operands surrounded by square brackets are optional. Examples would include indicating minimum command name length. Example:

L[ISTFIL]} test file [A[1]]
is the same as
l test file

String

A string is a sequence of characters bounded by delimiters. A string may contain spaces and special characters. Example:

CHANGE /this / this and that/

nn

nn represents a number of occurrences in a command from the current position in the file

*

* represents all the occurrences down or across from the current position in the file
 

-

- represents a search up in the locate command. Example:

LOCATE - /this/ 



ALTER

Change one character to another

ALTER    char1    char2    [ n ] [ G ]
                                            *      *
                                            1
char1 and char2 can be either a single character or two hexadecimal digits



AUTOSAVE

Save the file every nn changes

AUTOSAVE    nn
                        OFF



Bottom

In command line mode bottom moves the current line pointer to the last line of the file.



CASE

Set editor case to mixed or upper

CASE    [ M | U ]



Change

In command line mode change alters the contents of a file. Examples

c[hange] /string1/string2/[[nn] [*]]
c[hange] /string1/string2/[[*] [*]]

Make a change on the current line
c  /this/this and that/

Change the first occurrence of a string on the current line and the following four lines

c /this/this and that/4

Change the first occurrence of a string on the current line and all of the following lines

c /this/this and that/*

Change all of the occurrences of a string on the current line and all of the following lines

c /this/this and that/* * 



CMS

Enter CMS subset mode

CMS



Delete

del[ete]  [nn]

Delete lines from the file. Example:

Delete the current line from the file being edited

del

Delete the current line and the next 4 lines from the file being edited

del 5

Delete the current line and all the rest of the lines from the file being edited

del *



Down

Move the current line pointer down nn lines in the file.

down [nn] 



DSTRING

Delete from the current line down to but not including the line containing the string

DSRTING    /string[/]



File

The file command saves the current file and exits the editor. If the fn ft and fm operands are specified the file is saved under a new name.

file [[fn ft] [fm]]

Example

file

file test file a



FIND

Locate a line based on it's initial character string

find once upon a time               ( find next line in file beginning with once upon a time



FMODE

Set the File Mode for the current file

FMODE     B
FMODE    B2



FNAME

Set the File Name for the current file

FNAME    EAGLES



Get

The get command inserts a file after the current location in the file being edited.

get fn ft [fm]

Example:
get test two a1



Input

The input command changes the editor from command line mode to input mode. To enter input mode type INPUT<CR> on the command line. To exit input mode and return to command mode type a carriage return <CR> or enter on a blank input line.

INPUT<CR>



Locate

The locate command finds strings in the file being edited and moves the current line pointer to the line containing the string. Examples:

Search down from the current line pointer for a string

L[ocate] /string/
l /string/
/string

Search up from the current line pointer for a string

l - /string
l - /string 



LONG

Set the editor to respond to invalid edit commands with the long form of the ?EDIT message



NEXT

Move the current line pointer down nn lines

NEXT    [ nn ]



OVERLAY

Selectively replace one or more character strings in the current line with non blank characters from the input line.
The underscore character replaces the corresponding character with a blank

Example:

If the current line in the editor contains

blue fox

and the following overlay edit command is issued

Overlay red_  ax

the resulting line would be

red  fax



Quit

The quit command exits the editor WITHOUT saving any changes that have been made. Example:

quit



RECFM

The recfm command sets or displays the CMS files record format

RECFM  [ F | V ]



RENUM

The renum command recomputes the line numbers for VSBASIC and FREEFORT source files.

RENUM     [[ strtno ] [ incrno ]]
                        10        strtno



Repeat

The repeat ( = ) command repeats the previous editor command. Example:

locate /bridge

= (locate the next occurrence of bridge in the file



REPLACE

The replace command replaces the current line. If no replacement data is specified the line is deleted

REPLACE once upon a time                     ( Replace current line with once upon a time

REPLACE                                                ( Delete the current line 



RETURN

Exit from CMS Subset mode and return to edit mode

RETURN



REUSE

Stack LIFO editor subcommands on the stack and then execute them

REUSE    subcommand



Save

The save command saves the current file and continues editing. If the fn ft and fm operands are specified the file is saved under a new name.

save [[fn ft] [fm]]

Example

save

save test file a



SERIAL

The serial command specifies serialization and identification to be placed in columns 73-80

SERIAL        OFF
                    ON    [ INCR ]
                    ALL   [  10     ]
                    seq                                        ( Signifies 3 character identifier to be placed in columns 73 - 75 



SHORT

Set the editor to respond to invalid edit commands with the short form of the ?EDIT message



STACK

Stack data lines or editor subcommands on console stack for future reading

STACK    nn
STACK    subcommand



TABSET

Set editor tab values

TABSET     n1 [ n2 n3 .....nn ]

The following are the default tab settings for various file types:

----------------------------------------------------------------------------
ASM3705
ASSEMBLE
MACRO UPDATE    1, 10, 16, 31, 36, 41, 46, 69, 72, 80
UPDTxxxx
----------------------------------------------------------------------------
AMSERV                    2, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 61, 71, 80
----------------------------------------------------------------------------
FORTRAN                 1, 7, 10, 15, 20, 25, 30, 80
----------------------------------------------------------------------------
BASIC                        7, 10, 15, 20, 25, 30, 80
VSBASIC
----------------------------------------------------------------------------
PLI                            2, 4, 7, 10, 13, 16, 19, 22, 25, 31, 37, 43, 49, 55, 79, 80
PLIOPT
----------------------------------------------------------------------------
COBOL                    1, 8, 12, 20, 28, 36, 44, 68, 72, 80
----------------------------------------------------------------------------
OTHERS                    1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 61, 71, 81, 91, 101, 111, 121, 131
----------------------------------------------------------------------------



Top

The top command moves the current line pointer to the top of the file before the first line. Example:

top 



TRUNC

Display or change the truncation column for records

TRUNC
TRUNC    nn



TYPE

Display all or part of the file at the terminal

TYPE    [[ m ] [ n ]
TYPE     [ 1 ]



Up

The up command moves the current line pointer up nn lines in the file being edited.

up [nn]

Example:

up 19



VERIFY

Set or Display the current verification settings

VERIFY    [ ON | OFF ]
                  [ startcol endcol ]



X or Y

Assign an EDIT subcommand to be executed whenever X or Y is entered

X        [ n ]                            ( execute the subcommand represented by X n times
X        subcommand              ( set subcommand to be represented by X

Y        [ n ]
Y        subcommand



ZONE

Display or specify the zone to be scanned when the editor searches for a string

ZONE
ZONE    firstcol    lastcol
                    1        *