Trailing-Edge
-
PDP-10 Archives
-
BB-F494Z-DD_1986
-
10,7/sos23.man
There are 3 other files named sos23.man in the archive. Click here to see a list.
SOS
(an advanced line-oriented text editor)
User's Guide
This document reflects version 21 of the software.
(with an appendix for version 23 features)
Page 2
Reprinted with the permission of Applied Data Research,
Inc..
Copyright (C) October 1971 by Applied Data Research, Inc.
All rights reserved. This manual, or parts thereof, may not
be reproduced in any form without the written permission of
Applied Data Research, Inc.
Updated by U.C.I. Computing Facility May 28, 1975. Updated
by I.P.C. Digital Equipment Corporation December 10, 1976
Page 3
CONTENTS
Page
INTRODUCTION TO SOS 5
TYPOGRAPHIC CONVENTIONS 6
COMMAND FORMAT NOTATION 7
PART I SOS SIMPLIFIED
CHAPTER 1 INPUT MODE 8
1.1 Accessing SOS 8
1.2 Storing the file: The End Command - "E" 9
1.3 Correcting errors 9
CHAPTER 2 EDIT MODE 10
2.1 Entering edit mode 10
2.2 Indicating line numbers 10
2.3 Edit mode commands 11
2.3.1 The Delete Command - "D" 11
2.3.2 The Insert Command - "I" 11
2.3.3 The Replace Command - "R" 12
2.3.4 The Print Command - "P" 12
2.3.5 The Find Command - "F" 13
2.3.6 The Alter Command (Intraline Edit Mode) - "A" 13
2.3.7 The Substitute Command - "S" 15
2.3.8 The Copy Command - "C" 16
2.3.9 The Transfer Command - "T" 16
2.3.10 The Number Command - "N" 17
2.3.11 The End Command - "E" 17
2.3.12 The Save World Command - "W" 18
2.3.13 The Go Command - "G" 18
2.3.14 The Help Command - "H" 19
CHAPTER 3 READ-ONLY MODE 19
PART II SOS ADVANCED
CHAPTER 4 FILES 20
4.1 Backup and temporary files 20
4.2 Standard text files 21
CHAPTER 5 LINE NUMBERS, PAGES 22
CHAPTER 6 EDIT MODE COMMANDS 24
6.1 The Mark Command - "M" 24
6.2 The Kill Command - "K" 24
6.3 The Delete Command -"D" 24
6.4 The Insert Command - "I" 25
6.5 The Replace Command - "R" 27
Page 4
6.6 The Print Command - "P" 28
6.7 The List Command - "L" 29
6.8 The Find Command - "F" 30
6.9 The Alter Command (Intraline Edit Mode) - "A" 32
6.10 The Extend Command - "X" 36
6.11 The Substitute Command - "S" 37
6.12 The Copy Command - "C" 39
6.13 The Transfer Command - "T" 40
6.14 The Join Command - "J" 41
6.15 The Number Command - "N" 41
6.16 The Justify Command - "JU" 43
6.17 The Justify Left Command - "JL" 44
6.18 The Justify Right Command - "JR" 44
6.19 The Justify Center Command - "JC" 44
6.20 The Justify Word Command - "JW" 44
6.21 The Set Command - "_" 45
6.22 The Give Information Command - "=" 46
6.23 Line contents specification - all commands 47
6.24 The End Command - "E" 48
6.25 The Save World Command - "W" 50
6.26 The Go Command - "G" 50
6.27 The Position Command - "." 51
6.28 The Help Command - "H" 51
CHAPTER 7 READ-ONLY MODE 51
CHAPTER 8 INDIRECT COMMANDS 52
CHAPTER 9 UPPER AND LOWER CASE REPRESENTATION 52
9.1 C128 and C64 modes 53
9.2 Upper and lower case 53
9.3 Combining modes and cases 53
9.4 Model 37 Teletype: 37 mode 55
9.5 Ascertaining mode and case: The Give
Information Command 55
9.6 Special considerations: Find and
Substitute Commands 56
9.7 Special "matching" characters: Find and
Substitute Commands 56
Appendix A: Error messages 59
Appendix B: Summary of commands 60
Appendix C: Default values 63
Appendix D: ASCII character table 64
Appendix E: SOS switches 66
Appendix F: SOS Help file 68
Appendix G: Version 23 Features 73
Page 5
INTRODUCTION TO SOS
SOS is a line-oriented text editor that operates on sequenced files.
SOS provides the following features:
1. Simple, but powerful, commands. Each command usually
consists of a single-lettered "verb", followed by a number
or range of numbers indicating the line(s) on which the
command is to perform.
2. An "indirect command" file. The user can put a
frequently-used sequence of commands into a file. When the
file is called, SOS will then perform the commands.
3. The full ASCII character set, including lower-case
characters.
4. A search facility. This enables the user to search through
a file with strings of text instead of line numbers.
5. Text-justifying commands.
This manual is divided into two parts: Simplified uses of common
editing commands are presented in Part I, which should be read in its
entirety before any text-editing is attempted. Part II, on the other
hand, describes every command in greater detail, emphasizing more
sophisticated usage. Most of this advanced material is unnecessary
for ordinary editing problems; there are instances, however, in which
these commands can be quite useful.
Page 6
TYPOGRAPHIC CONVENTIONS
The following typographic conventions are used throughout the SOS
Manual.
* In an example, text which is underscored is produced by SOS
or the DECsystem-10 Monitor. Text which is not underscored
represents information typed by the user.
* The (CR) notation appearing after most lines in the examples
represents the carriage return key (RETURN) on the terminal
keyboard. The DECsystem-10 supplies a linefeed with each
carriage return.
* The (LF) notation represents the linefeed key (LINEFEED) on
the terminal keyboard.
* The (FF) notation indicates a formfeed obtained by
depressing CTRL-L (see below).
* $ is used to indicate the ESCAPE key. Note that SOS only
prints the $ without the circle.
* Characters following a circumflex represent the control
(CTRL) key and an alphabetic character - e.g., ^U. To
obtain the control character, depress the specified
alphabetic while holding down the CTRL key. The
DECsystem-10 will generally print an up-arrow and the typed
character to indicate that it has received a control
character.
* A vertical bar represents the condition "or" - e.g.,
LMAR RMAR means either the left or right margin.
* On some terminals an underscore character (_) is represented
as a backarrow and a circumflex (^) is represented as an
uparrow.
* Although the messages typed by SOS are typed to the user in
upper and lower case letters, this manual types them in all
upper case letters since most users are using upper case
terminals.
Page 7
COMMAND FORMAT NOTATION
The following notation is used in SOS command formats:
* Command names appear in capital letters; arguments in lower
case.
* There are no spaces between SOS command names and arguments.
* Angle brackets <> enclosing lower-case letters indicate a
string of text consisting of any characters on the terminal
(as long as these characters satisfy the specified
conditions) - e.g., <range> or <filename>.
* Brackets [] indicate an option which may be used or omitted
as desired.
-SOS- Page 8
PART I
SOS SIMPLIFIED
1.0 INPUT MODE
1.1 ACCESSING SOS
The user can call SOS by typing the following command to the monitor:
.R SOS(CR)
SOS then will request the name of a file by printing "FILE:"; the
user-supplied name should be typed on the same line as this request.
FILE: <filename>(CR)
<filename> consists of a 1-6 character alphanumeric name (required),
which may be followed by a period and a 1-3 character extension
(optional).
Alternatively, the user may type the filename directly on the command
line and omit the initial conversation with SOS:
.R SOS-<filename>
The following examples are equivalent ways to call SOS:
.R SOS-EXAMPL.FOR(CR)
or
.R SOS(CR)
FILE: EXAMPL.FOR(CR)
Note that ".R SOS EXAMPL(CR)" is illegal.
If there is no disk file with the supplied name, SOS will indicate
that it is prepared to accept input beginning with line 100 by
printing:
INPUT: <filename>
00100
After printing the line number, SOS waits for the user to type a
string of text followed by a (CR); SOS then prints the next line
number, incrementing by 100 each time. When there are no more lines
to input, the ALTMODE or ESCAPE key (abbreviated $ ) should be used
after the next line number is printed. The printing of sequence
numbers is terminated, and the user is at the SOS command level as
indicated by the asterisk in the left margin.
-SOS- Page 9
.R SOS-EXAMPL.FOR(CR)
INPUT: EXAMPL.FOR
00100 THIS IS LINE 1.(CR)
00200 THIS IS LINE 2.(CR)
00300 $
*
1.2 STORING THE FILE: THE END COMMAND - "E"
Instead of editing immediately after the file is created, the user may
want to store the file on the disk. To do so, he uses the End command
as follows:
*E(CR)
The file will be stored under the name assigned to it when SOS was
called. SOS then returns the user to monitor mode after printing:
[DSKB:<filename>]
The E command is also used at the end of an editing session (see
Section 2.3.11).
1.3 CORRECTING ERRORS
Typographical errors can be corrected in an input line, provided they
are noticed before (CR) is typed.
1. RUBOUT. To delete individual chatacters, RUBOUT should be
depressed once for every character being deleted, back to and
including the error. The deleted characters are enclosed in
single backslashes ("\"):
00100 THIS IS TI\I\HE FIRST LINE
In the above example, the user typed RUBOUT once after he typed
the "I" of "TI". "\I" is printed to indicate that SOS deleted
the "I". The next character typed in (other than another
RUBOUT) is accompanied by the second backslash - "\H".
2. CTRL-U. To delete the entire input line, strike U while
holding down the CTRL key - ^U . SOS will perform a carriage
return/linefeed, but will not print a new line number; instead
it will wait for input which will be associated with the last
number.
00100 THIS IS TEH ^U
THIS IS LINE 1.(CR)
00200
-SOS- Page 10
2.0 EDIT MODE
2.1 ENTERING EDIT MODE
There are two ways to enter edit mode. During the input sequence, if
an existing file is specified, SOS will recognize the filename, print
an asterisk, and wait for user commands. Any editing, then, is
performed on the named file.
.R SOS(CR)
FILE: <filename>(CR)
EDIT: <filename>
*
or
.R SOS-<filename>(CR)
EDIT: <filename>
*
To complete the editing of a new file, on the other hand, the user
should strike the ALTMODE key ( $ ) at the end of the input sequence;
this places him at the SOS command level. He can either store the
file for subsequent editing by using the E command, or else he can
utilize any of the editing commands listed below and in Part II.
.R SOS-EXAMPL.FOR(CR)
INPUT: EXAMPL.FOR
00100 THIS IS LINE 1.(CR)
00200 THIS IS LINE 2.(CR)
.
.
.
00600 $
*
2.2 INDICATING LINE NUMBERS
SOS recognizes certain abbreviations which can be employed in commands
requiring line numbers. The Print command is used in the following
examples to illustrate these abbreviations:
1. A colon between two numbers is used to indicate a range of
lines between, and including, the two endpoints.
*P100:200(CR) Print lines 100 through 200
inclusive.
-SOS- Page 11
2. A period is used to represent the current line, as determined
by the last command which actually specified a line.
*P100:.(CR) Print line 100 through the current
line.
3. An asterisk represents the last line of the file.
*P.:*(CR) Print the current line through the
last line of the file.
4. A circumflex represents the first line of the file.
*P^:*(CR) Print the first line through the
last line of the file.
2.3 EDIT MODE COMMANDS
2.3.1 The Delete Command - "D"
The D command corrects an error by deleting an entire line or lines.
*D200(CR) Delete line 200.
*D100:200(CR) Delete lines 100 through 200
inclusive.
The Delete command will inform the user of the number of lines that
were deleted as well as the range: "n LINES (<range>) DELETED".
2.3.2 The Insert Command - "I"
The Insert command is used to indicate that new lines will be
inserted, beginning at the stated sequence number. The line increment
is 100 by default, unless specifically changed.
*I200(CR) Accept input lines beginning at
line 200, with the default
increment of 100.
The increment is changed as follows:
*I200,50(CR) Accept input lines beginning with
line 200, using the increment of
50. The default increment for
subsequent I commands will also be
50.
If there already is a line with the specified sequence number, SOS
-SOS- Page 12
will determine a different line number for the insert by adding the
line number specified in the command to the current increment. If a
line exists between the line specified by the command and the next
line determined by the increment (e.g., "*I200,50(CR)" and line 210
exists), SOS will choose a line number halfway between these two lines
(i.e., line 205). If any subsequent line being inserted already
exists, or if an existing line in the file falls between two lines
determined by the Insert command, then the insertion process will
terminate and the user will return to SOS command level. The sequence
of line numbers may be terminated at any time using the ESCAPE key,
which will return the user to command level.
00200 THIS IS INSERTED.
00250 $
*
2.3.3 The Replace Command - "R"
The Replace command is a combination of the Delete and Insert
commands.
*R200(CR) Delete line 200 and accept input
beginning at that line.
*R200:300,50(CR) Delete lines 200 through 300
inclusive, and accept input to be
inserted in lines 200 through 300,
with an increment of 50.
SOS responds with the number of the first line to be replaced.
2.3.4 The Print Command - "P"
The Print command tells SOS to print specified lines on the user's
terminal.
*P(CR) Print the next 16 lines of the
file.
*P200(CR) Print line 200.
*P100:200(CR) Print lines 100 through 200
inclusive.
*P^:*(CR) Print all the lines of the file.
*P.:*(CR) Print the current line through the
last line of the file.
If SOS is ready to accept a command, striking (LF) will cause the next
line of the file to be printed, while striking $ will cause the
-SOS- Page 13
previous line to be printed.
2.3.5 The Find Command - "F"
SOS can locate an arbitrary text string within a file without having
the line number specified:
*F<text> $ (CR) Search for the first occurrence of
the given string of text starting
with the line following the current
line.
Note that immediately after the file is opened for editing, the
"current" line is the beginning of the file.
It is also possible to search through a range of line numbers for the
first occurrence of a given text string:
*F<text> $ 100:350(CR) Search for the first occurrence of
the string of text in lines 100
through 350 inclusive.
If the specified text is located, the line and line number where it
first occurred will be printed. If the specified text does not exist
within the given (or implied) range, SOS will indicate that the search
has failed and return the user to command level. The current position
is left at the same position previous to the failing search.
%SEARCH FAILS
*
Giving another F command with no arguments will continue the search in
the stated range and cause SOS to print the next occurrence of the
given text string (line number and content). If there is no other
occurrence, SOS will print "%SEARCH FAILS" and return to command
level. For example:
*FOLD $ 100:500(CR) Search for the first occurrence
00150 THIS IS AN OLD LINE. of "OLD" in lines 100 through
500.
*F(CR) Search for the next occurrence
0200 THERE WAS AN OLD MAN. of "OLD" after line 150 and
through line 500.
2.3.6 The Alter Command (Intraline Edit Mode) - "A"
It is possible to specify a line to be modified using the Alter
command.
*A200(CR) Alter line 200.
-SOS- Page 14
The A command places the user in a special intraline editing mode
which has its own commands (described below). In this mode, the
commands themselves will not echo on a full-duplex terminal, although
any accompanying user-supplied text will.
The intraline edit mode maintains a pointer within the line indicating
the next character in the line that the next command will affect.
1. Moving the Pointer (Space Bar and Rubout)
To advance the pointer one position to the right, strike the space
bar once. The character that is passed over is printed on the
terminal. If the pointer is already at the extreme right of the
line, this command is ignored.
To move the pointer to the left, use RUBOUT once for each
character being passed over. (Note that this does not delete
anything as it would in input mode.) The character(s) passed over
are printed between single backslashes (\XX\). (The second
backslash is printed when the next non-RUBOUT command is given).
If the pointer is already at the extreme left of the line, a
carriage return/linefeed is automatically performed. The line
number will be reprinted, and the pointer will again point to the
beginning of the line.
2. The "D" Command (Delete)
To delete the character pointed to, type "D" once for each
character being deleted. The deleted character(s) will be printed
within double backslashes (\\X\\). (The second double backslash
is printed when the next non-D command is given.) The pointer then
will point to the right of the last character deleted. The
command is ignored if the pointer is at the extreme right of the
line.
3. The "I" Command (Insert)
To insert text use the I command as follows:
I<text> $
Only the inserted text is printed on the terminal. The pointer
then will be at the end of the inserted material.
4. Terminating Intraline Editing: (CR) and the Quit Command
When no more editing is necessary, the user should strike (CR).
This causes that portion of the line to the right of the pointer
to be printed and ends the intraline edit mode. SOS then returns
to command level.
The Q command terminates intraline editing mode without making any
of the indicated intraline changes. SOS then returns to command
level.
-SOS- Page 15
5. ^U (RESTART)
To reedit a line, type U while holding down the CTRL key - ^U.
The line will be restored to its original state, and intraline
editing can be resumed as soon as the line number is reprinted.
This is equivalent to typing a Q command during intraline edit
mode and then issuing an Alter command followed by a period (after
the SOS command asterisk):
<line>Q
*A.(CR)
6. The "S" Command (Skip)
The S command will skip over the characters up to the next
occurrence of the specified character:
S<character>
Every character passed over will be printed. The current
character is automatically passed over and is not compared to the
character specified in the command.
If the character does not occur in the remainder of the line, the
pointer will move to the extreme right.
The following example illustrates intraline edit mode and pointer
movement. Remember that user commands are not printed on the
full-duplex terminal when this mode is utilized.
*A200(CR)
SX D IW $ (CR) User Input
00200 LET\\X\\W=A+B+C SOS Printout
The user wants to alter line 200 ("LET X=A+B+C"). The pointer is
at the first character of the line ("L"). After "SX" is typed,
the pointer skips to "X", and SOS prints "LET" on the terminal.
To delete the "X", the user issues a D command. SOS then prints
"\\X", and moves the pointer to the charater which follows the
deleted character (that is, to the "="). Typing "IW $ " completes
the deletion process by printing another "\\"; "W" is inserted to
the left of the pointer and printed on the terminal. (CR) causes
the rest of the line to be printed and returns the user to command
level.
2.3.7 The Substitute Command - "S"
Sometimes the same string of text occurs frequently in a file, and it
would be time-consuming for the user to perform intraline editing in
every line that the string is found. SOS provides a command that
allows the user to substitute one string of text for another within
-SOS- Page 16
some range in the file:
*S<oldtext> $ <newtext> $ 100:350(CR) Substitute the <newtext> for
the <oldtext> in the range
specified.
NOTE
If no range is included in the command,
substitution will be only done for one
line.
2.3.8 The Copy Command - "C"
To duplicate some line or group of lines within a file, use the Copy
command. This command acts like an Insert command; the lines
specified are copied but not printed on the terminal.
*C200,100(CR) Copy the contents of line 100 to a
new line numbered 200.
*C1000,100:500,50(CR) Copy a portion of the file (lines
100 through 500) to a new location
beginning with line 1000. As each
line is copied, the increment
between lines will be 50.
If a specified increment is too large for the specified range, SOS
automatically will indicate that it has chosen a smaller increment by
typing:
INC1=<number>
If SOS cannot choose a small enough increment, it will use the given
increment and copy as many lines a possible into the available space.
As a result, only part of the text will be copied and an "%OUT OF
ORDER" error message will be given. To finish copying the rest of the
specified range, edit mode must be terminated with an End command.
During the next editing session, the file must be resequenced and then
the copy can be completed.
2.3.9 The Transfer Command - "T"
The Transfer command moves a set of lines from one part of a file to
another. It is similar to the Copy command, but it also deletes the
original range immediately after the transfer is completed.
-SOS- Page 17
*T1000,100:500,50(CR) Copy lines 100 through 500 into the
location beginning with line 1000,
using the increment 50; then
delete lines 100 through 500.
2.3.10 The Number Command - "N"
The Number command alters the numbers of currently existing lines; it
should be used if an "%OUT OF ORDER" or a "%WRAP AROUND" error message
occurs.
*N50,100:500,1000(CR) Renumber lines 100 through 500,
starting at line 1000, with the
increment of 50.
*N50,100:500(CR) Renumber lines 100 through 500,
starting at line 50, with an
increment of 50.
*N100(CR) Resequence the entire file starting
or at line 100 with an increment of
*N(CR) 100.
2.3.11 The End Command - "E"
The End command causes the edit session to terminate and writes the
output file.
*E(CR)
To differentiate an edited file from the original, the new version may
be filed separately under a different name by using the End command
and the new filename.
*E:<filename>(CR)
This leaves the original file under its original name. SOS then
returns the user to the monitor:
[DSKB:<filename>]
.
Should the user realize that the current editing session is worthless,
the Quit option will return him to the monitor without saving the
edited version of the file:
*EQ(CR)
The original file (if there was one) is still intact after the Quit
option.
-SOS- Page 18
The user should be aware that SOS creates backup files. These backup
files may sometimes be helpful in retrieving lost information.
However, backup files should be deleted when not in use since the user
is charged for the disk space. For more information about backup
files, check section 4.1.
2.3.12 The Save World Command - "W"
The Save World command is the same as the E command except that it
leaves the user in command mode rather than returning him to the
monitor. This is used to save the current version of the file in case
the system crashes, and should be done every fifteen minutes while the
user is in edit mode. If the system does crash, the user will lose
only the editing that was done since the last W command was issued.
It is also possible to use a new name for the edited version with the
W command (just as in the extension of the E command). The new name
only has to be given once, any subsequent W commands will recall the
new filename.
*W(CR)
or
*W:<filename>(CR)
2.3.13 The Go Command - "G"
The G command is used after the user issues a program execution
command such as EXECUTE, LOAD, COMPILE, etc., and then edits a file.
A filename that has been given to SOS is saved, so that calling SOS
(".R SOS(CR)") again with no filename will immediately put the user in
edit mode for the last file specified.
Once editing is completed, the G command will write the file onto the
disk (like the E command) and will cause the previous program
execution command to be repeated.
The following debugging sequence illustrates G command usage:
.R SOS-EXAMPL.CBL(CR) SOS assumes input mode and is ready
INPUT: EXAMPL.CBL to accept lines of text beginning
00100 with line 100 (SOS also "remembers"
. the name EXAMPL.CBL).
.
.
nnnnn $ End input and give command to user.
*E(CR) The E command will save the input
[DSKB:EXAMPL.CBL] under the filename EXAMPL.CBL.
.EXECUTE EXAMPL.CBL(CR) The user issues the Monitor command
-SOS- Page 19
. "EXECUTE EXAMPL.CBL".
.
. The program did not execute
. correctly; the user must edit the
. source file.
.
.R SOS(CR) SOS "remembers" EXAMPL.CBL, because
EDIT: EXAMPL.CBL it was the last filename used, and,
* therefore, assumes edit mode.
.
.
.
*G(CR) The user performs some editing in
. the program. The G command will
. save the file as E did and will
. begin compilation, loading, and
. execution of EXAMPL.CBL.
.
.R SOS(CR) More execution problems.
EDIT: EXAMPL.CBL Edit EXAMPL.CBL again.
*
.
.
.
*G(CR) EXECUTE again.
.
.
.
2.3.14 The Help command - "H"
The Help command prints out the useful information in the file
"HLP:SOS.HLP". (See Appendix F.)
*H
3.0 READ-ONLY MODE
SOS allows the user to access his file in a "read-only" mode if
"/READONLY" (or "/REA") is included in the input sequence.
.R SOS(CR)
FILE: <filename>/READONLY(CR)
or
.R SOS-<filename>/READONLY(CR)
This mode permits the user to find information in his file, but does
not allow him to perform any editing.
-SOS- Page 20
PART II
SOS ADVANCED
4.0 FILES
4.1 BACKUP AND TEMPORARY FILES
Consider the following situation. After a file is created, it is
stored on the disk under a specified name such as PROG.FOR (See
Section 1.1).
When the user is editing this file and gives an End, Save World, or Go
command, a backup file is created. This backup file contains the
original contents of PROG.FOR, while the newly edited version will be
named PROG.FOR. A backup file is created with the extension .Qxx; xx
represents the last two characters of the original file's extension.
If an "old" file is requested (/OLD or _OLD), the first backup file
created will have the extension .Zxx; any subsequent backup file will
have the .Qxx extension. If no backup file is requested (/NOBAK or
_NOBAK) no backup file will be created and any existing .Qxx file will
be deleted.
If the E, W, or G command specifies a filename, no backup file is
created. The original copy of the file will still be named PROG.FOR;
the edited version will have the new filename as its name.
During the editing process, SOS copies the file as the editing
progresses through the file. In input mode, if lines are inserted in
the correct sequence order, the file can be written out as needed with
no wrap around to the start of the file. If material is inserted out
of order, however, it may be necessary for SOS to wrap around. SOS
does this by copying the file over from the beginning of the file to
the location specified in the command. With subsequent commands, SOS
will recopy additional portions of the file.
When editing an already-existing file, SOS is careful not to make
changes in the old version until the new version is complete. When
wrap around is required, three files may exist simultaneously: the
original; a partially-edited copy which contains the entire file with
all changes up to the last wrap around (".TMP" file - see below); and
a partial copy of that file up to the current position (".TEM" file).
SOS is always writing this partial copy into a file called
"nnnSOS.TEM" (where "nnn" is the user's job number). If recopying is
necessary, SOS will rename the file "nnnSOS.TMP" and use it as input.
At any time during an edit, SOS will read either the user's original
file or the "nnnSOS.TMP" file. Thus, if an "nnnSOS.TMP" file exists,
it is complete up to the last time SOS had to recopy the partial edit.
When an "E", "G", or "W" command is given, SOS will finish copying the
-SOS- Page 21
edit into the "nnnSOS.TEM" file and rename it either the name
specified in the "E", "G", or "W" command, or the original name given
when editing began.
During an edit, SOS prints "EXIT" and returns the user to the monitor
whenever one of the following error messages occurs:
Error message Explanation
%NO DISK AVAILABLE The disk which the user requested
is not available.
%TEMPORARY EDIT FILE IN USE The file name which SOS assigns to
the temporary file is already being
used. This situation should not
occur. If it does, the user should
issue the Monitor command "DEL
*.TMP,*.TEM(CR)" to delete all
temporary files. Users should
check that there are no other users
on the same account or they may
delete some files that do not
belong to them.
%DEVICE OUTPUT ERROR Output error - no recovery will be
attempted.
%DEVICE INPUT ERROR Input error - no recovery will be
attempted.
%INTERNAL CONFUSION SOS has just encountered an
or internal conflict - a systems
%ILLEGAL UUO programmer will be needed.
Although "EXIT" is called and the edit is lost, the original file is
not harmed. If a Save World command had been given prior to any of
these errors, however, the original file would contain all editing
changes performed before the W command was issued.
If the error message, "%ILLEGAL LINE FORMAT" occurs during an edit,
the file probably has a line with a carriage return but no linefeed or
vice versa. Issuing a Replace command for that line will correct the
situation.
4.2 STANDARD TEXT FILES
SOS utilizes a Standard Text File, containing Standard Text Lines and
Standard Page Marks. Standard Text Line format is a line number
composed of a string of five seven-bit ASCII digits, left-justified in
a single word with a 1 in bit 35. This line number is followed by a
TAB and the text (500 or fewer ASCII characters, not including the
carriage return/linefeed). Each disk file word is left-justified and
consists of five ASCII characters and a 0 in bit 35. The first
-SOS- Page 22
character which follows the line number is a TAB and the last two
characters are (CR)(LF). The characters NULL and RUBOUT may not
appear in the text. If necessary, the last disk file word for the
line is filled with NULLs to make a complete word.
A Standard Page Mark is a word containing 5 ASCII spaces,
left-justified in a word with a 1 in bit 35, followed by a word
containing the characters (CR),(FF),NULL,NULL,NULL, with a 0 in bit
35. Standard Page Mark usage is discussed in Chapters 5 and 6.
Lines are never broken across physical disk block boundaries, and all
unused words in a disk block are 0.
If the specified file was created by using an editor that does not
assign line numbers, SOS will assign a number to each line as it reads
the file, beginning with 100 and incrementing by 100.
5.0 LINE NUMBERS, PAGES
Throughout Part I, it was assumed that a file was entirely contained
in one continuous group. This is a feasible way to structure a file;
however, when a file is large, it may be advantageous to divide it
into pages. For every command that includes a line number
specification, a page qualifier may be included. Thus, a single line
(<line>) may be specified by both the line number and page number as
follows:
<line number>/<page number>
The line number must be in the range 0 to 99999; the first page is 1,
and there is essentially no upper limit. A range has the form:
<line number>/<page number>:<line number>/<page number>
A range includes all text within the range, including the endpoints.
Instead of a number, the symbol "." may be used to denote either the
current line or the current page, depending on whether it appears
before or after the "/". Therefore, "100/." means line number 100 on
the current page and "./2" means the line on page 2 which has the same
number as the current line number. The current line and page are
determined by the last command which was executed (or, generally, by
the last line on which an operation was performed and the page on
which that line appears).
The symbol "*" may be used to specify the last line on the page, but
it may also specify the last page if the "*" follows the "/". The
symbol "^" may be used to specify the first line of a page or the
first page of a file, depending on the position with regard to the
"/".
-SOS- Page 23
Line and page specifications may be further abbreviated as follows:
Abbreviated Specification Full Specification
100 100/.
100:500 100/.:500/.
100/2:500 100/2:500/2
/2 ^/2:*/2
/2:/5 ^/2:*/5
^/1:. ^/1:./1
Addition and subtraction can also be used in line and page
specifications. While the arithmetic is straight forward for pages,
it is not for lines because of varying increments and prior editing
changes. A count either goes forward or backward from the indicated
line to include the number of lines specified. Another form of the
range specification extends the ability to use the counting technique.
The starting line is specified in one of the above ways and is
followed by an "!" and the number of lines desired.
Line specifications using arithmetic cannot cross page boundaries,
except those with the "!" which may cross page boundaries if
necessary.
Special Specification Equivalent Specification
100+2 the second line after line 100
100!3 line 100 and the two subsequent lines
/5-3 /2 or page 2
/.+2 the second page after the current page
/.-1 the previous page
.-1:.+1 three lines, including the current line
*+2 *
0-5 0
*!2 */.:0+1/.+1 last line on current page and
first line on next page
-SOS- Page 24
6.0 EDIT MODE COMMANDS
6.1 THE MARK COMMAND - "M"
The Mark command will insert a page mark into the text, immediately
before the line specified. Note that page mark 1 is always assumed
when input begins.
*M<line number>/<page number>(CR)
If the line that is specified does not exist, the page mark will be
inserted immediately after the line with the next lower number on that
page. If the line specified is the first on that page, the new page
mark will be placed immediately after the already-existing page mark;
therefore, the page that already existed will not have any
accompanying text. If the page specified in the M command does not
exist, the error message "%NO SUCH PAGE" will be printed and no page
mark will be inserted. Note that the page mark always precedes the
related text.
Inserting a page mark causes renumbering of all subsequent pages. The
current line is set to zero; the current page is considered the one
just created. When the user is inserting text, the command:
*M99999(CR)
will place a page mark at the end of the current work, and the next
insertion will go on the next page.
6.2 THE KILL COMMAND - "K"
The Kill command allows a user to remove the specified page mark.
*K/2(CR) Delete page mark 2.
If line numbers are out of order because a page mark is removed, the
user will be warned. He must then renumber the page using the Number
command.
Page mark 1, or any page mark which does not exist, may not be
deleted. If deletion is attempted, the error message "%NO SUCH PAGE"
will be printed.
6.3 THE DELETE COMMAND - "D"
The Delete command will delete all the lines of a specified range:
*D<range>(CR)
-SOS- Page 25
If there are no lines in the specified range, SOS will respond with
the error message "%NO SUCH LINE(S)".
Lines in a range are specified in the usual manner.
On deletions of entire pages or deletions which span pages, SOS will
ask, "MASSIVE DELETE OK?", to which you may type "Y" or "N". Expert
mode does not ask for this confirmation.
All lines on a page may be deleted as follows:
*D/2(CR) Delete all lines on page 2.
MASSIVE DELETE OK? Y
The current line and page will be set to the last line deleted on the
specified page.
The "D" command will inform the user of the number of lines that were
deleted as well as the range: "n LINES (<range>) DELETED".
6.4 THE INSERT COMMAND - "I"
The Insert command, which is used to insert new lines into a file,
accepts a single line specifier (line number/page number) as its first
argument and begins inserting at that line. The Insert command may
also be used to change the current default increment between lines, in
which case the increment is preceded by a comma.
*I[<line>][,<increment>](CR)
or
*I[<line>][;<increment>](CR)
or
*I[<line>][;!<number>](CR)
Thus,
*I100/2,50(CR) Insert lines starting with line 100
on page 2 and set the current
increment to 50.
*I100/2;50(CR) Insert lines starting with line 100
on page 2. Use the increment of
50. NOTE: The semi-colon
indicates that 50 is a temporary
increment to be used only while
this command is in effect. The
current increment will remain
unchanged and will be used again
for the next command.
-SOS- Page 26
*I100/2(CR) Insert lines starting with line 100
on page 2 using the current
increment (since no increment is
specified). NOTE: At the
beginning of edit mode, the current
increment is 100.
*I/2(CR) Insert a page mark at the end of
page 2 and start inserting text on
page 3.
*I100;!2(CR) Insert two lines starting at line
100.
After a specified line is actually inserted, SOS will add that line
number to the correct increment to obtain the number of the next line
to be inserted.
If there already is a line with the same number as the specified line
number, the line number of the existing line is added to the correct
increment and insertion begins there. If there already is a line
located between the two line numbers (or at the second line number),
SOS will select a line number that is halfway between the indicated
line number and the next line in the file. For the next insertion, if
a line already exists at the location determined by the increment, or
if it is necessary to pass over a line which already exists, then
insertion mode will terminate and the user will be returned to command
level.
In the following example, lines 100 and 200 already exist; the
current increment is 100:
*I100(CR)
00150 THIS IS A LINE(CR) SOS selects line 150 to begin
insertion.
* The user is returned to command
level since line 200 already exists
and must be passed over (200 is
between 150 and 250).
If a line insertion is terminated with an $ , the text preceding the
$ is inserted, and the user is returned to command mode. If nothing
has been inserted and $ is used, an empty line will not be inserted,
although the user will be returned to command level.
The current line number and page become the last line actually
inserted, not the empty line terminated with $ . In addition, after
$ is typed, SOS will remember the line number and page of the next
line to be inserted; these will be used if the I command is given
later with no argument. The increment will be the same as the
increment used in the most recent, complete command, including those
commands with the temporary (";") construction.
-SOS- Page 27
*I100;100(CR)
00100 THIS IS LINE 1.(CR)
00200 THIS IS LINE 2.(CR)
00300 $
*P100(CR)
00100 THIS IS LINE 1.
*I(CR)
00300 THIS IS LINE 3.(CR)
00400 .
.
.
If a page which does not exist is specified, SOS will respond with
"%NO SUCH PAGE".
If an attempt is made to insert a line which contains more than 500
characters (not including the return/linefeed at the end), SOS will
print "%LINE TOO LONG". The line will not be inserted, and SOS will
return to command mode.
If the next line to be inserted has a line number greater than 99999,
insertion will terminate and the user will be in command mode.
An increment of zero will result in the error message "%ILLEGAL
COMMAND".
6.5 THE REPLACE COMMAND - "R"
The Replace command is the same as the Delete command followed by an
Insert command. Replace accepts a range specifier and an optional
increment, which can be either temporary (";") or an actual (",")
update of the current increment.
*R<range>[;<increment>](CR)
or
*R<range>[,<increment>](CR)
or
*R<range>[;!<number>](CR)
The deletion is performed on the specified range, and insertion begins
with the first line indicated by that range. If the first line is not
stated explicitly, the line number of the first line deleted will be
used as the starting point for insertion.
*R/2,50(CR) Replace all lines on page 2 and
insert new lines, beginning with
the first line deleted, using an
increment of 50.
-SOS- Page 28
*R100;!2(CR) Replace two line beginning at line
100.
*R/2(CR) Delete all the lines on page 2 and
begin insertion.
Insertion may be terminated by depressing $ after SOS has printed
the next line number. As in the Insert command, if $ is used after
some of the text has been typed, that text will be inserted and
command mode will be reinstated.
The "R" command will inform the user of the number and the range of
the lines deleted, "n LINES <range> DELETED".
6.6 THE PRINT COMMAND - "P"
The Print command will print out on the user's terminal the lines
specified in a range, including the line numbers.
*P[<range>][,<options>](CR)
If the range includes the boundary between two pages, "PAGE n" also
will be printed to indicate the position of the page mark.
*P100/1:100/2
00100 THIS IS A LINE
00200 THIS IS A LINE
.
.
.
PAGE 2
00100 THIS IS A LINE
The second argument, if given, consists of one or more of the
following options, separated by commas.
<Option> Explanation
N Number pages Print page numbers at the bottom of
the page.
S Suppress line #s Don't print line numbers and page
numbers and suppress the asterisk
indicating that SOS is ready for
the next command.
E Eject Eject at the bottom of a page.
W Wait At the bottom, wait for a line.
F Final Copy Equivalent to S, E, and W options
combined.
The "bottom of the page" is determined by a page mark or an exceeded
-SOS- Page 29
length (the default is 55 lines).
"Wait for a line" means that SOS will wait at the bottom of each page
while the user types an additional line, followed by a carriage
return, or a return only (if no line is added). Typing a "G" only
will suppress the wait option in the remainder of the printout.
Typing a "Q" only will stop the printout and return the user to
command mode. Typing ^O will suppress printout in progress. Since
SOS is still moving the output to a buffer area, typing another ^O
will resume the printout at some later point in the output. If all
output has been passed to the buffer area, the user is returned to
command level.
Common abbreviations used with Print are as follows:
*P(CR) Print 16 lines (or the number of
lines specified in PLINES),
beginning with the current
position; the same as
"*P.!16(CR)".
*(LF) Print the next line of the file.
* $ Print the previous line of the
file.
*P/.(CR) Print all the lines of the current
page; the same as "*P:*/.(CR)".
The current line number and page are determined by the last line
actually printed.
If there are no lines in the specified range, SOS will print the error
message, "%NO SUCH LINE(S)".
6.7 THE LIST COMMAND - "L"
It is also possible to have the file, or a part of it, printed out on
the line printer:
*L[<range>][,S](CR)
If no range is specified, the entire file will be listed. The "S"
option for suppressing line numbers and headings is the same as the S
option used in the Print command. In this case, however, the asterisk
will not be suppressed, and SOS will indicate that it is ready for the
next command.
As with Print, the List command determines the current line number and
page by the last line printed. Line printer output will have suitable
page headings on the top of each page. These include the name of the
file, the time and date of the printing, and the page given in the
form "M-N". "M" is the actual SOS page on which this text can be
-SOS- Page 30
found; "N" denotes the Nth page of line printer output comprising
page M.
The user must issue a ".PRINT *.LPT" command at the monitor level to
actually cause the listing to be printed.
6.8 THE FIND COMMAND - "F"
The Find command is used to locate a given string of text within a
stated range (note that the options are discussed separately below).
*F[[<string>] $ [<range>][,<options>]](CR)
SOS will find the first occurrence of the string in the range and
print the line containing that string. If the range includes more
than one page and if the string is found on a page other than the
first one of the range, SOS will print "PAGE n" before the line number
to indicate on which page the line is located. If the string does not
occur in the specified range, SOS will print "%SEARCH FAILS".
To find the first occurrence of a given text on a specific page,
simply precede the page number with a "/" as follows:
*FLINE $ /2(CR) Find and print out the first line
on page 2 containing "LINE".
To locate the same string specified in the last Find command, use only
the range argument.
*F $ /3(CR) Find and print out the first line
on page 3 containing "LINE" (from
the previous Find command).
If no previous Find command was issued, SOS will print "%NO STRING
GIVEN" since no string had been specified.
If the range is omitted, then SOS will begin its search at the line
following the current line and continue through the end of the file.
*FALWAYS $ (CR) Find the first occurrence of
"ALWAYS" beginning with the line
following the current line through
the end of the file.
To indicate a range beginning with the next line through a specified
location, it is necessary only to specify the second half of the
range.
*FALWAYS $ :/5(CR) Find the first occurrence of
"ALWAYS" in the range from the next
line through the end of page 5
(assuming the current position is
before page 5).
-SOS- Page 31
Note that if this particular range specification were used in any
other command (except Substitute), SOS would print the message
"%ILLEGAL COMMAND".
When the Find command is given repeatedly, it is not necessary to
specify the text and range when referring to the same text and range
given in the last complete Find command.
*F(CR) Continue to find the text
(specified previously). The search
begins with the line after the last
line that was found; the end of
the range is the endpoint specified
in the last complete Find command.
*F $ (CR) Continue to find the text
(specified previously) through the
end of the file (since no range had
been specified).
The current line will be set to the last one found. If the error
message "%SEARCH FAILS" is printed, the string cannot be located in
the remaining portion of the range. In this instance the value of the
current location will be unchanged.
It is possible to use an extended form of the Find command to find up
to six strings of text. The carriage return separates the text
strings:
*F<string1>(CR) Search for any occurrence of any of
<string2>(CR) the strings (totalling fewer than
. 200 characters) in the range
. specified.
.
<stringn> $ <range>(CR)
OPTIONS
The complete Find command format including options, is as follows:
*F[[<string>] $ [<range>][,A ,N][,E][,<number>]](CR)
Find command options are defined below:
A Enter intraline edit mode automatically when the
string is found. This moves the intraline pointer
to the first character of the string. If
intraline editing is complete and "*F(CR)" is
issued, the A option will still be in effect.
(This is the same for the N and E options
discussed below).
-SOS- Page 32
N Find just the line numbers of the locations of a
given string. N follows the range specification
and cannot be used with the A option. N will
still be in effect if an "*F(CR)" is issued.
E Do not treat upper and lower case letters as being
equivalent. E follows the range, or A or N if
either is present. E will still be in effect if
an "*F(CR)" is issued.
<number> "<number>" specifies the number of lines to be
found - 99999 usually will find them all. This
option can be used instead of repeating "*F(CR)"
until the string no longer can be found within the
range specified in the first complete Find
command.
6.9 THE ALTER COMMAND (INTRALINE EDIT MODE) - "A"
The Alter command (referred to by the Find command) is used to make
changes within a line without having to retype the line. The Alter
command accepts a range specifier indicating those lines to be
altered.
*A<range>(CR)
For each of the lines in the range, SOS prints the line number, and
then enters a special intraline edit mode which has its own commands.
A pointer, maintained within the line, points to the next character in
the line that will be affected by the next command. The special
intraline edit commands are not echoed on the user's terminal. Thus,
the line shown on the terminal at the end of the intraline edit is
exactly the same as it is in the file (except for the backslashes and
the characters between them). Any command in this mode may be
preceded by a number (positive or negative) which will cause the
command to be repeated for that number of characters. The line number
of the next line in the range will be typed out automatically as soon
as intraline editing is completed on the present line.
The current line is determined by the last line edited.
If there are no lines in the specified range, SOS will print the error
message "%NO SUCH LINE(S)".
INTRALINE COMMANDS
SPACE This will advance the pointer one position to the
right. The character that is passed over is printed
on the terminal. If the pointer is already at the
extreme right of the line, this command is ignored.
-SOS- Page 33
RUBOUT This moves the pointer one character to the left.
This does not delete anything as it would ordinarily
in input mode. The characters moved over are
printed between single backslashes (\XXX\). If the
pointer is already at the extreme left of the line,
a (CR)(LF) is automatically performed. The line
number will be reprinted, and the pointer will again
point to the beginning of the line.
C<character> This causes SOS to accept the next character from
the terminal. The character pointed to will be
replaced by the new character, and the pointer will
be moved one character to the right. The character
accepted from the terminal is printed on the line in
place of the one that is deleted. If the pointer is
at the extreme right of the line, the command is
ignored. During this command, any RUBOUT that is
used will be ignored. (LF),(CR), and $ will abort
the remainder of the command.
D This will delete the character pointed to. The
character(s) deleted will be surrounded by double
backslashes (\\XXX\\). The pointer will point to
the right of the last character deleted. The
command is ignored if the pointer is at the extreme
right of the line.
I<string> $ This will insert the given string into the line
immediately before the character to which the
pointer points. The pointer remains pointing to the
character to the right of the inserted string. The
characters being inserted are typed out on the
terminal.
If RUBOUT is typed before the $ , the last
character that is inserted will be deleted. If more
RUBOUTs are typed than characters inserted, the
characters to the left of the insert are deleted.
The characters deleted are surrounded by single
backslashes. If enough characters are inserted to
make the line exceed 500 characters, the message
"%LINE TOO LONG" is printed, and SOS will return the
user to command mode without performing any of the
alterations specified for that line.
If a (CR) is typed before the $ , the insert will
be terminated; intraline edit will terminate as in
the (CR) command.
If a (LF) is typed before the $ , a (CR)(LF) is
inserted at that point. This creates a new line
consisting of any subsequently inserted characters
and the rest of the old line to the right of the
pointer. The number of the new line is determined
as follows:
-SOS- Page 34
1. If the I command is preceded by a number, this
number acts like a temporary increment and is
added to the current line number to obtain the
new line number.
2. If the I command is not preceded by a number,
then the new line number is determined by adding
the current increment to the current line
number. The new line is inserted at this number
unless it would be out of order.
3. If the new line would be out of order in (2)
above, the new line number will be halfway
between the current line number and the next
line number. If the next line number is only
one more than the current line number, an "%OUT
OF ORDER" error message will be printed. SOS
will retype the line number and the contents of
the line to the left of the pointer. It is then
possible to insert more characters.
If no errors occur while making the new line, the
pointer will be left pointing to the first character
of the new line, and the current line will be set to
the new line just created.
(CR) If there is no more editing to be done, that portion
of the line to the right of the pointer will be
printed out; intraline editing is completed for
that line and command returns to the user, unless
there are more lines in the Alter command range to
be edited.
E This has the same effect as the (CR) key, except
that the rest of the line is not printed on the
terminal.
Q The Quit command terminates intraline editing
without making any changes in the line presently
being altered. SOS returns to command mode.
^U This restarts intraline editing on the same line.
The line will be restored to its original state, and
intraline editing can be started as soon as the line
number is reprinted.
S<character> The Skip command will accept one character from the
user's terminal (without printing it) and will move
the pointer to the right until the next occurrence
of that character. Every character passed over will
be printed. The character that is currently being
pointed to also will be printed without being
compared to the character specified in the command.
If the character does not occur in the rest of the
line, the pointer will be moved to the extreme right
-SOS- Page 35
of the line.
K<character> The Kill command is the same as the Skip command
except that it deletes all the characters passed
over. If there are no other occurrences of the
specified character in a line, the command will be
ignored (rather than the remainder of the line being
deleted).
R The Replace command is the same as a Delete command
followed by an Insert (even if a number is included
before R).
L The Line command prints the remainder of the line to
the right of the pointer, performs a (CR)(LF),
prints the number of the line, and continues the
intraline editing with the pointer pointing to the
first character of the line.
P This prints the remainder of the line to the right
of the pointer, performs a (CR)(LF), prints the line
number, and moves the pointer to the right; the
characters passed over are printed until the pointer
reaches the same position it had before the command
was issued.
J This Justify command inserts a (CR)(LF) where the
pointer is currently pointing, and concatenates the
portion of the line to the right of the pointer onto
the beginning of the next line. The current line
number is set to the new line number.
The error message "%LINE TOO LONG" will be given if
the new line that is created contains more than 500
characters. The error message "%NO NEXT LINE" will
be printed if this line is the last one on the page.
Either of these two errors will cause the J command
to be ignored; the line number and the portion of
the line to the left of the pointer will be typed
out again.
W The Word command moves the pointer to the right,
passes over blanks and tabs, then over the first
"word" encountered, and then over subsequent blanks
and tabs (until the next word). Everything that is
passed over is printed.
A "word" is defined as any collection of letters,
numbers, and the separators ".", "%", and "$". The
other separators which delimit a word will cause the
scan to stop after the word and subsequent blanks
and tabs are passed over. (See also Section 6.21 to
set separators.)
-SOS- Page 36
X<string> $ The X command moves the pointer over blanks and
tabs, deleting them as it moves, and then deletes
the next "word" and the following blanks and tabs.
After the deletion, a string of text is inserted to
replace the word and subsequent blanks which were
deleted.
^I A control-I (or TAB) moves the pointer to the end of
the current line.
Any other character, used as a command in intraline edit mode, will
cause a bell to be echoed and the command will be ignored.
All echoing of deleted text in intra-line edit mode is suppressed if
the user is in "EXPERT" mode (see Section 6.21).
6.10 THE EXTEND COMMAND - "X"
The Extend command is another way to enter intraline edit mode.
*X<range>(CR)
With this command, however, the pointer is moved immediately to the
extreme right of the line, the characters passed over are printed on
the terminal, and the user is in the intraline insert mode. The
desired text should then be typed in followed by (CR).
<text>(CR)
If a (LF) is typed instead of a (CR), a return, linefeed occurs at
that point. This creates a new line consisting of anything that is
subsequently typed in, since the user is still in insert mode. The
number of the new line is determined by the methods described in
Section 6.9. Note that a (CR) must be used eventually to end the
insertion, unless the sequence of line numbers does not permit another
line. In this case, the user will be returned to SOS command level.
If an $ is typed before the (CR), the user may then issue any of the
intraline edit mode commands.
<text> $ (CR)
The following form of the command will suppress the type-out of the
original line:
*X<range>,S(CR)
Only the characters that the user types for the insertion will be
printed on the terminal.
-SOS- Page 37
6.11 THE SUBSTITUTE COMMAND - "S"
The Substitute command will substitute "newstring" for all occurrences
of "oldstring" in the specified range and print every line in which a
substitution has been made. (Note that the options are discussed
separately below.)
*S[<oldstring> $ <newstring>] $ [<range>][<options>](CR)
If the first line with a substitution is not on the first page
specified in the range, or if a subsequent line with a substitution is
not on the same page as a previous line, "PAGE n" will be printed
before the appropriate line.
To substitute the same strings specified in the last S command, omit
the strings and one $ from the command:
*SOLD $ NEW $ 100/1:100/2(CR) Substitute "NEW" for all
occurrences of "OLD" in the
specified range.
*S $ /3(CR) Change "OLD" to "NEW" (as specified
previously) on page 3.
The "S" command with no arguments performs the substitution only on
the first line found.
If the strings are omitted and no previous S command had been given,
SOS will print the error message "%NO STRING GIVEN".
If the entire range is omitted, SOS will assume a range from the line
after the current line through the end of the file. If the first part
of the range is omitted, it is assumed to be the line after the
current line. The current line is set to the last line in which a
substitution took place. If a substitution did not occur, the value
of the current line will not be updated.
It is also possible to perform several substitutions at one time. All
text to be located and changed is specified first, followed by an $
and all the text to be substituted, followed by the range.
The form of this command is:
S<oldstring1>(CR)
<oldstring2>(CR)
.
.
.
<oldstringn> $ <newstring1>(CR)
<newstring2>(CR)
.
.
.
<newstringn> $ <range>(CR)
-SOS- Page 38
If there are fewer "newstrings" than "oldstrings", the last
"newstring" is substituted for the extra "oldstrings". Up to six
oldstring and six newstrings (containing 200 characters in all) may be
used; if either is exceeded, one of the following error messages may
appear: "%TOO MANY STRINGS" or "%STRING TOO LONG".
OPTIONS
The complete Substitute command format, including options, is as
follows:
*S[<oldstring> $ <newstring>] $ [<range>][,D ,N][,E][,<number>](CR)
Substitute command options are defined below:
D By specifying this option, the user can look at each line
after the substitutions have been made in order to "decide"
if he prefers the new line or the old one. After each line
is printed, SOS will wait for the user to type one of the
following characters:
RUBOUT The indicated substitutions will not be made; the
old version of the line will be retained. SOS will
then print the next line and, when found, will wait
for another "D" command character.
E SOS will return immediately to command mode without
performing the substitutions.
G SOS will use the modified line to replace the original
line; Decide mode will be halted and further
substitutions will be made automatically.
A SOS will enter intraline edit mode with the
substititions already made; the user then can issue
one of the following (or any other Intraline Edit
Command):
^U Restore the original line.
(CR) Leave intraline edit mode and continue
substitution.
Q Abort the entire process by returning SOS to command
mode.
A space will automatically cause the new line to replace the old line
and substitution to continue.
N This option will suppress the printing of those lines
in which a substitution has been made.
E This option will cause upper and lower case letters to
-SOS- Page 39
be treated as non-identical in the "old" string. This
should come after D or N, if either is present, or
after the range. See Chapter 9.
<number> "<number>" specifies the number of lines of a given
string to be substituted - 99999 usually will include
them all.
6.12 THE COPY COMMAND - "C"
The Copy command will insert a copy of existing text at a given
location. Its format is:
*C<destination line number>,<source range>[,<inc1>[,<inc2>]](CR)
The Copy command acts as if an Insert command had been done for a
given location, and then as if all of the lines specified by the
source range had been typed in, using the specified increment between
destination line numbers. If the increment is too large, SOS will
print "%OUT OF ORDER" or "%WRAP AROUND", and then choose a smaller
increment, which is indicated as follows:
INC1=<number>
If, for some reason, SOS cannot choose a small enough increment, it
will print
INC1=ORDER or INC1=WAR
The specified increment will be used, and SOS will copy as many lines
as possible into the available space.
Since all the text to be copied must be contained in core at one time,
copying large blocks of text may result in the error message
"%INSUFFICIENT CORE AVAILABLE". The only solution is to copy several
smaller blocks of text.
If the source lines contain page marks, the renumbering of lines at
the destination using the first increment will cease when the first
page mark is reached; then all lines between the first and last page
marks will be inserted with original numbers. Lines after the last
page mark will be inserted with the original numbers, unless a second
increment (<inc2>) for the destination line numbers is specified in
the command.
If the second increment is too large, SOS will print one of the
following error messages: "%OUT OF ORDER" or "%WRAP AROUND".
If the second increment is not specified and renumbering is not done,
SOS will print "%OUT OF ORDER".
In both cases, SOS will try to use a different increment, as indicated
by:
-SOS- Page 40
INC2=<number>
If SOS cannot find a suitable increment, it will print:
INC2=ORDER
SOS then will use the specified increment (or the original line
numbers if a second increment had not been stated in the command), and
will insert as many lines as possible into the remaining available
space.
The Copy command will enable the user to copy lines from a file other
than the one presently being edited. If the line numbers of this
other file are unknown, then the user will first type:
*C<destination line number><source filename>/S(CR)
or
*C<destination line number>=<source filename>/S(CR)
This will cause SOS to respond with a "C*". "/S" places the indicated
source file in read-only mode. The desired lines are found by using
the Print, List, or Find commands. After the lines have been found,
type:
C*E(CR)
SOS will reply
SOURCE LINES=
At this point, the rest of the Copy command should be typed.
<source range>[,<inc1>[,<inc2>]](CR)
The current line will be set to the last line copied.
6.13 THE TRANSFER COMMAND - "T"
The Transfer command moves a set of lines from one location in a file
to another.
*T<destination line number>,<source range>[,<inc1>[,<inc2>]](CR)
The Transfer command is the same as a Copy command followed by a
Delete command. With the Transfer command (unlike the Copy command):
1. The source range must be in the file currently being edited.
-SOS- Page 41
2. The error message "%ILLEGAL TRANSFER DESTINATION" will be
printed when the destination is inside the source range, as in:
*T100/3,/2:/5(CR)
If an "%OUT OF ORDER" error message is printed because of the removal
of a page mark, SOS then will reinsert one page mark and print "PAGE
MARK INSERTED TO PREVENT ORDER ERROR".
If the specified destination is on a page which does not exist, SOS
will insert the text at the end of the file and print "TEXT INSERTED
AT END OF FILE". SOS also will insert a page mark to prevent an "%OUT
OF ORDER" error message.
Note that <inc2> must be used if line numbers other than the original
are desired for the last page.
6.14 THE JOIN COMMAND - "J"
The Join command joins two consecutive lines by deleting the carriage
return/linefeed sequence at the end of one line and the line number
and TAB of the next line.
*J<line>(CR)
<line> is the first of the pair of lines to be joined. The line
number of the new line that is created will be the same as this first
line.
If there are no errors, the current line is the line that is created.
The lines will not be joined if SOS prints the error message "%LINE
TOO LONG".
If the line specified as the argument is the last line on the page,
SOS will give the error message "%NO NEXT LINE".
6.15 THE NUMBER COMMAND - "N"
After an "%OUT OF ORDER" message (or at any other time), it is
possible to renumber the file, or portions of it, by using the Number
command:
*N[A P]<increment>[,<range>[,<starting number>]](CR)
The first argument is the increment to be used in the renumbered file.
The first line that is renumbered is given this number, unless the
third argument is specified. Each succeeding line will be given a
number that is the sum of the increment and the previously assigned
line number.
-SOS- Page 42
If renumbering crosses a page mark, the first line on the new page
will be given the "starting number" - i.e., either the third argument
or the first argument (if the third is omitted). For example,
BEFORE RENUMBERING:
PAGE 2 115 126 137 150
PAGE 3 900 911 952 999
*N10,/2:/3(CR)
AFTER RENUMBERING:
PAGE 2 10 20 30 40
PAGE 3 10 20 30 40
If the second argument is absent (indicating the range to be
renumbered), the entire file will be renumbered. If there are no
lines in the specified range, SOS will print the error message "%NO
SUCH LINE(S)".
The Number command is useful in renumbering a page before the page
mark is deleted in order to avoid an "%OUT OF ORDER" error message.
If the user deletes the page mark before renumbering, he should issue
the Number command with the "/." range specification, the desired
increment, and starting point, if desired.
*N10,/.(CR) Renumber the current page with an
increment and starting point of 10.
*NA10,.!3(CR) Renumber the next three lines by
adding 10 to the line numbers.
*NP(CR) Renumber the entire file and do not
reset line numbers when crossing
page boundaries. This allows
continuously increasing line
numbers throughout the file
regardless of page marks.
After renumbering, the current number and page will be set to the
number of the last renumbered line. An increment of 0 will result in
the error message "%ILLEGAL COMMAND". If the specified increment is
so large that it causes some line numbers to be greater than 99999,
the high-order digits of these line numbers will be dropped. SOS will
then print the error message "%WRAP AROUND" along with the page on
which the problem occurred. The page will be out of order and should
be renumbered with a smaller increment.
-SOS- Page 43
6.16 THE JUSTIFY COMMAND - "JU"
The JUstify command justifies the text in a specified range by
ignoring all line numbers, returns, and linefeeds:
*JU<range>(CR)
Line numbers, returns, linefeeds, and blanks are then inserted so that
the line length is the difference between the right (RMAR) and left
(LMAR) margins plus one:
RMAR-LMAR+1=line length
Inserting any additional characters will result in unjustified text.
Note that the default values of "RMAR" and "LMAR" are 64 and 1
respectively.
If the right margin is less than the left, SOS will print "%MARGIN
ERROR".
In this case, use the Set command to reset either or both margins.
SOS inserts extra blanks between words, starting from the left or
right on alternate lines, to make the line length "RMAR-LMAR+1".
A word is anything between blanks. (The end of the original line is
considered a blank.) A word that ends with ".", "?", or "!" may be
followed by two blanks; otherwise, only one blank is allowed, and all
other blanks will be ignored.
SOS inserts blanks at the beginning of the new line equivalent to the
value of the left margin minus 1. The new line number is the same as
the number derived by the Number command:
*N<increment>,<range>(CR)
A page mark automatically will be inserted if the next line number
exceeds the maximum line number (MAXLN) whose default is 99999. If
this occurs, the user will be informed.
Paragraphing will cause exceptions to the above procedures. The end
of a paragraph is indicated by one of the following conditions:
1. Tab in the first character position
2. Blank line
3. Page mark
4. Beginning or end of specified range
When one of these conditions is encountered, the line that immediately
precedes the end of the paragraph is not expanded (unless it is the
beginning of the range). The line, however, is placed at the LMAR,
with leading blanks inserted if necessary.
-SOS- Page 44
If the paragraph begins with a tab (8 spaces, entered during Insert
mode by CTRL-I), the tab is merely inserted into the text. Otherwise,
the paragraph will begin with the paragraph margin (PMAR) whose
default is 1, rather than the LMAR.
6.17 THE JUSTIFY LEFT COMMAND - "JL"
The Justify Left command removes leading blanks from lines of a range
and inserts LMAR-1 blanks to move the lines to the left margin.
*JL<range>(CR)
The first line of a paragraph is treated as in the JUstify command.
No chopping, filling, or renumbering, however, is done.
6.18 THE JUSTIFY RIGHT COMMAND - "JR"
It is also possible to right justify a range of text:
*JR<range>(CR)
Enough blanks are inserted at the beginning of the line so that the
right end of the line is at the right margin. If any tabs are
present, the required blanks are inserted to the right of the
rightmost tab in the line.
6.19 THE JUSTIFY CENTER COMMAND - "JC"
The Justify Center command centers the lines of a range between the
left and right margins:
*JC<range>(CR)
JC is like the JR command, except that only half as many blanks are
inserted to make the line centered between LMAR and RMAR.
6.20 THE JUSTIFY WORD COMMAND - "JW"
The Justify Word command, like the JUstify command (Section 6.16),
justifies a line of text. In this case, SOS includes as many words as
possible between LMAR and RMAR without adding blanks or hyphenating.
---------------
WARNING: After a line that exceeds RMAR-LMAR+1, SOS will print the
error message "%LINE TOO LONG". The text, when printed, may not be as
expected; the margins should be reset and the command should be
reissued.
-SOS- Page 45
The text, therefore, appears as typewritten text without a justified
right margin.
The format of the JW command is as follows:
*JW<range>(CR)
6.21 THE SET COMMAND - "_"
The Set command sets (or changes) parameters in SOS:
*<parameter>[=<number>](CR)
For example, after SOS has been used for a while, the user may want
shorter forms of error messages. By typing:
*EXPERT(CR)
all error messages will be abbreviated to five characters or less (see
Appendix A). This is reversed by typing:
*NOVICE(CR)
Note that SOS begins in _NOVICE mode.
For the intraline edit mode W and X commands, the per cent sign,
dollar sign, and period are considered part of the word. To use these
as separators or delimiters, type:
*SEPARATOR(CR)
This is reversed by typing "*NONSEPARATOR(CR)", the default condition
when SOS began edit mode.
The parameters used in the family of Justify commands (LMAR, RMAR,
PMAR, MAXLN), the increment parameter (INC), and the LENGTH parameter
(Print option) may be assigned new values as follows:
* LMAR=5(CR) *MAXLN=1000(CR)
* RMAR=65(CR) *INC=50(CR)
* PMAR=10(CR) *LENGTH=60(CR)
The newly-assigned values are only valid while editing the current
file.
It is possible to change the name of the resultant edited file:
*NAME=<filename>(CR)
The name of the program to be run for the "G" command may be changed
by the following command:
-SOS- Page 46
*RUN=[dev:]<filename>[<path>]
6.22 THE GIVE INFORMATION COMMAND - "="
Any time the user is in command mode, he may request the value of a
parameter by using the Give Information command:
*=<parameter>(CR)
Possible Give parameters are:
*=INC(CR) Print the current increment.
*=.(CR) Print <current line number>/<current page>.
*=LMAR(CR) Print the current value for the left margin.
*=PMAR(CR) Print the current value used for paragraph
indentation.
*=RMAR(CR) Print the current value for the right margin.
*=MAXLN(CR) Print the maximum line number allowed in the JU
command.
*=BIG(CR) Print the page number of the largest page in the file.
*=ERROR(CR) Print the last error message - in the long form, even
if "_EXPERT" is in effect.
*=STRING(CR) Print the string used by the Find and Substitute
commands:
SEARCH:
<Find command string(s)>
SUBSTITUTE:
<Substitute command newstring(s)>
FOR:
<Substitute command oldstring(s)>
*=CASE(CR) Print whether SEPARATOR (or other words described in
Chapter 9) have been set.
*=NAME(CR) Print the name of the resultant output file.
*=LENGTH(CR) Print the length used for determining the end of the
page in the Print command options.
-SOS- Page 47
6.23 LINE CONTENTS SPECIFICATION - ALL COMMANDS
In SOS it is possible to address lines by content, rather than line
numbers. This is done by replacing each <line number> field of any
command with:
$ <string> $ (CR)
The rest of the original command string continues on the next line.
This may be another " $ <string> $ (CR)" or (CR) alone which
terminates the entire command. For example, to print everything
between a line containing "ONE" and a line containing "TWO", type the
command:
*P $ ONE $ (CR)
: $ TWO $ (CR)
(CR)
*
Note that three carriage returns are required: one for each string of
text and one for terminating the Print command.
If the string between two $ 's is null, then the string last used in
this context will be used again. (Strings from the Find and
Substitute commands do NOT qualify.) Normally, the search begins with
the current position and continues through the end of the file. A
range, however, may be specified as follows:
$ [<string>] $ [<range>][,D ,N][,E][,<number>](CR)
<range> may be specified as a group of line numbers, or the line
contents specification described above may be substituted. In the
latter case, <range> provides the outer boundaries for the search.
<range> may be nested a maximum of three times.
*P $ C $ (CR) Print all the lines between, and
: $ B $ $ D $ (CR) including, the first occurrence of
: $ G $ (CR) C and the first occurrence of B.
(CR) Only use that portion of text
between the first occurrences of D
and G.
Where the sample text is:
00300 B _current line
00400 C
00500 D
00600 B Search through this area
00700 C for lines C and B.
00800 A Print these 3 lines
00900 B
01000 G
Adding either the ",D" or ",N" option will cause the entire line
(",D") or the line number (",N") of the first occurrence of the text
-SOS- Page 48
to be printed. SOS then will print an "*". If the user types RUBOUT
at this point, SOS will search for the next line containing the text
and then print the line or line number. Typing any other character
will terminate the search for the particular text.
The ",E" option specifies that upper and lower case characters are not
equivalent (see Chapter 9).
<number> indicates a number of times the string occurs. SOS will skip
to the last occurrence of this specification and use that line as the
starting point for its search.
*P $ 1 $ ,D,3(CR) SOS would print all the lines between,
: $ 4 $ (CR) and including, the first occurrence of
(CR) 1 and the first occurrence of 4;
however, 3 in the number field indicates
that SOS should use the third occurrence
of 1 as its starting point.
Where the sample text is:
1
2
1
2
1 _starting point
2
3
4
1
2
NOTE:
RUBOUT, when used with the ",D" or ",N"
option, may only be repeated "number-1"
times.
6.24 THE END COMMAND - "E"
The End command is used to terminate the current edit.
*E[S B D Q][:<filename>[<path>]](CR)
If a filename is not specified, the original copy of the file being
edited will be renamed to <filename>.Qxx; then the newly edited
version will be stored under the original filename.
If a name is specified, it will be assigned to the edited version. If
the user specifies a filename which already exists, SOS will ask
-SOS- Page 49
"OUTPUT FILE EXISTS-DELETE? (Y OR N):" and wait on the same line for
a response:
Y - Delete old file and substitute new file
N - Do not delete old file
If "N", SOS will respond with "FILE:" and wait for a new name to be
typed; this will be assigned to the edited file.
If "Y" and if the old file cannot be deleted SOS will respond "FILE
WRITE PROTECTED. TRY ANOTHER NAME". The user will be prompted for
another file name.
Instead of using the End command to specify the filename under which
the edited version will be stored, the user, when beginning the
editing session, may specify the new filename as follows:
.R SOS-<new filename>=<old filename>(CR)
SOS will enter edit mode for <old filename>. "*E(CR)" at the end of
the editing will then cause the edited version to be stored under <new
filename>. The user may also add "/READONLY" or "/RO" to the command;
this will put the <old filename> in read-only mode. Thus, the file
named <old filename> will not be overwritten.
Should the user realize that his editing is useless, he may return to
the monitor without saving the edited version of the file by using the
Quit option:
*EQ(CR)
SOS will respond by returning him to the monitor.
If the user desires to output the file without sequence numbers
(either to save disk space or to allow processing by programs that
cannot handle sequence numbers) he should use the "S" option:
*ES(CR)
In order to suppress the creation of a backup file the user should use
the "B" option:
*EB(CR)
The user may also request that the original input file be deleted by
specifying the "D" option:
*ED:FILE.EXT(CR)
-SOS- Page 50
6.25 THE SAVE WORLD COMMAND - "W"
The Save World command:
*W[S B][:<filename>[<path>]](CR)
is similar to the End command except that parameters set by the Set
command are not returned to their standard settings (i.e., they remain
as they were before the command), and the user is returned to command
mode rather than to the monitor. This is useful for saving the
current version of the file in case the system crashes, and should be
done every fifteen minutes while in edit mode. Then, if the the
system does crash, only the editing done since the last W command was
issued will be lost.
If a filename is used with this command, the edited version will be
saved under that name. If the W command is issued again during the
save editing session and no filename is specified, then the current
version is saved with the name last given in a previous W command.
If the system crashes and a W command has not been issued recently,
the user may be able to recover his editing by typing the Monitor
command:
.RENAME <filename not in use>=nnnSOS.TMP(CR)
(where "nnn" is the user's job number).
This will attach the user to a temporary file which may be the one
that SOS was using when the system died. It is then necessary to
enter edit mode with the new filename. If this is not the correct
file, delete it and try again using another temporary file (e.g.,
nnnSOS.TEM). A system DIRectory command may be issued to see if there
are any temporary files.
6.26 THE GO COMMAND - "G"
It is possible to edit a program source file with SOS and then to
issue a compile-class Monitor command (EXECUTE, LOAD, COMPILE, etc.).
SOS can be reentered after the EXECUTE, LOAD, or COMPILE is done and
can determine the name of the last file edited; thus, typing:
.R SOS(CR)
---------------
WARNING: CTRL-C (^C) should be used with caution. In response to a
^C SOS will type "Yes? (Type H for help)".
C Continues
E Ends the session and closes the file
Q Quits (deletes temp files)
M Returns to the monitor
R Reenters (terminates a losing search, etc.)
-SOS- Page 51
will put the user immediately into edit mode within the last file
specified. Then, once the first DECsystem-10 Monitor command has been
given, and SOS has been entered a second time the Go command (instead
of End) will write the file onto the disk, exit from SOS, and cause
the previous compile-class Monitor command to be repeated.
*G(CR)
A filename may also be specified with a Go command:
*G[S B D Q][:<filename>[<path>]](CR)
This simply renames the edited version; the name will be saved for
the next Go command. Thus, a G command alone will store a file under
a previously-specified name; a G command which includes a filename
will store the file under that new name.
The Suffixes for the Go command are the same modifiers as those for
the End command.
6.27 THE POSITION COMMAND - "."
The position command sets the line pointer to the position indicated.
*.<position>
6.28 THE HELP COMMAND - "H" The Help command prints out a list of SOS
commands. The reader should refer to Appendix F for more details.
*H
7.0 READ-ONLY MODE
As indicated earlier, once a file is created it may be called by SOS
in read-only mode by the addition of "/READONLY" or "/RO" when the
file is named in the initial conversation with SOS:
.R SOS(CR)
FILE: EXAMPL.FOR/READONLY(CR)
READ: EXAMPL.FOR
or
.R SOS-EXAMPL.FOR/READONLY(CR)
READ: EXAMPL.FOR
-SOS- Page 52
The user will not be allowed to perform any editing in the named file
(i.e., "EXAMPL.FOR").
In read-only mode, only the following commands may be used: Print,
Find, End, Go and List.
8.0 INDIRECT COMMANDS
If a particular sequence of commands is used frequently, it is
possible to insert these commands in a file. Then SOS can be
instructed to read commands from the file, rather than from the
terminal keyboard. The command:
*@<filename>(CR)
will do this, provided the list of commands is found in the named
file. When SOS sees this command, it will begin taking its commands
from the file. Only the following will be printed on the user's
terminal:
1. Error messages
2. Printout from the P command
3. Items found by the F command
4. Substitutions made by the S command
5. Lines altered by the A command
If the user includes the Substitute command with the Decide option in
his file, he must type in the decision character when the Substitute
command is executed (see Section 6.11).
When SOS has executed the last command in the indirect-command file,
the user will be returned to command mode.
When the user is inserting commands into the file, he may have to
enter such characters as $ or a (CR) without the (LF) (see Chapter 9
on SOS character sets).
9.0 UPPER AND LOWER CASE REPRESENTATION
SOS has been designed to allow its use at a variety of terminals with
different character sets. The following explanations describe the
most common terminal characteristics.
-SOS- Page 53
9.1 C128 and C64 modes
Model 33 and 35 Teletypes employ only upper-case letters and some
special symbols, totaling 64 characters in all. SOS is capable,
however, of using the full ASCII 128-character set. Since edit mode
assumes the 64-character set, it is necessary to specify "C128" mode
in order to represent lower-case letters and the additional ASCII
symbols. This C128 mode is indicated in a Set command:
*C128(CR)
From Appendix D it is obvious that upper-case letters are input the
same in both C64 and C128 modes, except for the '. In C128 mode, a
single ' has no meaning whatsoever; it is necessary, therefore, to
type '' in this mode to represent a single '.
To return to C64 mode, again use a Set command:
*C64(CR)
In C64 mode, only the characters on the terminal may be input.
9.2 UPPER AND LOWER CASES
SOS initially assumes that all characters are upper case. Thus, in
C128 mode it is necessary to precede any character considered lower
case with a '. The user, then, can intersperse the two cases in his
text in this manner to obtain all alphabetic characters.
When the text primarily is composed of lower-case letters, it is
easier to assume that all characters are lower case. Then, a special
configuration (i.e., the ') will indicate upper case. The Set command
is used to indicate the dominance of lower case.
*LOWER(CR)
To represent upper-case characters, precede each character with a '.
To revert back to the original upper-case mode, type
*UPPER(CR)
9.3 COMBINING MODES AND CASES
The following examples illustrate how SOS modes and cases can be
combined:
-SOS- Page 54
Text Explanation
*I100
00100 IT'S A LINE Inserted in C64 UPPER.
*P.
00100 IT'S A LINE Printed in C64 UPPER.
*LOWER
*P.
00100 IT'S A LINE Printed in C64 LOWER.
*C128
*UPPER
*P.
00100 IT''S A LINE Printed in C128 UPPER.
*LOWER
*P.
00100 'I'T'''S 'A 'L'I'N'E Printed in C128 LOWER.
*C64
*I200
00200 IT ISN'T HARD Inserted in C64 LOWER.
*UPPER
*P.
00200 IT ISN'T HARD Printed in C64 UPPER.
*LOWER
*P.
00200 IT ISN'T HARD Printed in C64 LOWER.
*C128
*UPPER
*P.
00200 'I'T 'I'S'N'''T 'H'A'R'D Printed in C128 UPPER.
*LOWER
*P.
00200 IT ISN''T HARD Printed in C128 LOWER.
*UPPER
*I300
00300 DON''T YOU LIKE IT? Inserted in C128 UPPER.
*P.
00300 DON''T YOU LIKE IT? Printed in C128 UPPER.
*LOWER
*P.
00300 'D'O'N'''T 'Y'O'U 'L'I'K'E 'I'T? Printed in C128 LOWER.
*C64
*UPPER
*P.
00300 DON'T YOU LIKE IT? Printed in C64 UPPER.
*LOWER
*P.
00300 DON'T YOU LIKE IT? Printed in C64 LOWER.
*C128
*I400
00400 IT''S THE END Inserted in C128 LOWER.
*UPPER
*P.
00400 'I'T'''S 'T'H'E 'E'N'D Printed in C128 UPPER.
*LOWER
*P.
-SOS- Page 55
00400 IT''S THE END Printed in C128 LOWER.
*C64
*UPPER
*P.
00400 IT'S THE END Printed in C64 UPPER.
*LOWER
*P.
00400 IT'S THE END Printed in C64 LOWER.
9.4 MODEL 37 TELETYPE: 37 MODE
The Model 37 Teletype has the full ASCII 128-character set; it can,
therefore, input these characters directly to SOS. To type lower-case
letters on terminals such as the Model 37, it is necessary to issue
the system command:
.TTY LC(CR) or .SET TTY LC(CR)
Then, to allow SOS to output lower-case characters to this terminal,
the user types:
*M37(CR)
This is reversed by another Set command ("*M33(CR)") which will
essentially make the Model 37 Teletype act as if it were either a
Model 33 or 35 - i.e., 2-character equivalents must be used as
described in Section 9.2.
9.5 ASCERTAINING MODE AND CASE: THE GIVE INFORMATION COMMAND
If there is any doubt as to which case and mode are employed, issue a
"Give information" command.
*=CASE(CR)
For C64 mode, SOS will print
C64 UPPER
or
C64 LOWER
For C128 mode, SOS will print
UPPER
or
LOWER
-SOS- Page 56
For C64 mode on a Model 37 teletype, SOS will print
MODEL 37 C64 UPPER
or
MODEL 37 C64 LOWER
For C128 mode on a Model 37 teletype, SOS will print
MODEL 37 UPPER
or
MODEL 37 LOWER
9.6 SPECIAL CONSIDERATIONS: FIND AND SUBSTITUTE COMMANDS
For a Find command<string>, upper and lower-case characters will be
considered the same unless the E option is used. For the Substitute
command, upper and lower-case will be considered equivalent in
<oldstring> only.
9.7 SPECIAL "MATCHING" CHARACTERS: FIND AND SUBSTITUTE COMMANDS
If C128 mode has been specified or if a Model 37 teletype is used,
there are a few special characters which "match" some other character
in the Find and Substitute command <strings>.
Representation Explanation
': Matches a SEPARATOR which is any character
other than a letter, a number, a ".", a "%",
or a "$". See Section 6.21 on Separators.
'/ Matches any character.
'% The subsequent character matches any
character which it would not normally match.
A'%BC will be matched by AAC, ACC, ADC, etc.,
but not by ABC (or abc unless the "E" option
is specified with Find or Substitute).
-SOS- Page 57
Combinations of the above 3 codes include:
'%': Matches any letter, number, etc. -
i.e., not a SEPARATOR.
'%'/ Matches only the beginning or end of a
line. For example, '%'/OLD finds only those
occurrences of "OLD" at the beginning of a
line.
'7 Quotes the next character. When used with
another special character, '7 will find that
character and not its match:
'7'% Searches for the actual occurrence of
'%.
'7'7 Searches for '7.
'%'7'% Matches any character except '%.
') Indicates "any number of" the particular
character that follows it. For example,
A')BC Matches AC, ABC, ABBC, etc. In case of
ambiguity, the shortest string is found. For
the above example, A')BC will find AC rather
than ABC.
')'%'7'% Matches any number of characters
which are not '%'s.
Two other special characters may be used in the <newstring> of the
Substitute command when one of the special constructions discussed
above has been specified in <oldstring>:
'* Specifies that a match which occurs by using
one of the above special constructions is to
be used for a later substitution.
'*1'* A stand-in for whatever was actually
matched first by a special construction.
'*2'* is for the second match, etc.
For example, suppose all occurrences of OLD
are to be replaced by NEW, but COLD, FOLD,
etc., also exist in the file. OLD can be
given for the oldstring, but how can the
SEPARATORs be replaced? The "'*"
construction is used as follows:
*S':OLD': $ '*1'*NEW'*2'* $ <range>(CR)
-SOS- Page 58
'" In more complicated specifications, '" will
replace successive recurrences of the '*
construction when they appear in the same
order that they were matched.
For example, as the file is scanned for the
<oldstring>, the matches with the special
constructions are actually numbered and
stored on the disk. (The first is 1, etc.)
Then, when the <newstring> is being
substituted, these numbered matches can be
named for use with '*1'*, '*2'*, etc. - if
they occur in order, '" can be substituted
for '*<number>'*.
The constructions make it possible to isolate unknown portions of text
by manipulating what comes immediately before and after. NOTE:
Certain strings which can be formed with the above characters are
illegal and will produce the message "%ILLEGAL SEARCH STRING".
Since the strings are not checked when the command is issued, the
message will only be given when an attempt is made to match the
special construction. If '%'), or '7 is not followed by another
character, or if '% is followed by '), SOS will print "%ILLEGAL SEARCH
STRING".
Because some of these special searches involve recursion or require
the use of table space inside SOS, it is possible to get the error
message, "%SEARCH STRING TOO COMPLEX". If this occurs, try a simpler
string.
Example 1
Exchange two arguments of a function:
function (A,B) => function (B,A)
where A and B may be any string not including the left or right
parenthesis or a comma.
*Sfunction(')'/,')'/) $ function('*2'*,'*1'*) $ <range>(CR)
Example 2
Change all READ (3,#)list to READ (5,#) list
*SREAD')'%(3, $ READ'"(5, $ <range>(CR)
NOTE: This will not match "READ(4,#) A(3,5)" but will match
"READ(3,".
-SOS- Page 59
APPENDIX A
ERROR MESSAGES
EXPERT NOVICE
%DDE %DEVICE OUTPUT ERROR
%DIE %DEVICE INPUT ERROR
%DNA %DISK NOT AVAILABLE
%FNF %FILE NOT FOUND
%ICN %INTERNAL CONFUSION
%ILC %ILLEGAL COMMAND
%ILFMT %ILLEGAL LINE FORMAT
%ILR %ILLEGAL REPLACEMENT ON INSERT
%ILUUO %ILLEGAL UUO
%IRS %ILLEGAL REPLACEMENT STRING
%ISS %ILLEGAL SEARCH STRING
%ITD %ILLEGAL TRANSFER DESTINATION
%LTL %LINE TOO LONG
%NEC %INSUFFICIENT CORE AVAILABLE
%NLN %NO SUCH LINE(S)
%NNN %NO NEXT LINE
%NSG %NO STRING GIVEN
%NSP %NO SUCH PAGE
%ORDER %OUT OF ORDER
%STC %STRING TOO COMPLEX
%STL %STRING TOO LONG
%UNA %DEVICE NOT AVAILABLE
%TMS %TOO MANY STRINGS
%WAR %WRAP AROUND
%SRF %SEARCH FAILS
%CMERR %INDIRECT READ ERROR
%CMEND %INDIRECT END-OF-FILE
%MAR %MARGIN ERROR
-SOS- Page 60
APPENDIX B
SUMMARY OF COMMANDS
ALTER
*A<range>(CR)
Next Character - SPACE
Last Character - RUBOUT
Change - C<character>
Delete - D
Insert - I<string> $
End Alter Mode - (CR)
End Alter Mode - E (without printout)
Quit - Q
Start Over - ^U
Skip - S<character>
Kill - K<character>
Replace - R
Line - L
Print - P
Justify - J
Word - W
Delete Word and Insert Text - X<string> $
COPY
*C<destination line number>,<source range>[,<inc1>[<inc2>]](CR)
*C<destination line number><source filename>/S(CR)
*C<destination line number>=<source filename>/S(CR)
DELETE
*D<range>(CR)
END
*E[B D Q S][:<filename>][<path>](CR)
EXTEND
*X<range>[,S](CR)
<text>[ $ (LF)](CR)
FIND
*F[[<string>] $ [<range>][,A ,N][,E][,<number>]](CR)
GIVE
*=INC BIG CASE ERROR STRING . LMAR PMAR RMAR MAXLN
LENGTH NAME LOCATION(CR)
-SOS- Page 61
GO
*G[B D Q S][:<filename>][<path>](CR)
INSERT
*I<position>[,<increment>](CR)
or
*I<position>[;<increment>](CR)
JOIN
*J<line>(CR)
JUSTIFY
*JU<range>(CR)
JUSTIFY CENTER
*JC<range>(CR)
JUSTIFY LEFT
*JL<range>(CR)
JUSTIFY RIGHT
*JR<range>(CR)
JUSTIFY WORD
*JW<range>(CR)
KILL
K/<page>
LINE CONTENTS SPECIFICATION - ALL COMMANDS
line number field =
$ <string> $ (CR)
LIST
*L[<range>][,S](CR)
MARK
*M<line number>/<page number>(CR)
NUMBER
*N[A P]<increment>[,<range>[,<starting number>]](CR)
-SOS- Page 62
POSITION
*.<position>(CR)
PRINT
*P[<range>][,<options>](CR)
REPLACE
*R<range>[,<increment>](CR)
or
*R<range>[;<increment>](CR)
SAVE WORLD
*W[S B][:<filename>][<path>](CR)
SET
*<parameter>(CR)
parameter =
UPPER/LOWER
M33/M37
C64/C128
NOVICE/EXPERT
NONSEPARATOR/SEPARATOR
*<parameter>=<number>(CR)
parameter =
INC LMAR PMAR RMAR MAXLN LENGTH PLINES
*NAME=<filename>(CR)
*RUN=[dev:]file.ext[<path>]
SUBSTITUTE
*S[<oldstring> $ <newstring>] $ [<range>][,D ,N][,E][,<number>](CR)
TRANSFER
*T<destination line number>,<source range>[,<inc1>[,<inc2>]](CR)
Commands may be aborted by typing two bells (^G's) in succession.
This feature allows you to return to SOS command level from any level
except ALTER mode. This feature may also be used to delete back past
an ESCAPE typed for an "F" or "S" command.
-SOS- Page 63
APPENDIX C
DEFAULT VALUES
If certain parameters are not assigned values by the Set command, they
will assume a default value:
INC=100
LMAR=1
PMAR=1
RMAR=64
MAXLN=99999
LENGTH=55
PLINES=16
Also, the following parameters are "modes" in which SOS begins:
UPPER,M33,C64,NOVICE,NONSEPARATOR
These can be reversed by using the Set command with the following
parameters:
LOWER,M37,C128,EXPERT,SEPARATOR
All SOS parameters may be specified in the initial command string as
switches. They may also occur in the SWITCH.INI file. See Appendix
E. All command string switches and parameters may be specified by
their unique initial letters.
-SOS- Page 64
APPENDIX D
ASCII CHARACTER TABLE
INSERT PAGE 1 HERE
-SOS- Page 65
INSERT PAGE 2 HERE
-SOS- Page 66
APPENDIX E
SOS SWITCHES
All SOS parameters may be specified as switches on the initial SOS
command or in the user's SWITCH.INI file. The following are the legal
switches for SOS:
/BASIC If the file being edited does not have system style
sequence numbers but has at least one digit as the
first non-blank character, the file will be read in
the following format:
1. All leading blanks and tabs will be
stripped off.
2. If the first non-digit is a space,
replace it with a tab.
3. If the first non-digit is a tab, leave
it in place.
4. If the first non-digit is anything
else then insert a tab.
In addition, the "/R" switch in a COPY command
will cause the file to be read in BASIC mode.
If the UNSEQUENCE option is used, the sequence
number will be converted to a 5-digit string; the
following tab will be converted into a space upon
exit.
/START:n Allows the user to specify the starting sequence
number. The starting sequence number defaults to
100. If /START is omitted, it defaults to the value
specified in /STEP.
/STEP:n Allows the user to specify the starting increment
used in determining sequence numbers. /STEP
defaults to 100.
/SAVE:n Causes an automatic W after every n commands that
modify the file.
/ISAVE:n Invokes an automatic W command after every n lines
input.
When either counter goes to zero, the message:
"[Doing auto-save, please wait.]" will be printed,
then the edit session will continue. If the final
file is to be UNSEQUENCED, the user will be
warned, "[Warning: sequence numbers preserved]".
-SOS- Page 67
/DECIDE Permanently sets the ",D" option on the substitute
command. A space is the only character that permits
a modified line to be accepted.
/NODECIDE Negation of /DECIDE.
/NONUMBER Causes the suppression of sequence numbers on
typeout.
/NUMBER The inverse of /NONUMBER.
/CHECK This switch causes SOS to verify that enough disk
space exists before every output. It will allow an
overdraw of 100 blocks if possible. If your quota
is exceeded the message: "[Insufficient disk space
to do output]" will be printed on your terminal.
SOS will then wait for you to type "G", "T", "R", or
"W" which mean:
G Do the output (now and forever).
T Test disk space and do output if
space is available.
R Give resources and do output if space
is available.
W Wait until either space appears or you type
a different response.
-SOS- Page 68
APPENDIX F
SOS files:
1. HLP:SOS.HLP This file.
2. DOC:SOS23.DOC Changes from version 21 to version 23.
3. DOC:SOS.MAN User's manual for version 23E
4. SYS:SOS.EXE The editor.
SOS %23(221) Help file 13-Jan-77
Summary of SOS commands:
Cmd Meaning [Parameters]
P Print [<range>,<poptions>]
<LF> Print next line
$ Print preceeding line
I Insert [<position>,<increment>]
D Delete [<range>]
R Replace [<range>,<increment>]
F Find [<string>$<range>,<foptions>]
S Substitute [<old string>$<new string>$<range>,<soptions>]
N ReNumber lines [<increment>,<range>,<start1>,<start2>]
NA Add <increment> to <range>
NP Preserve line numbers over page marks
C Copy [<dest-position>,<range>]
or [<dest-position>=<filespec>,<range>]
T Transfer [<dest-position>,<range>]
A Alter [<range>,<aoptions>]
X eXtend [<range>,<xoptions>]
E End SOS editing session & return to Monitor
ES Unsequence resulting output file
EN (Same as ES)
ET Remove sequence numbers and Form Feeds from output file
EB Suppress backup file creation
EQ Quit (leaves file in unedited state)
ED Delete file being written or read
EX Same as "E" command (for TECO compatability)
G Go (End SOS editing session & run specified program)
W Save World (saves current version of edited file)
M Insert page Mark [<position>]
K Kill page mark [/<page number>][:/<page number>]
VV InVert case [<range>,<voptions>]
VU ConVert to Upper case [<range>,<voptions>]
VL ConVert to Lower case [<range>,<voptions>]
B Position to first line of file
BP Position to first line of current page
. Position to given line [<position>]
J Join [<position>]
L List (on LPT) [<range>]
/ Set SOS parameter [<parameter>]
= Print SOS parameter [<parameter>]
@ Invoke indirect command file [<filespec>]
; Comment line [<any text>]
-SOS- Page 69
JU Justify [<range>]
JL Justify left [<range>]
JR Justify right [<range>]
JC Justify center[<range>]
JW Justify word [<range>]
H Help (prints this text)
^G^G Cancel command being entered
^C^C Interrupt current command (enters dialog)
Alter Command operations:
nC<ch> Change n characters
-nD Delete next/last n characters
E Finish line with no printing
nI<text>$ Insert with temp increment n
J Break line and stick rest at front of next
-nK<ch> Delete to n occurrences of <ch>
L Print line and reposition to start of line
P Print line and reprint to current position
B Reposition to start of line
Q Quit ALTER (restore original line)
-nR<text>$ Delete n characters then insert (0I)
-nS<ch> Skip forward/backward n occurrences of <ch>
nW Skip forward n words
nU Delete n words
T<text>$ Delete word then insert text (0I)
-n<SP> Space forward/backward n characters
<CR> Print rest of line & finish it
n<RUB> Backspace n characters
n<BS> Backspace n characters
-<HT> Skip to end/start of line
-X Insert characters at start/end of line
-n^ Like <SP>, except inverts case of letters
-n< Like <SP>, except converts letters to upper case
-n> Like <SP>, except converts letters to lower case
nV Invert case of letters
-n@<cmd><ch> Execute <cmd> through n'th occurrence of <ch>
^U Restore original condition of current line
^R Print current line status
$ End text insertion; cancel repeat count
Special functions of the "I" command:
I<CR> Resume previous insertion (I or R command stopped by $)
I/<page> Insert page mark at end of <page>, followed by text inserted
on empty <page>+1.
I<pos>;!n Select increment from table of aesthetic values to permit
insertion of at least n lines of text.
-SOS- Page 70
SOS Parameters:
Name Set Print Default Value What
ADM3A Y CASE Off Type of CRT-sets CRT mode
. N Y --- Current <position>
BAK Y Y On Create backup file <.Qxx>
BASIC I N Off (unless *.BAS) Read BASIC file
BIG N Y --- Largest page #
BLOCK I Y On Output file line-blocked
C64 Y CASE On 64 character set
C128 Y CASE Off (uses "?") 128 character set
CASE N CASE C64 M33 UPPER Give case information
CHECK Y Y Off Do quota checking
COLUMN N Y --- Print terminal column #'s
COMPRESS I BLOCK Off Output file compressed
CORE I N 1.5K Set size of edit buffer
CREATE I NAME Off Create new file
DECIDE Y Y Off Auto ",D"
DELETE Y Y Off Delete input file
DISK N Y --- Current quota information
DSK (Same as DISK)
DPY N CASE Off Use specific CRT switch
EDIT I NAME On Normal edit/create mode
ERROR N Y --- Print text of last error msg
EXACT Y Y Off Exact letter comparisons
EXPERT Y N Off Fancy features & short msgs
INCREMENT Y Y 100 Default line increment
ISAVE Y Y None Controls auto-W on inserts
LENGTH Y Y 55 Used by Justify cmds
LMAR Y Y 1 Used by Justify cmds
LOCATION N Y --- First line in edit buffer
LOWER Y CASE Off Default lower case
MAXLN Y Y 99999 Used by Justify cmds
M33 Y CASE On Upper-case only terminal
M37 Y CASE Off Upper/lower case terminal
NAME S Y --- Output file spec
NOBAK Y BAK Off No backup file
N (Same as NOBAK)
NOBASIC I N On (unless *.BAS) Read SOS-format file
NOCHECK Y CHECK On No quota checking
NODECIDE Y DECIDE On No auto ",D"
NODELETE Y DELETE On Don't delete input file
NOEXACT Y EXACT On Folded letter comparisons
NONSEPARATOR Y CASE On Don't treat %,$,. as alphanum
NONUMBER Y N Off Suppress printing line #'s
NOVICE Y N On Normal mode
NUMBER Y N On Print line numbers
OLD Y BAK Off Create "old" file (.Zxx)
OPTION I N --- Read "SWITCH.INI" file
PLINES Y Y 16 Used by "P<CR>"
PMAR Y Y 1 Used by Justify cmds
READONLY I NAME Off Prevent file modification
R (Same as READONLY)
RONLY (Same as READONLY)
RMAR Y Y 69 Used by Justify cmds
-SOS- Page 71
RUN Y Y "SYS:COMPIL" Set program to run (G cmd)
SAVE Y Y None Controls auto-W on commands
SEPARATOR Y N Off Treat %,$,. as alphanumeric
SEQUENCE Y Y On Sequence #'s on output file
START Y Y 100 Starting sequence #
STEP Y Y 100 Increment for unseq. files
STRING N Y --- Current F & S strings
TEXT Y N Off Continuous text output file
UNSEQUENCE Y SEQUENCE Off Unsequence output file
UPPER Y CASE On Default upper case
VT05 Y CASE Off Type of CRT-sets CRT mode
VT52 Y CASE Off Type of CRT-sets CRT mode
User option file "SWITCH.INI" is read to set parameter defaults before
SOS command string is parsed. "Y" in "Set" column means parameter may
be set via SOS command, SOS "SWITCH.INI" entry, or "/" Set command; "I"
means parameter must be set with SOS command or "SWITCH.INI" entry; and
"S" means parameter must be set with "/" Set command.
SOS Special Characters:
Replacement: ^B ?" Next match string
^O ?* ?*<number>?* is n'th match string
^^ ?7 Quote next character
Match: ^E ?% Not next character
^X ?9 Any alphameric (0-9, A-Z, a-z)
^A ?! Any letter (A-Z, a-z)
^F ?& Any upper-case letter (A-Z)
^W ?2 Any lower-case letter (a-z)
^P ?+ Any decimal digit (0-9)
^\ ?< Space or Horizontal Tab
| ?: Any separator
^T ?/ Any character
^] ?> End of line
^N ?) "Zero or more of" next character
^V ?1 "One or more of" next character
Positions: . Present line or page
^ First line or page
* Last line or page
Symbolic BF:... Beginning of file
ranges: BF!... (Same)
...:EF End of file
EF Entire file
BF:EF (Same)
SOS definitions and meanings:
<range> ::= <pos>[!<number> or
:<pos>]
<pos> ::= [<line>][/<page>]
<line> ::= [<number> or
. or * or ^][(+-)<number>]
-SOS- Page 72
<page> ::= [<number> or
. or * or ^][(+-)<number>]
<number> ::= any positive integer
<filespec> ::= [dev:]name[.ext][<path>]
SOS Monitor Command format:
.EDIT command
.CREATE command or .R SOS - command
.SOS command
<command> ::= <spec> or <speco>=<speci>
where: <spec> = file to create/edit
<speco> = output file
<speci> = input file
<spec>
<speci> ::= [dev:]name[.ext][<path>][<nnn>][<psw>][/switches]
<speco>
<path> ::= [-] Default path
[,] User's own PPN
[PR,PG] PPN only
[PR,PG,SFD,...] Full path spec
[,,SFD,...] Use own PPN
<nnn> ::= Usual three-digit protection code, as in <157>
<psw> ::= (1-20 alphameric characters) Encryption password
/switches ::= One or more settable SOS parameters, as given above
[End of SOS.HLP]
-SOS- Page 73
APPENDIX G
Version 23 Features
1 The commands "B" and "BP", which position you to the
beginning of the file or the beginning of the current page,
respectively, have been implemented.
2 The number of simultaneous search strings that may be
given in a single "F" or "S" command has been increased from 6 to
10.
3 SOS provides an encryption feature for sensitive text
files. Encryption is requested by specifying an encryption code
(1-20 alphameric characters) enclosed in parenthesis following the
name of the file to be edited. Thus, command
.SOS TEXT.FIL(SECRET)
would either create or edit a file named "TEST.FIL" with an
encryption code "SECRET". To encrypt a previously-created file, the
command
.SOS CODED.FIL(KEYWORD)=PLAIN.FIL
would read the unencrypted file "PLAIN.FIL" and write the edited
file "CODED.FIL" using the encryption code "KEYWORD". To reverse
the process, the command
.SOS PLAIN.FIL=CODED.FIL(KEYWORD)
would similarly write the unencrypted file "PLAIN.FIL" as the edited
version of the encrypted "CODED.FIL".
At present, SOS can either read or write encrypted files.
IMPORTANT: It is the user's responsibility to
remember the encryption codes for all his
encrypted files. If a user cannot determine the
encryption code, the encrypted file will be
unreadable.
4 The Alter command ("A") has been improved in a number
of useful ways:
4.1 In Alter mode, the command "^R" types out the current line
from the left margin to the current position. This type-out
closely approximates the normal ^R output. Note that ^R may
be typed anytime in Alter mode, even while inserting text
into a line with the Alter-mode "I" or "R" commands, or
while typing arguments to the Alter-mode "C", "S", or "K"
commands.
4.2 Similarly, the command "^U" will always be taken in Alter
-SOS- Page 74
mode to restart the current line, even following a "I", "R",
"C", "S", or "K" operation.
Note that "^U" will produce an unexpected effect when typed
in as text for the Extend ("X") command. Because the "X"
command is implemented as an Alter mode operation with an
automatic insertion at end of line, typing "^U" terminates
the insertion and then puts you in Alter mode at the
beginning of the line.
4.3 The Backspace character (^H) is now completely equivalent to
the Rubout character (also known as the Delete or Del
character, 177 octal, sometimes written as "<RO>") in Alter
mode. This means that Backspace, like Rubout, deletes the
previous character as an "I" or "R" command character,
terminates the "C", "S", or "K" command operation, or as an
Alter command backs up the current character position.
4.4 The Alter-mode commands "^", "<", and ">" have been
implemented. These commands modify the case of the current
character, if it is a letter, and then move the current
character position one space to the right. The "^" command
inverts the case, "<" sets it to upper case, and ">" sets it
to lower case. If a repeat count has been specified, these
commands operate on that number of characters. If a
negative sign ("-") has been specified, these commands
operate on the previous character and then move the current
character position one space to the left. A negative repeat
count is also legal.
4.5 The Alter-mode command "B" immediately positions you to the
beginning of the current line. This command differs from
"L", which also positions you at the beginning of the
current line, in that it does not type the remainder of the
line before repositioning.
4.6 An ALTMODE (Escape, or ESC character) in Alter mode now
clears the accumulated repeat count and negative sign, if
any, without ringing the terminal's audible alarm (bell).
4.7 A greater number of Alter-mode commands may be used with
negative repeat counts. These include " " (space forwards),
Rubout or Backspace (space backwards), "@" (execute command
forwards - see 4.15, below), "D" (delete forwards), "R"
(delete forwards and then insert), "S" (search forwards),
"K" (kill next characters), "<HT>" (space to end of line),
and "X" (insert at end of line). When a negative sign ("-")
or negative repeat count ("-nn") is given the direction in
which a command operates is reversed, e.g., "-D" deletes
backwards instead of forwards, "-X" inserts at the start of
the line, etc. Note in the previous version "^U" was
illegal following a minus sign, which prevented the user
from restoring the original line under certain command
sequences.
4.8 As for other SOS modes, typing two Bell characters in
succession ("^G^G") will now terminate alter mode and return
-SOS- Page 75
you to SOS command mode (i.e., a "*" will be typed). The
line currently being altered will remain intact.
4.9 Control characters typed during Alter mode will now be
echoed as such (as "^<char>").
4.10 For the "C", "S", and "K" commands, the Carriage Return <CR>
character will now terminate the Alter-mode operation on the
current line, just as Carriage Return now terminates
operations on the "I" and "R" commands. Similarly, the
ALTMODE (Escape, or ESC character) will terminate the "C",
"S", or "K" operation, just as Backspace or Rubout does, but
leaves you in Alter mode on the current line at the current
position.
4.11 For the "S" and "K" commands, the initial character position
may be thought of as being before the first character
position on the line, so that an S command for the first
character in the line will find it, and a K command for the
first character will not kill any characters. This makes
Alter mode operations more consistent since, for example, in
a FORTRAN program, a search for a horizontal tab character
(e.g., typing "S<HT>") at the beginning of the line will
always put you at column 7, whether or not the line has a
FORTRAN statement number.
4.12 The "T", "W", "U", and "X" Alter-mode commands have been
changed from prior versions to provide greater word-handling
capability and to make Alter mode more consistent with other
SOS commands. "W" retains its present meaning of "skip next
word"; a word is defined as any collection of letters,
numbers, and the three separator-type special characters
".", "%", and "$". In version 23(220), "T" means "delete
next word and insert text"; "U" means "delete next word";
"X" means "skip to end of line and insert text", analogous
to the normal "X" (Extend) command. Note that "-X" is a
legal command meaning "skip to beginning of line and insert
text". For both "T" and "X" text is inserted until an
Altmode" or <CR> is typed.
This implementation replaces the prior version in which "X"
meant "delete word and insert text" (current "T" function )
and "T" and "U" were errors.
4.13 In Expert mode, text backspaced across (in response to a
"<RO>", "-<SP>", or "-S" command) is not typed when the
result would be that the character pointer will be at the
start of the line. Instead, the line number is again typed
to indicate this result.
4.14 For the "K", "S", and "C" commands, the Line-feed character
("<LF>") has been given a special meaning "end of line".
Thus, "K<LF>" kills all characters to end of line (beginning
of line if "-K"); and "S" searches to the end of line
(beginning of line if "-S"). Changing a character to a line
feed with "C<LF>" now inserts an <CR><LF> and copies the
remaining text to a new line, analogous the insertion of a
-SOS- Page 76
<LF> with the "I", "R", "T", or "X" command.
4.15 An important extension to the Alter mode command facility
has been implemented. This is the "Execute through" command
("@"), which has the syntax
[-] [nn] @ <cmd> <char>
and specifies to execute the Alter mode command "<cmd>"
through the "nn"th occurrence of "<char>". The command
searches backwards if the minus sign has been specified and
if minus is legal for the specified "<cmd>". This command
supports the following command characters: " " ("@ <char>"
is equivalent to "S<char>"), "C", "^", ">", "<", "D"
("@D<char>" is equivalent to "K<char>"), and "V" (see 4.19,
below). All commands except "C" and "V" may search in
either direction; only the " " command may be used when
searching a /READONLY file. The "@" command follows the new
convention for initial character position described in 4.11
and obeys the added special-character conventions for
Carriage Return, Altmode, Backspace, Rubout, Line Feed, ^R,
and ^U described in 4.1, 4.2, 4.3, 4.10, and 4.14, above.
4.16 The Alter mode character-matching facility, used by the "S",
"K", and "@" commands, has been improved.
First, letter comparisons will be either exact (upper case
distinct from lower case) or folded (upper case and lower
case are equal) depending on the setting of the "/EXACT"
switch and the ",E" argument, as described in item 28,
below.
Second, all pattern match special characters as described in
item 29, below, except "any number of" and "one or more of",
may be used as target characters. This means, for example,
that the command "K?:" when in /C128 mode will delete all
characters through the next "Separator".
4.17 The "^R" function now prints the correct number of
characters when following a "-D" command.
4.18 The Join function ("J") when given while positioned at the
beginning of a line now deletes the first line while
appending the text of that line to the beginning of the next
line. This was done to facilitate alignment of text into
evenly spaced lines.
4.19 The "V" command (Stanford case inversion command) has been
implemented for Alter mode. If the current character is a
letter, the "V" command inverts its case and spaces one
character to the left. Otherwise, the "V" command performs
no action. A repeat count may be specified, to permit the
case of consequitive letters to be inverted; or the same
effect may be achieved by using the "V" command as the
subject of the "@" command. However, the "V" command only
works left-to-right; a minus sign (negative repeat count)
may not be given.
-SOS- Page 77
5 The following changes have been made to SOS's handling of data
files and file specifications:
5.1 SOS now uses that PATH. UUO to verify that a LOOKUP has
found the desired file in the specified disk area. This may
occur when the user's search list has /LIB, /SYS, or /NEW
set. Specifically, in the normal SOS operation, when only
one file is specified and /READONLY is not in effect, the
specified file must be found in the disk area requested in
order to be edited. This means that if you attempt to edit
a file, which exists in your library area (i.e., on LIB:),
the file will be created in your area and not edited from
LIB:. To edit a file from LIB:, you must specify the file
as "LIB:file.ext".
5.2 In the normal SOS operation, when only one file is specified
and /READONLY is not in effect, if you have requested that a
file be edited that is not in either your default path or
your own disk area, SOS treats that as a request to read the
file from the specified disk area and write the edited
version onto your default path. This is an "implied copy"
operation.
When SOS does an implied copy, it uses the file
specification "DSK:file.ext[-]". SOS follows the normal
rules, as given in 5.3, below, for setting the file
protection on the resulting output file. To edit a file "in
place" in another disk area, you must give the other disk
area as both the input and output file specifications.
Because this feature is designed to keep the less
experienced SOS user from getting into trouble,
installations serving the more experienced user may disable
this feature with the "FTIMPCPY" conditional assembly
switch.
5.3 Whenever you give a file spec to SOS, you may now include
the protection to be associated with that file as part of
the file specification, as in "SAMPLE.CBL<157>". The
protection last typed as part of the file spec on either the
input or output side of the initial command line, as the
argument to /NAME, or as the new file name on the "E" or "W"
commands will set the protection for the edited output file.
If no protection is specified, SOS will use the
system-standard protection when creating files and the
file's current protection when editing existing files.
5.4 Whenever SOS types a file specification out, for example at
the end of an editing session, it will only type out the
device if it is not DSK: (or a file structure name
equivalent to DSK:), only type out the protection if it is
not the system standard, and only type the file's path if it
is not your default path. A file structure is equivalent to
DSK: when it is in the system search list (i.e., is a
public structure), when it is the only structure in the
user's active search list, and when it has the normal file
structure /WRITE and /CREATE attributes.
-SOS- Page 78
5.5 When editing from one file to another, SOS will type out the
file specifications as
Edit: <old file> as <new file>
to inform you that a copy operation is being performed as a
part of the editing process. If /CREATE has been set, the
message is typed as
Edit: <old file> creating <new file>
to indicate this. Note that a copy operation may be implied
from a single file spec accessing a file not in your disk
area or on your default path, as described in item 5.2,
above.
5.6 All SOS output files are written in ASCII Line mode (mode 1)
to better indicate their contents.
5.7 SOS file specifications may now be placed on the same line
as the RUN or R command initiating SOS by preceeding the
file specifications with a "-". Thus the command
.R SOS - TEST.F4
would be equivalent to the commands
.R SOS
File: TEST.F4
but is simpler to type. If you have previously edited a
file, and you wish to run SOS to edit or create a different
file, typing a dash ("-") following the RUN or R command
without a file name will cause SOS to ignore the remembered
file name. (Note that this is a new description of an
existing feature of SOS version 21(122).)
5.8 SOS does not echo the name of the file being edited when the
user entered the file name explicitly in response to the
"File: " prompt. This was eliminated since in that
particular case the user already knows what file is being
edited.
5.9 A "save" operation, caused either by the "W" command or an
auto-save operation requested by the "/SAVE" or "/ISAVE"
parameters, may now be done where the desired output file
protection is <400> or greater. In this case, the file's
protection is set to <3xx> by the save operation but reset
to the desired protection at the end of the editing session
("E" or "G" commands).
5.10 All SOS operations reading or writing files from ersatz
devices (e.g., NEW:, OLD:, HLP:, LIB:, etc.) will work
correctly. When accessing ersatz devices, SOS will ignore
any PPNs specified by the user since the device name
overrides the PPN.
-SOS- Page 79
5.11 The effect of the "/DELETE" switch or the "ED" command has
been modified when SOS has a specified output file which is
not the same as the input file. This situation can occur
when the user has typed an SOS command such as
.SOS FILE.NEW = FILE.OLD
or when the user has set a new output file with the "/NAME"
command. When this occurs, SOS will delete only the new
file (FILE.NEW in the above example) and only when SOS has
written a new copy of that file. Thus, when only one file
has been specified (the so-called "browse-and-delete"
function) /DELETE will delete that file; when both input
and output files have been given /DELETE will delete only
the output file and never the input file.
5.12 WARNING: PLANETS users should be aware of a potential
naming conflict between SOS backup files (*.Q??) and PLANETS
quarterly data banks (*.QTR). To prevent the PLANETS data
banks from being deleted by the DELETE command (as in
".DELETE *.Q*"), the data banks should be given <5xx>
protection. If you use the KJOB command "/S" option (as in
".KJOB/S" or ".K/S") any protection <100> or higher will
protect the data banks from deletion while logging out.
5.13 When set in "/NOBAK" mode, SOS will not delete previously
existing backup files (*.Q??) when saving a new version of a
source file. This permits a user to access a backup file
created by SOS when a source file was edited in "/NOBAK"
mode after the same file had been edited in "/BAK" mode.
This change also makes SOS slightly more efficient when
operating in "/NOBAK" mode.
Although the standard default for the "/BAK /NOBAK /OLD" set
of switches is "/BAK", a user may change what default with
an SOS SWITCH.INI entry; an installation may now change
that default by reassembly of SOS after changing the
"DEFBAK" conditional assembly switch.
5.14 Because prior SOS code would not recover from "No room on
disk" error while writing output files, SOS now sets
"DSKFUL PAUSE" during editing sessions. When the no-room
error then occurs, SOS would then return to Monitor level to
permit the user to eliminate the error condition and then
resume editing with the Monitor "CONTINUE" command. SOS
resets the "DSKFUL" setting to the user's prior setting upon
exit.
In addition, the user still may request SOS to check that
adequate disk space exists before writing each block of a
file by setting the /CHECK parameter. If no room exists,
SOS enters a dialog with the user to permit correction of
the error.
5.15 The format of the "=DISK" message and the "/CHECK"
diagnostic warning has been slightly reworded to clarify its
meaning.
-SOS- Page 80
5.16 To conform to normal DECsystem-10 conventions, SOS now looks
for the "SWITCH.INI" option file on the user's default path
("[-]") and uses the user's PPN ("[,]") for the "???EDS.TMP"
and "???EDT.TMP" command files. Writing the command files
in the user's own area assures that SOS commands will remain
remembered when the user changes his default path and makes
SOS perform consistently whether the files are written on
disk or in TMPCOR.
5.17 Where an input file can be read, but not renamed or deleted
by SOS, SOS now assumes the file is to read as /READONLY and
types an appropriate warning message.
5.18 When editing existing files, SOS attempts to optimize disk
file allocation by taking the actual size of the old file
and passing that size to the Monitor as an estimated file
size of the new file being created. Where disk space is
available, this means that the new version of the file will
get contiguous allocated disk space. This tends to reduce
overall disk space fragmentation and increase the speed at
which the new file may be read. However, no extra space
will be used if the new file is shorter than the old; nor
will anything bad happen if the new file is longer than the
old or if not enough contiguous space is available.
This optimization is done by using extended LOOKUP and ENTER
UUOs. Similarly, SOS now used the CHKACC UUO to determine
access privileges for all files being read or written. When
SOS detects that it cannot write a file to a certain disk
area, it gives the fatal message
? Insufficient privileges to write file
and exits to the Monitor. No editing work will be lost
because this condition will be detected at the start of an
editing session.
This change should mean that SOS will never be able to get
in the situation when exiting that the user cannot respond
the the message
?File write-protected. Try another name.
File:
because SOS has written a temporary file in a disk area with
a protection which prevents SOS from renaming or changing
the protection of the file. Determining access privileges
with the CHKACC UUO means that [1,2] users may edit files in
any disk area regardless of their protection.
5.19 Because SOS remembers that the file being edited has been
changed to determine whether to write a new copy of the file
when wrapping around to the beginning, when saving the file
("W" command), or when exiting ("E" or "G" command), logic
has been added so that changing a line to itself will not
count as a change to the file.
-SOS- Page 81
In a related improvement, the Save command ("W") will not
write a new copy of the file or reposition to the beginning
of the file when the file has not been changed.
Furthermore, commands that change the file to itself are not
counted by the /SAVE auto-save feature.
These changes will reduce SOS overhead.
6 The SOS mode /UPPER or /LOWER now is effective to invert the case
when in /C128 mode. This makes more sense that the prior
implementation, because if the user is working on an upper-case
only (/M33) terminal (s)he has no control over case in /C64 mode.
In contrast, if the user is working on upper/lower case (/M37)
terminals in /C64 mode typing characters out in inverted case when
the terminal can display both upper and lower case letters is
likely to be confusing. This means that /LOWER mode controls the
inversion of only /C128 (not /C64) upper or lower case letters.
7 Indirect command files may now invoke other indirect command files
with the "@" command. Note that this invokation is a permanent
transfer of control to the next indirect file, and is not in the
nature of a subroutine call.
As a convenience for the user, reaching an end-of-file on the
indirect command file will now not clear further SOS commands
typed ahead on the terminal.
8 When an "=" command is read from an indirect command file, the
name of the requested variable is typed out to indicate the user
what is being displayed.
9 When reading commands from an indirect file, the ^O terminal
status is not cleared between commands, so that the user may
easily suppress all typed output.
10 The "implied ." convention has been implemented. This means that
where you would use a "." to indicate the current line number (as
in ".+1"), you may omit the "." and SOS will assume it for you
(i.e., the above example ".+1" may also be given as "+1").
Normally, when SOS is in Novice mode (the default) SOS will assume
the "." only in the middle of the command, as in "I;10" or
"D:500". When in Expert mode, the SOS commands "D", "R", "X",
"M", "K", "A", "JU", "J", ".", "VV", "VU", and "VL" when typed
without any arguments, as in "D<CR>" or "A<CR>", will specify an
operation on the current line. Thus, the examples given if in
Expert mode will, respectively, delete and alter the current line.
However, the commands "P", "I", "L", and "N" will retain their
current implementation for an unspecified range. The command
"P<CR>" will print "PLINES" of text starting at the current line;
"I<CR>" will continue the previous insert operation; and "L<CR>"
will list the entire file. Also, a null range for the "N"
command, as in "N<CR>" or "N50<CR>" will renumber the entire file.
-SOS- Page 82
11 For compatability between the "T" and "C" commands as compared
with the "I" and "R" commands, the "T" and "C" commands will now
accept the increment delimited by a semi-colon as well as a comma.
12 For the "I" and "R" commands, you may now specify the number of
lines to be inserted with a "!" as well as with a ";!" delimiter.
Care must be taken for the "R" command. The command "Rn!m" means
"delete 'm' lines starting at line 'n' and then insert using the
current increment" NOT "delete line 'n' and insert using an
increment that will permit 'm' lines of insertion." To specify the
latter, the command would have to be "Rn;!m", with the ";"
specifying that the "!m" is an insertion count and not a range
specification. However, the command "Rn!m!k" is legal and
specifies the deletion of 'm' lines starting at line 'n' followed
by an insertion with an increment which will permit 'k' lines of
text.
When you specify the number of lines to be inserted, SOS
automatically computes the largest reasonable increment that may
be used to insert that number of lines at that place in the file.
The increment is selected from the list (1, 2, 4, 5, 10, 20, 25,
40, 50, 100) but cannot exceed your current permanent increment.
13 When an "I" or "R" command terminates, SOS now remembers the
increment being used, as well as the position, for use with the
next "I<CR>" command.
14 When in Novice mode, the message giving the number of lines
deleted for the "R" command now appears before the replacement
lines are inserted, and not afterward as before. Also, a similar
message is produced when lines are deleted by the "T" command.
15 The 128-character-set mode (C128) escape character has been made a
user parameter. It may be set to any printing special character;
the default is "?", which is compatible with older versions of
SOS. It is believed that "?" is a preferred escape character
over "'", because "'" has syntactic meaning in many common
programming languages, among them MACRO, FORTRAN, and COBOL, while
"?" does not have such a wide-spread meaning. In any event, this
implementation permits an installation to change the default
escape character by setting the assembly parameter "DFC128", and
permits each user to have his default set via SWITCH.INI. To set
the escape character, the command
/C128:<character>
is used, where "<character>" is the desired C128 escape character.
The command
/C128
with no argument sets C128 mode but does not change the escape
character, and the command "=CASE" displays the current C128
escape character when SOS is in C128 mode.
-SOS- Page 83
The rules for C128 character mapping are consistent with current
implementation; the current C128 escape character always maps
into itself for input or output while all other characters follow
the current C128 mappings. Item 51, below, describes the addition
of Rubout as a new /C128 character.
If "?" is the current C128 escape character while "/C128" is in
effect typing "??" on input would supply one "?" while one "?" in
a text file would type out as "??". As a further convenience,
both of the characters "?" and "'", if not the C128 escape
character, map into <BELL> (^G) so that that character may be
entered with either "?" or "'" as the escape character, e.g., as
"?'" or "'?", respectively. Note that setting the /C128 escape
character to any special character other than "?" or "'", while
legal, will preempt the normal use of a /C128 character value.
16 The renumber command ("N") has been improved. If the first
argument (the increment) is omitted, the current permanent
increment is used. This makes "N" consistent with "I", "R", "T",
and "C".
Second, to prevent the creation of "Order" errors, the error
message "%Illegal starting line number" ("%ISLN" in Expert mode)
is given if the specified starting line number for the first page
is not greater than the preceeding line.
Third, the starting line number for subsequent pages (i.e., when a
"N" command renumbers more than one page) is taken to be the
specified increment if one was specified, or the "START" parameter
if none was given. (See 17, below.) Furthermore, the user may
specify the starting line number for subsequent pages with a
newly-added fourth parameter to the renumber command.
Fourth, and perhaps most important, when the third argument
(starting line number for the first page) is omitted, it defaults
to the specified first line number of the renumbering range when
there is a previous line on the same page, and otherwise to the
starting line number for subsequent pages. This change means, as
a practical matter, the user never has to specify a starting line
number for normal renumbering operations.
17 The SOS parameters "START", "STEP", and "INCR" will always be used
for determining line numbers. START defines the first line number
on a new page, where a page is being created or does not have any
lines; STEP defines the increment to use when reading existing
unsequenced ASCII files; and INCR is the increment to use when
creating or copying lines.
18 The file-specification on the Copy command ("C") when copying from
another file will now default to the previous file from which text
was copied. If no previous copy-from-file operation has been
performed, attempting to default the file specification will be an
illegal command. The file specification is defaulted by omitting
it from the normal copy command. When a file specification is
defaulted, SOS will indicate the file being used by typing
"Copy: <file spec>" to the user. If the default is not desired,
typing "EQ" will terminate the command if the search mode (/S
-SOS- Page 84
option) has been taken. This feature should facilitate copying
multiple pieces of text from the same file.
19 Several improvements have been made to the Transfer ("T") and Copy
("C") commands. First, the informational messages indicating that
an increment has been chosen (the "INC1=" and "INC2=" messages)
will be suppressed when it was not necessary to choose an
increment, even though the user did not supply one. This can
occur when a single line is inserted between two lines, or when
during a multiple-page insertion the last page transferred is
given a page of its own.
Second, when it is necessary to choose an increment, and the user
did not supply one, SOS will apply the same algorithm used for
insertions (see 12, above) and select either the current increment
or the largest rounded increment that will permit all lines to be
inserted. Also, when selecting an increment SOS will now
reasonably generate the first line number of the inserted text.
Third, if during a Copy or Transfer operation while SOS is moving
all text to be inserted to free core it runs out of core, the
"%Not Enough Core" ("%NEC") error message will indicate the line
and page number at which core was exceeded. This will permit the
user to break the Copy or Transfer operation into smaller chunks.
20 The definition of the Print command with no arguments ("P<CR>")
has been "print 'PLINE' lines starting at the current line". To
assist the user in paging down through the file with this command,
SOS will not reprint the current line of successive "P<CR>"
commands; rather, the first such command will print as before
while all successive commands will start printing at the next
line. This means that lines will not get typed twice when doing
successive "P<CR>" commands.
21 The bug that any "save" operation, either a "W" command or an
auto-save function requested by the /SAVE or /ISAVE parameter,
while reading an indirect command file resulted in an "IO to
unassigned channel" error has been fixed.
22 The Move command (".<line number>"), which sets the current line
number to the specified line, has been made more flexible. It no
longer requires that the specified line exist; if is does not,
the current line is set to the next line following the specified
line. Also, the command "./n" will set the current line to be the
first line on page 'n', or to line 'START' (see 17, above) if the
page is empty.
23 SOS now has the "/CREATE" and "/EDIT" switches. "/CREATE" tells
SOS not to read an existing file and to give the user an option to
rename his created file or delete the existing file of the same
name before writing the new version of that file. "/EDIT" causes
SOS to operate as it previously always did, reading and
superceding existing files but permitting the user to create
nonexistent files. "/EDIT" is the default when SOS is run by the
RUN UUO, or by the RUN, R, SOS, or EDIT commands; "/CREATE" is
the default when SOS is run with the CREATE command. "/CREATE"
and "/EDIT" switches override the /READONLY switch; those three
-SOS- Page 85
switches are mutually exclusive. These switches may only be given
on the initial command line or in SWITCH.INI.
When SOS is in a "/CREATE" mode, the "=NAME" command will now type
"Creating <file spec>" to indicate this. Similarly, when SOS is
in /READONLY mode, the "=NAME" command will type "Reading
<file spec>".
24 Some changes to internal text buffer handling have made the new
SOS more efficient than earlier versions. While some improvements
apply to all commands which operate on text, the largest
improvements will be seen for Insert, Replace, Copy, and Transfer
commands. At the extreme, a 44% reduction in CPU time has been
observed while doing a large (50 textual page) Copy operation.
25 As a convenience to the user, and to conform SOS to normal
DECsystem-10 command scanning, the user may now omit the trailing
"]" on file specifications when that would be the last character
of the line.
26 On certain types of terminals (Texas Instruments Silent 700 at 300
baud, for example) the "<LF>" command (print next line) overprints
part of the sequence number of the line printed, due to a Monitor
design deficiency in terminal character handling. To assist the
users when the happens, the "/DPY" mode may be set. Note that
"/DPY" is designed to produce terminal output compressed for
display terminals (CRTs) and this added benefit is unintended.
For example, "/DPY" mode also suppresses the blank line normally
typed before the "Page n" output.
27 The "Decide" option for the Substitute command ("S"), for the Find
command ("F" - see item 47, below), and for context line numbers
("$<string>$<CR>" as a line number) has been improved.
First, when SOS is waiting for a user decision, it will clear the
terminal's ^O status, type the line to be accepted, and then
prompt with the characters "D*".
Second, when an incorrect response has been typed for the Decide
input, SOS will type "? ", clear type-ahead, and ring the
terminal's audible alarm (bell) to indicate the error. It will
then wait for a correct input.
Third, when the "Rubout" or "Delete" response is typed to indicate
that the changes or the line is not accepted or when "E" or "Q" is
typed to terminate a Find or Substitute command, when you are not
in Expert mode SOS will type an appropriate confirmation.
Fourth, the global SOS parameter "/DECIDE" will now be applied to
context line number searches as well as Find and Substitute
commands.
Fifth, the effect of the ",D" parameter for the Find and
Substitute commands and for context line number searches is to
invert the setting of "/DECIDE". Thus, if "/DECIDE" is set, the
",D" parameter will tell SOS not to perform the command in Decide
mode.
-SOS- Page 86
28 The Exact-match parameter ",E", on the Find and Substitute
commands, and on the context line number search, has been extended
to have features analogous to the Decide option described in 27,
above.
First, for the Alter command ("A") and for the Extend command
("X") the exact-match parameter (",E") has been added. This
permits the user the control whether the case of a letter is
considered when doing character comparisons for the "S", "K", and
"@" Alter-mode commands, as described in 4.16, above.
Second, the parameters "/EXACT" and "/NOEXACT" have been
implemented to control the default for character comparisons.
/EXACT implies that upper case letters are distinct from lower
case letters; /NOEXACT treats upper and lower case letters as
equivalent when comparing characters. The command "=EXACT" will
display the "/EXACT" switch setting; the initial condition is
"/NOEXACT".
Third, the definition of the ",E" parameter has been changed to
make ",E" invert the current "/EXACT" default value.
Fourth, the bug which caused the ",E" parameters on the Find and
Substitute commands to interact has been eliminated.
29 Several new pattern matching special functions have been
implemented, so that SOS and TECO Version 23 would have similar
capabilities. These functions are implemented as special
characters, similar to the existing pattern matching functions in
SOS; these characters may be entered as either "/C128" double
characters or by typing the appropriate control characters. All
pattern-matching special characters are now as follows:
-SOS- Page 87
Character C128 rep New? Use? Description
--------- -------- ---- ---- --------------------------------
^^ ?7 No Any "Quote" next character; the
next character is taken for
itself without any special
interpretation
^E ?% No Pattern "Not" next character
^X ?9 Yes Pattern Any alphameric (0-9, A-Z, a-z)
^A ?! Yes Pattern Any letter (A-Z, a-z)
^F ?& Yes Pattern Any upper-case letter (A-Z)
^W ?2 Yes Pattern Any lower-case letter (a-z)
^P ?+ Yes Pattern Any decimal digit (0-9)
^\ ?< Yes Pattern Space or Horizontal Tab
| ?: No Pattern Any separator (Note this
character is vertical bar, 174
octal, not back slash as
produced on some line printers.)
^T(*) ?/ No Pattern Any character (equivalent to
"Not End of line")
^] ?> Yes Pattern End of line (equivalent to "Not
Any Character")
^N ?) No F,S "Any number of" next character
(zero or more occurrences)
^V ?1 Yes F,S "One or more of" the next
character
^O ?* No String Substitute string number
delimiter
^B ?" No String Next substitute string
(*) Needs "SET TTY RTCOMPATABILITY" to be available for SOS use.
Notice that all characters identified as "Pattern" usage may be
used as arguments for Alter mode character-comparison commands;
and all characters identified as either "Pattern" or "F,S" usage
may be used in context line search strings.
A brief description of the SOS pattern-matching algorithm might be
in order here: The SOS pattern-matching algorithm will always
match the shortest, leftmost string that corresponds to the given
pattern. (This is the same algorithm the SNOBOL languages use.)
This affects the user in several significant ways: First, the
"any number of" operator likes to match zero characters, since
that is the shortest possible string. When "any number of" is
used as the first or last match in a pattern it will always match
zero characters; in those positions it is redundant! Second,
since the "end of line" operator may match either the beginning or
the end of a line, when it is given first in a pattern it will
match the beginning and when given last it will match the end.
Obviously, when it is given in the middle of a pattern other than
one consisting of "any number of" operators collapsing to zero,
that pattern will never successfully match anything.
30 The optional modifiers (",E", ",D", ",nnn", etc.) which may be
specified on the Find, Substitute, Print, and Extend commands and
on the context line search string may now be specified in any
order. However, each modifier may only be specified once. For
the syntax of the Find command, see item 47, below.
-SOS- Page 88
For the Substitute ("S") command, if ",N" (suppress printing the
changed line) is typed and Decide mode is in effect because either
"/DECIDE" has been set or the ",D" option was given, the effect is
to perform substitutions using the normal Decide operations until
the "G" reply (leave Decide mode) is given, at which time no
further substitutions are typed. This could be very useful for
"debugging" a Substitute command before performing a number of
substitutions.
31 Changes have been made in the default range and repeat counts for
the Find and Substitute commands, and for the context line search,
to make the defaults more consistent and rational.
For the Find command, the default when a search string has been
given without a range or count (i.e., a command like "F<string>$",
the normal case) is to search from the current line to the end of
the file for the next single occurrence of the string. When the
search string is not given, either for a "F" or "F$" command, the
default is search from the next line to the end of the preceeding
Find command range (which could be to the end of file by the
preceeding default) for the next single occurrence of the search
string given in the preceeding Find command.
For the Substitute command, the default when the old and new
strings have been given without a range or count is to search from
the current line to the end of the file and make a replacement
only in the first line found which contains the matching string.
When no search strings have been specified, as in "S<CR>", the
default is to search from the next line to the end of the
preceeding Substitute range (which might also have defaulted to
end of file) and make the substitution on the next single matching
line. This is done to make "S" function similarly to the "F"
command, and to minimize the harm done if one types "S"
accidently. However, to permit the user to perform a potentially
large number of pre-specified substitutions, the default for "S$"
command is to search from the next line to the end of the
preceeding Substitute range and make all substitutions.
The context line search follows the same conventions as the Find
command.
Starting the search range with the current line whenever the user
types a new search string (rather than defaulting the search
string with "F$...<CR>", "F<CR>", "S$...<CR>", or "S<CR>") assures
that SOS will never miss a potentiallly matching line. Because
the improvement is an obvious external change to the SOS
specifications, this improvement is under the control of the
"DEFCRL" conditional assembly switch.
32 The output produced by the "=STRING" command has been limited to
display only the Find, Substitute, or context line search strings
that the user has actually previously defined.
33 The "/NAME" command has been made illegal when "/READONLY" is in
effect, so that the user is prohibited from making a name change
on the file being read and to simplify some internal logic. /NAME
is also illegal on the initial command line or as a SWITCH.INI
-SOS- Page 89
parameter for much the same reasons.
34 As a convenience for users running SOS on slow terminals, and as
an efficiency improvement, SOS will not type out the Horizontal
Tab following the sequence number when typing a null line.
35 To assist users in documenting SOS indirect command files, and to
permit annotation of SOS terminal sessions, SOS now has a comment
command (";"). When ";" is typed as an SOS command, any text
following the ";" through the next Carriage Return or Line Feed
character is ignored.
36 Several options have been added to the Exit ("E") and Go ("G")
commands. These are "N" to unsequence (as in "EN" or "GN", which
is identical to "ES" or "GS" but is consistent with PIP's /N
unsequencing switch); "X" to exit (as in "EX" or "GX", which is
identical to "E" or "G" but could help out the user familiar with
TECO); and the new facility "T". The "ET" or "GT" command is
designed to produce continuous textual-format output files in
which both the SOS sequence numbers and Page Marks (including the
Form Feed characters) have been removed.
This continuous-text output option may also be selected by the
"/TEXT" command. Since "/TEXT", "/SEQUENCE" and "/UNSEQUENCE" are
mutually exclusive options, the setting of "/TEXT" is displayed by
the "=SEQUENCE" command.
37 Some additional support for users editing BASIC programs with SOS
has been provided.
First, the default for editing or creating any file with the
extension 'BAS' is now "/BASIC". However, this may be overridden
by the "/NOBASIC" switch on the initial command line or in
SWITCH.INI.
Second, the default processor to run for a "G" command when
"/BASIC" is set is now "SYS:BASIC".
Third, because the SOS sequence number is part of the syntax of
the BASIC language, the Renumber, Copy, or Transfer commands,
which will modify the existing sequence numbering, produce the
query "Destroy numbering in BASIC file?" when not in Expert mode.
The user may reply "Y" or "N" to the question; the "N" answer
aborts the command and no harm is done.
Fourth, for compatability with BASIC, SOS will not given the "?Bad
BASIC file format" error when a Form-Feed character is the last
character in a BASIC file. Instead, the Form Feed is ignored.
39 To permit the user to trade off response time and core size
against the amount of text in core and file wrap-around time, the
"/CORE:nn" switch may be given on the initial command line. This
permits the user to specify the minimum amount of core ("nn") in K
(1024 words = 1 K) that SOS will reserve for the in-core text
buffer. SOS will actually allocate the minimum core size
specified and then utilize all available core up to the next K (or
P) boundary. The default minimum core size is 1.5K, which turns
-SOS- Page 90
out to be equivalent to a "/CORE:1" specification. The default
text buffer size may be changed be redefining the assembly
parameter "DEFCOR".
Users may determine the first line number currently in core with
the "=LOC" command and may determine the current core used by SOS
with the Monitor's ^T command. The "/CORE" switch allows SOS
users on Virtual Memory systems to keep larger sections of text
files in core.
40 The ^C trapping implementation has been improved. First, when SOS
is at command level (an asterisk prompt has been typed), typing ^C
followed by either a "C" (continue) or "R" (reenter) response will
now reprompt with another asterisk.
Second, when typing commands or text into SOS, typing ^C followed
by either "R" (reenter) or "E" (exit) will take effect
immediately. In the prior implementation, the user had to type a
Carriage Return for the reentry or exit to occur.
Third, the explanatory text typed in response to "H" has been
re-written to make it easier to understand by the casual SOS user.
41 As a user-selected option, SOS will now produce a more compact
file format for sequence-numbered output files. In this file
format, lines are not line-blocked; there is no wasted space in
the file for zero "space-filler" words except that the last single
word in a block might be zero to prevent a sequence number word
and its following Horizontal Tab from being split between two
blocks. In one test of a fifty-block MACRO source file, this
option resulted in a 4% reduction in file size. The actual
reduction in size depends on the contents of the data file being
compressed and the cluster size of file structure on which the
file is written. Whatever size reduction is achieved will also be
reflected in a corresponding decrease in the transfer time every
time the file is subsequently read.
This option may be selected by the "/BLOCK" and "/COMPRESS"
switches, which may be given only on the initial SOS command line
or in SWITCH.INI. "/BLOCK" specifies that line-blocking, the
previous SOS file format, should be written; this is the default.
"/COMPRESS" specifies the new compressed file format should be
written. These switches only apply to the format of files written
by SOS (including temporary work files); all versions of SOS will
read files written in either file format. The command "=BLOCK"
will display the file format in which the file is being written.
The default switch value is set with the conditional assembly
switch "DEFBLK".
We believe that all processors will accept both line-blocked and
compressed SOS files without change; however, because not every
processor has been tested the default has been set to "/BLOCK".
For example, we have confirmed that FILCOM will not find any
differences between line-blocked and compressed versions of one
sequence-numbered file. If a user determines that all the
programs that (s)he runs will accept compressed SOS files, that
user's own default may be changed with a SWITCH.INI parameter.
-SOS- Page 91
42 The correct range of deleted lines is reported in Novice mode for
the "D", "R", and "T" commands, when the range spanned more than
one page and no lines were deleted on the first page.
43 The range definition for the Delete ("D") command has been changed
to correspond to that of the Transfer ("T") and Copy ("C")
commands. This change only affects Delete operations in which the
first line number as not been specified, as in "D/2" or "D/3:/5".
In these cases, the Delete command now deletes both the Page Mark
preceeding the specified page (before page 2, and page 3,
respectively in the examples) as well as the contents of the
specified pages. Thus, the first example would delete the
contents of page 2 as well as the Page Mark preceeding page 2,
while the second example would delete the contents of, and Page
Marks preceeding, Pages 3, 4, and 5. This would be the same text
which would be moved if the range specifier was used as the source
lines of a Transfer or Copy command. This change also means that
the confirmation message "Massive delete ok?" is produced only
when SOS is going to delete one or more Page Marks from the file
being edited.
44 Bugs have been fixed with the Replace command so that
multiple-page replacements will never be inserted so as to create
an Order error.
45 The Kill Page-Mark command ("K") has been extended to permit
multiple Page Marks to be killed with a single command. The
syntax of the K command is now "K/n:/m", where "n" is the page
number of the first Page Mark to be killed and "m" is the page
number of the last Page Mark to be killed. As before, only one
Page Mark may be removed, as in "K/2".
In SOS notation, the "/n" Page Mark is the one preceeding page
"n". Because there is no Page Mark preceeding the first page of a
file (SOS treats the beginning of the file as if it were a Page
Mark), the command "K/1" (or the equivalent "K/^") can't do
anything. However, for consistency, the command "K/1" is legal;
furthermore, "/1" may be used as the first page of range of Page
Marks to be deleted. Thus, for example, the command "K/1:/*" will
delete all Page Marks in a file. To prevent order errors when
deleting Page Marks, use the command "NP" first to monotonically
renumber the affected pages of the file.
46 To eliminate one potential source of confusion, SOS will not
permit users to number a line as "00000", by insertion,
replacement, transfer, copy, or renumbering. If users attempt to
do so, SOS will start the first line number at the increment being
used for the operation.
47 Three significant extensions have been made to the Find ("F")
command.
First, a "find not" option (",-") has been added; when in
"find not" mode the Find command reports a match on every line
-SOS- Page 92
which does not contain the given pattern. We expect this facility
to be most useful for applications such as finding all non-comment
lines in a FORTRAN program.
Second, a Decide option (",D") has been added; this is very
similar to the Decide option of the Substitute command.
Third, the number of operations that may be performed on lines
found by a Find command has been increased from one (Alter) to six
(Alter, Insert after, Replace, Delete, Mark, and Extend). These
operations may be permanently set on the Find command (as in ",A"
for Alter), or if none has been specified on the command one may
be selected as a Decide option reply (as in "A" to alter the found
line, similar to the Substitute command Decide option
implementation).
Thus, the complete Find command syntax is as follows:
[,A]
[,I]
[,R]
F <string> $ [<range>] [,nnn] [,E] [,N] [,D] [,K] [,-]
[,M]
[,X]
By item 30, above, the command modifiers (optional arguments
preceeded by a comma) may be given in any order and in any
combination. However, only one of the operations (Alter, etc.)
may be specified on a single Find command. Also, notice that the
Delete operation is specified with the letter "K", because "D" is
used for the Decide option.
The effect of each of these new options is as follows:
Decide (",D"): The found line is typed (only the line number
if ",N" parameter has been given) and the "D*" prompt is given, as
described in item 27, above. The legal responses are " " (accept
the line), Rubout (reject the line), "E" or "Q" (terminate the
Find command), "G" (accept the line and terminate Decide option),
and if no operation has been specified any operation may be
requested using the operation letter ("A", "I", "R", "K", "M", or
"X"). The Decide option was primarily implemented to permit the
user to control what lines were operated on by a pre-selected
operation. However, it is also useful to exploring a file by
giving a large range and high repeat count on the Find command,
and then terminating the Find or operating on the found lines by
the proper Decide reply.
Insert (",I"): The found line is typed and a sequence number
is chosen and typed to permit insertion of a single line right
after the found line.
Replace (",R"): The found line is typed and then deleted. In
Novice mode, the "Line deleted" message is typed. Then the line's
sequence number is typed to permit insertion of a single line at
the same place.
-SOS- Page 93
Delete (",K"): The found line is typed and then deleted. In
Novice mode, the "Line deleted" message is typed.
Mark (",M"): The found line is typed and a Page Mark inserted
before the found line, thus making it the first line on a new
page. Unless "/NONUMBER" is set, the new page number is typed.
Extend (",X"): The found line is typed in Alter mode (unless
",N" has been specified) and the user can type extra text on the
end of the line.
Alter (",A"): Functions as presently implemented. In normal
operation, the Alter-mode cursor is positioned before the matching
search string in the found line; in "find not" mode the cursor
remains positioned at the left margin (see item 4.11, above).
Note for both Insert and Replace, if an Altmode ("$") is typed as
the first character of the line nothing is inserted. However, if
an Altmode is used to terminate the line of inserted text, there
is no special action.
48 The "find not" facility (described in 47, above) may also be used
for a context line search. The (",-") operator is used to specify
"find not" for a context line search, just as it is used for the
Find command.
49 SOS will now permit switches to be given in the command string
between the input and output file specifications, as in
.SOS FILE.NEW/UNSEQ=FILE.OLD
However, the user should be aware that SOS switches are not
file-specific, i.e., the switch is not associated with the
filespec it follows; rather, this change merely permits the user
to type SOS command strings with more flexibility.
50 The Stanford-type case inversion commands ("VV", "VU", and "VL")
have been implemented. These commands take as arguments a range
of lines, optionally followed by ",S" to suppress printing line
numbers, and operate on the case of all letters found on all lines
within the range; all the lines in the range are typed. The
commands are "VV", invert case; "VU", set to upper case; and
"VL", set to lower case.
51 In /C128 mode, the Rubout character (177 octal) may now be entered
into text or used as a search character by typing the character
pair "?\". As before, Rubout will type out in C128 mode as "?\".
52 When in /NONUMBER mode, SOS will now suppress the next "*" command
following a "P" or case-inversion ("VV", "VU", or "VL") command
when the ",S" option is typed.
53 As an aid to users who enter primarily lower-case text with SOS
via both upper and upper-lower case ASCII terminals, SOS will now
force /UPPER as well as /M37 when run from a terminal that has
"SET TTY LC" in effect. This change permits such users to have
/LOWER set in their SOS SWITCH.INI files, so that /LOWER will
-SOS- Page 94
apply when using SOS from upper-case-only ASCII terminals, such as
the Teletype Model 33, but /UPPER will be set for upper/lower case
ASCII terminals, since the user can control case with that
terminal's shift key. If this feature is not desired, the user
may override it by setting the /M37 switch.
54 SOS now supports the SAIL compiler's syntax-error interface. This
feature gives the SAIL user the option, when a SAIL syntax error
is detected, of immediately editing the erroneous file, beginning
at the line where the error was detected.
55 To compensate for terminal output timing problems, SOS now has a
special routine which makes sure all output generated by SOS has
been typed or suppressed before ^O terminal status is cleared.
SOS clears ^O before typing the "*" prompt, before typing
any error messages, and before typing any messages that will
require a response from the user.
56 As a safety measure to prevent the accidental deletion of edited
files, the ED command (Exit with deletion) now asks for a
confirmation by typing
Really delete the file? (Y or N)
If you type "N", SOS ignores the "ED" command and returns to
asterisk level. If you type "Y", SOS deletes the file and exits,
as before. See item 5.11, above, for a description of the effect
of the "ED" command.
57 To assist users in aligning text to specific columns within a
file, SOS now has the "=RULER" command. This command types a
template, showing column numbers, across the width of the
terminal. The width of the terminal is determined by the
"SET TTY WIDTH" command (initially set to 72 by the Monitor for
most terminals). The column template has the format
123456789 123456789 123456789 123456789 123...etc.
and respects the /NONUMBER switch, which causes sequence numbers
to be suppressed.
58 As an abbreviation for common range specifications, SOS now
recognizes certain symbolic ranges. These are as follows:
Symbolic range Replacing Meaning
BF:... ^/^:... Beginning of file
BF!... ^/^!... (Same)
...:EF ...:*/* End of file
EF ^/^:*/* Entire file
BF:EF ^/^:*/* (Same)
These symbolic ranges may be used as part of any range
specification (e.g., on a Find command). However, they may not be
used as a line number (e.g., on an Insert command), with line or
page number arithmetic (e.g., EF-10), or any combination other
than as shown (BF, EF:..., EF!..., ...:BF are all illegal.)
-SOS- Page 95
The symbolic range specifications differ from the "^/^" and "*/*"
line numbers in that "BF" and "EF" represent the lowest or highest
lines that possibly could be in a file while the "^" and "*" forms
represent the current lowest or highest lines. This means that
symbolic ranges are more efficient since they do not have to
inspect the file to find an actual lowest or highest line number.
Thus, use of the "BF" and "EF" range specifications may prevent
unnecessary wrap-arounds of the file being edited.
59 The error message "% Illegal when READONLY" ("%IRO" in /EXPERT
mode) has been added to better identify the error message given
when an SOS command which would modify the file (C, D, I, J, JU,
JR, JL, JC, JW, K, M, N, R, S, T, VV, VL, VU, W, X) is typed while
in /READONLY mode. Previously, this error was identified as
"% Illegal command" (%ILC).