Digital PDFs
Documents
Guest
Register
Log In
AA-D02SA-TE
August 1978
162 pages
Original
7.0MB
view
download
OCR Version
6.3MB
view
download
Document:
VAX-11 Text Editing Reference Manual
Order Number:
AA-D02SA-TE
Revision:
0
Pages:
162
Original Filename:
OCR Text
August 1978 This document contains information on the two text-editing programs provided with VAX/VMS. It describes in detail the features and use of SOS, an interactive editor, and SLP, a batch-oriented editor. VAX-11 Text Editing Reference Manual Order No. AA-D0O29A-TE SUPERSESSION/UPDATE INFORMATION: This is a new document for this release. OPERATING SYSTEM AND VERSION: VAX/VMS V01 SOFTWARE VERSION: VAX/VMS VO1 To order additional copies of this document, contact the Software Distribution Center, Digital Equipment Corporation, Maynard, Massachusetts 01754 digital equipment corporation - maynard, massachusetts First Printing, August 1978 The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any errors that may appear in this document. The software described in this document is furnished under a license and may only be used or copied in accordance with the terms of such license. No responsibility is assumed for the use or reliability of software on equipment that is not supplied by DIGITAL or its affiliated companies. Copyright () 1978 by Digital Equipment Corporation The postage~prepaid READER'S COMMENTS form on the last page of this document requests the user's critical evaluation to assist us in preparing future documentation. The following are trademarks of Digital Equipment Corporation: DIGITAL DEC DECsystem-10 DECtape MASSBUS OMNIBUS DECUS UNIBUS COMPUTER LABS EDUSYSTEM FLIP CHIP FOCAL PHA RSTS RSX VAX VMS PDP COMTEX DDT DECCOMM ASSIST-11 DIBOL INDAC LAB-8 DECSYSTEM-~20 RTS-8 0s/8 TYPESET-8 TYPESET-11 TMS~11 ITPS~-10 SBI CONTENTS Page PREFACE CHAPTER CHAPTER vii 1 INTRODUCTION TO TEXT EDITING 1-1 1.1 1.2 SOS AND SLP LINE NUMBERS 1-1 1-2 2 INTERACTIVE TEXT EDITOR 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.2 2.2.1 2.2.2 2,2.3 2.2.4 INTRODUCTION TO SOS Initiating and Terminating SOS Control Characters Use of Escape Upper- and Lowercase Characters MODES OF OPERATION Input Mode Read-only Mode Edit Mode Copy-file Mode 2.2.5 Decide 2.2.6 Alter Mode 2.2.7 Alter/Insert Mode 2.3 LINE (SOS) 2-1 Mode NUMBERS, 2-1 2-2 2-2 2-3 2-3 2-4 2-6 2-7 2-7 2-9 2-9 2-10 PAGE 2-10 NUMBERS, AND RANGES 2-11 2.3.1 Line Numbers 2-11 2.3.2 2.3.3 Page Numbers Positions 2-11 2-11 2.3.4 Ranges 2-12 2.3.5 Shorthand Characters 2-13 2.3.6 2.3.7 The Current Position Defaults for Line and Page Numbers 2-13 2-14 Line-Number 2-16 2.3.8 2.4 of Line Numbers and Page-~Number Offsets HOW SOS NUMBERS NEW LINES The 2.4.2 2.4.3 When an Existing Line Intervenes Input Mode versus Alter/Insert Mode 2.5 2.6 Current Line-~Number 2-17 2.4.1 DEFAULT Increment CONDITIONS WHEN SOS IS AND RESTRICTIONS INITIATED LIMITATIONS 2.7 2,7.1 2.7.2 2.7.3 2.7.4 2-18 2-18 2-18 2-21 2-21 USING SOS SAFELY Built-in Safety Features The Save World Command Two Options for Automatic File Saving Recovering Information from Temporary Files: An Example 2.8 EDIT-MODE COMMANDS 2.8.1 Alter (A -~ Alter Mode) 2.8.2 Copy (C) 2.8.2.1 Copy-file Mode 2.8.3 Delete (D) 2.8.4 End (E) 2.8.5 Find (F) 2-21 2-22 2-22 2-22 2.8.5.1 2-48 Find Options iii 2-23 2-24 2-27 2-40 2-42 2-43 2-44 2-46 o e * [) IRENE [] (Cont.) Help (H) Input (I -- Input Mode) Join (J) Kill Page Mark (K) List (L) Mark (M) reNumber (N) Print (P) Replace (R) Substitute (S) Multiple Substitutions Substitute Options Decide Mode Transfer (T) Save World (W) eXtend (X) Move Position (.) Give Parameter (=) Set Parameter (/) Command File (@) SOS WNH o NDNNNHRPHEEHBPRHEREHERFREWODOJ0 NHEOWVOIAUILUILLBE WM HO NNNDNDDNODDODNDNDODNDNDDNDODNODBDNDNDNDNDNDNDNDNDN O O WO W L]Ed [0000 0000 o0 0o L]000 0o .oo 0o L]CO L]G L] O L . L] * L] [) LJ L] L] [) * [] ® CONTENTS PARAMETERS AND SWITCHES Parameters Switches Setting Default Conditions Using Symbol RANGES SPECIAL SOS INTERNALS BY CONTENT CHARACTERS SOS Temporary Files 2.13.1.1 2,13.1.2 2.13.2 Temporary File Example Using SOS Efficiently Format of Text Lines and Page Marks INTRODUCTION RUNNING SLP TO SLP INPUT AND OUTPUT FILES The Correction Input 2 The SLP 3 The SLP Listing File The SLP Output File HOW SLP NN USING .1 .2 File Command File PROCESSES FILES SLP Specifying SLP Edit Commands SLP Operators General Form of the Edit Command Updating Source Files Using SLP 1 2 3 4 Generating a Numbered Listing Adding Lines to a File Deleting Lines from a File Replacing Lines in a File SLP l—l (SLP) SLP 1 4 L] & o 8 o s o o o o o o WWwWwwwNn = BATCH-ORIENTED TEXT EDITOR oottt WWWWwWwWwwLwwwwwwwwwwww 3 QUALIFIERS / [NO]JLISTING[:file-spec] iv | [ SOS w wN SPECIFYING WWWWWLWWwWwWwWwwwwwwwwww ! HHEFHFOUNNSNNSNUTLLLLERWWWDNDND HHO w N el eNeNoNe PATTERN-MATCHING CONSTRUCTS Find-String Constructs Substitute-String Constructs Combining Find-String Constructs 2.13.1 o CHAPTER SPECIAL [ [ N NNV L] L4 L] * L) L] L) ol el el ol e Assignment CONTENTS (Cont.) Page 3.6.2 3.6.3 3.6.4 3.6.5 3.7 3.7.1 3.7.2 3.7.3 3.7.4 / [NO]JOUTPUT [: £ile-spec] /[NO]AUDIT_TRAIL[:(POSITION:pos,SIZE:len)] /[NO]TAB_FILL / [NO]TRUNCATE [ :position] THE AUDIT TRAIL Changing the Value of the Audit Trail Setting the Position and Length of the Audit Trail Temporarily Suppressing the Audit Trail Deleting an Input Audit Trail 3-11 3-11 3-11 3-11 3-12 3-12 3-12 3-13 3-13 APPENDIX A SUMMARY OF SOS FUNCTIONS AND FEATURES APPENDIX B SOS ERROR MESSAGES: APPENDIX C SLP COMMAND FEATURES C~-1 APPENDIX D SLP ERROR MESSAGES D-1 NOVICE AND EXPERT FORMS INDEX A-1 B-1 Index~1l FIGURES FIGURE 2-1 SOS 2-2 How SOS Modes of Operation 2-3 2-4 Inserted Lines Alter-Mode Example Transfer Operation to Move Part of to Another Location 2-5 SOS 2-6 3-1 Temporary Files in a Sample Editing Session Input Files and Output Files Used During 2-111 SLP 3-2 Calculates Switches 2-5 the Numbers and Their Initial of New, 2-20 2-30 a File Values Processing 2-71 2-85 TABLES TABLE 2-1 Edit-Mode 2-2 Defaults Commands: 2-3 2-4 Edit-Mode Command Summary Alter-Mode Commands 2-26 2-28 2-5 2-6 2-68 2-83 2-7 Decide-Mode Commands SOS Parameters SOS Switches 2-8 2-9 3-1 A-1 A-2 Special Pattern-Matching Constructs SOS Special Characters SLP Operators SOS Modes of Operation Edit-Mode Commands: Function and Format 2-99 2-107 3-5 A-1 A-2 for of Line Form and A-3 Meanings A-4 A-5 Alter-Mode Commands Decide-Mode Commands Edit-Mode and Function Page Numbers 2-8 2-15 2-84 Command Options A-4 A-4 A-6 CONTENTS (Cont.) Page TABLES TABLE A-6 A-7 A-8 A-9 B-1 Cc-1 C-2 c-3 D-1 (Cont.) SOS Parameters SOS Switches Special Pattern-Matching Constructs Position Shorthand Characters SOS Error Messages: Novice and Expert Forms SLP Output Qualifiers Edit Mode Commands SLP Operators SLP Error Messages vi A-6 A-7 A-8 A-8 B-1 C-2 Cc-3 Cc-3 D-1 PREFACE MANUAL OBJECTIVES This manual is designed as a reference for users who have had some exposure to text-editing computer programs. It is not intended as a tutorial introduction, either to text editors in general or to the SOS and SLP editors in particular. INTENDED AUDIENCE If you have read the introduction to SOS in the VAX/VMS want to know more about SOS, this is the manual for you. Primer and If you are familiar with some other text editing program -either a DIGITAL text editor or another -- you can use this manual to gain familiarity with SOS and SLP. The tables and figures will prove helpful in this familiarization. Later, you can study this manual learn details of SOS and SLP commands and features. to STRUCTURE OF THIS MANUAL Information in this document @ Chapter 1 e Chapter 2 describes SOS in detail. e Chapter 3 in detail. @ Appendix A summarizes SOS on B ® is a brief is organized as follows. introduction to text editing; some of the differences between S0S lists SOS Appendix C error describes SLP error functions summarizes SLP commands, messages. following documents may also be ® VAX-11l e VAX/VMS SLP. features, it touches and Appendix messages. ASSOCIATED DOCUMENTS The and and useful. Information Directory Primer vii and Appendix D 1lists SLP CONVENTIONS USED Colored ink is that you type. IN THIS MANUAL used in examples of For example: user-system dialog to show the text K500 5 7 00CRET) This means a carriage following L] JEHEEE B The that after return. The the SOS prompt symbols represent The escape key the terminal) The carriage The delete The line feed The space bar The tab The backspace following key symbols (labeled CTRL/I pressing Section 2.1.2 discusses keys on ALT, SEL, the (labeled CR or DEL, RUB, or or followed terminal PRE, by keyboard: depending on which you RETURN) CAN) (see below) key stand by key ESC, you type P500:700 key key or initiate special (labeled return (*) for various control functions, the given key while holding down the CTRL these control functions. key. A downward-pointing arrow (|) marks a character that is not echoed literally. For example, SOS echoes the escape character as a dollar sign (§). In Chapter 2, this is indicated (B KGR i viii as follows: CHAPTER 1 INTRODUCTION TO TEXT EDITING Text editing on a computer system means creating, modifying, and maintaining files of information. The files can contain any kind of character-oriented information. Some examples are: ® Source language language for an assembly language @ Clear text -- such as memos, @ Data -- such as records of numbers for input to correspondence, higher-level documentation from a payroll master file or a chemical-analysis program Text editing does not refer to maintaining binary or any other non-character-oriented information. 1.1 or program files, image columns files, SOS AND SLP This manual describes two text you can use to create, modify, editors, which are computer and maintain ASCII files: programs @ SOS is an interactive editor. Using it, you work online to the computer, carrying on a dialog with the program as you create or modify a file. (SOS stands for Son of STOPGAP, an earlier text editor.) ® SLP is a batch-oriented -editor. It is designed to make changes to a text file in one pass, without your intervention, guided by a file of instructions you have prepared. (SLP originally meant "source language input program.") Interactive editing, SOS-style, is the usual way to create files. SOS is also suitable for modifying a file interactively -- for thinking as you work. However, this method of text editing, while more amenable to creative thought, does not leave a record of how a file was modified. If you need such a record, a batch-oriented editor is more suitable. Use SLP 1if you need an exact record of what changes were made to a file, and when. SLP is widely used in PDP-1l1 program-development environments. Changes an operating system, for distributed by means of source files. to a given reference copy (a "base level") of example, can be succinctly described and an SLP command file applied to the base-level A batch-oriented editor is also useful when you want to check the editing commands carefully before issuing them, or when you want to minimize the editing time on a system. INTRODUCTION TO TEXT EDITING SOS is often used to create SLP command files. Many people use SOS for almost all their text-maintenance tasks, relying on SLP only when they need a formal and complete record of changes to a file. SOS and SLP are both invoked by the DCL command editor 1is §SOS. Therefore, to start S0OS, type start SLP, type EDIT/SLP. 1.2 EDIT. EDIT or The default EDIT/SOS; to LINE NUMBERS Different text editing programs use different methods to refer to the text they work on. Some use line numbers, whereas others refer to text lines strictly by their content. For example, a line-oriented text editor might accept the command "delete 1line 50," while a content-oriented editor would take the command "find the next 1line that contains ABC and delete that line." SOS and SLP both refer to text by line number.! the philosophy behind their aware of the differences. 1line numbering; But as a they user, differ in you must be In SOS, line numbers are actually part of each text 1line. When SOS writes your file to disk, it includes the line numbers unless you specifically request that it omit them. Lines are numbered with some interval between them (usually 100), and new lines that you insert must fit between adjacent line numbers. Unless you give a command to renumber part of a file, any given line of text has the same line number each time you edit the file with SO0S. In SLP, by contrast, line numbers are not part of the text. The number of a line in a file you are editing with SLP corresponds to its sequential position relative to the beginning of the file. Thus, a given text 1line may have different sequential numbers for different runs of SLP, if lines have been inserted or deleted at an earlier point in the file. In Chapters 2 and 3, this distinction is made by referring to "line numbers" in the SOS discussion (Chapter 2), and to "sequence numbers" in the SLP discussion l. Both editors also have in the text. string (Chapter 3). features that let you search for a given CHAPTER INTERACTIVE 2.1 TEXT 2 EDITOR (SOS) INTRODUCTION TO SOS SOS is a line-oriented, interactive, text-editing program. Unlike many line-oriented editors, SOS has features that allow you to examine and change text character by character. You can use SOS to perform the following functions: ® Examine, e Search with create, for and/or the option ® Merge ® Create parts a and modify ASCII of file to one that change one or verify each file into is subset a text files more arbitrary change before it text strings, is made another of another file SOS you is line-oriented, so it works with line-numbered text files. edit a file that does not have line numbers, the editor adds numbers to the text lines. If line Unlike some (content-oriented) text editors, SOS requires you to be concerned with line numbers within the file. For most SOS commands, a line number or a range of 1line numbers specifies the text to be operated on. programmed of text. text, file. When to insert keep you line insert, numbers delete, move, or copy text, SOS is ascending order within each "page" either refuse to accept more inserted in To this end, SOS may "page marks," or warn you to renumber the 1lines in the SOS is more interactive than many other editors. In some modes of operation it responds on a character-by-character basis to what you type. This degree of interactivity: may be new to some users accustomed to less interactive editors, which always expect a command line terminated by a carriage return. For example, one SOS feature that exhibits this character-by-character interactivity is Alter mode. This special mode lets within a line of text, interactively. Alter mode has and syntax; it functions essentially as an editor Alter mode is discussed in detail in Section 2.8.1. Advanced features of S80S allow searching for a string of text specify blocks of text by content, Section Many SOS you make changes its own commands within an editor. you considerable flexibility in (see Section 2.10) and allow you to instead of by 1line number (see 2.11). parameters and editor's default values switches, which (see Sections you 2.8.21 can and set, 2.9). control the INTERACTIVE TEXT EDITOR 2.1.1 (SOS) 1Initiating and Terminating SOS Initiate SOS by the DCL prompt: typing one of the following commands in response to $ EnITCren) or $ EDNIT file-srec(rea) or $ EDIT/0U ! outrut-file-sree TRUT file-srec(RED) In the first form above, SOS prompts you for the specification of the file you want to edit or create. In the second form, you explicitly type the file specification (file-spec). If the specified file does not exist, SOS creates it. In the third form, outfile is the specification for an output file. In the second and third forms qualifiers, separated by slashes SOS does not supply a default type is null. above, (/), to you can optionally append the file specification. file type. If you omit it, the file There are several ways to terminate SOS; they are discussed in detail under the End command (E) in Section 2.8.4. Usually, you give the command E after SOS's prompt (*): [file-sreacl % Upon terminating, SOS writes an output file containing all the modifications you made in editing the file. The original file is not changed. The specification SOS uses for the output file (unless you supply it explicitly) has a version number higher by 1 than the latest version of the original file. 2.1.2 Control Characters All the usual VAX/VMS control characters can be used in most contexts within SOS. However, some of these characters are not effective in Alter mode. For details, see the Alter command in Section 2.8.1. The control characters are described briefly below. DEL (DELete, or RUBout, or CANcel) This character deletes the previous input character. Successive DEL characters remove previous characters one by one. Any number of characters can be deleted, up to the last carriage return or escape typed. The way this deletion is represented on your terminal depends on the type of terminal. On CRT terminals, the characters are physically deleted and the cursor is moved backward. On hard-copy terminals, the deleted characters are echoed in reverse order, and set off within backslashes (\). This character, typed before an input 1line 1is complete, deletes the entire line being input. You can then retype the line. is generated by typing u or U while holding down the CTRL key. It is echoed as This character, typed while output suspends the output until you type echoed. 2-2 “U. is in @=o. progress, is not INTERACTIVE TEXT EDITOR (SOS) This character resumes output suspended by @, not G echoed. is This character interrupts output in progress. SOS continues to send output to the terminal, but the terminal discards it. SOS prompts when it 1is ready for further input; the prompt depends on which 6 is not echoed. This character, redisplays the This character typed before entire line. an Substitute is echoed as Use of immediately gets the On character (select), is or The escape Although by the command command) are some terminals, labeled ESC; PRE (prefix). character is a VAX-1ll the (for key on others, message the DCL by in progress Any changes an Alter or into the as part of their to the escape only in In this manual, the terminal. contexts indicates SOS echoes the escape as dollar-sign character,_ special meaning to SOS. Upper- and is labeled ALT in input, in which that you the escape it file. (altmode), VAX/VMS should SEL system. interchangeably with SOS does not. is You can legal. press $§. Do not confuse this shift-4. The dollar Lowercase terminal lowercase it (&), corresponding accept indicate the end of a example, delimiter programs the and “R. “C. use Whether completed, as attention of incorporated carriage return to 2.1.4 in. Escape many escape is is type any legal DCL command, the DCL command does not resume SOS by typing the DCL Some SOS commands use the escape character, syntax. line editor character interrupts whatever command is returns you 1immediately to Edit mode. already made 2.1.3 input the is echoed interpreter. You can then such as SHOW or CONTINUE. 1If change the SOS image, you can command CONTINUE. This and mode the escape key on character with the sign normally has no Characters generates all uppercase interchangeably l. The in 1is file. See commands. characters dollar-sign ESCAPE set, depends in text character enabling Sections 2.9.1 and SOS that is you on type into significant only insert 2.8.22. of or both terminal distinguishes enter to you the characters, escape a between and upper- how the terminal characteristics are set. (Terminal characteristics are changed by the DCL SET command -- see the VAX/VMS Command Language User's Guide and the VAX/VMS Primer.) SOS accepts either uppercase or lowercase characters in commands, or a combination of the two. In the examples in this manual, upperand 1lowercase characters are used lowercase characters, on upper~- and file. when the characters parameter into a text INTERACTIVE TEXT EDITOR (SOS) Normally, SOS does not distinguish uppercase from lowercase when searching for a given text string. Thus, a search for the text string satisfied "holiday," using the Find or Substitute commands, would be Holiday, or holiday, following: the any of encountered S80S if search these a description of for 2.8 (See Section HOLIDAY. SOS to distinguish upper- and lowercase request can You commands.) or characters either by setting the EXACT switch (see Section 2.9.2) by using an option of the Find and Substitute commands. 2.2 MODES OF OPERATION SOS operates in a number of different modes. A mode of operation is defined as a state of SOS in which the editor interprets terminal input in a distinctive way. You can tell which mode SOS is operating in by the way the terminal behaves. SOS submodes of two and seven modes the represents Figure 2-1 You among them, and the prompt for each mode. paths the operation, or Read-only, Input, can initiate the editor in one of three modes: Edit mode is the heart of SO0S, from which the other modes can Edit. and to Alter Two submodes of Decide mode correspond be accessed. Throughout Alter/insert modes, but communicate only with Decide mode. the rest of this chapter, miniature versions of Figure 2-1 mark places in the text where the various modes are discussed. Figure 2-1 also shows the command(s) that let you change from one mode of operation to another. These commands are described in Section 2.8. In different modes, SOS prints different prompts when it is ready to accept input, as shown in Figure 2-1. It then accepts a certain set SOS some modes, In its mode. to unique of commands, each set input on a character-by-character basis, so that you need interprets In different modes, SOS has different after a command. not type typed unacceptable input. have you that you ways of informing INTERACTIVE TEXT EDITOR (SOS) EDIT file@®ED) (file exists) o - ERED CIRLY Input EDIT file®ED {no file exists) P o - €0 o nnnnn €EBLO o | GED (GITIVi)) REED Read-only EDIT file /READONLY GED) . - E@RED CIRLY) Decide EQG CTRL/C D+ - - S....DERED A DCL : $ Decide Alter - JE ETRLY) nhnnnn A A EDIT @D Decide Alter/ DI G R \a (CTRL/C} CTRL/O - CTRLIY) [ | | Alter - * insert o - (GIe) ®ED (CTRL/Y) - @ 3 nnnnn -t A.ET A ] Alter/ insert (@) - > - Copy-file - ctay) C* X @ED > ERED -~ C.../CRED The paths among the various SOS modes and submodes of operation are marked by arrows. Prompts are shown in boldface type. Figure 2-1 SOS Modes of Operation INTERACTIVE TEXT EDITOR As mentioned e In above, you can Input mode, initiate SOS SOS accepts mode, you text (SOS) in one of you type three modes: and adds it to the display the file. @ In Read-only file; e Four you cannot change can only search and it. In Edit mode, you issue most of the commands to display and change a file. From Edit mode you can move to any other mode, or you can exit to DCL. other modes of are Copy-file, SOS Decide, operation Alter, are accessible from Edit mode. They and Alter/insert. ® Copy-file mode another. You the text to be ® Decide mode is used in conjunction with the Substitute command (see Section 2.8.15). You can issue a Substitute command to replace all occurrences of one text string with another string within a given range of text. If you specify Decide mode, you can choose on a case-by-case basis whether or not to make the substitution, or you can enter Alter mode to make more extensive changes within a line. ® Alter In is mode lets you this special a command that . type ® lets you to can search copied. Alter/insert mode edit copy all or part of one file into and display the copy file to locate character by character within a 1line. intraline mode, each character that you SOS acts upon immediately; you need lets you insert text that you type type not into the text file. 1In this mode, most control characters are treated as text; they do not perform their usual control functions. Decide mode In these has two submodes: submodes, SOS Decide Alter acts almost and exactly as Decide Alter/insert. it in Alter does mode and Alter/insert mode, respectively. The only difference 1is that these submodes are accessed from Decide mode, not from Edit mode. When you exit from the submodes you return to Decide mode, not to Edit mode. The following in general sections discuss terms. later, at places 2.2.1 Input Mode In Input mode SOS file. You in enter More the you text can Input the seven modes detail marked insert mode one and two on each mode of by miniature copies or either more new submodes operation lines of of of Figure text directly from DCL or SOS is given 2-1. into from a Edit mode. S0S starts up in Input mode if, when you give the DCL you specify a file that does not exist. SOS creates specified name and waits for you to type text to put example follows. $ EDIT NEW.FORCED) INFUTIDRAL I IMANCHINEW.FOR S 1 00100 a EDIT file into command, with the it. An INTERACTIVE Notice that In that it is Input next EDITOR the to be prompt typed. is the line 1Initially, number SOS that numbers To correct typing errors while entering control characters described in Section When input character. (SOS) SOS types the word INPUT before the filespec creating the file and entering Input mode. mode, line TEXT text, SOS lines use to remind assigns to by 100s. any of the you the terminal 2.1.2. is complete, switch to Edit mode by typing an escape You can type escape either at the end of a line of input, or after SOS has prompted with the next line number. SOS then prompts with an asterisk (*), indicating Edit mode. You can E. just To store the file and enter Input mode again into the Sections 2.8.7 file -- put 2.2.2 Use end SOS at this point by typing the Or, before terminating, you can make changes to the text typed by using other Edit-mode and Alter-mode commands. and -- use if you have more whole the Input or Replace respectively). 2.8.14, lines commands command you of have text (described to in Read-only Mode Read-only mode intend to if modify you it, protected against appending the qualifier $ EDIT your PAYROLL only or need if to you writing it. /READONLY to examine need to Start the a file 1look at SOS in a and do file that this mode not is by filespec: «MST/READO Y Crer) NL READIDEBALILCORFIFAYROLL .MST$3 R Note that SOS the prompt in types the word READ Read-only mode. before the filespec, and that R* is Only nine commands are legal in Read-only mode (see Section 2.8): End, Find, List, Print, Save World, Move Position, Give Parameter, Set Parameter, Any other message and Command File. These commands do not modify the commands, which would modify the file, result in the COMMAND INVALID FOR READ ONLY file. error FILE. Read-only mode is the most efficient way to to modify a file. It is efficient because to a working details. 2.2.3 file as it does in Edit use SOS if you do not need SOS does not copy the file mode. See Section 2.13 for Edit Mode Edit mode constitutes the main part of SOS. You can switch to any of five other modes of operation from Edit mode, and you can return to Edit mode from any of them. (You cannot switch to Read-only mode from Edit mode, or vice versa.) SOS accepts 24 commands in Edit mode. Most single character,. and most take arguments in Table 2-1 lists the names and single-character and gives a descriptions of are represented by a a predetermined syntax. forms of the commands, brief summary of their functions. the commands, see Section 2.8. For complete INTERACTIVE TEXT Initiate SOS in Edit mode by already exists, on either SO0S's prompt. For example: EDITOR (SOS) giving the filespec the EDIT command line of or a in file that response to s EnITGEn) FILESTESTELD. MACCReD) ERDITIDRALICHENDRIKSITESTRLD.MACH & ¥ SOS prints the word The prompt for For details on the operation of each Edit-mode command, Table 2-3 in that section summarizes the command 2.8. commands numbers, take EDIT before this mode as an is an argument the a line indicating what text SOS appear if the file is divided also numbers, page numbers, and Edit-Mode Form A filespec, asterisk ranges number, are a Table Commands: Edit see Section syntax. Most range of in Section 2-1 Form and Function Meaning Enter Alter mode for Copy Copy a range of intraline, char- editing. lines to another place Delete E End End F Find Search SOS, return for specified the to DCL. occurrence strings of H Help Print Help package I Input Enter Input mode J Join Join two text lines K L Kill page mark List Delete List a to Mark Insert reNumber Renumber P Print Print R Replace Delete Substitute mode. Replace W Save World X eXtend . = Move Position Give Parameter / e Set Parameter Command File e one or more of text. terminal. insert lines into one line. the printer or a file. M Transfer on to of text. a page mark. range of lines on N S 1line 2.3. within a file, or from another file. Optionally, enter Copy-file mode. Delete a range of lines. D mode. Page numbers may formats of 1line given acter-by-character C or is to operate on. into pages. The Command Alter indicating (%*). a a page mark. a range range of a range one or of of lines. lines on lines more text the and terminal. enter Input strings with other string(s) in a range of lines. Optionally, enter Decide mode. Copy a range of lines to a new location and delete the original lines. Write a new file containing all the changes made so far. Enter Alter/insert mode to add text to the end of a line. Reset the position of the current line. Give the value of an SOS internal parameter or switch. Reset an SOS parameter or switch. Execute the SOS commands contained command file. Print next line. Print previous line. 2-8 in a INTERACTIVE TEXT EDITOR 2.2.4 (SOS) Copy-file Mode Copy-file mode allows you to copy all or part of one file into another file at a specified location. Furthermore, it lets you search through and display the copy file to locate the exact part you want to copy. Enter Copy-file mode by using the Edit-mode command Copy with the qualifier /C (see Section 2.8.2). For example, to search the file SUBRLIB.FOR and copy part of it after line 100 into the file being edited, type: Cx Note that C* is the prompt for this mode. The copy file |is opened read-only. Thus, only commands that do not change the file are legal, as in Read-only mode. The commands most often used are Print. and Find. To exit from Copy~file mode, use the command E. (Do not confuse this command with the Edit-mode command E, with which you exit to DCL.) SOS then prompts for the range of lines to copy. When you supply the range, the copy operation is completed and you return to Edit mode. Copy-file mode 2.2.5 is described in detail in Section 2.8.2.1. Decide Mode The SOS command Substitute (see Section 2.8.15) allows you to replace arbitrary strings of text with other strings. Decide mode, entered by way of the Substitute command, lets you decide, line by line, whether or not to make the specified substitution. For each line in which a substitution is called for, SOS displays the modified line and prompts with D* for your decision. You reply with a single character. (No is needed; 8SOS reads and acts upon the single character that you type.) If you reply with an illegal character, SOS repeats the prompt. The options you can exercise make e Yes, e No, ® Enter Decide Alter mode with the change already made. e Make the change, e Return do the change in Decide mode include: not make the without decision. as shown. change. and make all further changes immediately to Edit mode. Decide mode is described in detail in Section 2.8.15.3. automatically, INTERACTIVE TEXT EDITOR 2.2.6 Use (SOS) Alter Mode Alter mode, you ® mode to make minor can perform the Insert or delete changes following single or within a line of text. In this functions: multiple characters or words within by character (s) a line ® Move forward or word(s) ® Move @ Delete within e Split @ Insert to the or backward next all text a line a line control occurrence until at within the of a a line, given either character next occurrence of into a within a line a given character not echo single-character commands illegal command, a bell rings on the that you terminal. any point characters In Alter mode, SOS does type; if you type an line SOS displays the line of text that you are editing as you build it, that is, as you insert, delete, and pass over characters and words. You enter Alter mode by issuing the Alter command from Edit mode. The prompt in Alter mode is the line number followed by a tab, the same as the prompt for Input mode. You can easily determine which mode SOS is in, however, by observing the behavior of the terminal (for example, commands are not echoed in Alter mode). There are several type RET ) SOS the Edit-mode Alter mode 2.2.7 In is ways to prints prompt return the to Edit remainder mode. of the The most line, if common any, is and to gives (*). described in detail in Section 2.8.1. Alter/Insert Mode Alter/insert mode, characters text. Most control characters into the text without performing example, Command does Language not User's that discard Guide for you type are inserted into the (with seven exceptionsl) are inserted their usual special functions. For the input line. control-character (See the VAX/VMS functions.) You enter Alter/insert mode from Alter mode by giving the I or R command, or from Edit mode by giving the eXtend command. SOS does not prompt’ in Alter/insert mode. You return to Alter mode by typing (), or to Edit mode by Alter/insert mode Section 2.8.1. typing is (). described with the Alter-mode command I 1. The exceptions are @, (&, (), (D), @D, GH, and @D . 1in INTERACTIVE 2.3 LINE NUMBERS, Many S0S commands TEXT PAGE NUMBERS, take as line one EDITOR (SOS) AND RANGES argument a line number or a range of numbers, indicating what text the command is to operate on. This section describes how to use line numbers and page numbers to form such ranges. It also discusses shorthand characters for line and page numbers, line and page number offsets, and SOS-supplied defaults in range specifications. command, 2.3.1 which The displays examples lines of in this section use the Print text. Line Numbers SOS line numbers are 5-digit decimal Line numbers may not be larger number, you typing 00050. need When SOS and ascends first not command; ascending following number : zeros: thus typing 50 is the same a file, it assigns line numbers starting at hundreds. (You can change these defaults with the Parameter The leading 13280. a line numbers by always in type numbers, such as 00400 or than 65535. When you type is see an Sections order on example 2.8.21 and 2.9.1.) any given page. of the Print command Line using a as 100 Set numbers are single 1line 300 GED * 00300 5 DATE: 15-AUG-77 k4 2.3.2 If a into Page Numbers file a pages. is large, number of For number of or if the logical example, logically if an information it contains falls divisions, you can divide the assembly-language independent sections, you source file could place naturally file into contains a each section The Edit-mode commands Mark and Kill Page Mark, respectively, and delete page marks in a file (see Sections 2.8.11 and Sometimes SOS automatically inserts page marks when you give a Transfer command, depending on how the line numbers fall. 2.8.9). in this file on a separate page. The complete specification for a contain both a line number and the two. For line position in an SOS a page number. A slash example: insert Copy or text file can (/) separates X F110/2CRer) This means print 2.3.3 110 on page 2. Positions A position marks position as an 2.8.11). segtion); points. line Other a a single line in a text file. Some commands argument, as for example the Mark command commands take a range as an argument (see range can be specified by giving two positio ns 2-11 take a (Section the next as its end INTERACTIVE TEXT EDITOR (SOS) A position consists of a line number and a page number. You can omit either one; if you do, SOS supplies a default, as shown below. The notation => means "is defined as." The braces indicate that one of the enclosed expressions must be chosen. line position => 2.3.4 /page line/page (current page assumed) (first line on page assumed) Ranges of Line Numbers A range of line numbers can be formed in two ways.l One way 1s to specify a starting position and an ending position; separate the two positions with a colon (:). For example, the following command tells SOS to print all 1lines from line 100 on page 4 through line 500 on page 5, inclusive. XF 10074150075 D) Depending on how the lines are numbered, this command could tell SOS to print five 1lines, or 50, or none. If you know exactly how many lines you want to print, but not what all their numbers are, you can form a line-number range using the exclamation point (!) to indicate a relative number of lines. The following command tells SOS to print six consecutive lines, starting with line number 100 on page 4. ¥FLOOAAVE This command prints six lines whether or not it encounters a page boundary. The end points of a range need not themselves be existing 1line numbers. For instance, in a file whose lines are numbered by 10s, the range 33:67 refers to the three lines numbered 40, 50, and 60. A range can consist of only a single line: you can omit the ending position or relative number of lines. the Print command, which takes a range as single line. Previous examples showed how its argument, can print a A all command whose range You can omit the starting position is => applies position less lines on the a range; SOS shown below. (range starts at current line) common way to form single the position { (range a defaults (range n is page. position 1 n 1. A third, much Section 2.11. to starting position of to the current line, as position position range /page starts ranges at 1is line) current line) described in INTERACTIVE 2.3.5 TEXT EDITOR (SOS) Shorthand Characters SOS recognizes three characters as shorthand for special line numbers. These shorthand characters can be used in position specifications to stand for both line numbers and page numbers: . / . (period) (caret /" * or The The current line current page The first . The The last line on last page in is represented up-arrow) (asterisk) * The character and as an ", ASCII up-arrow on 94, line The first page on a a page the file as a caret on some terminals others. The character 0 can be used interchangeably with first 1line on a page or the first page in a number of 0 specification 1is 1illegal, to mean “. Some of examples the page in the file use ¥F100: . Crer) of and SOS these through interprets shorthand Print all lines the = to file. 0 represent the A line or page in characters from line current a position follow. 100 line, inclusive. Xp e a0 () Print all lines from the beginning of ¥ o oCrer) the page through line 620. Print 10 lines beginning with the current Xpe 2k (ren) line. Print all lines on the current page. ¥/ Crer) Same as above: the ¥kt 2 (Crer) print all lines on current page. Print the last line on the current page and the first line on the next last line page. 2.3.6 The Current Position The current position For example, to by a command.!l after in SOS SOS is the completes a position of Print List or the command, referred the current position is that of the last line that was output. After a Copy or Transfer, it is the last line moved. After a Find or Substitute, it is the 1last 1line matched. (These commands are described in Section 2.8.) Immediately after SOS is initiated, the current position corresponds l. The to terms the "current interchangeably. components, the first line in the position" In fact, the current line number file. and "current current and the position current line"” are is made page up of number. used two INTERACTIVE TEXT EDITOR The current-line pointer reason and returns an is not moved error if (SOS) a command fails for any message. Two Edit-mode commands allow you to interrogate and to reset SOS's current-line pointer. To find out where the current line is without printing it, use the Give Parameter command =. (described in Section 2.8.20). + For IS AT example: 00450/5 X The Move Position command (see Section 2.8.19) resets the current line. Its argument is a position specification, which can contain a line number, a page number, or their shorthand equivalents. For example, the following command moves the current-line pointer to the last line on page 3. % k/3CED) X 2.3.7 One Defaults form for for Line a complete and Page Numbers range specification is: linel/pagel:line2/page2 You can omit various parts of the complete specification, and SOS will supply defaults for the omitted parts. The defaults discussed in this section apply only to ranges for which: ® You explicitly type a colon ® You explicitly an exclamation mark e You use the type (:) (!) form /page If none of these conditions holds, then the range involves line, and the defaults listed in Section 2.3.3 apply. a single These defaults apply to all commands when you omit part of a range specification. For some commands, the entire range specification is optional. The default range that results depends on the command. See the individual command descriptions in Section 2.8 for details. The following partial indicate a range. range 1. 1linel/pagel:line2 2. 1linel:line2/page2 3. /pagel:line2 4. linel:/page2 5. /pagel 6. :line2 specifications 2-14 all represent legal ways to INTERACTIVE Below TEXT EDITOR are the complete specifications The defaults SOS supplies are above. 1. 1linel/pagel:line2/pagel 2. 1linel/.:line2/page2 3. "/pagel:line2/pagel 4. linel/.:*/page2 5. “/pagel:*/pagel 6. ./.:line2/. Table range 2-2 shows the rules SOS specification. Note uses that (SOS) of the partial underlined. ranges to supply the omitted 1linel defaults to ~ 1listed parts of if pagel a is supplied; but if neither is supplied, the starting position defaults to ./. (the current position). If omitted, page2 defaults to pagel, if pagel is given; if neither is given, both default to the current page. Defaults If this part is for Table Line omitted: 2-2 and Its default linel ° . /. /pagel .line2 Applying results: Page Numbers the rules * /page2 given an in /pagel Table 2-2 argument of in is: (if pagel is supplied) (if is defaulted) pagel (whether pagel is supplied or defaulted) some e A command with an argument of :line/page acts on all between the current position and the given position. @ A command with an argument of the current line and the last :/page acts line on the defaults for on all gives A command with given page. SOS's acts cases e The examples below illustrate range specification. /page common lines on all lines given page. omitted parts these on the lines between of a INTERACTIVE TEXT EDITOR (SOS) Complete Command XF o 8O Equivalent (Rer Meaning Fo/eiBO/, Print all line through 1lines from line 80 the on current the current page. Xo (RET VS Fo7. 0%/ Print (ETD R eV § VN gk (Rex Fo/e i X/ current Same the ¥FLR0S/3(RED) P/ 1905/3 as print all above: Print all current page. 1lines on 1lines on page. current line 2.3.8 lines on the Same as above: the ¥F all print all page. 1lines through line from the 905, page current 3. Line-Number and Page-Number Offsets Anywhere that forming refer to sign (+) a line-number offset. You can use arithmetic expressions to lines whose numbers you do not know. Expressions with a plus refer to lines later in the file, and those with a minus sign (-) refer to a line earlier number is legal, so is an arithmetic expression lines. Arithmetic expressions do not act across page boundaries, unlike the exclamation mark construction (relative number of lines). Thus, if the current line is the third line from the end of a page, the command P.+4 prints Some examples *F o2 the last of line on line-number (rET the offsets Print the before LYt KENGTD) (as P.+5, P.+6, follow. line the do two lines current line. Print all lines from the fourth page % Pk~ 1 1 O0Crer) page line through on the the current current line. Print the last six lines on the current page and the first four lines on the next page. £F =18 % Fo-113 +1Crer) e Print three lines centered about the Same current as above: lines centered current line. 4 P33 Crer) Print the first that arithmetic not cross page 2-16 line. print three about the line. Note expressions do boundaries. and so on). INTERACTIVE Page-number that offsets are number is a page page-number offset. TEXT EDITOR (SOS) analogous to line number legal, so is an arithmetic Some ¥F100/ . +1 (&) examples offsets: expression follow. anywhere forming a Print line 100 on the next page. kF305/%-1 1 4(ED) Print four lines starting with line 305 on the next-to-last page. XP/ =18/ +1(ReD) Print all text from the first line on through the previous page the last line on the following page. You are allowed only one expression. Thus, P10+3 is The syntax of defined. In integers, and A line m is a line-number p is a page g is number number has less than analogous of a number followed form. by That 1 an or one HOW SOS now and g be are formally positive indicate NUMBERS the three shorthand expression. A is: page *O x ( [+ m] page=>{ that one chosen. 2.4 of arithmetic ~ the braces can p, arithmetic 65536. 1 where in an illegal. offset. can consist line=> is offset. optionally an sign P10+3+1 number. a page-number number minus numbers and page numbers the definitions below, 1, m, represent the following: is a line or but line l characters, plus legal, of , ¢ [+ q] the enclosed expressions must be NEW LINES Basically, when you insert new lines of text into a file, SOS numbers each new 1line by adding the current line-number increment to the previous line number. This section discusses three topics that elaborate on this basic rule: ® What e How SOS current behaves line-number when an it wants increment existing line is, and how intervenes it is set before the Differences in SOS's line-numbering depending on whether are entering lines in Input mode or in Alter/insert mode you next e the line number to assign INTERACTIVE TEXT EDITOR 2.4.1 The Current Line-Number (SOS) Increment The current line-number increment is a parameter that SOS maintains. If you do not set it, SOS uses a value of 100 for the increment. You can find out what its value is by giving the Give Parameter command =INCREMENT(®&1), and you command /INCREMENT:n(rer), can set it directly with the Set Parameter The usual way to change the 1line-number increment, however, is by specifying a second argument to an Input or Replace command. With this second argument you can call for either a permanent update to the increment, or a temporary update that applies for this command only. Alternatively, you can request SOS to calculate a line-number number of lines to fit in the space known a that allows increment available to them. See the description of the Input command, 2.8.7, for details. 2.4.2 When an Existing Line Intervenes Section SOS does not let you insert lines so that the line numbers would be out of sequence. If an existing line stands in the way of the series of new line numbers that SOS 1is generating, the editor eventually refuses to accept any more inserted lines since it cannot number them in sequence. For example, suppose the current line-number increment is 100. You want to insert some new text after line 400; however, line 500 already exists. You type an Input command: I400Cxi). SOS bends its usual rule (which would call for the new 1line to be numbered 500) and assigns the number 450, halfway in between the existing lines. SOSs then accepts one input 1line. The next line number SOS calculates, however, is 550 (the increment, 100, plus the previous 1line 450). Again, this 1line number is beyond an existing line. point, SOS returns you to Edit mode, ending text insertion. 2.4.3 number, At this Input Mode versus Alter/Insert Mode There are two ways in SOS to insert new 1lines of text: Input mode (accessed by the 1Input or Replace commands) and Alter/insert mode (accessed from Alter mode by the command I, or from Edit mode by the eXtend command). SOS behaves differently in the two modes when it encounters an existing line whose number intervenes in the sequence of new line numbers SOS is generating. The difference is as follows. In Input mode, SOS lets you insert one line before an intervening line, if it is the first inserted line. If SOS encounters an intervening line after you have inserted one or more lines, it immediately terminates Input mode. 1In Alter/insert mode, upon encountering an intervening line, SOS always numbers the next line halfway between the previous line and the intervening line. For example, suppose you want to insert text after 1line 100. The current increment is 100, and the next existing line is 500. TIf you enter Input mode to insert the text (I100(z)), SOS numbers the new lines 200, 300, and 400; then SOS returns you to Edit mode. INTERACTIVE TEXT EDITOR (SOS) However, if you enter the new lines in Alter/insert mode (Al100Ceer), followed by I, followed by (Cr) for each new line), SOS numbers the new lines 200, 300, 400, 450, 475, 487, 493, 496, 498, and 499. At this point, no room is left for any more new lines, since the previous line and the intervening line are numbered 1 apart. SOS rings the terminal's bell and rejects further line insertion, but leaves you in Alter/insert mode. If you have more lines to insert, you must return to Edit (xer)) and issue a reNumber (N) command. mode (type Figure 2-2 shows the logic of SOS's line numbering. In this figure, IN 1is the current line-number increment; NL is the number of the new line; PL is the number of the previous line; IL is the number of a line that intervenes 1in the sequence of 1line numbers S80S is generating. In the calculation of a line number halfway between PL and IL, the notation [-1] means that SOS subtracts 1 if IL - PL is odd, but does not subtract 1 if IL - PL is even. INTERACTIVE TEXT EDITOR NL=PL+IN |- (SOS) TM~ Insert line (Alter/insert mode) Input mode ? . incoreed line ? yes IL—PL=17? 4 Ring bell, refuse insert. Remain in Alter/insert mode. NL=PL + e (L-pLI/2 (=1 i & Insert line NL =PL + (IL—PL)/2 [—1] i insert line i Return immediately to 4-) Edit mode Figure 2-2 How SOS Calculates the Numbers of New, Inserted Lines INTERACTIVE 2.5 TEXT DEFAULT CONDITIONS WHEN SOS IS EDITOR (SOS) INITIATED The default conditions that apply switches when you start up the to various SOS editor are listed parameters and switches are described fully a way (the symbol-assignment mechanism) parameters -and below. The SOS in Section 2.9, along with to override these initial defaults. Noexpert —-- SOS starts by assuming that you are not an experienced SOS user. Therefore, it prints long, self-explanatory error messages; it asks for verification before deleting large blocks of text; and it displays deleted characters in Alter mode. All examples in this chapter assume a nonexpert user. See Section 2.9.2 for a discussion of the EXPERT switch. Line numbering 100. of When you SOS insert numbers lines lines of by text, 100s SOS uses 1initially, a starting line-number at increment 100. Automatic file saving (see 0; -- therefore, you work saving -Sections SOS on does 1it., The two 2.9.1 not parameters that govern automatic file and 2.7.3) are initially set to automatically You must issue save Save World a copy of commands your to file achieve as file backup. Lowercase characters -- Initially, SOS accepts lowercase characters as typed. If your terminal can generate lowercase characters, and if you have instructed VAX/VMS not to convert them to uppercase (using the DCL command SET), then SOS accepts and 2.6 LIMITATIONS AND RESTRICTIONS Some limitations and restrictions on echoes the them as use of SOS lowercase. are listed below. Line length -- No line of text can be 1longer than 500 characters, including spaces but excluding the that terminates the line. 1If you attempt to generate a line longer than 500 characters (with the Alter, 1Input, Join, Substitute, or eXtend commands), SOS prints the error message LINE IS TOO LONG, and returns you to Edit mode. In the case of an Alter or eXtend command, any changes that you made previously to the line are discarded, and you are returned to Edit mode. String length -- No string used in a Find or Substitute command can exceed 200 characters in 1length. If you use the forms of these commands that allow multiple strings, the combined length of all such strings cannot exceed 200 characters. If you exceed these limits, SOS prints the error message SEARCH STRINGS EXCEEDED BUFFER LENGTH and returns you to Edit mode. Reissue the command with fewer or shorter strings. Line numbers -- 2.7 USING SOS Line numbers cannot exceed 65535 (decimal). SAFELY Some risk is associated with the use of any text editor. You can, by mistake, delete or garble large amounts of text, or even whole files. A hardware or software failure that occurs while you are using a text editor can destroy a considerable amount of work. INTERACTIVE TEXT EDITOR (SOS) S0S is designed for safe use. The editor assumes that you can make mistakes; therefore (unless you have declared yourself an expert SOS user, via the EXPERT switch), SOS asks you to confirm commands that would delete 1large amounts of text. It also provides features that you can use to minimize the adverse effects of system malfunctions. 2.7.1 Built-in Safety Features SOS requests confirmation before making major changes to a file. Decide mode 1is one safety feature of SOS; the editor lets you decide case by case on character-string substitutions, instead of making all substitutions blindly. (Section 2.8.15 describes Decide mode.) SOS also requests confirmation before performing a Replace or Delete that would delete all the text on one page, or would delete across a page boundary. 2.7.2 The Save World Command The SOS creates results The W Save World (W) command saves "everything in the world." a back-up file that is a copy of the input file containing of all the editing changes you have made so far. command minutes against in the errors of the work 2.7.3 For your own. since Two Options greater automatic named SAVE mode; and ISAVE To select 2.8.21). be used frequently, perhaps every five or ten a long editing session. 1In this way you protect yourself ill effects of system failures, and against any possible done even the should 1It the If the some system failure does occur, you lose only last W command. for Automatic File Saving safety, wuse of ISAVE. controls you can the Save World SAVE it these options, For example: set controls in two SOS parameters command. automatic These file that saving Input mode. use the Set govern parameters in are EAQdit : Parameter command, / (see Section you have issued */SAVE$ 10 Grer) %/ ISAVE t5Gar) X S0S automatically performs a Save World command after 10 Edit-mode commands that modify the file, or after you have inserted five lines of text in 1Input mode, whichever comes first. While executing the save, SOS displays this message: DOING You can SOS is 0 turns SOS, set AUTO-SAVE. or reset operating off the in PLEASE the SAVE and Edit mode. corresponding both options WAIT. are turned ISAVE Setting auto-save off. parameters either at any parameter option. When time to you while a value of initiate INTERACTIVE TEXT EDITOR 2.7.4 (SOS) Recovering Information from Temporary Files: An Example If SOS execution is interrupted by a system malfunction, you may be able to recover some lost work from SOS temporary files. These files, and the way in which SOS uses them, are described in Section 2.13. Briefly, one or both of the files 8S0Sxnn.TM1l and SOSxnn.TM2 may contain part of your file number of your terminal). (x is the controller number, and nn is the The following example illustrates one way in which lost work might be recovered from an SOS temporary file. A hypothetical user, Adams, is updating a master address list on terminal number 22 when the system loses power. Not being prudent by nature, Mr. Adams has not been using the W command frequently. After this close call, however, he sets the ISAVE parameter for automatic file saving. K=rame(RET) SSOMST§1? nkfil:EQHAMSJQDHRE X kFlavkir :s{; PAGE 4 1050 Larkin James 4935 Forbes Av. 01059 Lawson Acdam 225 Grand Av. OLOSO ‘ Fittshursh PO 15213 Osk land CA 94610CreT) INTERACTIVE TEXT EDITOR (SOS) Nothing works: the system has expired. Several minutes later, after Adams logs back onto the revitalized system, he recovers information from an SOS temporary file as shown below. The temporary file must be renamed, because SOS refuses to open a file it recognizes as a temporary file. $ directory sosel2. )/ FullCeD) DRALICARAMS] 17-JUN-78 13121 205422.TMLs L SO8AZ2. TM25 1 TOTAL OF 4 2 4./35. BLOCKS $ rensme sose22.tml ¢ edit addtme.mstCrer) 17-JUN-78 17-JUN-78 IN 2., 131135 13817 FILES addtme.mst(Cer) EOITIDRALCADAMSIADDTMF . M8TS 1 ESC %Flarking FAGE 4. LA i« Larkin James S5CRET) 4935 Forbes Av. Fittsburdgh FA 15213 * ¥wiaddress vmetCer) CNRAL I CADAMETANDRESS . M8T3 182 X The exact details of the editing done so far determine how current the material contained in an SOS temporary file will be. Adams was lucky; most of the previously edited material was in the temporary file. However, the point of emphasis here is that you cannot depend temporary files to provide reliable back-up in case of system Such files are at best a last resort. The safest back-up is use of 2.8 the W command. EDIT-MODE COMMANDS This section describes in detail the functions of SOS Edit-mode commands. mands are presented in alphabetical four nonalphabetic commands given last. The functions when they discussed Table 2-3 syntax, both chapter. used as the summarizes and described. used are along with the The in the . Edit-mode The and com- order. The =/ @ ) are and (Cesc), commands, are Print command. the pages and DCL commands, on following table ( of forms which defines in the their they - the terms rest of are this on SOS failure. frequent INTERACTIVE Definitions for the TEXT EDITOR Edit-Mode Command (SOS) Summary (Table 2-3) Uppercase letters represent literals that you type verbatim. (SOS accepts either upper- or lowercase letters.) Lowercase terms represent variables, defined below. The symbol => means "is defined as." Brackets ([ ]) indicate optional parts of the argument string (except in directory or filespec, in which one set of brackets must be typed). Stacked braces ({ }) mean choose one of the enclosed expressions. Angle-brackets (< >) enclose descriptive terms. And represents the escape key (or ALTmode, SELect, or PREfix). file-spec [device:] [[directory]l]filename[.type[;version]] increment <a positive 1 <a line integer number> (0 line-number < 1 < increment> 65536) 1 line - [+ m] <an integer * m line-number <a positive <a page page <a position { integer> number> [+ gl * parameter offset> legal line SOS parameter [/page] or switch> } /page q <an integer page-number offset> :position position !n range tposition In start string <a positive integer line number> stringl{(xe)string2[ (ze)string3[(rer)string4 [Ce)string5[ (rer)string6]]1]1 (fewer than characters) 2-25 200 INTERACTIVE TEXT EDITOR Table 2-3 Edit-Mode Command Command (SOS) Summary Page | Form Arguments Alter! 227 A [range] Copy? 2-40 C position [=file-spec] ,range[ increment1 [ increment2] ] Delete 2-43 D [range] End 2-44 E {B] [Q] [S] [T] {:file-spec] position=file-spec/C Overwrite input file EB No output file EQ Strip line numbers ES No numbers, no pages ET Find® 246 | F Help 2-51 H Input* 252 I [ [string]Cesc Dlrange] ] [,A] [N][.E] [.n] [-] [:n] [position] [,increment] [position] [;increment] [position] [;!n] Join 2-55 J [position] Kill page mark 2-56 K [page List:LP or file 2-57 L [range[,S] [,P{:file-spec]]] Mark 2-58 M [position] reNumber 2-59 N [increment] [,[range] [.start] Print: terminal 2-61 P [range] [,S] [range] [,[S] [,F:file-spec] ] Replace® 2-63 R [range] [,increment] [range] [;increment] S [range] [;!n] [[oldstring(esc Inewstring] (esc) [range] [,D] [ N1 [,E] 2-69 T position,range[,increment1 [ ,increment2] 2-73 w [B] [:file-spec] eXtend® 2.74 X [range] [,N] Move Position 2-76 . position Substitute® 2:65 Transfer Save World Give Parameter 2-77 = parameter Set Parameter 2-78 / parameter[:n] Command File 2-79 @ file-spec Print next line Print previous line 1 Enter Alter mode. 2 Enter Copy-file mode (if /C). 3 Enter Alter mode (if ,A). 4 Enter Input mode. $ Enter Decide mode (if ,D). $Enter Alter/insert mode. INTERACTIVE TEXT EDITOR (SOS) Alter 2.8.1 Alter (A -- Alter Mode) Format: A[range] (rer) Argument: range Specifies the range mode. you omit If of lines range, to only be edited the one current at line a is time in Alter edited. Current line: After SOS last line completes an Alter command, it sets the current The Alter command invokes Alter mode, a special intraline editing mode, for each line in turn in the given range. Alter mode is useful for making changes within a line without having to retype it. to the - It is also useful for making changes involving the column positions of a single line or within a range of characters lines. :Z::{::]:::: in For each line in the given range, SOS prints the line number and waits in Alter mode for your input. Eighteen commands are 1legal in Alter mode; any other input 1is ignored and rings a bell on the terminal. These commands are listed in Table 2-4 and described fully later in this section. The single-character commands are not echoed when typed. 1Instead, they are effected immediately. Text input that you type, replacing or adding characters within the line, is echoed as typed. As it line edited. a result, in Alter mode, you see the line taking (except for text that you have backed up over or DCL ‘"“_fl;:J:::: 1" H L shape as you deleted). edit SOS maintains an intraline pointer in Alter mode. At any given time this pointer points between two characters in the line. You can space the pointer across the line a character or a word at a time (forward or backward); you can insert text before or after the pointer position; and you can delete or replace one or more characters before or after the pointer. As you move the pointer across a line, SOS displays characters that the pointer passes. When you move the pointer backwards across a line (to the left), characters are displayed in reverse order, surrounded by backslashes (\...\). Any characters that you delete are displayed L2tween pairs of backslashes (\\...\\). (Note that, if you have declared yourself deleted text is not the EXPERT switch.) As shown positive an expert SOS user by giving the echoed. See Section 2.9.2 for a in Table 2-4, many Alter-mode or negative integer. For command /EXPERT, description of commands can be preceded most commands, the result by is a to INTERACTIVE TEXT EDITOR (SOS) repeat the command the does not make sense repetition counts move move given number of times. The repetition count for some commands, and is ignored. Positive the pointer to the right, and negative counts (except for (&), for which the reverse is true). it to the left Table Alter-Mode 2-4 Commands Command B Meaning Do not print beginning of rest line of line; recycle to with edits incorporated. [-]1[n]Cx... Change next/previous n characters to given [-]1[n]D Delete next/previous n characters. E characters.! End Alter mode for this line; do not [-] [n]Itext(esc)|Insert text after/before pointer; increment n for new lines. [-] [n]Kx Kill (delete) character all until nth print use temporary occurrence of x. L Print rest of line; recycle with edits incorporated. to beginning P Print rest with edits of to current Q Quit Alter mode; [-]1 [n]Rtext(esc) |Replace Skip line; recycle incorporated. restore original of line position line. next/previous n characters with inserted [-][n]Sx line. text. forward/back to nth occurrence forward/back n words. of character X. [=][n]W Skip [-][n]X Delete [-][n]” Invert case of next/previous n characters. [-][n]< Convert [=]([n]> Convert next/previous n characters [-1[n] Gs) Space back/forward n characters. RET next/previous next/previous Leave Alter mode for n words. n characters this line; to uppercase. to lowercase. print rest of print rest of line. [=] [n] Coe) Space back/forward i.gave Alter mode n characters. for this line; ine. {continued on next page) INTERACTIVE Table TEXT EDITOR 2-4 (Cont.) Alter-Mode Commands Command (SOS) Meaning [-]1[n1 (=) Space forward/back n characters. [-] Skip to end/start of TAB line. Do not print rest of line; recycle position with edits incorporated. CIRL/U 1. "Next" typed. similar Start fresh: of if line, no minus The other fashion. do sign commands discard edits, not print is "previous" accept current recycle to beginning line. typed; that to a minus if sign minus are .sign presented |is in Figure 2-3 shows on five 1lines the interactive process of using Alter-mode commands to edit a single line of text. (On your terminal, you would see the single line displayed piece by piece as you gave the commands.) User input is shown in color. Alter-mode commands are not echoed as typed; rather, SOS displays their results on the text 1line. The arrow (}) shows the position of the intraline pointer at the time the user types the given Alter-mode’ commands. The resulting printout is shown immediately below each arrow; an underline (_) marks the new position of the intraline pointer. The five Alter-mode commands used in the figure are described more fully later in this section. If the error range message specified RANGE for GIVEN an Alter DOES NOT is empty, CONTAIN ANY command LINES. SOS prints the INTERACTIVE TEXT EDITOR Commands used in w this moves example the i inserts the &€D) to space(s) the text are: pointer following text is (SOS) the right and/or you past one word and its tab(s). type until (&) (in the example, active(®)). moves the pointer to the right one character at a time, and prints o changes you RET the the type following (in prints the character. the rest of this line. SOS command applies 10200 Eacn user character example, the to the next character q). line and ends Alter mode for returns to Edit mode, because the to only one line in the example. reauiring CFU time Alter obtains 1) 1G200 Each . 10200 Each active .. LO200 Fach active user re.. CRW 10200 Fach acltive user requiring . RET 10200 : Each ascltive user Figure reaquiring 2-3 CFU time obtains Alter-Mode Example B (Alter mode) B The Do B not print command rest tells SOS of to line; recycle recycle to the to beginning beginning of of line the line. That is, the line number is reprinted and the pointer is positioned before the first character. All edits made to the line up to this point are S0S does not print the remainder of the line (from the incorporated. current pointer position to the end) before recycling. 2-30 INTERACTIVE TEXT EDITOR (SOS) C (Alter mode) [-]1[n]Cx... Change next/previous n characters to given characters SOS accepts and prints the next n characters typed on the terminal. These characters replace the n characters in the line immediately to the right of the pointer. The pointer moves one character to the right as you type each character. If you type a minus sign before C, the n characters you type replace text to the 1left of the pointer position. SO0S displays two backslashes (\\) followed by the replaced characters (in reverse order). When you type the first replacement character, SOs displays two more backslashes and echoes each replacement character as typed. The following example 1illustrates this sequence. 00905 The sreliminsty business rslan (attached) 2 Q09GS The srelimimsts .o -4 QU205 The =raliminstye \\ wts.. 00905 The sreliminasty SN whasN\\arwe aru(Cs) . RET QOO The sreliminstys N wts \\ary business rlan (attached) X The C command is ignored if the pointer at the beginning of the line for -n). is at the end of the line (or : Three characters prematurely terminate the C command: . (Cec), (rer), and If you type nC, followed by some replacement characters (fewer than n), followed by one of these three characters, SOS terminates the C command. e After e After Alter or ('r), SOS is at command level in Alter mode. (rer), SOS continues with the next line in the range command, or returns to Edit mode if none remain. In each case, n characters have been deleted from the original of the text ~line. The character is ignored after a C command. D (Alter mode) [-]1[n]D Delete next/previous n characters Typing D deletes the character that follows the pointer. More than one character is deleted if you precede the D command with a number. he deleted character(s) is (are) displayed, surrounded by pairs of backslashes: \\abc\\. If you supply a number, n, that is greater than the number of characters remaining in the 1line, all remaining characters are deleted. 1If you precede the command with a minus sign, characters before the pointer are deleted. The D command 1is ignored if the pointer is at the end of the line (or at the beginning of the line for -n). 2-31 INTERACTIVE TEXT EDITOR (SOS) do line E (Alter mode) E End Alter mode for this line; not print The E command tells SOS to end Alter mode for this line. The rest of the 1line 1is not printed. If more 1lines remain in the range you specified when issuing the Alter command, SOS proceeds in Alter mode. Otherwise, the Edit mode prompt (*) is issued. (The command is the usual way to exit from Alter mode; prints the rest of the line before returning té Edit mode, or to the next line in the range.) | (Alter mode) [-]1[n]Itext(ec) Insert text after/before increment n for new lines pointer; use temporary The I command moves SOS to Alter/insert mode. SOS accepts characters from the terminal and inserts them into the line beginning after the current pointer position. If you precede the command with a minus sign, characters are inserted before the pointer position. Alter/insert mode is terminated when you type IZZZ{::] (esc); the editor 1is left in Alter mode. The pointer is then positioned to the right of the inserted text, and points to the same place it did before the insertion. The characters are echoed on the terminal inserted as typed. Both mode Alter/insert mode and Alter DCL_{ H }- T E are terminated for this line if you type (&/r). 1In this case the final (esc) 1is not needed. S0S prints the rest of the line and returns to Edit mode (or continues in Alter mode if more lines remain). If you type (i) while inserting deleted. ve ) echoes as a pair of character. Successive text, the backslashes (®r)s delete and echo previous character is followed by the deleted previous characters in turn. The next non(ee) character that you type is echoed as a second pair of backslashes followed by the character. If you type more ((il)s than the number of characters you have inserted with the I command, SOS continues deleting characters to the left of the original point of insertion (until it encounters the beginning of the line). SOS remains in Alter/insert mode. If you insert so much 500 characters, SOS text that the overall length of prints the message LINE IS TOO you to Edit mode. Any changes to this point are discarded. You can type a number before that the I you may have command. made This the line LONG and to number repetition count, as it is for most Alter-mode commands. acts as a temporary line-number increment if SOS creates while inserting text. SOS <creates a new 1line when existing line by I inserting before the command, inserts characters before (Cr). SOS If uses the pointer you +n type as a the position. the exceeds returns 1line is not up a Instead, it a new line you split an negative number, -n, temporary increment and INTERACTIVE TEXT EDITOR (SOS) If you type while in Alter/insert mode, SOS creates a new line receive the rest of the inserted text. The number of this new line determined as follows: e If you type a number before the I command, this e If type @ If an existing line intervenes between the current line number and this new number, the new 1line is numbered halfway in do not a is added to number the before the added to I command, is temporary you is number taken as a line number. increment increment and to is the current the current line number. current between. If the next existing current line, a bell After the beginning 1line sounds 1is and numbered 1 no new line higher than is created. new line is <created, the pointer 1is positioned of the new line; SOS is still in Alter/insert mode. the at the In Alter/insert mode, any character you type (with seven exceptions) is inserted into the text line. Many control characters do not have their usual effect when entered in Alter/insert mode. For example, and have no effect on terminal output. They are simply inserted into the text line without interpretation. The following seven characters are not treated as text in Alter/insert mode. ends insertion. ends Alter mode for this line. deletes the previous character. creates a new text line. (cTRLIC) returns SOS to Edit mode. ~ | ~ w 2] Lt 2 [2) Ly retypes the line. gets the attention of DCL. K (Alter mode) [-1[n]Kx Kill (delete) all until nth occurrence of character x This command tells SOS to delete all text from the pointer position up to, but not including, the next occurrence of the given character x. If you supply n, SOS deletes all text up to the nth occurrence of A minus sign causes SOS to delete backwards (to the left) from pointer position through the given character. Deleted characters printed within pairs of backslashes (in reverse order for -n). x. the are SOS the ignores remainder If the upper— of the the K command line, or if the given if it occurs character fewer than does n not occur in times. EXACT switch is on (see Section 2.9.2), SOS requires and lowercase match with the given character x. an exact INTERACTIVE TEXT EDITOR (SOS) L (Alter mode) L Print rest of line; recycle to beginning of line This command tells SOS to print the rest of the line, from the pointer position onward, and recycle to the beginning of the line. The line number is reprinted and the pointer is positioned before the first character. All edits made to the 1line up to this incorporated. Compare the L command with the P command, next (and see the following point are described example). P (Alter mode) P Print rest of line; recycle to current position . The P command tells SOS to print the rest of the 1line, from the pointer position onward, and recycle to the current pointer position. All previous edits are incorporated. The P command 1lets you get a fresh 1look at a line and the L command. command 0240 ¥ Wit lee bhe you muon are editing. sees 3 The oroses example section of below 0.2 shows the P barney (RET NI GOIAN while btre . (A0 Wi le e sriNNirves\cecondasry Wil le the e sNire SN \iecornosary mun vt e bhe erpsNLesSNaeconcare muaon bthe Lecondare Q240 0240 uf .2 TSI TY] wi v Cesc) "aees 8 oross seocotion harnsy wina le maon " U EDINEED)! NOTAG Wity Te tne socoredare moaon "Hees" & Ceross section of 0.2 Py HOTA0 iMean(BO5(F )i A Meanwnilas A0 MednWiin fes Voeas Lhe (B)e caecondars ¥V 2-34 nuon "sees® 2 oross section of 0 INTERACTIVE TEXT EDITOR (SOS) Q (Alter Q Quit Alter The Q from mode; command the E most original line immediately returns you to Edit mode. and commands, which end Alter current line. the range you Under restore Q returns specified mode) Thus mode you to Edit mode even if more the initial Alter command. it differs only for the lines remain in in circumstances, Q restores the line to its original (as it was before editing with the Alter command). made to the line are discarded. However, if you have by inserting ((ir), the Q command leaves them intact. state Any changes you formed new lines R (Alter mode) [-] [n]Rtext(ec) The R command command Replace next/previous n characters with behaves exactly 0Itext(esc). SOS like the deletes command the [-] [n]D next n inserted followed characters text by the after the pointer (before the pointer for -n) and enters Alter/insert mode. The characters deleted are displayed surrounded by pairs of backslashes (in reverse order for -n). (If the EXPERT switch is on, SOS does not display deleted text.) 1If you type after an nR command to create a new line, SOS does not use the given n to determine the new line number. In other words, the n in nR applies to the delete operation, not to the insert operation. S (Alter mode) [-]1[n]Sx Skip forward/back to nth occurrence The S command accepts one character it, and moves the pointer to the that character. If you supply n, occurrence of skip character moves over the if are n character. is printed. intervening characters backslashes. are pointer All If the printed character moves pointer in to characters the EXACT switch between 1is on (see uppercase Section and left the to order character after the current pointer position is the skip character. Therefore, you can skip repeatedly typing, for example, Se. The pointer is to the next occurrence of e. If the that moves reverse The distinguishes example: x from the terminal, without echoing right until the next occurrence of the pointer moves to the nth The negative. of left, between skip ¥ the S command 160 Crer) FrodueLbian senecder fa 0 S wp0r ] dn Froodao Lion m. 50 A0 G Preoveeboon managser S o3 Bhrafl erodoctse the single characters. w/exact(ReD) RIS the pointer not compared to through a line by advanced each time 2.9.2), lowercase the past deficits of For INTERACTIVE TEXT EDITOR (SOS) The S command is ignored if thelgiven character does not occur in rest of the line, or not moved. if it occurs fewer than n times. The pointer the is W (Aiter mode) [-]1[n]W Skip forward/back n words This command moves the pointer to the right (to the left for -n) until it points to the first character of the next word. The pointer moves over spaces and tabs, then over the next word, then over any following spaces and tabs. If you supply n, the pointer moves to the start of the nth following word (preceding for -n). A "word" is defined as any collection of letters and numbers. X (Alter mode) [-][n]X Delete next/previous n words The X command acts like the W command, except that it deletes spaces, word(s), and following spaces through the nth word after the pointer (before the pointer for -n). SOS prints deleted characters between pairs of backslashes is on, (in reverse order for -n). SOS does not print deleted characters.) (If the EXPERT switch Typing 99X is an easy way to delete the rest of a line. A (Alter mode) [-1[n]" Invert case of next/previous n characters This command changes the case of n characters after the pointer (before the pointer for -n). Uppercase letters become lowercase, and lowercase characters become uppercase. Nonalphabetic characters are not affected. The cursor moves past the n characters and they are echoed (for -n, the characters are echoed in reverse order between backslashes). < (Alter mode) [-][n]< Convert next/previous n characters to uppercase This command converts lowercase characters to uppercase. The pointer moves past n characters (or moves back n characters if -n). All lowercase characters characters (for -n, in encountered become encountered are not affected. reverse order uppercase; between backslashes). 2-36 and uppercase The n characters are echoed INTERACTIVE TEXT EDITOR (SOS) > (Alter mode) [-]1[n]> Convert next/previous n characters to lowercase This command converts uppercase characters to lowercase. The pointer moves past n characters (or moves back n characters if -n). All uppercase characters encountered become lowercase; any lowercase characters encountered are not affected. The n characters are echoed (for -n, in reverse order between backslashes). (Alter mode) [-1[n](s) Space back/forward n characters Typing moves the intraline pointer one space to the left, The characters that the pointer passes over are printed between single backslashes. If you supply n, the pointer moves back n characters. The pointer moves forward if n 1is negative: -nCesr) is exactly equivalent to nCs#). If the n (or -n) you supply is greater than the number of characters remaining, the pointer moves to the beginning (end) of the line. SOS ignores the command if the pointer is at the beginning of the line (or at the end of the line for -n). (Alter mode) RET Leave Alter mode for This Alter-mode command this line; print rest of line is the usual way to terminate editing for the current line. ends Alter mode for this line whether you are in Alter mode or in Alter/insert mode. SOS prints the rest of the 1line, and either prints the 1line number of the next line gives the Edit-mode prompt if no lines remain. in the range or (Alter mode) [-]1[n] () Space back/forward n characters has the same effect as (¢): it moves the character pointer one to the left. does not delete characters at Alter-mode command level, it simply moves the pointer. The characters that the pointer passes over are printed between single backslashes. space If you supply n, the pointer moves back n characters. movement is to the right if n is negative: -nCom) is Pointer exactly equivalent to n(Cs). If the n (or -n) you supply is greater than the number of characters remaining, the pointer moves to the beginning (end) of the line. SOS ignores the command if the pointer is at the beginning of the line (or at the end of the line for -n). INTERACTIVE TEXT EDITOR (SOS) (Alter mode) Leave Alter mode (rD acts like Alter-mode to command for this line; end Alter mode level. (r) signals SOS to create above, for details. From print for rest of this line 1line, if SOS within Alter/insert mode, a new line. See 1is at however, the Alter-mode command I, (Alter mode) [-][n]Css) Space forward/back n characters Typing moves the pointer one character to the right and prints the character. The pointer moves n characters if you supply n. Pointer movement is to the 1left if n 1is negative; characters are printed in reverse order between single backslashes. If the n (or -n) you supply is greater than the number of characters remaining, the pointer moves to the end (beginning) of the line. SOS ignores the command if the pointer is at the end of the 1line (or at the beginning of the line for =-n). (Alter mode) [-1(as) (or Skip to end/start of line (@mn)) characters moves that the pointer the pointer SOS moves the pointer to in reverse order between to the end of passes over. If the start of the line single backslashes. the you and 1line type and a prints prints minus sign, characters The Edit-mode command X (eXtend), which invokes Alter mode, is equivalent to the command A followed by and I. That is, X prints the line and invokes Alter/insert mode at the end of the line. (Alter mode) Do not print rest of line; recycle to beginning The command tells SOS to recycle to the current pointer position. All previous edits are incorporated. SOS does not print the remainder of the line (from the current pointer position to the end) before recycling. Thus, in Alter mode behaves the same as in Edit mode. INTERACTIVE TEXT EDITOR (SOS) (Alter mode) Start fresh: discard edits, do not print line recycle to beginning of line, This command restarts Alter mode for the current line. Any previous changes you made are discarded. SOS immediately redisplays the line number without printing the rest of the line. If you have formed new lines by inserting (¥, the command leaves previous 1lines intact. It discards any changes made to the latest (r)-created line and recycles to the beginning of that line. mode, does not have the is taken as same text effect and is in Alter/insert inserted into the mode. line. In this INTERACTIVE TEXT EDITOR (SOS) C Copy 2.8.2 Copy (C) Formats: Cposition,range|,incrementl[,increment2] JCrer) ‘ Cposition=file-spec|,range|,incrementl|, 1ncrement2]]]@ Cposition=file- spec/C‘llD Arguments: position Specifies the destination for the copied 1lines. If number specified by position already exists, the copied inserted after position. If not, the copied lines are beginning at position. the 1line lines are inserted range Specifies the omit range in source range of the lines to be copied. the second form, above, the entire file is If you copied. incrementl Specifies the line-number increment for SOS to use for the copied lines. If the source range contains page marks, incrementl is used only up to the first page mark. If you omit incrementl, SOS uses the current line-number increment. increment2 Specifies the line-number increment for SOS to use for the lines following the final page mark in the source range. If you omit increment2, SOS uses the current line-number increment. Signals that file~-spec Specifies text the is copy to come from a second file (the copy file). file. Option: /C Tells as a SOS to enter Copy-file read-only file so that mode: that is, you can search to it open the copy file for the text to be copied. Current line: After SOS last line The completes a Copy command, it sets the current 1line to the copied. Copy command inserts a copy of a block of text at a given position in the file. The block of text can be copied either from somewhere else within the file (the first usage form above) or from another file (the second and third usage forms). 1In the latter case, if you type /C at the end of the Copy command, SOS enters Copy-file mode so vyou can locate the text in the second file. When you give a Copy command, SOS acts as if you command at the given location, and treats specified range as if you had typed it in. had each given an text line Input in the INTERACTIVE TEXT EDITOR (SOS) S0S takes after a steps to make sure that line numbers are in Copy operation. The rest of this section numbers before and after a Copy command. For an line SOS handles 2-4, line numbers in this situation, SOS chooses a small enough line-number lines 1in the range to fit after the following 1. protocol: SOS checks current 2. If the whether all line-number lines the example of how Section 2.8.15, Figure see increment to allow destination position, lines will fit if increment. will not fit proper sequence gives details on with the it <current increment, S0S checks whether the lines will the increment you supply (incrementl). 3. 1If the lines will not fit with incrementl supplied incrementl), SOS tries to find that SOS cannot be copied number at will choose 1is make a small larger position the lines enough than and the the fit all using the uses the the line-number if it uses (or if you have not a smaller increment fit. increment if numerical difference number of the the next line number of 1lines between the line file. In in the inserts a to this case, SOS inserts page marks. First, it copies as many lines as will fit, using either the current increment or your incrementl (if supplied), inserts a page mark, and copies the rest of the source lines with their line numbers intact. Then SOS second page mark. SOS it tells you what increment it has used with the inserts a page mark, SOS issues the message message INCl=n. INC1=ORDER n AND If P/M INSERTED. If the range of renumbers the lines to be copied already contains page marks, copied lines only up to the first page mark. The mark and is range copied, are copied For the lines to the one it l. the their lines line after the last uses for lines If the lines will increment, SOS uses 3. to SOS the them with increment fit with SOS chooses the you the is INC2=n If ", the SOS does n AND P/M specification meaning precedes range range contains page marks, the lines copied after the if INC2=ORDEK the the first page of first line specification following not mark have INSERTED the increment2 a well. the similar default does range it *, (or smaller 1line-number (increment2). if you have not increment. inserts inserts another a final page page SOS tells you the increment final page mark. The message insert it source contains as to if 1line on a page, before in the default choose a small enough increment, it the lines with numbers intact, and source uses for mark using specify mark. If it page SOS follows a protocol first page mark: copies £fit the the lines will not supplied increment2), last intact. ‘ not If cannot copies up numbers page mark, before the If the lines will fit, line-number increment. 2. If SOS mark, all with SOS page a final insert one. contains the page mark, shorthand symbol SOS copies the page mark begins to meaning the copy last the line, text. SOS and If copies that the the INTERACTIVE TEXT EDITOR (SOS) Note that SOS copies the page mark(s) whether you specify the symbol (s) and/or *, or whether SOS supplies them as defaults. Thus, SOS copies the preceding page mark if you type the range S3:50/4 This is because the initial line number for page 3 defaults to ~. copies: the succeeding page mark if you type the range SOS 20/3:/4 This is because the final line number for page 4 defaults to *. If you type only a single page number for the range, SOS copies both the preceding and the succeeding page marks for that page. For example: 75 This is because S0OS expands /5 to "/5:*/5, above. For B you allows Copy-file Mode - This mode 2.8.2.1 not only to copy a block of text from another file, but also to search the copy file to locate the text. You call for Copy-file mode by using the Copy command in the third format given example: KCAGS 3=CONTROL . OLR/CCrer) The equal sign (=) means copied from a second signals Copy-file mode. (that is, if you use the that file, text 1is to be DCL and the final /C If you do not type /C second usage form given above), the entire file is copied at the point specified. In this example, the file would be copied at or after line 455, page 3, depending on whether or not line 455 exists. | ‘rih;iq_J l: E A — A \ ‘ a type If you type the final /C, SOS prompts C* and waits for you to Find, Print, List, or Move Position command. Only a limited number of Iis the copy file in Copy-file mode because commands are legal read-only while it is open. and (&) are The Edit-mode commands legal, because they are essentially abbreviations of the Print command. Also legal, but of limited utility, are Give Parameter, Set Any other command results in the message Parameter, and Command File. COMMAND INVALID FOR READ ONLY FILE. After you locate the desired lines in the copy file, ¥ SOS type (_RET responds with ENTR RANGE OF LINES: if and, range the At this point you complete the Copy command with desired, one or two line-number increments. You can use line-number abbreviations ( . - * ) in specifying the range. The values of the current line, current page, last line, and so forth refer to the copy and SOS completes the copy operation file, not to the original file. responds with * (the Edit-mode prompt). INTERACTIVE TEXT EDITOR (SOS) D Delete 2.8.3 Delete (D) Format: D[range] (&) Argument: range Specifies the lines to be deleted. default 1If you omit the range, the it sets the current line to the is to delete the current line. Current line: After SOS completes a Delete command, last line deleted (which no longer exists). lines If no This command deletes the lines in the specified range. range, SOS prints the error message RANGE GIVEN DOES NOT the in are CONTAIN ANY LINES. Before deleting all lines boundary, questions: SOS DELETE ENTIRE FAGE? DELETE ACRDSS PAGESYT on a OR NI page, confirmation requests Y Y DR or with deleting one of across the a page following N3 needed). not is SOS then waits for you to type either Y or N (a rejects any character other than Y, y, N, or n and repeats the SOS question. After deleting the lines, SOS reports the results of the deletion with a message such as the SLOLINFOSY following: DELETEDR 20145721 002507°4) . *. If the EXPERT switch is on, SOS neither tells you how many lines were deleted. 2-43 requests confirmation nor INTERACTIVE TEXT EDITOR (SOS) E. End 2.8.4 End (E) Formats: E[:file-spec](re) EB[:file-spec] EQ[:file-spec] ES[:file-spec] ET[:file-spec] () Arguments: file-spec If given, current specifies output the file output file. If omitted, file. The SOS uses the output file has specification. B Tells the SOS not to create a same version number effectively deleted. Q ’ Tells SOS to quit Tells SOS to write page marks. Tells SOS "back~up" as without the input writing an file, output and the input file is file. S the output file without line numbers, but with the output fiie without line numbers or page T to write marks. Current Not line: applicable: after the End command, SOS terminates. The End command terminates the editing session and returns you to DCL. Different versions of the End command allow you to exit with or without a back-up file, line numbers, or page marks. SOS tells you the specification of the output file it writes. It gives no specification if you exit without an output file (EQ). 1If you have not changed the file since it was last written, SOS appends the note (NO CHANGES) to the file specification, and exits without rewriting the output file. If you do not give a file specification with the E command, SOS writes an output file with the same file specification as given in the last Save World command. If no Save World was given, then the file name and type are the same as those of the input file, but the version number is higher by 1. If you supply a file specification, the output file 1is written with that specification. When supplying a file specification, output file over an existing file. same name and type version number specification is version EXISTS number, and FILENAME:. as the given file before writing the identical to that of SOS requests rejects a new the you cannot make SOS write If a file already exists with specification, SOS output file. If an existing file, command filename with with increments the the given including file the the message the its the prompt FILE ALREADY ENTER NEW INTERACTIVE TEXT EDITOR (SOS) Use the EB form of the End command to request SOS not to create a back-up file when it exits. The version number of the output file is not incremented. Thus, the information in the original file is 1lost, unless you have previously given a Save World command that incremented the version number. The ES form requests SOS to write the output file without 1line numbers. You can use ES to save disk space, since files without line numbers require less storage space. However, SOS requires significantly more processing time to generate a file without line numbers. This Section 2.13.1. is because On VAX/VMS systems, programs that of the way SOS you need not cannot deal with use handles temporary ES make to 1line-numbered files; allowances files. see for (This is desirable on some other systems with other implementations of SOS.) On VAX/VMS, the input/output system transparently handles line-numbered files. Therefore, the use of ES should be rare. Use the ET form of the End command to clean up a file that has become messy with uneven line numbers and with page marks scattered randomly throughout. ET tells without page marks opens the file, it mechanism to 2.9.3). Thus, One use of the files to serve Chapter 3). SOS control you can ET as to write the as well as without renumbers it. You SOS's start form of command output line can in ESECrer) ERTCrer) any order. 1ts useful and T options forms version Write the output marks. Do not textual file, (see Section command is in preparing command SLP, the batch-oriented editor (see are V_Write the output f@le without increment a The next time SOS symbol-assignment 1line-numbering defaults the file. the End input to Some as fresh with You can use any combination of the B, S, command, file numbers. use the file number. without increment 2-45 its with given below. 1line numbers. 1line version numbers number. the End Do not or page INTERACTIVE TEXT EDITOR (SOS) F’ Find 2.8.5 Find (F) Formats: F[[string] () [range] [,A)[,N][,E][,n][,-]]1C&D F[[stringlCrm) string6] C& [range] [,A] [,N] [,E] [,n]]GED Arguments: string Specifies the string of characters (fewer than 200) that SOS to search for. SOS prints the first line in which the string found. If you omit string, SOS uses the current find string. is is range Specifies SOS the the range of lines searches from the line to be after searched. the file. 1If you omit current line to the range, end of ’ stringl...stringé Specifies six or fewer distinct strings that for. The total number of characters in exceed 200. SOS 1is the to strings search may not Options: [ A Tells SOS found. string ’ to enter Alter mode automatically when The intraline pointer in the line. points before the string the beginning is of the the 1line(s) in lowercase letters as N Tells SOS which the to print only the string is found. line number(s) of /E Tells SOS equivalent not in to the treat search uppercase and string. ,N Tells given SOS to range. Tells SOS find the to print the next next n occurrences line that of does the not string contain in the string. Current line: After SOS completes last 1line found; a Find however, command, if it the unchanged. 2-46 sets search the current fails, 1line the current to line the is INTERACTIVE TEXT EDITOR Common F (D short (SOS) forms: Search for the string(s) specified in the previous complete Find command, starting at the 1line after the current 1line, and continuing to the end of the previously specified range. | N EED) Search for the previousl} specified string(s), starting after the current line and continuing until the end of the file. Use the Find command to find a given string of text occurring within a given range of lines. SOS prints the first line containing the string within the range. finds the string If the range includes more than one page, and on a page other than the current one, it prints n. before printing the line containing the string. If SOS find the string in the given range, it prints STRING NOT FOUND, FAILED. The current line is unchanged. To find the first following form: occurrence of a word on a find and print given page, SOS PAGE cannot SEARCH . use the Fisomerd/4 This form of that contains To locate previous the Find the command means the string next occurrence command, the first line on page 4 "isomer". use of only the the same range string you gave in the argument: ! KF 4/ &(RET) This form means find and print the first line on page 6 that contains the string "isomer" (from the previous Find command). If you use this form of the Find command before you issue a complete Find command, SOS prints ILLEGAL SEARCH STRING GIVEN. If you omit the range following the current For example: specification, SOS begins searching line, and continues through the end at of the the 1line file. (Cesc ) { fdeoxsribob(rer) This form means beginning with the file. find the the line first occurrence of the string "deoxyribo" following the current line through the end of INTERACTIVE TEXT EDITOR (SOS) You can give the Find command repeatedly, each time occurrence of a string in the file. To do this, For finding the next simply type F(xrer). example: (Cesc) xfrandom$/1/ xCED D) 01310 a POGE 00110 2. & *f (Crer) kf (GED) STRING *:::: ¢ ¢ IS random but 00320 certain dedree eseudo-random NOT AT rerturbations FOUNDy of in the structure lattice the randomness rnumber SEARCH of in the imnterval srocess. [O0r1dy chosen FAILED 00110/2 X You can special search for form of string. and the After typing all the search range and options (if desired). first string, The multiple as many as six different strings at once by using a the Find command. Instead of typing (sc) after the type (®r); search SOS prompts you with F* strings strings can contain up to in 200 for another this way, characters search type in all. An example using two search strings is given below. Note that the user has typed ,99 as an option at the end of the Find command. SOS finds the first 99 (or fewer) occurrences of either search string in the range. £fraendom(rer) ESC F¥stochastriod s/ Lk 99(rer) DOI20 but QO740 NL310 froam the stochastic a certain dedree of FAGE PAGE revburbastions of the lattice eauation (Ee. randomness i structure 4-2)., bhe #rocess. 2. QG110 OQL2L0 ranmdon a8 4. i rseudorandow bhe studs of mumber in bthe stochastic interval DOy1ly chosen #rocesses. ¥ A common error in using the Find command 1is to type RET after a search string when you meant to type (Cesc). SOS assumes you intend to specify multiple search strings, and prompts F*., At this point, you can type (sc) and complete the Find command normally. 2.8.5.1 Find Options - The complete Find command, including options, is shown as the first format given at the beginning of Section 2.8.5. You can supply options in any combination and in any order. If you give a Find command with one or more options, these options will still be in effect if you later use the abbreviated form F (rer). The ,n option is an exception: it applies only to the complete Find command. INTERACTIVE TEXT EDITOR To reset the options while still using an type F(esc) (rer). If you do not indiscriminately Number, or use find NUMBER. the ,E option, a line containing (SOS) abbreviated the any of Find command, command below would the following: number, ESC Froumirer $(rer) This ambiguity can be useful: for example, when you want to find a whether it begins a sentence or not. But if you want SOS to distinguish uppercase from lowercase characters when searching, use the ,E option. word Using the ,E option is equivalent to turning Section 2.9.2) for Find commands only. Use in a a the EXACT switch (see large number like 999 for the ,n option to find all the strings given range. Unlike the other three options, the ,n option applies only you give only one If on you to the more use same Find positioned one execution command occurrence the ,A of the Find FFIRST(esc),2(rer) (Alter of the mode) string and ,- command. and later For use example, F(rer), SOS if finds FIRST. (do not find) command, SOS enters Alter mode with at the beginning of the line that was options the intraline found. in the pointer Examples: ESC fdigl /49053 Print last a the first three 1line on page 4, string that of lines, from the current that contain the string unless its case (upper the given string. or lower) 1line digi. agrees through the Do not match exactly with +F ( RET Print the next line after the current 1line that contains the string digi. The search starts at the line after the current line and continues to the end of the range last specified (to the end of page 4). An exact pattern prints only one matched line; previous Find command applies the only match ,3 to is still option that one required. specified command. in SOS the L?( | Mot /¥y 999 Crer) Print only the line numbers (and page numbers) of the lines in the rest of the file that contain the string digi. Exact pattern matching is no longer called for. Consequently, SOS matches Digi and DIGI, for example, as well as 2-49 digi. INTERACTIVE TEXT EDITOR (SOS) Kol pimg @ FIND- digi SURSTITUTE FOR~ X Display the strings currently in effect for Substitute commands. See Sections 2.9.1 respectively, for details on the STRING parameter Parameter command (=). the and and Find and 2.8.19, the Give K P Mumioh F¥torm (rer) (CEsc) FXGorlin$ .,/ Xsaver999 Find all occurrences of any of the strings Munich, Bonn, and Berlin in the rest of the file. Do not match a string unless it starts with an uppercase letter. As each string is found, enter Alter mode for that line, with the intraline pointer positioned before the start of the string that was found. INTERACTIVE TEXT EDITOR (SOS) Help 2.8.6 Help (H) Format: H[:n]Crer) Argument: n Specifies the number of is to start printing. the module in the help package that SOS Current line: The Help command does not affect the current line. The Help command prints a help package on your terminal. is composed quickly of a number of modules. through A control This package feature lets you skim the modules. After the introductory module, the help package contains summaries of SOS features and functions similar to Appendix A, but formatted for printing on a terminal. If you type the Help command with no argument, SOS prints the entire help package. The introductory module contains a list of the other modules and their numbers, plus instructions for printing the help package on the line printer. If you type @rw) while a module is printing, SOS skips to the beginning of the next module. You can skim through the help package by typing successive .Cmru9s. Typing returns you immediately to Edit mode. Tf you type the Help command with an argument number n and continues to the end of the n, SOS prints help package. As an example of how you can use the Help command, suppose see a list of Alter-mode commands. Proceed as follows: 1. 2. Type H(rer). Type @9 SOS prints when you Alter-mode commands. 3. Type H:6(rer). 4. Type prompts read the to introductory module. that module SOS prints module number *, you want number 6 summarizes SOS prints the Edit-mode prompt when SOS begins to with module print *. 6. module number 7. SOs INTERACTIVE TEXT EDITOR (SOS) | Input 2.8.7 Input (I -- Input Mode) Formats: I[position] [,increment]Crer) I[position] [;increment](rr) I[position] [;!n]Ceer) Arguments: position Specifies the destination for the inserted text; position is the line number of the first inserted 1line, if a line does not already exist at position. If a line exists at position, the line number 1is set to position plus the current line-number increment (or the specified increment). If another 1line exists at or halfway before this between. in continues at new 1line If you omit the position where number, the new line is numbered position argument, insertion the the last Input command left off. increment Specifies comma. the I1f new current preceded by line-number a semicolon, increment only for this insert. current line-number increment is If used. increment, if preceded by a argument is a temporary the you omit increment, Specifies the number of lines you want to insert. an appropriate temporary line-number increment. Current calculates line: After SOS last line Common SOS the completes inserted. short I.CxD) Insert an Input command, line. it sets the current line to the forms: after the current after the last new page 1 *GED Insert I/*+1(re) Start a at line the end on this of page. the file there. and begin inserting I ( Rrer Continue inserting after the line most the 1line-number increment given in command. this You must issue a complete form. 2-52 recently inserted, the 1last complete Input command before using Input using INTERACTIVE Use the file. TEXT EDITOR (SOS) Input command to enter new lines into a Its arguments are a single position (line/page) and/or a line-number increment. — Text insertion begins (SOS enters Input mode) at or after the line number specified by position. SOS accepts successive lines of text from the terminal, and inserts them into the file. Successive line numbers are determined by adding the current increment to the previous 1line number. . |I ::::{::] DCL - 4 The increment argument, if specified with a comma, becomes the new line-number increment. If specified with a semicolon, increment acts as the line-number increment for this command only. Subsequent commands continue to use the default increment (except temporary increment). ICreT), which uses the Use the third form of the Input command when you know exactly how many lines vyou want to insert. 1In this case, SOS calculates a line-number increment that allows the given number of lines to fit before the next existing line. Exit Input mode by typing (). If you type at the beginning of a new input line, that (empty) line is not inserted into the file. The last full line inserted becomes the current 1line. You <can also return to Edit mode by typing at the end of the last line to be inserted. In some circumstances, SOS returns you These circumstances are given below, continue inserting text: to Edit mode automatically. along with ways to recover and @ A line exists whose number is equal to or less than the number that SOS calculates for the next inserted line, and this line is not the first line inserted. (To continue inserting text, issue another Input command, specifying a smaller increment.) @ The line number that SOS calculates for the next inserted is greater than 65535. (Renumber part of the file.) line @ You (Use try to shorter insert a line longer than 500 characters. lines.) After completing an Input command, when you have returned to Edit mode, SOS remembers the line number and page number of the next line to be inserted. 1If you type I(ka), text insertion resumes at this point. SOS uses the increment specified in the last complete Input command you typed, even if it was a temporary increment. Thus, 1in this special case, the temporary increment endures after the Input command in which it was established. If you specify an existing line as position in an Input command, and this 1line 1is followed by anothér line with a number higher by 1, SOS prints the error message INSUFFICIENT LINE NUMBERS FOR INSERTION. In this case, use the reNumber command (N), then reissue the Input command. INTERACTIVE TEXT EDITOR (SOS) Example: 00130 MOV 00140 CLR 00142 EREQ X1, 92CED) 00144 00146 *G 00150 MOV Cesc) RSsyCNTEL(R3) $SAVE UCE FOINTER U.CW2(RS) SCLEAR 10% 3 IF I.TCR(RK1) RO ALL EQUAL SWITCHES YES (ReD) FGET REQUESTOR TCR ADDRESS (Ren) | % MOV X1 @D 170.yU.CNT(RS) $SET COUNT FOR 170 NULLS (Esc ) 00146 ENE k=RIG(RE) 65% 5IF 4 XTk/4(rer) 00430 VERSION 214y 2-21-78. GNL ,Cre) ESC 00432 ¢ Xz Crer ) COEALCLANEYIFFIRV,MACS 181 $ 2-54 NoE. DON‘T FUNCH TRAILER INTERACTIVE TEXT EDITOR (SOS) Join 2.8.8 Join (J) Format: J[position]Crer) Argument: position Specifies the line to be joined to the following line. If you omit position, the current line is joined to the following line. Current line: After SOS completes a Join command, it sets the current 1line to the new line made from the two o0ld lines; that is, the current line number becomes the specified position. The Join command joins two lines together. The joined line is given the number of the first line of the pair, that is, of the line at the specified position. It becomes the current line after the Join command completes. The 1line number that previously belonged to the second line of the pair ceases to exist. SOS refuses to join two lines if the resulting line would be longer than 500 characters. It prints the error message LINE IS TOO LONG. If the line specified by position is the last prints 1line on a page, ILLEGAL SYNTAX OF COMMAND. Example: §= 400 1 3(Crer) 30400 FAGE The #osl to write 13 a2lwsws 2. 50610 DOLED , cleary furnctional srecifications that are essw to understand. %J 400 1Crer) TLLEGAL SYNTAX OF unambiguous COMMAND PRLUNEED) V0 ey The goal is 2lwawsto write cleary Q0400 The soal is alwaus The #@ozl is alwaws unsmbhishuous X DOA00 Lo write ¥ 2-55 clesrcy unasmbhidguous SOS INTERACTIVE TEXT EDITOR (SO0S) K Kill Page Mark 2.8.9 Kill Page Mark (K) Format: K/page(rer) Argument: /page Specifies Current The to be deleted. line: Kill This the page mark Page Mark command command deletes does ("kills") not affect a page mark the current line. that you have inserted with the Mark command, or that SOS has inserted in the course of a Copy or Transfer command. When a page mark is deleted, the text that was previously on that page appears at the end of the preceding page. (A page mark is considered to be located at the head of its page.) You can delete only one page mark at a ;ime. Deleting a page mark can leave line numbers out you with the message LINES OUT OF ORDER. immediately renumber the current page using the If you PAGE try DOES responds delete NOT CANNOT immediately not to insert a EXIST. KILL nonexistent If INITIAL you PAGE page try of In order. SOS warns this case, you must reNumber command. number, SOS prints delete page mark to MARK. after the start of the file a physical page mark there.) (SOS to be the 1 considers on page 1, message (K/1), SOS the text but it does INTERACTIVE TEXT EDITOR (SOS) List 2.8.10 List (L) Formats: Lirangel [,[S][,P[:file-spec]]](rer) Lirangel [,[S][,F:file-spec] ](re) Argument: range Specifies the range of lines to lists the entire file. list. If you omit range, SOS Options: 14 S Tells SOS to ,P:file-spec suppress line numbers Tells SOS to specification, in the listing. produce a disk file, with formatted fo; later printing. the given file an ordinary SOS 1line the (F:file—-spec Tells SOS to produce text file. a disk file formatted as Current line: After SOS completes a List command, last line listed. it sets the current to The List command allows you to generate either a printer listing or a disk file containing all or part of the file being edited. The List command has an advantage over the DCL PRINT command for printing SOS files. The List command generates headings on each page of printer output giving the SOS page number, as well as each 1listing page's sequential number within the SOS page. The heading contains the specification of the file being listed; the date and time printed; and a page number in the form m-n, where m represents the page number in the SOS file, and n 1is the segquential number of the 1listing page within the SOS page. (When n=1, the printing of "-n" is suppressed.). These headings are generated if you specify ,P (whether the output goes to a printer or to a disk file). The headings are also generated if neither ,P nor ,F is specified. The SOS parameter LENGTH controls the page length of listings produced by the List command, ,P option. 1Its initial value is 55 lines. You can reset this parameter if desired (see Section 2.9.1). You can specify a particular printer by using the ,P option in the form ,P:LPan: (a 1is the controller designation and n is the printer rnamber). LPan: is a legal file specification. If you omit file-spec from the ,P option, or if you supply neither ,P nor ,F, the listing is sent to LPAO. The option ,F:file-spec generates a disk file containing the lines in the given range, but without the page headings described above. The disk file thus produced is a normal SOS file. Any page marks in the range are included in the file. The ,S option, if present, tells SOS to suppress line numbers in the disk file. 2-57 INTERACTIVE TEXT EDITOR (SOS) M Mark 2.8.11 Mark (M) Format: M[position](rer) Argument: position Specifies on a the position new position. page. SOS (line/page) inserts that a If you omit position, is page to be the mark before the current line first the 1line given is assumed. Current line: After first SOS completes a Mark command, line on the new page. The Mark and command renumbers inserts all it a page mark subsequent pages. at sets a the current specified point 1line in to the the text If the line number in the position specification does not exist, SOS inserts the page mark immediately after the previous, lower-numbered line. If you give the Mark command for the first line on a page, SOS inserts a page mark immediately after the existing page mark. The page that previously existed is then empty. After the completion of a Mark command, the current line is the line on the new page. Therefore, if you give the Mark command below, the current line becomes 300/4. first shown X M300/3CRED) The new line is the same line that you referred to 300/3, but it is now on page 4. 2-58 in the command as INTERACTIVE TEXT EDITOR (SOS) N reNumber 2.8.12 reNumber (N) Format: N[increment] [, [range] [,start]](re) NA[increment] [, [range] [,start] ](rer) NP[increment] [, [range] [,start] J(zr) Arguments: increment Specifies the line-number increment between the renumbered lines. If you omit it, SOS uses the current line-number increment. range Specifies renumbers the the range of lines entire file. to renumber. If you omit 1it, SOS for the renumbering. If the value of increment. you start Specifies the starting line number omit it, SOS starts renumbering at Tells SOS to add increment to every 1line number in the given range. Tells SOS to renumber all lines in the range sequentially. S0S does not reset the starting line number at each page boundary. Current line: After SOS completes a reNumber the last line renumbered. This command reNumber renumbers whenever commonly, you INSUFFICIENT can LINE the SOS command, lines prints renumber NUMBERS FOR in the the upon it sets given message the range. LINES receiving INSERTION (or current You any must OUT OF ORDER. the at 1line error other to use More message time). The first argument, increment, specifies the increment between 1line numbers. The first line renumbered is given this number, unless you specify the third argument (start). Each succeeding line is given a number that 1is the sum of the increment and the previously assigned number. If SOS number crosses a page mark while renumbering, it to the first line on the new page (unless example, you type the following command: assigns the increment you specify NP). For Before renumbering, shown below. and Page 2 115 Page 3 900 the line 126 911 numbers 137 952 150 1022 on pages 2 3 might be as INTERACTIVE TEXT EDITOR After renumbering, the line numbers (SOS) are: Page 2 10 20 Page 30 3 40 10 20 30 40 If you use the NP form of the command, SOS does not reset its numbering when it encounters a page boundary. The entire range is numbered in ascending order. Thus, using NP in the above example produces: b ST EOPRNAQ D) Page 2 10 20 30 40 Page 3 50 60 70 80 The NA form of increment argument If you range the reNumber to each line is meaningless. do not specify is empty, a command number If in supplied, range, SOS prints tells the SOS it LARGE reNumber - LINES OUT command OF using is renumbers to add If you the specified use NA, the ignored. the entire file. If start RANGE GIVEN DOES NOT CONTAIN ANY LINES. If, while renumbering, SOS assigns a line stops renumbering immediately and prints TOO SOS range. ORDER. At this a smaller Page Mark the number larger than 65535, it the message LINE NUMBER STEP point, you increment or must a reissue smaller the starting number. If, after issuing a message LINES current page). OUT Kill OF ORDER, (K) command, renumber 2-60 using you /. get as the the range error (the INTERACTIVE TEXT EDITOR (SOS) Print 2.8.13 Print (P) Format: Pl[range] [,S]Cre) Argument: range Specifies the range of lines to print. If yo. omit range, SOS prints 16 lines (or the number of lines given by the parameter PLINES). Option: S Tells SOS to suppress line numbers and to print only the text. line to Current line: After SOS completes last line printed. Common P( short a Print command, it sets the current ' the forms: rer Print at 16 the p/.GED lines current (or the line; Print all lines on Print the next Print the previous number of lines given by PLINES) cross page boundaries if starting necessary. the current page. line. ESC The Print including prints a line. command prints on your terminal the lines in a given range, 1line numbers. If the range includes a page boundary, SOS blank line and PAGE n. suppress when it to mark Use the option ,S still prints PAGE to n. You can interrupt until you type typeout at any time by to resume where it. line numbers in the Print crosses a page boundary. typing @G=is). it left off. command. S0s Output pauses To suppress all There may be a remaining output from a Print command, type @®rwo). slight pause before S0S gives the Edit-mode prompt continues to move output to a buffer area after you type * because @wo. If type a second point in the at "If you use number of can change parameter during pause, typeout resumes some later the Print command without arguments (P(rer)), SOS prints a 1lines (initially 16) beginning with the current line. You the number of lines printed by P(xr) by resetting the SOS PLINES. The % /PLINES ; n(CeEr) X this output. SOS you command is: INTERACTIVE TEXT EDITOR See Section 2.8.21 (SOS) for details on the Set Parameter command /. The Edit-mode commands and (&) act as abbreviated forms of Print command. They tell SOS to print, respectively, the next and the previous line in the file. With and (<), you can through a file a line at a time in either direction. and suppose the operate regardless of page boundaries. For example, current 1line is the last line on page 3 when you type X = o (CRET) . IS AT x Cre) PAGE 1600/3 4. 00100 X Guidelines for creating These two special abbreviations of follows: => RET => Csc) RUNOFF files online are the Print command can be defined as P°/.+41 if . = * P.-1 if . # P*/.-1 if . =" ° Example: ¥ o1 1 3CreD) 00530 trade~-off 00540 files 003545 most casesy 00550 Howevery x Crer) involved instead of im retrieval there using relativelw seauentially maw be time is unused ordanized ordanized ones! in reduced significantles. srace on the file. ¥ Crer) FAGE 3. 000190 Access Methods? 00660 VAX-11 + I8 AT RMS file ordanizations 00600/3 ¥ =RIGCRer) 3 RECED) NO the line step SUCH LINE EXISTS X 2-62 listed in Table 4-1. INTERACTIVE TEXT EDITOR (SOS) Replace 2.8.14 Replace (R) Formats: R[range] [,increment ) (rer) Rirange] [;increment](Crer) R[range] [; In]CGeD Arguments: range Specifies the range of lines to be deleted and replaced with new text. SOS enters Input mode. The first new line of text is given the number of the first line in the range. If you omit range, the current line is replaced. increment Specifies the new current line increment, if preceded by a comma. If preceded by a semicolon, it is a temporary increment for this command only. If you omit increment, the current line-number increment is used. n Specifies the number of deleted range. SOS increment. lines you want to insert in place of the calculates an appropriate line-number Current line: After SOS last line Common completes inserted. short a Replace command, it sets the current line to the forms: R.(Cr) Replace the current line with a new line or Replace the line. lines typed in. RCrer) current The Replace command acts like a Delete command for the given range, followed by an Input command at the first line in the range. SOS tells you how many lines have been deleted (unless the EXPERT switch is on) and then enters 1Input mode. You can optionally supply an increment for the Replace command, as you can for the Input command. The increment, if supplied, acts as either a temporary (;) or permanent (,) update of the current line~number increment. That is, use the ,increment argument to change the default line-number increment. Use the ;increment argument to define a temporary increment for this command only. Subsequent Input and Replace commands continue to use the default increment. Use the third form of the Replace command, Rrange;!n, exactly how many 1lines you have to insert. SOS appropriate (temporary) line-number increment. 1if you know calculates an The line number of the first inserted line is that of the first 1line that SOS deleted in the range. Subsequent line numbers are determined by adding the current increment to the previous line number. 2-63 INTERACTIVE TEXT EDITOR (SOS) If you specify a range that crosses page boundaries, or that includes an entire page, SOS asks for confirmation before deletlng anything. SOS prints one of the following queries: DELETE REFLACE ACROSS PAGES?T ENTIRE PAGE?T SOS does not switch request Y Y OR OR N? Nt this confirmation before deleting if the EXPERT is on. In only one particular does the Replace command differ from an equivalent combination of Delete and Input commands. The Replace command does not define the proper parameters to allow the abbreviated Input command ICeer). You can use this abbreviated form only after typing a full Input command. Examples: X R/250(rer) REFLACE ENTIRE FAGE? Y OR N!Y Replace all lines on page 2 and insert new lines, beginning with the first 1line deleted. Use an increment of 50; make 50 the current line-number increment. X Ri503 i 2(Cker) Replace line 150 on the calculates a temporary fit. current page with two increment that allows the 1lines. ' SOS two lines to ¥ R33715 7CGED) 6 Replace the five lines starting 2-64 at line 337 with seven new lines. INTERACTIVE TEXT EDITOR (SOS) S Substitute 2.8.15 Substitute (S) Formats: S[[oldstring(a)newstring] (o) [rangel [,D] [,N] [,E] 1CzD) S[oldstringl () oldstring6(esc)newstringl(rer) newstring6 ()] [range] [,D] [,N] [,E]CxeD) Arguments: oldstring Specifies any string of characters (fewer than 200). newstring Specifies a string of characters that SOS is all occurrences of oldstring within the range. range to substitute for is to make the Specifies the range of lines over which S80S If you omit range, SOS performs the substitution substitution. its search with the starting found, only on the first match current lihe, proceeding if necessary to the end of the file. oldstringl...oldstringé Specifies six or fewer distinct strings that SOS with newstring (1 to 6). is replace to The total number of characters in all the oldstrings cannot exceed 200. newstringl...newstring6 Specifies six or fewer strings that S0S is to substitute for (1 to 6). The total number of characters in all the oldstring newstrings cannot exceed 200. Options: D N Tells SOS to enter Decide mode. Tells SOS to print only the number of Tells SOS to accept only an exact match substitution B 1line in (upper- and the which the is made. letters must agree) in the oldstring(s). lowercase Current line: After SOS completes a Substitute command, it sets the current line to If SOS does not find the 1last line in which a substitution was made. the string to be replaced, it does not change the current line. 2-65 INTERACTIVE Common Short You must TEXT EDITOR (SOS) command before Forms: issue a complete Substitute using these forms. sCrer) Perform substitution(s) on the current oldstring. of the current range. one line: Search from the the first 1line current line containing to the end ESC Sé, RET Perform substitution(s), newstring, | ss on the using current the current oldstring the current oldstring and line. RET Perform substitution(s), newstring, the current on the line to wusing first line the end of containing the file. oldstring. and Search from This command substitutes an arbitrary string of characters (newstring) for another arbitrary string (oldstring) within a given range of lines, and prints each line in which a substitution is made. An option (,D) for which a invokes Decide mode, in which SOS displays each 1line substitution is appropriate -- with the change already -- and asks you to decide the disposition of the 1line. Decide is described fully in Section 2.8.15.3. made mode SOS remembers the you can them reuse strings in a you later specify in command. a Substitute For example: command so that bDr. for all (Cese ) (Cesc ) ¥sloolar $hr.$/1 8 2CED) This command occurrences tells SOS tells SOS of Doctor to make the to on substitute pages same 1 and 2. substitution on page If you omit the search strings as shown complete Substitute command, SOS prints A Substitute command with the Then, no string the The specified in command 3. above before you have issued ILLEGAL SEARCH STRING GIVEN. arguments (assuming issued a complete command) performs the substitution the next line, starting from the current 1line, in occurs. following you search proceeds, if necessary, until the the last complete Substitute command. have already in only one line: which oldstring end of the range One exception applies: if the last Substitute command operated on current 1line, then S(&r) tells SOS to search from the line after current line. Thus, having issued a complete Substitute command, can perform range SOS on by repeatedly prints a new the a blank page. same substitution typing line and one line at a time throughout S(r). PAGE n. each time a it makes a the the you the substitution INTERACTIVE TEXT EDITOR (SOS) 2.8.15.1 Multiple Substitutions - SOS can perform substitutions for several string-pairs at a time. That is, oldstringl is replaced by newstringl; usage oldstring2 by newstring2; form above as and so follows: on. Use the second 1. Specify all oldstrings first, and follow each oldstring 2. SOS prompts with S* to remind you that 3. After typing the last oldstring, with CeD- Substitute command. newstring. with Follow S*, each type newstring you are (& with within and (®r). 4., After specifying the last newstring, type a final 5. Complete the command by typing the range (and the the first SOS prompts (o). options, if desired). The limit for multiple substitutions is six oldstring-newstring pairs. The total length both of all oldstrings, and (independently) of all newstrings, cannot exceed 200 characters. For example, suppose you want to substitute the variable X6 for all occurrences of X in a FORTRAN program, and likewise Y6 for Y. X and Y are always space-delimited. Use the following Substitute command: ¥s CGOHXCGOGED) | sxCeOYCeD$(OXeCGOCeD) { sx(CGOYeCe 61t /x(CED) You can specify fewer newstrings than substitutes example, the 1last newstring oldstrings. you do, SOS For "goat" Note that in the case of two oldstrings, one of which is a subset of the other, you must give the longer oldstring first. leading 2.8.15.2 ,E) "goats" on page 1, "sheep" If all the extra oldstrings. for all occurrences of and to substitute the word for type: Xsgoats(Rer) Cso) | (o) { Skgoatdsheers/1(ED) appear in Substitute Options - The Substitute options (,D any order at the end of a substitute command. ,N can Any options used in a complete Substitute command remain in effect for later S(xr) commands. SOS always distinguishes uppercase newstring(s). The ,E option only oldstring(s). For example, suppose you want routine in the following line: N0330 The uwtilitye to from lowercase characters 1in affects SOS's interpretation of change routine EXE is the name executed by of the utility INTERACTIVE The following Substitute TEXT EDITOR command effects routine XQT (SOS) the change: Cese) G 4 | X SEXE$S XOT$ 330y e (D 00330 The utilite is executed bw X The EXACT switch controls this exact pattern-matching feature. Find) command requires an exact EXACT is off. Section EXACT is on, every Substitute (and pattern match. When SOS is initiated, describes the EXACT switch. 2.8.15.3 Decide Mode - SOS enters Decide mode if you type the option ,D after the range in a Substitute command. (SOS also enters Decide mode if the DECIDE switch is on, that is, if you have issued a /DECIDE command.) In this mode you can decide on a line-by-line basis whether or not to make each substitution. . DCL SOS prints each 1line in which it makes a substitution, and prompts with D*, Type one of the eight single characters shown in Table 2-5. No is needed. 1If you type any character other than those listed, SOS repeats the prompt. Table Decide~-Mode 2-5 Commands Form Meaning Yes, make the change as shown. Decide mode with the next line remains in the original range. DEL No, do not unaltered. A Alter: make SOS enter already made. type legal any the change. continues Decide in Alter Once SOS to in Alter-mode changed, The 1line Decide mode. mode, with Decide Alter commands. Decide Alter mode, SOS continues displaying the next changed line (if the original range). E End: do not make Decide mode substitutions G Go: yes, make the change, (return are made the to in N Same as (TM): Q Quit, same as E: do not immediately to Edit mode. Y Same as (Cs): and the When and if change you you Decide mode any remains immediately make all automatically, in any remains mode, Edit mode). the original range. change, changes in the range Decide-mode intervention. continues be can end by in leave further further without no, do not make the change. make the yes, make the change. 2-68 change, return INTERACTIVE TEXT EDITOR (SOS) T Transfer 2.8.16 Transfer (T) Format: Tposition,range[,incrementl|[,increment2]] Arguments: position Specifies the destination for the transferred lines. number specified by position already exists, the lines are inserted after position. If not, the inserted beginning at position. If the line transferred 1lines are range Specifies the source range incrementl Specifies the line~number of the lines increment to for be transferred. SOS transferred lines. If the source range incrementl is used only up to the first page incrementl, SOS uses the current line~-number to wuse for the contains page marks, mark. If you omit increment. increment2 Specifies the line-number increment for SOS to use for the lines following the final page mark in the source range. If you omit increment2, SOS uses the current line-number increment. Current line: After SOS completes a the last line moved. Transfer command, it sets the The Transfer command moves a block of text from one another. When you give a Transfer command, SOS given an Input command at the given location, and current 1line to place in a file to acts as if you had treats each text line in the specified range as if you had typed it in. The text is deleted from its original place in the file. Contrast this command with the Copy command, which moves a block of text without deleting it (see Section 2.8.2). SOS takes steps to make sure that line numbers are in sequence after a Transfer operation. The rest of this section gives details on line numbers before and after a Transfer command. Figure 2-4 shows an example of a Transfer command. SOS chooses a small enough line-number lines in the range to fit after the following protocol: increment to allow destination position, If the lines will not increment, S0OS checks fit with the current line-number whether the lines can fit if it uses the (incrementl). 3. If the lines will not fit with incrementl supplied 1incrementl), SOS tries to find that can make the lines fit. 2-69 it the 2. supply if wuses S0S checks whether all the lines current line-number increment. you fit the the 1. increment can all using (or if you have not a smaller increment INTERACTIVE TEXT EDITOR (SOS) SOS cannot choose a small enough increment if the number of 1lines to be moved 1is larger than the numerical difference between the line number at position and the number of the next line in the file. In this case, SOS 1inserts page marks. First, it transfers as many lines as will fit, using either the current increment or your incrementl (if supplied), inserts a page mark, and transfers the rest of the source lines with their line numbers intact. Then SOS inserts a second page mark. SOS tells you what increment it has it inserts a page mark, the message If SOS The the used with the message INCl=n. If is INC1=ORDER n AND P/M INSERTED. the range of lines to be transferred already contains page marks, renumbers the transferred lines only up to the first page mark. page mark is copied, and all the lines up to the last page mark in range are For the lines to the one it transferred with after the last uses for lines their line page mark, before the 1. 8GCS moves them they can fit,. using the 2, 1If the lines will not increment, SOS uses the 3. If the lines will not supplied increment?), intact. SOS follows a protocol first page mark: default fit with increment fit SCS numbers 1line-number similar increment, if the default 1line number you specify (increment2). with increment2 (or if you have chooses a smaller increment. not IaBuny9s02L1o00jt£€q23a1E1Jeu0009la|0AjvsQ0J00udaegys¥wr]n)‘Pu(GU8Sqv/€¥L1ZLMB/mp/Lv2o9LzOA0I0o¢u%ltLcEIe2LC€LsLeInaObADbeydSr}|*Pg3sI1aN4qSuU!HlnuO-S}IzYILAjCdLI1e1ix9epd3u4sI-BOeuLsyo3iuySnteliej«IsS3e)loiuItd)yl‘IO1}xa}uJ1I43o10u(OYsi1yIarNO1ay8UyIjb5EIeaNuaeusbo2e-iu‘‘18y1adweuas0dJneldb4s|u|e03-w|e1aqa)eyg3s0bulwee1\l4)-d8jp0uUano3idesat1p3iu0lAd0W3ieu.daeyalyJuaJ320L97¢n00j€OoE21s13£e1q£uag0005ielnvBS)0b00dMa‘OPAY¥SUdSB.o[LA9)SgGqIvv€1zLyIL2//l/9‘0iILc0d0o¢14OplWvE€eLcCL}DIuBe'I.Aw0jOo3“3pA:({Ja1dusUoZLB)SeeIOu0E319rWNU:~sdAIa1IOSb:dslI)33xei.4OadBa|Y1oU.3q951|cjI/yiu,0eJoi=S4y2.n0Il3euPS£uqhwymJaAOutdYfoIudBLouAJsToBqu3aIuy|IulUnRs1uaDLS6280#90iyp00112|31li0T0pn98|iov1nm040do3am4q¢04a.q3ySgsQ€}1vyL174//pa34Lt0c901uwLvLel¢}eu1sJa1)oaj}yel |euiblioasejda+043q)auy)‘g9bed*(G 39Vvd ‘G 001€00 00 lc//0agl 0100039Vd ‘¥ L/0v P005S0A2L1LZ330000999vVV0000ddd‘'‘G€1GL£1£€Z////0600aSYzLC1lL 1ajsuedsaR\3bOju.Nse.u_ye.nJo"JM(as\qau1OiubP}lswv0)Mi11J:a\auZiqOOsouVNuwiIyanun€Y-3-u1¢yUlt| a0l0S01o3Z11323j000099oVVV0gO000dddJ|‘'a'G€ljLS€1gXs/o/vu00SGzevzL7l/lS5LY3.1l“8uJ1sByqwu-iabn~enudu-a:‘u=yPb) leZb“ ¢w €8220£3T30J9009aVV0lv00ddy'‘J€||agL£€j///s00S04/; uzLCLlel 0S00 G/0S 0500 -5/06I\o e INTERACTIVE TEXT 2-71 EDITOR (SOS) 0G)5/0Q80 INTERACTIVE TEXT EDITOR (SOS) If SOS cannot choose a small enough increment, it inserts another page mark, moves the lines with numbers intact, and inserts a final page mark. increment the If the source range contains page marks, SOS tells you The message for the lines copied after the final page mark. uses it and final page mark, a insert to is INC2=n if SOS does not have INC2=0ORDER n AND P/M INSERTED if it does insert one. If the specification of the source range contains the shorthand symbol ~, meaning the first line on a page, SOS duplicates the page mark that precedes the first line before it begins to move the text. If the specification contains *, meaning the last line, SOS duplicates range the following page mark as well. Note that SOS duplicates the page mark(s) whether you specify the Thus, and/or *, or whether SOS supplies them as defaults. symbols SOS duplicates the preceding page mark if you type the range /315074 This is because the initial line number for page 3 defaults to ~. copies the succeeding page mark if you type the range SOS 2073074 This is because the final line number for page 4 defaults to *. If you type only a single page number for the range, SOS copies both the preceding and the succeeding page marks for that page. For example: 75 This is because SOS expands /5 to "/5:*/5. 2-72 INTERACTIVE TEXT EDITOR (SOS) W Save World 2.8.17 Save World (W) Formats: W[:file-spec] (D) WB[:file-spec] (rker) Arguments: file-spec 1f given, uses the specifies current the output output file file. If you omit file-spec, SOS specification. WB Tells SOS not The previous you have not to increment version of used W the the before) is version number of the output file. output file (or the input file, if overwritten. Current line: The Save World command does not The Save World command directs file being edited to disk. written. After the command, affect SOS SOS you the current to write tells you remain in the line. current the name of Edit mode. version the file of it a has Use the Save World command frequently as a precaution against system malfunction or against your own errors. If a catastrophe happens, you only lose the work done since the last time you saved "everything in the world." Section 2.7 gives an overview of "defensive editing." Each time you use the W command, the current contents of the file are overwritten on the output file. Thus, if you repeatedly use the W command without giving a different file specification, vyou are repeatedly updating a single back-up file. To obtain a chronological string of back-up files, use W with a different file specification each time. WB tells SOS not to increment the version number before writing the output file. This option of the Save World command is effective only if it is the first W command given. That is, once a W command has been issued, the version number of the output file has been incremented. All subsequent W or WB commands use that same version number. Only if WB is the first Save World command will the original input file; otherwise WB is equivalent overwrites the input file with the current contents of are editing, and returns you to Edit mode. 2-73 it overwrite W. S0s the file you to INTERACTIVE TEXT EDITOR (SOS) X eXtend 2.8.18 eXtend (X) Format: X[range] [ ,N]Crer) Argument: range Specifies the range of lines to be extended one at you omit range, the current line is extended. a time. If Option: ' N Tells SOS to print only the line number of each 1line 1in the range. Current line: After SOS completes an eXtend command, it sets the current line last line in the range that was extended. to the The eXtend command aads text to the end of lines. It does this by acting as if you had typed A (to enter Alter mode), () (to reach the ena of the line), and I (to begin inserting text). Alter mode 1is described in detail with the Alter command in Section 2.8.1. SOS enters Alter/insert mode for each 1line 1in the range that you sgecify. It prints the line and waits in Alter/insert mode. If you specify ,N, SOS prints only the line number. At any time you can type () to end insertion and then give any Alter-mode command. For example, typing L moves the intraline pointer to the beginning of the line, so you can make changes before the text you have just inserted. If you type while inserting text, the previous character 1is deleted. echoes as a pair of backslashes followed by the deleted character. Successive (il)s delete and echo previous characters in turn. The next non() character that you type is echoed as a second pair of backslashes followed by the character. If you type more (U)s have inserted after the eXtend you characters of number the than before back 1left, command, SOS continues deleting characters to the the end of the original line. If you insert so much text that the overall length of the line exceeds 5uL characters, S0S prints the message LINE IS TOO LONG and returns you to Luit moue. Any cnanges that you may have made to the 1line up to tnat point are aiscarued. INTERACTIVE TEXT EDITOR If you type (1D after The current the eXtend (SOS) command (that 1is, while in Alter/insert mode), SOS creates a new line to receive the rest of the inserted text. The number of this new line is determined as follows: 1. line 2. increment is added If an existing 1line intervenes between number and this new number, the new line in 3. line-number to the current number. the current 1line is numbered halfway between. If the next existing current line, a bell line is numbered higher by 1 than sounds and no new line is created. If no errors occur and the new line is created, the intraline is positioned at the beginning of the new line; SCS is Alter/insert mode. the pointer still in . After an eXtend command, while in Alter/insert mode, any character you type (with seven exceptions) 1is inserted into the text line. Many control characters do not have their wusual effect when entered 1in Alter/insert moae. For example, and have no effect on terminal output. They are simply inserted into the text line without interpretation. The following seven characters are not treated as text moae : ends enuys insertion. the eXtena command for this aeletes tne previous character. creates a new text line. returns SGS to eait mode. retypes the line. gets the attention of DCL. 2-75 line. in Alter/incert INTERACTIVE TEXT EDITOR (SOS) . (period) Move Position 2.8.19 Move Position (;) Format: .positionCrer) Argument: position Specifies the new current position (line/page). Current line: After SOS completes a Move Position command, it to the line specified by the position argument. This line command resets the or page number, change the current Edit-mode prompt sets the current 1line current line. If you specify a SOS prints NO SUCH LINE EXISTS, line. Otherwise, the only 220, page nonexistent and does not response 1is the *. Examples: Set the new current position to line 2. *H'“'S Set the new current position to the fifth line before the present position. Note that, if at present the current line is less than five lines from the beginning of a page, then "/. 1is the current position after the command. *Q 0/0‘*'2 Set as the the current new current position to current 1line, on the page. the line that has the same number page that is two pages beyond the INTERACTIVE TEXT EDITOR (SOS) = (equal) Give Parameter 2.8.20 Give Parameter (=) Format: =parameter (RD) Argument: parameter Specifies any legal SOS parameter or Parameters switch. switches are listed in Tables 2-6 and 2-7 (see Section 2.9). and Current line: The Give Parameter command does not affect the current line. SOS switches. This command returns the value of SOS parameters and characters, or strings, integers, parameters can have values of A switch is an SOS internal variable that can positions (line/page). have one of two values: on or off. : Tables 2-6 and 2-7 in Section 2.9 1list and define all 1legal SOS The following examples show some useful parameters and switches. ones., Examples: i ot Crer) k=t 4 % Print the page number of the largest page in the file. F=NAME Crer) (MST3$3 DRE2 I CMANNIFAYROLL * Print the current specification of the output file. filespec used by the Save World and End commands. This is the =S TRING D) FIND- isomerr SURSTITUTEstochastic FOR~random b 4 Print the values of the current Find and Substitute strings. These are handy to know when using these commands repeatedly through a newstring, is The string identified as SUBSTITUTEfile. the of description the (see oldstring is and FOR- Substitute command in Section 2.8.15). 2-1717 INTERACTIVE TEXT EDITOR (SOS) / (slash) Set Parameter 2.8.21 Set Parameter (/) Format: /parameter [:value] Arguments: parameter Specifies 2-6 and any SOS 2-7 in switch Section or parameter that can be set (see Tables 2.9). value Specifies a legal of the individual Current line: The Parameter Set This command allowed to 16 can value for that parameter. See parameters in Section 2.9.1. command does sets the value set any of the parameters. Table 2-6 not affect the current of SOS parameters switches, but you in Section 2.9 and can shows the descriptions line. switches. You set only nine of which parameters are the you set. After setting the requested Edit-mode prompt *. parameter The examples below demonstrate setting used SOS parameters and switches. All or switch, some of the are described S80S prints the more frequently in Section 2.9. Examples: x/isavet10(ReD) Perform added in an automatic Save World command after every 10 1lines Input mode. ¥ /exrert Crer) The user shorter claims error deleting text; to be an expert at wusing messages; do not request and do not display deleted the editor: confirmation issue before text in Alter mode. current 1line, when x/FLINES: 23 Ce) Print 23 receives lines of P(E). text, This starting at the is a useful value of PLINES CRT terminals that display 24 (especially if the terminal's rate, for instance 1200 baud or 2-78 SOS for users with 1lines of text on speed has been set to above). the screen a high baud INTERACTIVE TEXT EDITOR (SOS) @ (at) Command File 2.8.22 Command File (@) Format: @file-spec(rer) Argument: file-spec Specifies a file containing SOS commands. Current line: After SOS completes a Command File command, it sets the to the last line modified by a command in the file. current 1line Command File lets you place a repetitive or frequently used series of commands in a file. SOS executes the commands from the file as if they came from the keyboard. Once SOS begins executing a Command File command, it performs all the commands in the file, returning control to the keyboard only when it reaches the end. However, SOS prints the following 1items on the terminal: e Error messages e Printouts e Lines e Changes made by the Substitute command e Lines from the found by altered the by Print Find command command the Alter command SOS also requests input from the terminal if the command file contains a Substitute command that places the editor in Decide mode. If the file type field of the command-file specification is can omit the file type when giving the file specification. CMD, you Command files can be nested to a depth of three levels. That 1is, a command file can contain a Command File command; that file can contain another Command File command. If you attempt to nest command files to a depth of four or more, SOS prints MAXIMUM COMMAND FILE DEPTH EXCEEDED and issues the Edit-mode prompt *. 2-79 INTERACTIVE TEXT EDITOR (SOS) You can use command files to shorten the typing of For example, you might <create two files named shorthand for commonly used Print commands: common commands. L.CMD and W.CMD as Lo GMID S Fo 5/ %k 1 6 WeOMO: Bl If these two files are in your directory, you the last six lines in a file, and type @W(RE) lines surrounding the current line. can type to see a @L(®1D) to "window" of see six Another use for Command File is in repetitive editing. Consider the task of deleting the final three characters on each of 400 lines on a page. This task would be tedious to perform by hand, and prone to error as well. The example below shows how to build and use a command file to do the required deletion. Example: In this example, the user (whose name is Lyles) generates a command file named DEL.CMD. The first line contains an X (eXtend) command with a range of 100 lines. (Lyles gives four Command File commands to delete the 400 1lines.) The remaining 100 lines in DEL.CMD contain identical Alter-mode command sequences that perform the deletion on each line in turn. Lyles uses the eXtend command, instead of the Alter command, to suppress typeout of the lines being altered. The ,N option of eXtend allows this. Since eXtend leaves SOS in Alter/insert mode, the first Alter-mode command level. subsequent (the The last three 1is esc ), which command characters in returns deletes the the SOS to Alter-mode previous three line). To get an escape command /ESCAPE character into the file, Lyles uses the to set the logical escape character to (+). Lyles Thus, escape when character into inserts the After entering the line command to replicate after seven deletes the copy 200 (For and types details, of Alter-mode commands, the line the required commanas, excess. line file. there command characters are 128 see +, Set the SOS Section Lyles uses 1lu0 times. replicated Parameter plus sign inserts an 2.9.1.) the WNote lines; Copy that, Lyles INTERACTIVE TEXT EDITOR & 1l (SOS) oo o y Gen) INFUT SDRA2 (CLYLESIDEL .CMD5 1 CisO) { 00100 SO BT| . oona o4 rt (ren) *‘ c & ¥ (0 RET 00200 EEED; < 00300 $ I ERD) PN INC1=100 Kitae 200 o) INC1=100 KOs 200 1% INC1=100 Xy 2000k Crer) INC1=100 ITNCL=100 Xp x (o) ~32M 03300 Xk 20054 o) INC1=100 XOky 2000 K INC1=100 ¥k Crer ) ~30 12900 28 LINE(S) DELETED (10200/1:12900). X (Crer) CORAICLYLESIDEL .CMDG L] % Now Lyles edits the file in which the deletions are needed. The 400 lines are on page 3, numbered 10 to 4010. Because the eXtend command in DEL.CMD uses the current line (.), Lyles sets the current 1line to the next wunedited line before typing @DEL. Immediately after giving each Command File command, Lyles types to suppress all printout. SOS completes the command and issues the Edit-mode prompt. $ EXIT DIREC.CORGCeD) EDITIORAZELYLESIDIREC . CORS 12 X, /3D *¥enEL CreD) X, 12 (RE) 01010 Gurthers 21020 Gurskars ¥enEL 1 2(ReEr) ¥, Jau coesesoee ANOdrew o csee 02020 Mosbhersy TOm cesssos oo 02030 Modeens Alice seseesee 22 4l ¥epe GeD) @ruo) L xeneL Ce) e, 1 8 kCren) Q4000 Zosels Marie 04010 Tualy Rauymorsd sses v o ceeeven ¥ 2-81 INTERACTIVE TEXT EDITOR 2.9 SOS PARAMETERS AND SWITCHES SOS maintains a number of control different aspects some of 2-7 list (SOS) the parameters the A switch and parameters in SOS is an internal parameters and switches its operation. You can set and of switches and from the terminal. that reset Tables 2-6 and one of two switches. internal variable that can have values: on or off. Switches are set with the Set Parameter command (/) and interrogated with the Give Parameter command (=). All switches can be turned off by prefixing NO to their names in a Set Parameter command. Figure 2-5 shows the SOS abbreviations are given range Four of values. switches and in uppercase their initial values; minimum letters. A parameter can have a Most parameters have integer values: BIG LENGTH INCREMENT ISAVE PLINES SAVE START STEP SUBSTITUTE parameters have values that are text strings: ERROR 1D NAME STRING Two parameters have values that are positions (line/page have values that are single characters: can specified pairs): LOCATION Two parameters ESCAPE MAICE qualifiers in the initial DCL EDIT command. They can also be specified by using symbol-assignment mechanism (see Section 2.9.3). The parameters switches that you can preset in the EDIT command are: parameters and the and INCKEMENT ISAVE DECIDE PLINES SAVE EXPERT LINE STAKT LOWER switches STEF KEADONLY | N the o of S Sone be as INTERACTIVE TEXT EDITOR Table S0OS Name' (SOS) 2-6 Parameters S?t from .Prwet , Initial Edit Mode? via DCL? Value Meaning BIG n - ERROr n (null) Displays highest page number Displays last error message ESCApe y (null) Sets character for input/output of escapes ID n - Displays current SOS version number INCRement y 100 Sets increment for numbering inserted lines ISAVe y 0 Controls auto-W on inserts LENGth y 55 Sets page size for List command LOCAtion n 1 Displays first line in edit buffer MATCh y (null) NAME n - Displays output file specification PLINes y y 16 Sets number of lines printed by P(Rer) SAVE y y 0 Controls auto-W on commands STARt y y 100 Sets starting line number STEP y y 100 Sets increment for initial line numbering STRIng n (null) SUBStitute n 0 . n 00000/1 Sets special pattern-matching flag character Displays current Find and Substitute strings Displays number of matches in last Substitute Displays current position ! Minimum abbreviation is given in uppercase letters. 2You can specify these parameters as qualifiers in the initial DCL EDIT command, or by using the symbolassignment mechanism (see Section 2.9.3). INTERACTIVE TEXT EDITOR (SOS) Table 2-7 S0S Switches Name! Initial Value BAK on DEClde off EXACt off . Preset 2 Meaning via DCL? Tells SOS to create back-up file y Sets auto Decide mode on Substitute Requires exact case match for Find, Substitute, contentspecification EXPErt off y Declares experienced SOS user LINE on y Tells SOS to use existing line numbers LOWEr on y Tells SOS to accept uppercase, lowercase as is READonly off y Starts SOS in Read-only mode SEPArator off Tells SOS to treat _$ . as alphanumeric SEQUence on Leaves output-file line numbers ! Minimum abbreviation is given in uppercase letters. ?You can specify these switches as qualifiers in the initial DCL EDIT command, or by using the symbolassignment mechanism (see Section 2.9.3). Turn off any switch by using the letters NO before its name; thus, NOLINE tums off the LINE switch. ' 2—-84 INTERACTIVE on TEXT EDITOR off (SOS) on off ~e ,: \\\\\ o . N ~ ~ DECIide off on off on EXPErt on off /,’,“ //, /‘ 7”7 ,I on off .7 on off Vos v\ /// N\ SN ALY ~ P SEPArator 2-5 SO0S SEQUence Switches and -85 [ Figure P4 4 P NN Their Initial Values INTERACTIVE TEXT EDITOR 2.9.1 (SOS) Parameters BIG Value: Integer: the largest page number now in the file. Default: Null. Set: Cannot be set by user. SOS resets BIG when you add or delete pages, and (if necessary) when you interrogate it with =BIG<CR>. Interrogate: Use =BIG( D) When you give the command =BIG for the first time, SOS searches through the entire file, inserting page marks if it finds lines out of order, until it reaches the end of the file. The following output is typical. X (REX 14, OUT OF ORDER INSERTED FOR FAGE 2 LINES OUT OF ORDER /M INSERTED FOR FAGE ? F/7M 1% LINES *? / X In this example, SOS returns the value 7 as the highest numbered page in the file. The message LINES OUT OF ORDER might result from concatenating line-numbered files, for example with the DCL command COPY. ERROR Value: String: the last error message SOS printed. Default: Null. Set: Cannot be set by user. prints an SOS always prints the long form (that is, the NOEXPERT form) of last error message. It does this even if the EXPERT switch is on. the error 8SOS resets ERROR each time it message. Interrogate: Use =ERROKk CxeD) INTERACTIVE TEXT EDITOR (SOS) ESCAPE Value: Character: when into the encounters input, causes SOS to insert file; also, the character an escape character in text. an escape that S0S character prints when it Default: Initially null. When you (/ESCAPE(®D)), the default is §$ Set: do not specify (dollar sign). a character Use /ESCAPE:x(rer) Interrogate: Use =ESCAPE (&) This parameter defines a "logical escape" character that 1lets you insert an escape character into a text file, and lets SOS display escape characters in text that it types out. One reason for inserting escape characters 1into text files is to use the Find and Substitute commands in command files (see Section 2.8.22). This parameter characters into command, SOS character. is the uses initially null, so you text. When you issue the the default value of §$§ cannot insert escape following Set Parameter as the 1logical escape £ ALEGCAE The logical escape is used in three ways: ® SOS inserts an escape character into the text whenever you type $ in Input mode, in Alter/insert mode, or in the newstring of a Substitute command. @ SOS prints text to be ® SOS searches for an escape character when you type $ command or in the oldstring of a Substitute command. § whenever typed out. encounters character to logical escape an act escape as the 7 You can select another character by typing: it where x represents the new character. NOTE You cannot characters s use as a any of the following logical escape: 2/ ] = These characters specifications. To disable the logical escape are meaningful feature, % Canar s GeD) s Note that the colon must be typed. 2-87 type: in file character in 1logical a in Find escape INTERACTIVE TEXT EDITOR (SOS) ID Value: String: the current version number of SOS. Default: The current version. Set: Cannot be set by user. Interrogate: Use =ID(rD) SOS responds to the command =ID(®T) with its current version number. If you experience problems with the text editor software, ascertain the version number of SOS so you can report it to DIGITAL service For example: personnel. % T u(ReD) 808 V02,044 b 4 INCREMENT Value: Integer: the line-number increment SOS line number for input text. uses to assign the next Default: 100 Set: Append as a qualifier to the EDIT command; or set by the symbol-assignment mechanism; or use /INCREMENT:n<CR>. S0S changes INCREMENT when you give an Input or Replace command with a second argument (comma-delimited) to update the line-number increment. Interrogate: Use =INCREMENT (rer) INCREMENT is the line-number increment SOS uses to calculate 1line numbers for new lines created in Input or Alter/insert mode. You can set this parameter directly by using the Set Parameter command. However, the more common way to change its value is by supplying an increment argument to the Input or Replace commands. ISAVE Value: Integer: number of lines of input text between automatic file saves. Default: 0 (auto-save turned off). Set: Append as a qualifier to the symbol-assignment mechanism; EDIT command; or or use /ISAVE:n(xrer), 2-88 set by the INTERACTIVE TEXT EDITOR (SOS) Interrogate: Use =ISAVEGer) This parameter (the other is controls one controlled /ISAVE:10 -~ SOS insert 10 more commands. of SOS's by SAVE). automatic When you automatically performs a 1lines into the file ISAVE initially has inserts. To disable the value ISAVE once 0, so you have set file-saving ISAVE -- for options example, W command each time you using the Insert or Replace auto-saving is disabled set it, reset it to 0. on LENGTH Value: Integer: page length for the List command. Default: 55 Set: Use /LENGTH:n () Interrogate: Use =LENGTH(Rer) LENGTH represents the page length for printer 1listings generated by the List command. 1Its initial value is 55 lines. Thus, SOS starts a new page in the printer listing whenever it encounters a page mark, and also whenever it has printed 53 lines without encountering a page 'mark (the listing heading requires two lines). LOCATION Value: Line/page: the position of the beginning of SOS's edit buffer. Default: ~ 1 Set: Cannot be set by user. from the input file and SOS keeps writes to track of LOCATION as its temporary files. it reads Interrogate: Use =LOCATION (Crer) The edit buffer contains all the text that is immediately accessible to SOS. If you 1issue a command that affects lines outside this buffer, SOS must read text from the input file before' performing the command. See Section 2.13 on SOS Internals. For example, if you request the printout of a line earlier in the than the position LOCATION, SOS must write the remainder of the (after the current position) to its temporary file, and then read the input file up to the line you requested. 2-89 file file from INTERACTIVE TEXT EDITOR (SOS) MATCH Value: Character: the flag character Find and Substitute commands. for special do not pattern-matching in Default: Initially null. (/MATCHCrer)) , Set: When you the default is ? specify (question mark). a character Use /MATCH[:x]Cre) Interrogate: Use =MATCH( ) This parameter defines a flag character for S0S's special pattern-matching feature (see Section 2.10). MATCH is initially null, so special pattern-matching is disabled. When you issue the following Set Parameter default value of ? as the flag character. command, SOS uses the £ mn T CHCD In Find and Substitute with ? are interpreted strings, certain groups of characters beginning in a special way (see Section 2.10). You can select another character to pattern-matching flag character by typing: act as the special issue a x0T CH Qe x where represents the flag new character. type: To disable special pattern-matching, *MATCH Note that the colon must be typed. NAME Value: String: the specification of the output file. Default: The Set: specification of the input file. Cannot be set by user. SOS changes NAME when you World command, giving a new file specification. Save Interrogate: Use =NAME (rer) After you issue a Save World command, the parameter NAME contains the file specification that SOS would use for the output file if you gave an End command (without naming a new file). Before you have issued a Save World command, NAME contains the input file specification. However, if you explicitly gave an output file specification when you initiated SOS (/OUTPUT:file-spec), NAME initially contains this specification. 2-90 INTERACTIVE TEXT EDITOR (SOS) PLINES Value: Integer: the number of lines command without arguments. SOS prints upon receiving a Print Default: 16 Set: Append as a qualifier assignment mechanism; to the EDIT command; or or use /PLINES:n(rer), set by the symbol Interrogate: Use =PLINESCrer) SAVE Value: Integer: number of text-changing commands between automatic file saves. Default: 0 (auto-save turned off). Set: Append as a qualifier to the symbol-assignment mechanism; EDIT or command; or set by the use /SAVE:n(Ge), Interrogate: Use =SAVE(rer) This parameter controls one of SOS's two automatic file saving options (the other 1is controlled by ISAVE). When you issue the command /SAVE:20, for example, SOS automatically performs a Save World command each time you issue the 20th text-changing command (listed below). Commands that do not change the file are not included in this count. Text-changing commands are defined as the commands that are illegal in Read-only mode: Alter Insert Copy Join Delete Kill Page Mark reNumber Replace Substitute Transfer eXtend Mark START Value: Integer: and/or to the line number the first line SOS on gives a page, to the first line in an unnumbered in a file, file. Default: 100 Set: To override the EDIT SOS's command, use /STAKRT:n initial or set default by the value, append as symbol-assignment a gqualifier to mechanism; or . Interrogate: Use =STARTCrD) If you reset START midway through editing a file that was initially unnumbered but that contained page marks, SOS numbers subseguent pages (that it has not yet encountered) using the new starting line number. 2-91 INTERACTIVE TEXT EDITOR (SOS) STEP vValue: Integer: the line-number increment numbers to an unnumbered file. SOS uses to assign 1line Default: 100 Set: To override S0S's the EDIT command, Section 2.9.3); initial or default value, set by the append as a qualifier symbol-assignment mechanism or use /STEP:n(xer). to (see Interrogate: Use =STEP(®D) STEP is the default line-number increment SOS uses to number the lines of an unnumbered input file. SOS assigns line numbers as it reads in the lines. Therefore, you can change STEP at any time to affect the line-number increment for the lines that SOS has not yet accessed in an unnumbered file. STRING ! Value: String: the current Find and Substitute strings. Default: Null. Set: Cannot be set by user. new Find or Substitute 8S0S updates STRING whenever you command. issue a Interrogate: Use =STRING( D) The parameter STRING contains the values of three search strings: one for the Find command and two for the Substitute command. Any of these search strings can contain multiple strings, if such strings were specified in the last Find or Aalter mode Substitute. mode example: Find command strings Alter-mode SURSTTTUTE - Neoide For ‘ Substitute command newstrings Substitute command oldstrings [ecide-mode FiR-- deride mode decide-mode X It is sometimes useful to issue =STRING(Re) when you are using the Find and/or Substitute commands without arguments; that is, when you are searching for strings specified in a previous complete command. 2-92 INTERACTIVE TEXT EDITOR (SOS) SUBSTITUTE Value: Integer: the number Substitute command. of substitutions performed by the 1last Default: 0 Set: Cannot be set by user. SOS wupdates SUBSTITUTE Substitute command, whether successful or not. after every Interrogate: Use =SUBSTITUTE (rer) This parameter is useful because it tells you how many SOS performed in a Substitute command with the ,N option lines changed are not printed out). substitutions (in which the If you entered Decide mode you entered Decide Alter with the last substitute command, and if mode for any line, the SUBSTITUTE parameter the total number of possible substitutions for that 1line. true even if, in Decide Alter mode, you undo one or more of reflects This 1is the substitutions. . * (Period) Value: Line/page: SOS's current position. Default: 00000/1 Set: Use .position(®r). command that affects SOS a updates this parameter after every line. Interrogate: Use 2.9.2 S0S can =.(xrer Switches switches are summarized in Table 2-7 and Figure 2-5. All turned on with the Set Parameter command; for example: switches be X ot (rex Several of the switches can be specified as qualifiers to the initial EDIT Section command, 2.9.3). All or by using switches can the symbol-assignment be interrogated with mechanism the (see Give Parameter command: R A ST You can abbreviate switch names to examples below, the full switch names four characters. are used. In all the INTERACTIVE TEXT EDITOR (SOS) Any switch can be turned off by prefixing NO to its name in the Set For example, to turn off the Decide-mode switch, Parameter command. type: ¥ CHOTECTOF use the However, For compatibility with other implementations of SOS, you can minus sign (-) interchangeably with NO to turn off a switch. you cannot use the minus sign on the initial DCL It is best to use NO in all cases. EDIT line. command BAK Meaning: Determines whether SOS output file. increments the version number of the SOS does not Default: BAK Set: is on. Use /BAK(®T) or /NOBAK(xer) (after initialization, set this switch). This switch determines whether SOS increments the version number of issue the first Save World command in an the output file when you World. editing session, or when you issue End without a previous Save If BAK is off, SOS is on, SOS increments the version number. If BAK does not increment the version number, but instead overwrites the file. input The setting of the switch is not meaningful if you give a new file This is because the specification with the Save World or End command. new file specification obviates the question of whether or not you want a back-up file. The setting is also not meaningful after you issue the first Save World command. DECIDE Meaning: Determines whether SOS automatically enters Decide mode for each Substitute command. Default: DECIDE Set: is off. Append as a qualifier to the symbol-assignment mechanism; EDIT command; or set by the or use /DECIDE(CxT) or /NODECIDE (&) (after initialization, SOS does not set this switch). I1f DECIDE is on, SOS Substitute command. command with the issue a time you enters Decide mode each The effect is as if you issued each Substitute ,D option. The DECIDE switch provides an operator errors. Therefore, may want to set this switch. automatic way of protecting against a user who is just beginning to learn SOS 2-94 INTERACTIVE TEXT EDITOR (SOS) EXACT Meaning: Determines whether SOS lowercase letters) in requires pattern an exact match (uppercase and searches. Default: EXACT Set: 1is off. Use /EXACT(x1) or /NOEXACT(wer) not set this (after initialization, SO0S does switch). If EXACT is on, SOS requires an exact pattern match for: e All Edit-mode Find and e All Alter-mode S ® All content-specified searches (see Sectioh 2.11) and K Substitute command command searches searches EXPERT Meaning: If EXPERT is on, SOS assumes you are an experienced SOS user. Default: EXPERT is off. Append as a (after initialization, Set: qualifier to the SOS does expert SOS symbol-assignment mechanism; Declaring yourself an or EDIT command; or set not set wuser this (/EXPERT(xe)) The error and informational than tnose for nonexperts. ® SCS does not recuest confirmation before deleting page bounaaries, or before deleting all text on a ® S5CS In has four more brief text page. across = e e the switch). consequences: does belete by use /EXPERT(®T) or /NOEXPERT(&e) not or Alter report kewlace moae, SCS how many messages lines SOS it types deletes are when you issue a command. does not display deleted pairs of backslashes (\\...\\). Thus, the as you eult them in Alter mode corresponds actual contents cof the lines. characters between appearance of lines more closely to the LINE tiesning: Uetermines whether or not present in an input file. Lefault: LINE is on 3CS wuses line numbers that (that is, SC3 uses existing line numbersf. may be INTERACTIVE TEXT EDITOR (SOS) Set: Append as a qualifier symbol-assignment (after to the mechanism; initialization, SOS does EDIT command; or use not set or set by the /LINE(®) or /NOLINECrer) this switch). If you turn off the LINE switch by the logical name mechanism, or if you initiate SOS with the qualifier /NOLINE, SOS ignores line numbers that may be present in the file it reads. The file 1is renumbered. SOS does not print the usual message indicating the absence of line numbers (INPUT ASSUMED UNSEQUENCED) . LOWER Meaning: Determines whether or not S0OS from the terminal to uppercase. translates 1lowercase characters Default: LOWER is on (that is, lowercase letters are not translated to uppercase). Set: Append as a qualifier (after initialization, symbol-assignment to the EDIT SOS does not mechanism; command; or set by the or use /LOWER(XT) or /NOLOWER(RED) set this switch). A side effect of turning off LOWER is that if the exact character match options (,E) of the Find and Substitute commands are used, it is impossible to match any lowercase character that 1is already in the file. The EXACT switch, if turned on, has the same side effect. SEPARATOR Meaning: Determines whether SOS treats the three characters ., $, _ as word delimiters if special pattern-matching is enabled for Find and Substitute commands. Default: SEPARATOR is off. Set: Use /SEPARATOR(®e1) or /NOSEPARATOR(CRe) does By .y not setting the S, and set this (after initialization, SOS switch). switch SEPAKATOR, you can make SOS treat the characters as word-delimiters for purposes of special pattern-matching (see Section 2.10). This feature could be useful in editing a MACRO program, for instance, in which decimal points, dollar signs, and underscore characters appear frequently as parts of symbolis. INTERACTIVE TEXT EDITOR (SOS) SEQUENCE Meaning: Determines whether SOS leaves line numbers in the output file. Default: SEQUENCE Set: is on. Use /SEQUENCE(®1) or /NOSEQUENCE(®r1) (after does not set this switch). initialization, SOS command, the If you turn off the SEQUENCE switch and exit with the E effect is as if you exited with ES. Setting Default Conditions Using Symbol Assignment 2.9.3 You can change the parameter and switch values that apply when SOS is initiated by using the DCL symbol-assignment mechanism. You can issue a symbol-assignment command from the terminal to override the initial defaults temporarily; or you can include the command in your LOGIN.COM file to override the defaults permanently. SO0S's initial default values for parameters and switches are listed in Tables 2-6 and 2-7, and discussed briefly in Section 2.5. You can override these defaults in three ways upon starting the editor. 1. To override the defaults only, S F0ITATHNCREMENT 2. for the editing current use qualifiers to the EDIT command line. 22 session For example: filesrec(Re) To override the defaults for all editing sessions within the current job (that is, until you log off the system), issue a symbol-assignment command from the terminal: $ GOS8 3. ERIT/S08/TNCREMENT § 2 (ReD) To override the defaults for all future editing sessions, place a symbol-assignment command (similar to item 2 above) in your LOGIN.COM file. The symbol-assignment command associates a character string with a symbol. 1In item 2 above, the character string EDIT/SOS/INCREMENT:2 is associated with the symbol SOS. Typing SOS(ED) or S80S file-spec(®D then becomes your own private way of initiating the editor with the qualifier /INCREMENT:2. Such a symbol assignment lasts until you 1log off the systenm. To define a symbol that lasts from one job to the next, perform the symbol assignment in the file LOGIN.COM. This command procedure file contains commands that are automatically executed each time you log in (see the VAX/VMS Command Language User's Guide). 2-97 INTERACTIVE TEXT EDITOR You can include more than one SOS parameter assignment. Use a minus sign (-) in the continue a long line. As an example, suppose you have the (SOS) or switch in a symbol last character position to following line in your LOGIN.COM file: B08:="ERIT/808/LOWER/STEFI10/8TART{LO/INCREMENT ¢t 2/PLINESL10" When you type SOS or SOS file~-spec to initiate the editor, the parameters and switches specified in the symbol assignment are applied as qualifiers. ® Therefore, Lowercase input the is following accepted as conditions hold: is, and is not converted to uppercase. @ If SOS reads file, it numbers line-number increment of 2 10 starting at starting at ® SOS uses @ SOS prints 2.10 One a an unnumbered the lines by 10s, 10. 1lines, receiving pCrD), for inserted lines. the current line, in searching upon SPECIAL PATTERN-MATCHING CONSTRUCTS SOS feature that allows great flexibility for strings using the Find and Substitute commands is special pattern-matching. This feature is initially disabled. You control it by means of the MATCH parameter (see Section 2.9.1). The Set Parameter pattern-matching. command The /MATCH : x (rer) character pattern-matching constructs. A x acts construct as is a flag a enables to group mark of two characters beginning with the flag character. When SOS such a construct in a Find or Substitute command, it treats single character with a particular meaning for its pattern detailed below. If you issue character, SOS the special-constructs ? as the command uses flag. the The /MATCH(®&) question examples without mark (?) given later special the in default this more encounters it as a search, as specifying by special or a as section flag the use flag. To disable of special pattern-matching, and to divest the flag character any special meaning, type /MATCH:(®er)., Note that you must type the colon. Table 2-8 lists the special constructs. Some of the constructs are used in find strings (the string argument of Find and the oldstring argument of Substitute), while others are used in substitute strings (the newstring argument of Substitute). Sections 2.10.1 and 2.10.2 describe these two classes of special pattern-matching constructs. Section 2.10.3 describes combining find-string constructs. INTERACTIVE Special Con- Internal struct represen- TEXT EDITOR (SOS) Table 2-8 Pattern-Matching Constructs Meaning tation — SN\ Z = L [2) Ellelie ~ RlIRI=R 3){3)(3 3 ~ £ EVENICVIIVEN ICVICS RV RUVRCS IOV IV Find-string constructs: ? CTRL/T Match Match < LTRL Match Match X Match ) X Match 1x Match 9 (CTRL/A) ! & Match Match Match Match + (CTRLID) (CTRLI) > 7c a separator space or tab any character except x 0 or more of the character 1 or more of the character any alphanumeric character Match any letter CTRL/W 2 any character any (A-Z, x x a-z) any uppercase letter (A-2) any lowercase letter (a-2z) any decimal digit (0-9) beginning or end of line Match internal representation of ¢ Substitute-string constructs: 2" (cTRL/B) 2*n?* 2,10.1 Find-String You use can oldstring ?/ the of Substitute next string matched CTRL/O Substitute nth string matched Constructs constructs the Substitute given below in the Find command, or in the command. Match Any Character This construct matches any character. As an example of 1its use, suppose you want to locate variables that start with B in a MACRO program, but you do not want to see lines with labels that start with B. Since labels start in column 1, they are never preceded by any other character. Thus, the following Find command locates the desired variables: 250 The ,A is found. first ?: This in the AN Find In character AR command Alter of the tells mode, SOS the to enter Alter mode intraline pointer when points a match before the pattern matched. Match Any Separator construct matches letter, a number, SEPARATOR is turned separators. See searching imbedded words other for in or on, any separator, the these Section that, words that is, characters ., $, three characters 2.9.2.) The ?: any character and_. also construct besides appearing in as well. For example, (If are 1is except a the switch considered useful 1isolation, may suppose you want 1in be to INTERACTIVE TEXT EDITOR (SOS) find all occurrences interested in words can issue of the word "can"; however, like incandescent, canonical, and following Find command: the you are so forth. not You _ESC KPF toan?t /11 /%y 999D The ?: constructs before and after the word are matched by a tab or a space. Note that, unless the command /SEPARATOR(XT) was given, this Find command does not match the word "can" if it ends a sentence. SOS does not treat the final period as a separator. The Find command does work if the word "can" begins or ends a 1line, considers the beginning and end of a line to be ?2< Match This a Space or construct represents a described above. example command S80S Tab matches subset The in however, because separators. a space of the ?: or a following command previous section: the tab (match has character. any separator) the same effect Thus, it construct as the KFPeanT g/ . L/ Ky 99 (R This Find command does not match the word line, or 1if it ends a sentence. A Find limitations is given in Section 2.10.3. ?2%x Match Any Character Except "can" if it begins or ends a command that overcomes these x This 3-character construct matches any character except the final character of the construct: any character that x would not normally match. Thus, a?%bc matches aac, acc, adc, and so forth, but not abc. ?)x Match 0 or More of the Character x This construct matches the character that follows, any number of times that it appears. Thus, a?)bc matches ac, abc, abbc, and so on. SOS matches the first such string it encounters. This construct cannot be used in isolation: the command illegal, and results in the error message ILLEGAL SEARCH Such a construct, if legal, would match every line. ?1x Match 1 or More of the Character This construct is similar to the one matches one or more occurrences of matches abc, abbc, abbbc, and so on, first ?9 such string it x described the given but not encounters. Match Any Alphanumeric This construct matches F?)x(s0) is STRING GIVEN. above, except that it character. Thus, a?lbc ac. SOS matches the Character any character in 2-100 the ranges A-Z, a-z, and 0-9. INTERACTIVE 2! Match Any Letter (A-Z, TEXT EDITOR (SOS) a-z) This construct matches any uppercase or lowercase letter. use 1it, for example, to find all lines in a file that strings Mr., Ms., or Dr.: You could contain the ¥ /mateon () Xp 2171,%/18/%,99 ) This Find two letters ?& Match Any Uppercase command prints (of either all lines case), that followed Letter contain a by a Match Any Lowercase Letter Match Any Decimal This construct 203-A, ?> and so finds on, Digit a but Match Beginning or or For example, 101-f. 101-?& the (A) range a-z. or (4). For example, For example, ?+?+?+-A matches 101-A, DEF-A. End (?22) (0-9) number. not by (a-z) This construct matches any letter in matches (i), (j), and so on, but not 2+ followed (A-2Z) This construct matches any uppercase letter. matches 101-A, 101-B, and so on, but not 101-7 2?2 space period. of Line This construct is useful in searching for a string that begins or ends a line. For instance, suppose you want to search a MACRO program for all labels of the form Ln:. You do not want to see 1lines in which these labels lines, the are referred following Find to. Since labels occur command performs at the the desired beginning of search. ESC FroLvts® /s, e Can) Here the ?> construct construct matches any ?27c Match This construct matches represent in Table character the 2-8. represent locate Internal The use of infrequent For the the beginning Representation of the construct These that suppose you Table 2-8 , shows, ?& any (match construct when you character, pattern-matching and to type /MATCH:(®e) (note the as f@uwp Cesc) D). should need it search colon) SOS internal use the combined construct ‘epresentation a 1line, and the 2+ internally to ¢ character c. example, As the 1?7 instance of digit. construct @rr), €w®uP), matches is for uses representations need to SOS uses uppercase be to letter). rare. search Normally, for an SOS easier 2-101 to character then issue a given for the Thus, to internally to ?72&. the and search are disable directly. Find in the internal special That command is, such INTERACTIVE TEXT EDITOR (SOS) The only time you are required to use ?7 is when you must use other special pattern-matching constructs 1in a search. In that case, you cannot first disable special pattern-matching. One such case would be a Substitute command that searches for and then uses it in a Substitute-string construct in the newstring argument (see Section 2.10.2). 2.10.2 Substitute-String Constructs When you use find-string constructs in the oldstring of a Substitute command, SOS keeps track of the first, second, ..., nth strings matched within each line by these constructs. The substitute-string constructs let you manipulate the strings matched by the special find-string constructs, natched strings. without knowing Jse these two constructs in substitute the exact strings, lewstring arguments of Substitute commands. contents of the that in the is, NOTE Do not attempt to use substitute-string constructs to refer to a string matched by ?> (beginning or end of 1line). A beginning or end of line thus matched is not included in SO0S's count of matched strings. ?2*n?* Substitute nth String Matched This special construct gives you access to the first, second, ..., nth strings matched within a line by special find-string constructs. One possible use of this feature is in exchanging arguments of functions. For example, if you want to change all occurrences of FUNCTION(a,b) to: FUNCTION (b, a) for any arguments a and b, command: you can 1issue ¥ AMATCH the following Substitute ESC ESC XGFUNCTIONC?Y P/ » P2/ 3 FUNCTION CPRIPK, PRLTKIG /10 4 Crer) ?" Substitute Next String Matched This construct is similar to the previous one. When used in a substitute string, it specifies substituting the next string in the series of strings matched by find-string constructs. Thus, if you use the constructs ?*32*2" in a Substitute newstring, SOS substitutes the third and fourth strings matched within the 1line by find-string constructs. 2-102 INTERACTIVE 2.10.3 Combining TEXT EDITOR (SOS) Find-String Constructs Find-string constructs can be combined in a Find or Substitute command to give Perhaps is ?%x More even greater the most (match versatility useful to SOS's pattern-searching Find-string any character except construct x). For to others matches any character that is not alphanumeric. 2%2+ matches any character other than ?%22 matches any character except a than two Find-string constructs ?%21?+ matches anything combined construct file in which much ?21?%2< matches tabs. one or more can be matches any lowercase combined. of any character the ?2%2/ anything that 2%72: not 2%2?2> not a ?2%29 not alphanumeric ?2%2! not a 2%72+ not you example: except spaces or ?& a the (that 1line matched internal is, anything a character. by all of the is not a character separator space or tab letter a number can search the following combined begins or ends a sentence it begins or ends a line. | SPECIFYING RANGES for all occurrences of the construct. This Find command (assuming the EXACT switch is XEPUP oan®L?lE/1 /%99 For any Edit-mode argument, you can letter. For except construct SOS does not consider the beginning or end of Thus, the beginning or end of a 1line 1is following combined constructs (among others): example, number. but one or more digits. This could be useful in searching a data of the text is multidigit numbers. character of but @rup) ., a a ' representation 2.11 with example: ?2%29 ?2%?272& For combine features. word "can" works if not on), with "can" or if D) BY CONTENT command that requires a range of line numbers implicitly specify the range by text content. as an For example, instead of requesting that SOS print the 1lines numbered from 150 through 220, you can request that SOS print all lines from the line in which the string ABC occurs through the line in which the string DEF occurs. (You can do this for any SOS command, not just the Print command.) 2-103 INTERACTIVE A common way to specify a range TEXT of EDITOR lines is (SOS) to use the following form: position:position To specify a range by content, specifications with arguments replace in the either or following both of the position form: (s string Cso Crer) Terminate the command with a final Print command cited above, (®T). type: For example, to issue the Note that three carriage returns are required: one each to terminate the two content specifications, and a final one to terminate the Print command. Note also that a colon separates the two halves of the content-specified Using one this or range. kind of content two Find for the specification commands within whatever executing the Print command given above, search search starts If SOS does string ABC as soon range). is found, SOS performs ABC, when you type Again, When you the range of equivalent command for as you are the first instance, type to you embedding issuing. SOS performs (®&). 1In a The at the current line and proceeds to the end of the file. not find the string, it prints an error message immediately after you type the first Assuming ABC position of is type SOS prints the lines an final it has error (®er), (D), a second search, starting at the the second (terminating the message if it fails to find DEF. SOS performs the Print command, located in its two Normally, SOS starts its search for a content-specified current 1line. search with the However, form: you can specify a using searches. range over 1line which at SOS is the to (s string(&range For example, current current suppose page line, specifying /. that you as the current line is beyond the first line on contains the string ABC. Without resetting can effect the Print command given above the range for SOS's TN *F$ARCH/ . b $ $O0EF & Cer) 2-104 content-specified search: the the by INTERACTIVE TEXT EDITOR (SOS) Content specification is more general still. give options that specify: After the range you ® An exact pattern match ® A quasi-Decide mode e The nth occurrence of the given string. can (upper- and lowercase) In other words, content specification has options that give it all the generality of a Find or Substitute command. The full syntax of a content specification is as follows: o) [string] (e [range] [{,N}] [,E][,-]1CD ,D N where: string Specifies the pattern SOS is to search for. Note that string is optional. If you omit it, SOS uses the string last used in the same position in a content specification. range Specifies the range over which SOS is to search for the string. If you omit range, SOS searches from the current line to the end of /D the file. Tells SOS to enter a quasi-Decide mode. SOS prints the first line containing the string, then prompts with ?. You type Y, y, or if the line printed 1is the 1line you intend for the content specification. SOsS then continues with the content-specified command. Type to reject the 1line. S0S then prints the next line in the range that contains the string, and again prompts with ?. If you reject all the 1lines in the range that contain the string, SOS prints an error message and terminates the content-specified command. N of instead but Tells SOS to enter the same quasi-Decide mode, found, SOS prints only the line number, and 1line each printing to accept the line; type Type Y, y, or prompts with ?. to reject N it. An integer: within the tells SOS to use the nth occurrence of the string range. Note that the meaning of this option differs from its meaning in the Find command. In Find, ,n tells SO0S to print the next n occurrences of a string, not its nth occurrence. 'E - Tells SOS to accept only an exact pattern match in its search for the string. Upper- and lowercase letters must match. Note: the EXACT switch, which controls exact pattern matching in the Find and Substitute commands, is also effective 1n content specifications. Turning on the EXACT switch has the same effect as specifying the ,E option. Tells SOS to use the first line in which does not occur. 2-105 the specified pattern INTERACTIVE TEXT EDITOR (SOS) Content specification has still another sort of generality. The range that you can give in a content specification can itself be content-specified; the range in that content specification can also be content-specified. The maximum nesting depth is three levels. For example, a file contains the 00100 00200 00300 00400 00500 00600 abc cde fgh ijk 1mn opq 00800 00900 01000 01100 01200 01300 uvw Xyz 123 234 uuo 890 00700 following lines: T rst ] . As indicated by the brackets, the user wants to print the 1lines between the first occurrence of o and the next occurrence of u, with the searches constrained to the range between the first occurrence of £ and the next occurrence of 1. The following two-level, content-specified Print command performs this task: IR $w$m$if$|flfll Print lines from o... ESC | t gl (e Start searching at f... ...continue search , until 1. ESC | 4 o i $RET RET Do it. G600 L35 0 0700 el GOB00 11 ...through 2.12 SOS SPECIAL CHARACTERS Table 2-9 shows meaning to SOS. (for instance, mode SOS is all the nonalphabetic The meaning (0O u. of some can have one of operating characters characters that depends have on the special context several meanings, depending on the in). 2-106 INTERACTIVE TEXT EDITOR (SOS) Table 2-9 Special Characters SOS Char- Meanings acter Edit mode: Move Position command. In position specifier: means current line or current page. Edit mode: In Copy Give Parameter command: means command. text is copied file. from another a positive In position specification: signifies line-number offset. Special pattern-matching construct: decimal digit. Edit mode: Command File match command. Edit mode: Set Parameter command. In Copy command: /C means enter Copy-file At DCL level: marks beginning of a character. position specifier: means first page in a file. first mode. qualifier. In position <cspecifier: separates line page number. Special pattern-matching construct: In or any line number and match any on a page, In position specifier: means last line on a page, or last page in a file. Special pattern-matching construct: substitute the nth string matched by a special construct. In End, Save World, List commands: of a filespec. In range specification: ending positions. In Set Parameter parameter Special signals separates command: signals beginning starting and beginning of value. pattern-matching construct: match any separator. In range lines. specification: Special pattern-matching (A-Z, In signals relative construct: number match any of letter a-z). Input, Replace commands: signals new line-number commands: separates increment. In Copy, reNumber, Transfer arguments. In End, eXtend .F ,N Find, List, commands: ,P ,S5 Print, separates Substitute, command Save options (,A World, ,D ,E ,-). (continued 2-107 on next page) INTERACTIVE Table SOS TEXT EDITOR 2-9 Special (SOS) (Cont.) Characters Char- Meanings acter - In Find command and in content specification (all commands) : used as a command option. Tells SOS to find the first 1line not <containing the specified pattern. In position specification: line-number offset. signifies ; In 1Input, line-number signals temporary command only. ? Default flag $ Default logical < Special pattern-matching construct: Replace commands: increment for this character for a negative special pattern-matching. escape character. match a space or tab. > Special pattern-matching or end of line. 3 Special ) Special pattern-matching of the given character. & Special pattern-matching uppercase letter. character " construct: pattern-matching except the given match construct: one. construct: Special pattern-matching construct: next sequential string matched match match construct: begining 0 any or match more any substitute the by a special construct. ESC Edit mode: Input mode: print previous line. return to Edit mode. Alter/insert mode: return Decide Alter/insert mode: mode. Decide mode: illegal. to Alter return In Find, Substitute commands: for search and substitution. Alter mode: move mode. to Decide delimits intraline text pointer Alter strings back one character. RET Edit mode: print next line. Alter mode: print rest of edit for this line. 1line, finish intraline Alter/insert mode: print rest of 1line, intraline edit for this line. Decide Alter mode and Decide Alter/insert print rest of line, return to Decide mode. (continued 2-108 on finish mode: next page) INTERACTIVE TEXT Table 2-9 SOS Special EDITOR (SOS) (Cont.) Characters Char- Meanings acter DEL Alter mode and Decide Alter mode: move pointer back one character. Decide mode: no, do not make the change. All other modes: delete previous input Alter mode and Decide Alter mode: pointer forward one character. Decide mode: yes, make TAB Alter mode and Decide CTRL/U Alter mode and performed so pointer to the end the the Decide far and character. move intraline move intraline change. Alter of intraline mode: line. Alter place mode: discard intraline beginning of line. Alter/insert mode and as 2.13 SOS text and edits pointer Decide Alter/insert mode: insert it into the text line. at take INTERNALS This section discusses SOS temporary files and the format of SOS text lines and page marks. You can make the most efficient use of the editor if you know what SOS does with its temporary files, and how these files are related to the input and output files you specify. 2.13.1 SOS Temporary Files Whenever you are using the editor, you have either one or two SOS temporary files in your directory. Their names are SOSxnn.TM1l and SOSxnn.TM2 (x is the controller number and nn 1is your terminal number) . Two events within an editing session "affect the status of these temporary files: your 1issuing a Save World command, and SOS performing a "wraparound." To understand. the wraparound operation, consider the process of editing a file. As you edit a file, SOS reads lines into an internal edit buffer! writes them out to the temporary file SOSxnn.TMl. and Changes you make whose bytes. size while editing are incorporated into this file. This- process of passing text through the edit buffer to the temporary file continues as long as your editing does not refer to a line before the start of the edit Dbuffer. (The position of the start of the edit buffer is marked by the parameter LOCATION, described in Section 2.9.1.) 1. The edit buffer 1is an in-image storage area determined when SOS is linked; a typical size is 1500 2-109 |is INTERACTIVE TEXT EDITOR (SOS) When you do call for editing on a line before the start of the edit buffer, SOS performs a wraparound. This means that SOS copies the rest of the file (from the current position to the end) to SOSxnn.TMl. At this point, SOSxnn.TMl is a complete copy of your original file, with all edits to date incorporated. SOS then "rewinds" SOSxnn.TM1l: it returns to the beginning of the temporary file and starts reading from it. Thereafter, SOSxnn.TM1l serves as the input file for SOS closes your original file, and does not read it further again. editing. After rewinding, SOS creates a second temporary file, 8S0Sxnn.TM2, to which it writes lines passed through the edit buffer. SOS continues this pass-through operation until it finds the 1line referred to in your command. The next time wraparound is necessary, the temporary files switch roles. SOS rewinds both files, and uses 8S0Sxnn.TM2 (which now contains the most up-to-aate copy of the file) for input. SO0S passes text 1lines through the edit buffer and writes them to SOSxnn.TMl. Neither file is closed. When you issue a Save World command, the temporary files again effectively switch roles. The temporary file being used for output is renamed to the file specifier given -- or provided by default =-in the Save World command. it (read-only) for input. is rewound and thereafter SOS closes this renamed file, and The temporary file that was used is used for output. then for opens input If you give enother Save World command, or if you give an End command without a new file specification, SOS deletes the file created by the last Save World command before renaming the output temporary file. If you try to recover Section 2.7.4, you information from temporary files as described in may encounter some errors when SOS tries to read data near the end of the file. The errors occur never closed properly and has no end-of-file delete the erroneous line(s). 2.13.1.1 Temporary File the wraparound number 5. Brana Fourier-analysis Figure 2-6, line 22v. from the Example Figure program) named 2-6 depicts beginning to line typed =LOCATION(CRer) at the buffer is example of FOUR.FOR. In illustration current copy of (a) in line to FOUR.FOR 22v. start eait an Brand is working at terminal FORTRAN source file for a Brand gives a Find command that moves the At this point, the file SOSAU5.TMl is a If Brand of - process. A user named eaits a 500-line file (a because the file was mark. You can simply at this point, line he would learn that the 2u0. Illustration (b) in the figure shows what happens when Brand some editing on line 4UU. More of FOUR.FOR is pacssed through buffer and written to SOSAU5.TMI1. 2-110 vperforms the edit INTERACTIVE TEXT EDITOR FOUR.FOR Edit SOSA05.TM1 Buffer FOUR.FOR 0— 0 00— 100 200— Edit SOSAQ05.TM1 Buffer ] 200 — line 220 300 300 — 400 — 400 — 500 500 (A) (SOS) User issues a command referring to (B) line 400 User performs edit on line 400 line 220 FOUR.FOR Edit SOSA05.TM1 Buffer 0 FOUR.FOR SOSA05.TM1 1 0 h— 100 — — 100 — 200 — L 200 — 300 — — 300 — 400— —— 400 — 500—- Edit Buffer line ine 1 180 500 (C) User issues a command referring to line 180, which is before the start of the edit buffer. Therefore, SOS performs a wraparound. Figure 2-6 Temporary Files in 2-111 a Sample SOSA05.TM2 P Editing Session INTERACTIVE TEXT EDITOR (SOS) The start of the edit buffer is now at 1line 340. The 1lines are shorter in this part of the source file, so more lines fit into the fixed-length edit buffer. Illustration (c) shows the wraparound process. Brand issues a Find command that matches a string in line 180. SOS copies the rest of the file to SOSA05.TM1, rewinds the file, and uses it as the 1input file. SOS then creates SOSA05.TM2; this file receives text passed through the edit buffer up to line 180. 2.13.1.2 Using SOS Efficiently - In Read-only mode, SOS does not write an output file. The pass-through and wraparound file-writing described above does not occur. For this reason, SOS uses far less system resources in Read-only mode. This is why it is best to use Read-only mode routinely whenever you only need to examine a file. (You might wuse symbol assignment to define a command such as READ:="EDIT/SOS/READONLY".) The most efficient way to use SOS in Edit mode is to avoid wraparound. You can do this by editing a file sequentially from beginning to end. If you never refer to a line earlier in the file than the position marked by LOCATION, SOS does not wrap the file. You minimize the need for costly and time-consuming file copying. S0S's wraparound behavior explains why writing an line numbers (ES or ET commands) requires more leaving the line numbers in place (as mentioned output file without processing time than in Section 2.8.4). Suppose, for example, that the current line is in the middle of the file when you issue an ES command. SOS passes text through the edit buffer until end of file; rewinds both temporary files; then passes the entire file through a second time, omitting 1line numbers. S0S then renames the output temporary file to the output name, destroys the other temporary file, and exits. If instead of an ES command you issue an E command, SOS need not pass the file through the edit buffer a second time. After first passing through to end of file, SOS renames the output temporary file to the output name, destroys the other temporary file, and exits. 2-112 INTERACTIVE 2.13.2 When Format of Text Lines stored in is a VAX-11l control. The of the VAX-11l a TEXT EDITOR (SOS) and Page Marks line-numbered RMS record. SOS line number RMS record. file, a line Its type comprises of 1is the text generated variable with fixed-control by SOS fixed-length access field The text line has the following format: Byte count n | Line The byte count, characters in integer. above by The implied a 16-bit the text text char) or number | char | char consists of An SOS page case of the byte mark 1is general to SOS 5-digit text; and adds terminate such number; a SOS does not print a text on a page other the text line; represented in a file format given above: -1 displays ASCII 2 more than the number of 1line number is also a 16-bit fewer characters (represented or its end (3v). No point is count. Byte count 3 When is The 500 or that do not include the characters is present by the integer, line. char text the following special D lines, prints and by a to it prints (G#); the the prints 1line number a line. page mark as such. Instead, when it than the current page, it prints PAGE n. 2-113 as the n-2 characters of displays first. CHAPTER 3 BATCH-ORIENTED TEXT EDITOR 3.1 INTRODUCTION TO SLP SLP 1is a batch-oriented editing program (SLP) used for source file maintenance.l SLP allows you to update (delete, replace, add) lines in the changes made to a file, time computer an existing file. Furthermore, SLP gives you a record of editing changes. The SLP command file provides a reliable way to duplicate at a later or on another system. Input to SLP consists of (1) a correction input £file that you want updated, and (2) a command file containing text lines and edit command lines that specify the update operations to be performed. SLP locates lines to character be changed strings). by means of "locators" (sequence numbers or SLP output is a listing file and an updated copy of the correction input file. SLP provides an "audit trail" that helps you keep track of the update status of each line in the file. The audit trail is shown in the listing and is included permanently in the output file. When a given file is wupdated with successive versions of an SLP command file, you can use different audit trails to differentiate among the changes made at different times. SLP output qualifiers let you truncate lines, create audit trail, eliminate an existing audit trail, and beginning position of the audit trail. 3.2 or suppress an and specify the length RUNNING SLP Run SLP by submitting a command file for processing. The command file contains the EDIT/SLP initialization line, SLP edit commands, and a. DCL S$EXIT command. You submit the command file by wusing either the SUBMIT command or the @ (Execute Procedure) command. You must create the command file before running SLP. The interactive text editor SOS is usually used to create SLP command files. In the following example, SLP is run by submitting the command file UPDATE .COM. (The required contents of such a command file are detailed in Section 3.3.2.) Note that, since the file type of the command file is COM, the type can be omitted on the DCL command line. $ QUFDATE When SLP finishes its processing, l. SLP originally meant "source the DCL prompt is language 'input issued. program." Today, interactive text editors like SOS are used more often for file input. 3-1 BATCH-ORIENTED TEXT EDITOR 3.3 (SLP) SLP INPUT AND OUTPUT FILES SLP requires two types of input files: a correction input file and a command file. The correction input file is the source file you want to update. The command file consists of an initialization 1line, SLP edit commands that indicate how the file is to be changed, and the DCL command S$EXIT. The listing file is a copy of the output file with sequence numbers added; it shows the changes SLP makes to the correction input file. The output file is the permanently updated copy of the input file. SLP output consists of a listing file and an output file. Figure 3-1 shows the relationships among the SLP input and output files. Later sections show the contents of the various files in this example. Input File Listing File MYFILE.TST: MYFILE.LIS;1 m— Command File UPDATE.COM;1 Figure 3.3.1 3-1 B Processor Output File MYFILE.TST:;2 1Input Files and Output Files Used During SLP Processing The Correction Input File The correction input file is the file to be updated by SLP. It can contain any number of 1lines of text. When SLP processes the correction input file, it makes the changes specified by SLP edit commands and marks these changes with an audit trail (discussed in Section 3.7) in the output file. BATCH~ORIENTED TEXT EDITOR 3.3.2 (SLP) The SLP Command File The SLP command edit commands. l. file is a VAX/VMS procedure It consists of: file that contains An initialization line that tells SLP what files This line has the general form: EDIT/SLP[/qualifiers] to SLP process. input-file The optional qualifiers are described in Section 3.6. This initialization 1line must be the first line in the command file. 2, SLP edit command lines (see Section 3.5.1). that define 3. Input lines. output file, the file. 4. An SLP terminator. A single slash in column complete its processing of the files. 5. A command These lines of text are either as new lines or to terminator -- the The example below shows a command to the items listed above. SEQDITASLF INSERT changes to the DCL file. LINE causes SLP to The numbered lines correspond (1) AFTER LINE 3 (3) (2) DELETE LINE 4 AND REFLACE IT WITH THIS LINE (3) 4) BEXIT £5) The SLP Listing File The SLP listing file line 1in the listing shows the updates made to the file is numbered in sequence. by means trail of an audit suppresses audit-trail of a listing file. (unless you generation). A listing file is generated by default. file by using the /NOLISTING qualifier; 3.3.4 1 S$EXIT command. ~4y 4 3.3.3 file inserted into the replace old lines in MYFILE.TES THIS input specify Section 3.4 source file. Each Updates are marked the qualifier contains an You can suppress the see Section 3.6.1. that example 1listing The SLP Output File The SLP output file is the updated input file. All of the updates specified by SLP edit commands are inserted in this file. A default audit trail, unless suppressed, is applied to new or changed 1lines. The numbers generated by SLP for the listing file do not appear in the output file. An output file is generated by default. file by using the /NOOUTPUT qualifier; 3-3 You can suppress see Section 3.6.2. the output BATCH-ORIENTED TEXT EDITOR 3.4 (SLP) HOW SLP PROCESSES FILES This section uses an example to show how following test file is named MYFILE.TST. SLP processes files. The ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE TEN This file is to be updated under file, named UPDATE.COM: the control of the SEDIT/SLPAAUNTTLTRATL I (FOESITION=GG following command MYFTLE.TSHT ;gSERT THIS LINE AFTER LINE 3 BéiETE LINE 4 AND REFLACE IT WITH THIS LINE ;EXIT Figure 3-1 represents the process of updating this file by issuing the command @UPDATE. Below is the listing file (MYFILE.LIS) that results from this operation. l. ONE 2., TWO 3. 4. 5. THREE INSERT THIS DELETE LINE 6. 7. 8. 9. 10. l1l. FIVE LINE AFTER LINE THREE 4 AND REPLACE IT WITH THIS LINE SIX SEVEN EIGHT NINE TEN The audit trail shows the new lines (;**NEW**) and ; **NEW** ; **NEW** prx-1 indicates where lines have been removed (;**-1l). In this case, a new line has been added after line 3, and 1line 4 has been replaced, causing all subsequent lines to be renumbered. The /AUDIT_ TRAIL qualifier in the initialization line indicates that the audit trail is to begin at the next tab stop after column 50. To process the files, SLP writes each line from the correction input file into the output file until it reaches a line to be modified, as requested in the command. When SLP reaches a line to be modified, it makes the indicated modification, notes the change in the audit trail, and then continues writing lines to the output file, in sequence, until it encounters another command or reaches end of file. 3.5 USING SLP This section contains information on how to specify SLP edit and update files using SLP. commands BATCH-ORIENTED TEXT EDITOR (SLP) 3.5.1 Specifying SLP Edit Commands SLP edit commands let you update source files by adding, deleting, and replacing lines in a file. SLP edit commands are marked by certain characters that SLP interprets as operators. This section first the describes operators SLP interprets specially, then describes the general form for specifying SLP edit commands. following characters interprets the 3.5.1.1 SLP Operators - SLP of them as the first character of an one specially when you enter the percent sign input line: the minus sign (-), the backslash (\), (%), the at sign (@), the slash (/), and the less-than character (). Table 3-1 lists each of these operators and the functions they perform. The at sign (@) operator tells SLP to read further input from a This second command file can contain only SLP file. command another edit commands and new text lines. (<) The less~than character escape is the character that 1lets you enter characters in the command file (in column 1) that SLP otherwise </ hides the slash For example, would interpret as operators. from SLP, thereby enabling you to enter the slash into the character You can use the output file without terminating the SLP edit session. character less-than listed in Table 3-1 as an escape character (including itself). Table for all SLP operators 3-1 SLP Operators Function Operator 3.5.1.2 - First character of an SLP edit command \ Suppress audit-trail generation % Reenable audit-trail generation @ Invoke a further command file for SLP processing / Terminate the edit session < Escape character General Form of the Edit Command - The general edit command is as follows: trail/] -locatorl[,locator2][,/audit[;comment] inputline Arguments: - (minus sign) Specifies that this is an SLP edit command line. 3-5 form of the BATCH-ORIENTED locatorl Is a line locator that pointer to a specified current line any line pointer in of the the edit causes is moved to file. forms EDITOR (SLP) SLP to move the 1If only locatorl is line. command locator TEXT that This described line and field SLP can be current line specified, the reads the specified next using below. locator?2 Is a line range deleted the locator that beginning or replaced. locator defines with forms a range locatorl This and field described can of 1lines ending be (that with is, locator2) specified using the to be any of status of below. /audittrail/ Is a character each string 1line in replaced lines changed or slashes (/). the in used file. the to keep This file suppressed. track audit wuntil This of trail the the is audit argument update used to mark trail must be the file is new or either delimited by inputline Is a line of following new text to the <current optional comment. be inserted 1line. You lines. into can enter any immediately number of input ;comment Is an All fields specified. The in locator the command fields can SLP line take {/string[...string]/} number ignores are one of any text after position-dependent; the following a semicolon. commas must be forms: [+n] Arguments: string Is a string which of string ASCII characters. exists and SLP locates the next moves 1line in the current line pointer to that specified in the form /string...string/ strings of characters separated by three line. If the locator is (that 1is, two different periods), SLP locates the 1line in which string is followed by the second character what characters may be in between them. the first string, character regardless of number Specifies to be is 9999, a sequence moved. The number largest to which sequence the current number that line can pointer be is specified n Specifies specified . (period) Indicates a decimal value by the locator. the All forms of the command line. current line used as an offset from the 1line line. locator can be specified interchangeably in a BATCH-ORIENTED SLP can only edit a files given TEXT sequentially. moves line. past 1line in 3.5.2 Updating Source Files the EDITOR Once file, Using (SLP) the it current cannot be 1line pointer returned to that SLP This section describes how to use the SLP edit command to add, delete, and replace 1lines in a file. The section also includes a procedure for generating a numbered listing for use in editing source files by sequence number. 3.5.2.1 Generating sequence number. file; they are a Numbered However, not written To use SLP effectively, when you prepare the other programs (such necessarily be SLP listing numbered Listing sequence to the - SLP numbers output processes appear only in input the by listing file. obtain an up-to-date numbered listing for use command file. Numbered listings generated by as useful by S0OS in and the preparing submitting a an MACRO SLP assembler) command command file file. in the will not Generate an following form: SEDNTTACLP/ZNOODUTFUTEAZLISTING S List~Filel inegbt-file / SEXTT Here list-file is the that SLP produces, whose lines are to be processing the files. name you optionally assign to the 1listing file and input-file is the specification of the file numbered. The slash (/) tells SLP to begin SLP generates a numbered listing file, but does not file. produce an output 3.5.2.2 Adding Lines to a File - The SLP edit command for adding lines to a file contains only one locator field. 1Its form is given below. -locator|[,,/audittrail/]} [ ;comment] where (as in Section 3.5.1.2), locator has the following form: /string[...stringl/ number If number is specified, specified by sequence lines in the file. If string is specified, [+n] SLP inserts number. Any SLP locates the file and moves the current string. Any input lines following the file. If you specify +n, SLP moves the 1line specified 1in the lines to the file. the new line(s) after the 1line lines you enter are inserted as next occurrence of string in line pointer to the line containing the command line are then added to the current line pointer n locator field and then adds 1lines beyond any new input BATCH-ORIENTED TEXT EDITOR (SLP) The example below shows how to add lines to a input file consists of the following lines: file. The correction ABC DEF GHI KLM 123456789 The input file consists of the following commands and text lines: $EDIT/SLF MYFILE.TST ~/123/ INSERT THIS LINE AFTER LLINE 3 s $EXTT SLP processing generates the 1. 2. 3. following listing file: ABC DEF GHI 4. KLM 5. 123456789 6. INSERT THIS 7. 8. 9. 10. 11. LINE AFTER LINE 5 ; **NEW** 456 789 CBA XYz 987 SLP has applied sequence numbers to the lines and added an audit trail to the the line following string 123. line The next example uses the new command file: SEDLT/SLE 5, same where SLP correction found input the first file MYFILE.TST - DEF /42 THIE 18 NEW TEXT / $EXTT WN- ABC OO SLP processing generates THIS the following listing file: DEF GHI KLM IS NEW TEXT 123456789 456 9. 789 CBA 10. 11. XYZ 987 ; **NEW** 3-8 and occurrence the of following BATCH-ORIENTED TEXT EDITOR (SLP) Again, SLP has numbered the lines in sequence; this time the new input line 1is inserted two lines beyond the 1line containing the first occurrence of the string DEF. 3.5.2.3 Deleting Lines deleting 1lines from a given below. from a File The SLP edit file contains two locator fields. command for 1Its form is -locatorl,locator2(,/audittrail/] [ ;comment] where locatorl and locator2 can be any of the forms of the 1locator fields described above. The first field, locatorl, specifies the line where SLP is to begin deleting lines; locator2 specifies the 1last line to be deleted. SLP deletes all lines from locatorl through locator2, inclusive. The The example below shows how to delete correction input file consists of lines from a file the following lines: wusing SLP. ABC DEF GHI KLM 123456789 456 789 CBA XYZ 987 The command file SEVIT/SLF =S Lo for this example is as follows: MYFILE.TST s R/ v/ XYL/ / SEXIT SLP processing generates 1. 2. 3. 4. 5. the ABC DEF GHI KLM 987 following listing file: ;¥*=-5 In this example, the ellipsis (...) is used to abbreviate the larger string 123456789. SLP searches for the first occurrence of the string 1 and the first occurrence of the string 9 on the line, assuming these two strings bracket a larger string, in this case, the string 123456789, SLP begins deleting 1lines at this 1line and continues deleting lines until it deletes the last line, specified by the string XYZ. SLP applies the audit trail count of the lines it deleted to the next line in the output file. Using the same correction input file, this example shows how to delete a single 1line using the period locator. The command file for this example is as follows: $EDIT/SLF ~/DEF/y. / $EXIT MYFILE.TST BATCH-ORIENTED TEXT EDITOR (SLP) SLP processing generates the following listing: 1. ABC 2. GHI 3. 4. KLM 123456789 5. 6. 7. 8. 9. 456 789 CBA XYZ 987 p*¥*-1 SLP moves the current line pointer to the line containing the string DEF and then finds the period as the second locator field. Since the second locator field is specified, SLP interprets the edit command as a delete operation and deletes the line containing DEF. 3.5.2.4 Replacing Lines in a File A replacement 1is a deletion followed by new text. The number of lines deleted need not match the number of lines added. To replace lines in a file, use the full 2-locator command form, as in the delete command. The first line locator field specifies the first line to be deleted. The second line locator field defines the for replacement operations, last line in the range to be deleted, and, the line where new text is to be inserted. For example, the command -4,.+4 instructs SLP to move the line pointer to line 4 and replace line 4 and the next four lines (as represented by .+4) with new input lines that immediately follow the command line. This command is equivalent to -4,8. The example below shows how to delete lines from a file and replace them with new lines. The correction input file consists of the following lines: ABC DEF GHI 123456789 BCN CRB BUR The command file SEDIT/SLF e 4 o+j NEW LINE NEW LINE is as follows: MYFILE.TST 2 3 / SEXIT SLP processing generates the 1. ABC 2. 3. 4. NEW LINE 2 NEW LINE 3 123456789 5. BCN CRB BUR 6. 7. following listing file: ; **NEW** ; **NEW** s ¥*-2 3-10 BATCH-ORIENTED TEXT EDITOR 3.6 (SLP) SLP QUALIFIERS file 1listing SLP qualifiers control the generation and format of the You can use them to control the audit trail and the output file. and sections following The output options associated with these files. describe the SLP qualifiers and the functions each performs. /[NO]JLISTING[:file~spec] 3.6.1 The listing file that SLP generates by default has the same file name You can request its file type is LIS. the correction input file; as the using by file 1listing the for specification different a /LISTING: file-spec qualifier. specify /NOLISTING. To suppress the listing file, 3.6.2 /[NOJOUTPUT[:file-spec] By default, SLP generates an output file with the same file name and file type as the correction input file. Its version number is higher name by 1 than the highest version number existing for the input file and type. You can give a different specification by using the /OUTPUT:file-spec qualifier. To suppress the output file, specify /NOOUTPUT. /[NO]AUDIT_TRAILI:(POSITION:pOS,SIZE:len)] 3.6.3 specify or This qualifier lets you suppress audit-trail generation, The default is the beginning position and length of the audit trail. to generate an audit trail 8 characters long, that is, starting in column 80 -- /AUDIT_TRAIL:(POSITION:SO,SIZE:B). The maximum allowea value for the length parameter is 16. either the position or length parameters, If you give you must give both. The audit trail starts at the first tab stop after the position (or defaulted) every 8 columns. for Section the /AUDIT_TRAIL The /AUDIT TRAIL detail in 3.6.4 /[NO]TAB_FILL qualifier. qualifier 1is given Tab stops are set discussed in more 3.7. The qualifier /TAB_FILL causes SLP to insert tabs at the end of each text line containing an audit trail. The default is to fill such lines with spaces (that is, /NCTAB_FILL). Using /TAB_FILL saves disk space, because fewer tabs than spaces are required to fill the lines in both the output 3.6.5 file and the listing file. /[NO]TRUNCATE|[:position] This qualifier lets you truncate input lines to the given column position. The default is /NOTRUNCATE. If you specify /TRUNCATE but omit position, SLP uses the position given (or defaulted) for the /AUDIT TRAIL qualifier. BATCH-ORIENTED TEXT EDITOR 3.7 (SLP) THE AUDIT TRAIL The audit trail is a device that allows you to keep track of changes made to a file with SLP. The qualifier /[NOJAUDIT TRAIL lets you suppress the generation of the audit trail, or set its beginning position and length. With SLP edit commands, you can change the value (that is, the text) of the audit trail, and temporarily suppress and resume audit-trail processing. To suppress audit-trail /NOAUDIT_TRAIL. By default, s ¥**NEW**, of each 3.7.1 The the audit That is, new or following trail is the text changed Changing generation initially, initially ;**NEW** specify turned on. the 1Its qualifier text value audit trail: is placed starting is in column 80 line. the Value of SLP edit the Audit Trail command changes the value of the -,./newtrail/ Here newtrail is the new value (text) of the audit trail. length of newtrail exceeds the length specified (or defaulted) /AUDIT TRAIL qualifier, the audit trail is truncated to that (The default audit specify a The audit trail 3.7.2 Setting the To the the new set length that is used Position beginning following trail, less ;**NEW**, If the for the 1length. is never truncated, even if you 8.) in all and position subsequent Length and the of lines changed. the Audit Trail length of the audit trail, use gqualifier: /AUDIT TRAIL: (POSITION:pos,SIZE:len) The example input file below shows for the this example use of this qualifier. The follows. ONE TWO THREE FOUR FIVE The command file is as follows: SEDIT/SLEP/ZAUDNITOTRATILI(FOSITION 30, SIZEL10) “~2y bl v /FCHANGEQO LY NEW LINE 2 NEW LINE 2 SEXIT 3-12 MYFILE.TST correction BATCH-ORIENTED TEXT EDITOR (SLP) The following listing file results from SLP processing. l. ONE 2. 3. NEW LINE NEW LINE 4. FOUR 5. FIVE 3.7.3 2 3 ; CHANGEOQOO1 ; CHANGEOO1 Temporarily Suppressing the Audit Trail You can temporarily suppress the audit trail im the output and listing files by using the backslash (\) operator. You can reenable audit-trail generation with the percent sign (%) operator, even if you initially specified /NCAUDIT_TRAIL. Use the backslash in column 1 of the command audit-trail generation. Use the percent operator later point to resume the audit trail. 3.7.4 file to suppress in column 1 at some Deleting an Input Audit Trail You can delete audit trails in the input file in one of the following ways: ) The default audit trail, ;**NEW**, is automatically deleted when the file is read with audit-~trail processing enabled. () Any other audit trail can be deleted by using qualifier. the /TRUNCATE The qualifier /TRUNCATE[:position] truncates input lines at the given column position. If you give the /TRUNCATE gualifier but omit position, SLP wuses the position given (or defaulted) for the /AUDIT_TRAIL qualifier. Set position at or before the start of the old audit trail you want deleted. Any trailing spaces or tabs after position are also deleted. APPENDIX A SUMMARY OF SOS FUNCTIONS AND FEATURES Table A-1 SOS Modes of Operation Mode Prompt Used for Edit * Editing -- adding, Input nnnnn Typing in lines of text Alter nnnnn Editing within a line Alter/insert (none) changing text Inserting text within Alter mode Read-only R* Examining a file without changing it Copy-file C* Searching, copying from another file Decide D* Deciding case by case on substitutions Decide Alter nnnnn (Submode) Like Alter mode Decide Alter/insert| (none) (Submode) Like Alter/insert mode SUMMARY OF SOS FUNCTIONS Table Edit-Mode Command Alter Commands: AND FEATURES A-2 Function and Format Function Enter Alter mode for intraline, Format' A [range] character-by-character editing. Copy Copy a range of lines to another place within a file, or from another file. C position [=file-spec] ,range [,incr1 [ ,incr2} ] position=file-spec/C Optionally, enter Copy-file mode. Delete Delete a range of lines. D [range] End End SOS, return to DCL. E [B] [Q] [S] [T] [:file-spec] Find Search for the occurrence of one or F [{string] Cesc ) [range] [,A] {N] [.E] [,n] [,-1] more specified strings of text. Help Display the help package. Input H [:n] Enter Input mode to insert lines of Jincr text. I [position]] < ;incr Join Join two text lines into one line. J [position] Kill Page Mark Delete a page mark. K /page List a range of lines on the printer L [range] [,S] [{ ,P[:file-spec]}] iIn List or to a file. ,F:file-spec Mark Insert a page mark. M [position] reNumber Renumber a range of lines. N [incr]} [,[range] [,start] } Print Print a range of lines on the terminal. P [range] [,S] Replace Delete a range of lines and enter Input ,incr mode. R [range] ;incr Replace one or more text strings with S [[oldstring(CesC ) newstring] ;In Substitute [range] [,D] [LN] [LE]] other string(s) in a range of lines. Optionally, enter Decide mode. Transfer Copy a range of lines to a new location T position,range [,incr1 [,incr2] ) and delete the original lines. Save World Write a new file containing all the W [B] [:file-spec] changes made so far. eXtend Enter Alter/insert mode to add text X [range] [N] to the end of a line. Move Position Give Parameter Reset the position of the current line. . position Give the value of an SOS internal = parameter parameter or switch. Set Parameter Reset an SOS parameter or switch. | parameter [:value] Command File Execute the SOS commands contained @ file-spec in a command file. RET Ces) Print next line. RET Print previous line. ! The space after the single-character command is optional. Terminate each command with and (EO). (except the commands SUMMARY OF SOS FUNCTIONS AND FEATURES Definitions for the Edit-Mode Commands Uppercase letters represent literals that you accepts either upper- or lowercase letters.) variables, defined below. The symbol => type verbatim. (SOS Lowercase terms represent means "is defined as." Brackets ([ 1) indicate optional parts of the argument string (except in directory or filespec, in which one set of brackets must be typed). Stacked braces ({ }) mean to choose one of the enclosed expressions. Angle-brackets (< >) the escape key enclose descriptive terms. (or ALTmode, SELect or PREfix). And () represents file-spec =>[device:] [[directory]]filename[.type[;version]] increment => 1l => line => <a positive <a line integer number> line-number (less than increment> 65536) 1 ~ [+ m] * m => <an integer n => <a positive p => <a page P page => ) ° ( parameter => position => <a offset> integer> number> [% q legal { line line-number SOS parameter [/page] or switch> } /page g => <an integer page-number position -range => offset> [{:position}] :position o In start => <a positive integer line number> string => stringl[(eDstring2[(R& D string3[(XDstring4 [GeDstring5{()string6]]1]] value => <a legal parameter value> SUMMARY OF SOS FUNCTIONS AND FEATURES Table A-3 Meanings of Edit-Mode Command Options Option Meaning Commands /A Enter Alter mode Find ,D Enter Decide mode Substitute D Enter quasi-Decide mode Content specification ,E Require exact case match Find, ,F List to disk List /N Type only number, ,P Select printer List ,S Suppress line numbers List, , - Find line in which specified|{Find, content pattern does not occur commands) ,n Find (all commands) Substitute, content Substitute, eXtend, specification file not line Find, specification n occurrences of (all (all commands) content commands) Print specification (all Find specified pattern /N Use nth occurrence of Content specification specified pattern Table Alter-Mode A-4 Commands Command B Meaning Do not print rest of line; recycle line with edits incorporated. [-] [n]Cx... Change next/previous characters.l [-]1[n]D Delete next/previous n characters. E End Alter [-][n]Itext(ssc)|Insert 1. "Next" The Kill if no minus mode text increment [-] [n]Kx (all commands) n is this new all typed: beginning characters line; after/before for (delete) sign for n to do not to print pointer; use occurrence of of given line. temporary lines. until nth ‘"previous" if minus character sign other commands that accept a minus sign are presented is in x. typed. similar fashion. (continued on next page) SUMMARY OF SOS FUNCTIONS AND FEATURES Table A-4 (Cont.) Alter-Mode Commands Command L Meaning Print rest of line; edits incorporated. P Print edits rest of line; incorporated. Q Quit Alter mode; recycle to beginning of line with recycle to current position restore original with line. [-] [n]Rtext ()| Replace next/previous n characters with inserted text. [=] [n]Sx Skip forward/back [-][n]W Skip forward/back n words. [-][n]X Delete next/previous n words. [-]1[n]~ Invert case of next/previous n characters. [-][n]< Convert next/previous n characters [-]1[n]> Convert next/previous n characters to lowercase. [-]1 [n] to nth occurrence of character x. ) Space back/forward n characters. RET Leave Alter mode for [-] [n] CoeD (L) this line; uppercase. print rest of line. Space back/forward n characters. Leave Alter mode for this line; [-1[n] (D Space forward/back n characters. [=] Skip to end/start of line. TAB to print rest of line. Retype line to current position. Start fresh -- discard edits, line, do not print line. recycle to beginning of SUMMARY OF SOS FUNCTIONS AND FEATURES Table A-5 Decide-Mode Commands Form Meaning or Y Yes, or N No, make do the not change make Alter: enter already made. E or Q End: do Go: make not the the make the (leave Table Set from Edit Mode? Preset via DCL?? Alter change, change, SOS shown. change. Decide automatically Name' as and mode return make with to all the Edit change mode. further Decide mode). changes A-6 Parameters Initial Meanin Value 8 BIG n - ERROr n (nuil) Displays highest page number Displays last error message ESCApe y (null) Sets character for input/output of escapes ID n - Displays current SOS version number INCRement y 100 Sets increment for numbering inserted lines ISAVe y 0 Controls auto-W on inserts LENGth y 55 Sets page size for List command LOCAtion n ! Displays first line in edit buffer MATCh y (null) NAME n - Displays output file specification PLINes y 16 Sets number of lines printed by P(Rrer) SAVE y y 0 Controls auto-W on commands STARt y y 100 Sets starting line number STEP y y 100 Sets increment for initial line numbering STRIng n (null) SUBStitute n 0 n 00000/1 y Sets special pattern-matching flag character Displays current Find and Substitute strings Displays number of matches in last Substitute Displays current position ! Minimum abbreviation is given in uppercase letters. 2You can specify these parameters as qualifiers in the initial DCL EDIT command, or by using the symbolassignment mechanism (see Section 2.9.3). SUMMARY OF SOS FUNCTIONS AND FEATURES Table A-7 S0S Name! Initial . Preset \ Value via DCL? BAK on DEClde of f EXACt off Switches Meaning Tells SOS to create back-up file y Sets auto Decide mode on Substitute Requires exact case match for Find, Substitute, contentspecification EXPErt off y Declares experienced SOS user LINE on y Tells SOS to use existing line numbers LOWEr on y Tells SOS to accept uppercase, lowercase as is READonly off y SEPArator off Tells SOS to treat _$ . as alphanumeric SEQUence on Leaves output-file line numbers Starts SOS in Read-only mode ! Minimum abbreviation is given in uppercase letters. 2 You can specify these switches as qualifiers in the initial DCL EDIT command, or by using the symbolassignment mechanism (see Section 2.9.3). Turn off any switch by using the letters NO before its name; thus, NOLINE tums off the LINE switch. SUMMARY OF SOS FUNCTIONS AND Table Special Con- Internal struct Represen- Constructs Meaning E) E (2] SR separator Match a Match any or tab character except 0 space or more of or more of x the character the character 2 [2) T character Match 1 Match Match Match Match any any any any alphanumeric character letter (A-Z, a-z) uppercase letter (A-Z) lowercase letter (a-z) Match any decimal Match internal g | Ll | Kl | il 1 K mllE{Ril=|{= [2) Y £x) o) () [ ] o] [2) fu) any any JIEFIGTIETICS CTR Match Match Match N CTR G cHoflel e |— | Constructs 3 i CIRL/ : b % Q AV ROR = O N U 0 ) s s ) ) ) ) ) &) ey = g0 A e N Find-String A-8 Pattern-Matching tation FEATURES digit x x (0-9) Match beginning or end of line representation of c Substitute-String Constructs 2x12% The first string matched by a find-string construct 2*22% The ?2%n?2* The nth 2" second The by string string so matched so matched next a string in the sequence find-string construct Table Position Character A-9 Shorthand Characters . Meaning . Current line /. Current page - First line on page /" First page * Last line on page /* Last page in file in file matched APPENDIX SOS ERROR MESSAGES: B NOVICE AND EXPERT FORMS In the right-hand Table B-1 lists the error messages produced by SOS. of the messages that SOS prints if the EXPERT forms the are column messages except one are switch is on (see Section 2.9.2). All the and returns you to Edit command nonfatal: SOS halts the offending (You one confounded the 1last mode. The one fatal error is If it does not occur in normal SOS use. error This Sorry.). S0S. does occur, SOS returns you possible recovery procedures to the Table SOS Error Novice monitor. Messages: and Expert command file name Cannot access HELP file Cannot access LIST file Cannot delete across pages Cannot kill initial page mark Command invalid for read only file Command line I/0 error Failed to open command file Illegal file specification Illegal parameter to switch Illegal search string given Illegal specification in line or page number Illegal specification in range Illegal switch name Illegal syntax of command Insufficient line numbers for insertion Line is too long Line number step too large - lines out of order Lines out of order Maximum command file depth exceeded No such line exists Page does not exist Range given does not contain any lines Search strings exceeded buffer length String not found, search failed Too many search strings given confounded SGCS. Sorry. 2.7 for B-1 Novice Forms Message Bad You Section See in this eventuality. Expert Message Name bad HELP LIST trouble trouble Del no pages K/1 bad File RO I/0 error Open failure File? Bad param to switch ISS Bad line/page Bad range Bad switch ?27? No room Line Step too too long big Order Command files NSL Page? Nothing Too long Not there Too many Internal error too deep APPENDIX C SLP COMMAND FEATURES To run SLP, You submit a command l. Initialization line 2. SLP edit 3. DCL submit file containing: commands SEXIT command a command file by using either: e SUBMIT command e @ (Execute Procedure) command The general form of the initialization line EDIT/SLP[/qualifier] is: input_file where: EDIT/SLP Invokes SLP. /qualifier Specifies one or more output gualifiers. This field can be specified using any of the five forms listed in Table C-1. input_file Specifies update. a source file you want to SLP COMMAND FEATURES Table SLP Qualifier Output C-1 Qualifiers Default /[NO] AUDIT_TRAIL [:(POSITION:pos,SIZE:1en)] /[NO] LISTING [:file-spec] Function /AUDIT TRAIL: Specifies whether an audit trail should be (POSITION:80,SIZE:8) generated, its beginning field and length. /LISTING:file-spec Specifies whether a listing file should be produced, and lets you rename the listing file. J/OUTPUT: file-spec /[NO]OUTPUT{:file-spec] Specifies whether an output file should be produced, and lets you rename the output file. /NOTAB_FILL /[NO] TAB_FILL Inserts tabs at the end of each text line containing an audit trail; /NOTAB_FILL inserts blank spaces. /NOTRUNCATE /[NO] TRUNCATE([:pos] Truncates input lines at the given column position; /NOTRUNCATE disables truncation. The general form of the SLP edit command is: -locatorl|,locator2] [,/audittrail/] [;comment] inputline where: - (minus) Specifies that this is an SLP edit command line. locatorl Moves current line pointer to This field can be specified using syntax forms listed below. locator?2 Represents either an actual 1line number or the number of 1lines to be deleted or replaced. This field can be specified wusing any of the three syntax forms listed below. /audittrail/ Generates an audit trail which marks modified lines in your file. It also change the value of your audit trail. inputline Inserts new following the ;comment An optional semicolon. 1lines into your current 1line. comment; SLP ignores specified any of the file any 1line. three new or lets you immediately text after a SLP COMMAND FEATURES SLP will process a command line with any of the following line locator syntaxes: All forms of the line locator can be used interchangeably in the command line. 1. /stringl[...string2]l/ 2. [/ number / 3. / . / [+n] where: stringl Is an ASCII string used to 1locate the line containing that string. If the locator is specified as /stringl...string2/, SLP locates the line in which the two strings delimit a larger string. number Is a your n Is a decimal value used as specified by the locator. . (period) sequential number listing file. an offset 1line from the in line C-2 Commands Format Function -locator[,/audittrail/] NEW that Indicates the current line. Table Edit Mode Command specifying Add new line(s) of text. LINE ~locatorl,locator2|[,/audittrail/] Delete a range of lines. -locatorl,locator2,[,/audittrail/] NEW LINE NEW LINE Delete a range of lines and replace with new lines. Table SLP C-3 Operators Operator - (minus) Function First character \ Suppresses % Reenables @ Invokes a of audit audit processing. an SLP trail trail command. generation. generation. supplemental edit edit command session and file for SLP returns to SLP / Terminates SLP command mode. < Allows you to enter characters in an input file that SLP would otherwise interpret as operators. APPENDIX SLP Table D-1 lists the error D ERROR MESSAGES messages SLP produced by SLP. Table D-1 Error Messages COMMAND SYNTAX ERROR ILLEGAL DEVICE NAME ILLEGAL DIRECTORY ILLEGAL ERROR/SEVERITY ILLEGAL FILE NAME ILLEGAL GET COMMAND ILLEGAL SWITCH INDIRECT COMMAND INDIRECT FILE DEPTH INDIRECT FILE OPEN CODE LINE SYNTAX pl p2 ERROR ERROR EXCEEDED FAILURE I/0 ERROR COMMAND I1/0 I/0 ERROR COMMAND OUTPUT FILE ERROR CORRECTION INPUT FILE INPUT I/0 ERROR LINE LISTING I/0 ERROR SOURCE OUTPUT LINE NUMBER ERROR OPEN FAILURE CORRECTION OPEN FAILURE p3 SOURCE FILE FILE FILE INPUT OUTPUT PREMATURE EOF COMMAND PREMATURE EOF CORRECTION INPUT FILE FILE FILE INPUT FILE INDEX A Adding lines, SLP, 3-7 S0S, 2-52 with with Alter (A) Backup BAK Alter-mode 2-10, 2-27 (sLp), 2-27 BIG commands, SVANXSTIODOWOWEHERKHEDON (change), 2-31 (delete), 2-31 (end), 2-32 (insert), 2-32 (kill characters), 2-33 (line), 2-34 (print), 2-34 (quit), 2-35 (replace), 2-35 (skip), 2-35 (word), 2-36 (delete word), 2-36 (convert to uppercase), 2-36 (convert to lowercase), 2-37 (invert case), 2-36 o m 2-37 2-37 cRLY) e 2-38 wm 2-38 - ~ - I - - D 2=37 W , 2-38 , 2-39 Alter-mode fill, (), ‘ 2-86 SLP output, Caret ("), first Colon (:), 2-12 Command File (@) command, Command file, SLP, 3-3 expression 2-16 Assignment, symbol, (*), last Alter-mode, 2-28 Decide-mode, Edit-mode, 2-68 2-26 Commands, SOS, Altexr (A), 2-27 Input Join Kill List in range, 2-88, 2-91 2-52 2-58 Mark (M), Position 2-76 Print (P), saving, 3-13 2-22, reNumber Replace (R), World 2-109 Transfer Complete 2-14, 2-59 2-63 (w), Parameter Substitute (.), 2-61 (N), Save Set 2-77 2-~55 Mark (K), 2-56 2-57, 2-89 Move File command (S0S), 2-79 Audit trail, SsLp, 3-12 changing the value of, 3-12 deleting on input, 3-13 initial value, 3-12 resuming, 3-13 setting position and length, file (I), 2-97 temporarily suppressing, 2-79 (J), Page (L), line or page, 2-13 sign (@), Command Automatic File (@), (C), 2-40 Delete (D), 2-43 End (E), 2-44 eXtend (X), 2-74 Find (F), 2-46 Give Parameter (=), Help (H), 2-51 2-32, 3-12 2-79 Commands, 2-75 Arithmetic 2-37 line or page, 2-13 summary, 2-10, 3-11 C Command commands, editor Alter-mode command, Copy Alter-insert mode, At text 3-1 parameter, Blank 2-28 Asterisk 2-45 2-94 Batch-oriented command, Alter mode, file, switch, (/), (S), (T), range 2-22, 2-73, 2-78 2-65 2-69 specification, 2-14 Confirming before deleting, 2-43, 2-64 Index-1 INDEX Constructs, find-string, 2-99 special pattern-matching, 2-98 substitute-string, 2-102 Content specification of range, 2-103 full syntax, 2-105 nested, 2-106 Control characters, 2-2, 2-10 Control characters, inserting into text, 2-33 Conventions used in manual, 5 Convert to, 2-37 opposite case, 2-36 Exact string match, 2-46 EXACT switch, 2-3, 2-46, 2-68, 2-36 Copy (C) command, 2-40 Copy—-file mode, 2-9, 2-42 Correction input file, SLP, 3-2 Cross section, 2-34 @ruO interrupt, Edit-mode commands, 2-24 form and function, 2-8 Efficient use of S80S, 2-112 Ellipsis (...), SLP, 3-9 End (E) command, 2-44 Equal sign, Copy-file mode, 2-42 Give Parameter command, 2-77 Error messages, B-1l ERROR parameter, 2-86 esc ), as Print command, 2-62 Escape character, 2-3 as Print command, 2-62 use of, 2-3 ESCAPE parameter, 2-3, 2-80, 2-87 lowercase, uppercase, (Cont.) 2-3 €9, in Help command, 2-51 Current line, 2-13 Current line-number increment, 2-17 Current position, 2-13 Current—-line pointer, 2-14 2-95 Example, Alter-mode editing, 2-30 Command File command, 2-80 nested content specification, 2-106 SOS temporary files, 2-110 Transfer command, 2-70 wraparound, 2-110 Exclamation point (!), 2-12 EXPERT switch, 2-63, 2-95, B-1l EXtend (X) command, 2-74 F D DCL SET command, 2-3 Decide Alter mode, 2-6, 2-68 Decide Alter/insert mode, 2-68 Decide mode, 2-9, commands, 2-68 quasi- 2-68, Find (F) command, 2-46 Find-string constructs, 2-99 combining, 2-103 match 0 or more of x [?)x], 2-6, 2-100 2-94 match (context-specified range), match any character match any character X (?%x), 2-100 2-14, (?+), 2-101 match any letter E 3-5 Edit mode, except match any decimal digit 2-15 Defensive editing, 2-21 Delete (D) command, 2-43 Deleting across a page boundary, 2-43, 2-64 Deleting lines with SLP, 3-9 Dollar sign ($), 2-3, 2-87 2-109 specifying, (2/), 2-99 2-21 line and page number, Edit buffer, 2-89, Edit command, SLP, (?9), 2-100 2-94 conditions when SOS initiated, (?1x), match any alphanumeric 2-105 DECIDE switch, Default, 1 or more of x 2-100 (2!), 2-101 match any lowercase (22), 2-101 letter match any separator (?:), 2-99 match any uppercase (?&), 2-101 letter match beginning or end of line (?>), 2-101 match space or tab (?<), 2-100 Format of text line, mark, 2-7 Index-2 2-113 page INDEX G (Cont.) LINES Generating a numbered listing (sLpP), 3-7 Give Parameter (=) command, 2-77 OUT OF ORDER, LOCATION parameter, Locators, SLP, LOGIN.COM file, LOWER switch, processes files, Intraline Invert ISAVE (M) parameter, 2-32, 2-75 Modes of operation, Alter, 2-10, 2-27 NUMBERS, 2-59 2-1, pointer, 2-10 2-27 2-36 parameter, 2-22, 2-88 Input, sS0s, command, 2-55 (K) 2-7 Help, 2-51 Move Position (.) command, 2-14, 2-76 Multiple search strings, 2-48, 2-92 K Kill Page Mark 2-56 2-4 2-4 Modules, (J) 2-98 assignment, 2-6 Read-only, J Join symbol Alter/insert, 2-10, 2-32, 2-75 Copy-file, 2-9, 2-42 Decide, 2-9, 2-68, 2-94 Decide Alter, 2-6 Decide Alter/insert, 2-6 Edit, 2-7 2-3 case, 2-58 2-90, (-), 2-16 "do not find", 2-46, 2-49, 2-106 DCL continuation, 2-98 2-52 LINE command, 2-88 2-6 Interactivity, Interrupt, Mark MATCH 2-18, Inserting lines, Alter/insert mode, Input mode, 2-97 3-4 Initiating SO0S, 2-2 Input (I) command, 2-52 INSUFFICIENT 2-109 2-96 Mechanism, 2-97 Minus sign ID parameter, 2-88 INCREMENT parameter, Input mode, 2-89, 3-6 and uppercase characters, 2-3, 2-21 Lowercase conversion, 2-37 Help (H) command, 2-51 Help modules, 2-51 SLP 2-89 Lower- H How 2-60 List (L) command, 2-57, Listing file, SLP, 3-3 command, Multiple substitutions, Muon, 2-67 2-34 L NAME Largest page number, LENGTH parameter, 2-57, Limitations, SOS, 2-21 Line length restriction, Line number restriction, LINE NUMBER STEP TOO LARGE, Options, syntax, 2-17 LINE switch, A (Find command), D (content 2-46 specification), 2-105 1-2 @O SLP, 3-7 o) 2-21 2-21 Line numbers, 2-11 new lines, 2-17 vs. 2-90 2-89 2-60 SOS parameter, Numbered listing, 2-86 2-95 S Line-number arithmetic, 2-16 Line-number increment, 2-53, 2-63 (Substitute command), 2-68 (content specification), 2-105 (Find command), 2-46 (content specification), 2-105 Index-3 INDEX Options (Cont.), N (content specification), 2-105 n N - (Find command), (Find command), ("do not find"), 2-46 2-46 2-46 2-49, 2-106 Output file, SLp, 3-3 S0s, 2-2 Range of line numbers, arithmetic expressions and, 2-16 deleting across, 2-43, 2-64 line-number offset and, 2-16 relative number of lines and, 2-11, 2-41, 2-58, 2-70 format of, 2-113 Page-number syntax, ID, 2-80, 2-87 2-88 INCREMENT, 2-18, 2-88 2-22, 2-88 LENGTH, 2-57, 2-89 LOCATION, 2-89, 2-109 MATCH, 2-90, 2-98 NAME, 2-90 ISAVE, PLINES, 2-91 SAVE, 2-22, 2-91 START, 2-91 STEP, 2-92 STRING, 2-92 SUBSTITUTE, 2-93 Pass-through, 2-110 Period (.), current line or page, 2-13 Move Position command, 2-76 parameter, 2-93 PLINES parameter, 2-91 Plus sign (+), 2-16 Pointer, 2-12 legal commands in, 2-7 Relative number of lines, 2-12 ReNumber (N) command, 2-59 Repetition count, Alter-mode commands, 2-27 Replace (R) command, 2-63 Replacing lines with SLP, 3-10 Restrictions, S0S, 2-21 ReT ), as Print command, 2-62 "Rewinding" temporary files, 2-110 2-17 Page numbers, 2-11 Parameter, 2-82 BIG, 2-86 ERROR, 2-86 ESCAPE, Qualifiers, SLP, 3-11 Quasi-Decide mode, 2-105 Question mark, special patternmatching flag, 2-90, 2-98 Range syntax, 2-12 Read-only mode, 2-7 efficiency of, 2-112 P(Crer), 2-61, 2-91 Page boundary, 2-12 Q R P Page mark, (Cont.) current~-line, 2-14 intraline, 2-27 Position syntax, 2-12 Print (P) command, 2-61 Prompts for different SOS modes, 2~5 Running SLP, 3-1 S Safety features, 2-22 SAVE parameter, 2-22, 2-91 Save World (W) command, 2-22, 2-73, 2-109 SEPARATOR switch, 2-96 Sequence numbers, 1-2 SEQUENCE switch, 2-97 Sequential editing, sLp, s0s, 3-7 2-112 Set Parameter (/) command, 2-78 Shorthand characters, 2-13, 2-72 Slash (/), page specifier, 2-11 Set Parameter command, 2-78 use in qualifier, 2-2 SLP operations, adding lines, 3-7 deleting lines, 3-9 generating a numbered listing, 3-7 replacing lines, 3-10 SLP operators, 3-5 SLP output, qualifiers for, 3-11 SOS internals, Index-4 2-109 INDEX S0Sxnn.TM1 file, 2-23, 2-109 SOsSxnn.TM2 file, 2-23, 2-109 Space (blank) fill, SLP output, 3-11 Special characters, SOS, (Cont.) Syntax, line number, 2-17 page number, 2-17 position, range, 2-106 2-12 2-12 Special pattern-matching, 2-90, T 2-98 Specifying ranges by content, 2-103 START parameter, STEP parameter, 2-91 2-92 String length restriction, STRING parameter, Submodes, 2-6 Substitute (S) SUBSTITUTE 2-21 2-92 command, parameter, 2-65 2-93 Substitute-string constructs, 2-102 next string matched Tab £ill, SLP output, 3-11 Temporary files, S0OS, 2-109 recovering information from, 2-23 Terminating SOS, 2-2 Text editing, introduction, 1-1 Text line, format of, 2-113 Textual file, 2-45 Transfer (T) command, 2-69 (?"), U 2-102 nth string matched (?*n?¥%), 2-102 Switch, 2-94 DECIDE, 2-94 ESCAPE, 2-3 EXACT, 2-3, 2-46, Updating BAK, EXPERT, LINE, LOWER, 2-63, SLp, Upper- 2-68, 2-95, 2-95 B-1 2-95 2-96 SEPARATOR, SEQUENCE, Up-arrow ("), page, 2-94 2-96 source lowercase 2-3, charac- 2-21 Uppercase conversion, Using SLP, 3-4 Using SOS efficiently, Using SOS safely, 2-21 2-97 Switches, 2-82, 2-93 abbreviating names of, 2-94 initial values of, 2-85 turning off, 2-82, 2-94 Symbol assignment, 2-97 files with 3-7 and ters, first line or 2-13 2-36 2-112 W World, Save (W) 2-22, 2-73 Wraparound, Index~5 command, 2-110 VAX-1l1l Text Editing Reference Manual AA-D029A-TE READER'S COMMENTS NOTE: This form is for document comments only. DIGITAL will use comments submitted on this form at the company's Problems with software should be reported discretion. If you on a Software Performance Report (SPR) form. require a written reply and are eligible to receive one under SPR service, submit your comments on an SPR form. Did you find errors in this manual? If so, Please make Is there suggestions for improvement. usable, sufficient documentation on associated and well-organized? system programs required for use of the software described in this manual? what material is missing and where should it be placed? If not, Please indicate the type of user/reader that you most nearly represent. 000000 Please cut along this line, Did you find this manual understandable, specify by page. Assembly language programmer Higher-level language programmer Occasional programmer (experienced) User with little programming experience Student programmer Non-programmer interested in computer concepts and capabilities Name Date Organization Street City State Zip Code or Country - — — Do Not Tear - Fold Here and Tape dlilgliltlall No Postage Necessary if Mailed in the United States BUSINESS REPLY MAIL FIRST CLASS PERMIT NO.33 MAYNARD MASS. POSTAGE WILL BE PAID BY ADDRESSEE RT/C SOFTWARE PUBLICATIONS TWwW/A14 DIGITAL EQUIPMENT CORPORATION 1925 ANDOVER STREET TEWKSBURY, MASSACHUSETTS - — Do Not Tear - Fold Here 01876
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies