SC24 5220 2_VM_SP_System_Product_Editor_Users_Guide_Release_4_Dec84 2 VM SP System Product Editor Users Guide Release 4 Dec84
User Manual: SC24-5220-2_VM_SP_System_Product_Editor_Users_Guide_Release_4_Dec84
Open the PDF directly: View PDF .
Page Count: 202
Download | |
Open PDF In Browser | View PDF |
] J ] J J J -- ---~ ------- ------ ---_.- -- -----. Virtual Machine/ System Product ] System Product Editor J User's Guide J J ] Release 4 SC24-5220-2 J J 'J ~l ~' -J J J 'J ~ i,~ :' , , " - Acknowledgement We gratefully acknowledge the permission to reprint excerpts from the following: The People's Almanac, by David Wallechinsky and Irving Wallace. Copyright © 1975 by David Wallace and Irving Wallace. Reprinted by permission of Doubleday & Company, Inc. I Wouldn't Have Missed It, by Ogden Nash, reprinted by permission of Curtis Brown, Ltd. Copyright 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1942, 1943, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, © 1955, 1956, 1957, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971 by Ogden Nash. Copyright 1933, 1934, 1935, 1936, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1947, 1948 by the Curtis Publishing Company. Copyright 1952 by Cowles Magazines, Inc. Copyright © 1969, 1970, 1971, 1972, 1975 by Isabel Eberstadt and Linell Smith. Copyrights Renewed © 1957, 1958, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1968, 1970 by Ogden Nash. Renewed © 1963, 1964 by the Curtis Publishing Company. Renewed by the Saturday Evening Post Company. Third Edition (December 1984) This edition, SC24-5220-2, is a major revision of SC24-5220-1, and applies to Release 4 Virtual Machine/System Product (VM/SP), program number 5664-167, until otherwise indicated in new editions or Technical Newsletters. Changes are made periodically to the information herein; before using this publication in connection with the operation of IBM systems, consult the latest IBM System/370 and 4300 Processors Bibliography, GC20-0001, for the editions that are applicable and current. Changes or additions to the text and illustrations are indicated by a vertical line to the left of the change. Summary of Changes For a detailed list of changes, see page iii. References in this publication to IBM products, programs, or services do not imply that IBM intends to make these available in all countries in which IBM operates. Any reference to an IBM program product in this publication is not intended to state or imply that only IBM's program product may be used. Any functionally equivalent program may be used instead. Publications are not stocked at the address given below. Requests for IBM publications should be made to your IBM representative or to the IBM branch office serving your locality. A form for reader's comments is supplied at the back of this publication. If the form has been removed, comments may be addressed to IBM Corporation, Programming Publications, Dept. G60, P.O. Box 6, Endicott, NY, U.S.A. 13760. IBM may use or distribute whatever information you supply in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1980, 1983, 1984 ,/ J J ] J -I -.l J ',I J Summary of Amendments ::"7' ] To obtain editions of this publication that pertain to earlier releases of VM/SP, you must order using the pseudo-number assigned to the respective edition. For: J J Release 3, order SQ24-5220 J Release 2, order ST24-5220 J Release 1, order ST24-5220. :J Summary of Changes for SC24-5220-2 VM/SP Release 4 =J J The XEDIT enhancements described in this document provide new or improved support in the following areas: ~ ] o .] SI Prefix Macro (to continuously add new lines of indented text) ~ o -=:J Summary of Changes for SC24-5220-1 VM/SP Release 3 :J =.J The XEDIT enhancements described in this document provide new or improved support in the following areas: ~ • ~ .J ~J ~ ~] Prefix Macro Support (writing prefix macros, < (shift left) and> (shift right) prefix macros, and LPREFIX) :J ~ Usability (all messages issued by the editor are in mixed case). ~ ~ Structured Input • Selective Line Editing (ALL) • Screen Control (SET MSGLINE, SET CMDLINE, SET SCREEN, SET COLOR) ... Summary of Amendments 111 o Extended Data Manipulation (MERGE, the logical AND operator for targets, SET FULLREAD) o Miscellaneous Enhancements (SET POINT, command line arrow extension, the alteration count on the screen (Alt = n), new initial PFIO, PFll, and PF12 settings). IV VM/SP System Product Editor User's Guide '--J J ] J ] J ] Preface J J J :J J This book was written primarily for the individual who has limited data processing experience. It is designed to give you a working knowledge of the System Product editor (also referred to as XEDIT). The System Product editor provides a wide range of functions for text processing and program development. Both a full-screen and a line-mode editor, it can be used on display and typewriter terminals. J Some highlights of the editor discussed in this book are: ~] o Extended string search facilities for improved text processing J o Automatic "wrapping" of lines that are longer than a screen line J o The ability to enter selected subcommands directly on a displayed line J o The ability to tailor the full-screen layout o The ability to divide the screen in order to display multiple views of the same or of different files o A variety of macros for improved text processing, such as macros to join and split lines o A HELP facility that provides an online full-screen display of any XEDIT subcommand or macro (or any command in the CMS HELP facility) during an editing session. The System Product Editor can manipulate Double-Byte Character Set strings (KANJI, for example). Special considerations for editing files that contain double-byte characters are described in the VMjSP System Product Editor Command and Macro Reference. How To Use This Book This book relies on "before-and-after" examples that illustrate the text. You can also tryout these examples for practice. Preface V The first three chapters are intended for data processing novices: Chapter 1: An XEDIT Subset: Full-Screen Text Processing is written for the inexperienced user who has a display terminal used in full-screen mode. It defines a subset of XEDIT subcommands that perform commonly-used editing functions. Chapter 2: A Practice Exercise is designed to give you practice in using the subcommands presented in Chapter 1. It is an interactive text, that is, it walks you through an editing session, step by step. Chapter 3: An XEDIT Subset: Text Processing on a Typewriter Terminal is similar to Chapter 1, but is written for a new user who has a typewriter terminal. The last four chapters are intended both for new users who have mastered the fundamentals and for data processing professionals. These chapters introduce more sophisticated editing functions: Chapter 4: Using Targets explains how to use the editor's extended string search facilities. Targets are used to move the line pointer and to define the range of many XEDIT subcommands. Chapter 5: Editing Multiple Files explains how to edit multiple files and how to divide the screen into multiple logical screens for multiple views of the same or of different files. Chapter 6: Tailoring the Screen explains how you can alter the screen layout to suit yourself. Chapter 7: The Macro Language explains how to write XEDIT macros and also explains how to write a profile macro. The Appendix is a summary of all XEDIT subcommands and their functions. These sub commands are described in detail in the publication VM/ SP System Product Editor Command and Macro Reference. VI VM/SP System Product Editor User's Guide J J ] Related Publications ~ Virtual Machine/System Product J System Product Editor Command and Macro Reference, SC24-5221 J System Product Interpreter User's Guide, SC24-5238 J System Product Interpreter Reference, SC24-5239 ~ CMS Primer, SC24-5236 =.J CMS Primer for Line-Oriented Terminals, SC24-5242. J ~ :J ~ ~ ~ =.J =.J _J --1 --...J ~ =:J :J =:J ~ =:J ~ =:J =:J :J ~ ~ ~ ( "- "--.-- Preface Vll /' V1l1 VM/SP System Product Editor User's Guide ] -1 .....J J -") -.J ] J ] Contents ] Chapter 1. An XEDIT Subset: Full-Screen Text Processing ...... 1 Editing a File .............................................. 1 XEDIT Command ......................................... 1 Screen Layout ............................................ 2 Entering Data .............................................. 5 INPUT Subcommand ...................................... 5 POWERINP Subcommand .................................. 8 U sing Program Function (PF) Keys ............................ 11 Splitting and Joining Lines ................................ 12 Scrolling Backward and Forward ............................ 13 Redisplaying a Subcommand ................................ 13 Reexecuting a Subcommand ................................ 14 Inserting Words in a Line .................................. 14 U sing Prefix Subcommands .................................. 15 Adding and Deleting Lines ................................. 15 Duplicating Lines ........................................ 22 Moving and Copying Lines ................................. 23 Setting the Current Line (/) ................................ 24 Canceling Prefix Subcommands ............................. 24 Moving through a File ...................................... 26 BACKWARD and FORWARD Subcommands ................... 26 TOP and BOTTOM Subcommands ........................... 26 DOWN and UP Subcommands .............................. 27 Making Changes in a File ................................... 29 CLOCATE Subcommand ................................... 29 CHANGE Subcommand ................................... 30 Making a Selective Change ................................ 31 Making a Global Change .................................. 34 CINSERT Subcommand ................................... 34 CFIRST Subcommand ..................................... 36 Setting Tabs .............................................. 37 Ending an Editing Session ................................... 38 FILE Subcommand ....................................... 38 QUIT Subcommand ....................................... 39 SET AUTOSAVE Subcommand ............................. 39 Inserting Data From Another File ............................. 40 Inserting a Whole File .................................... 40 Inserting Part of Another File .............................. 43 Getting Help .............................................. 47 Learning More About the Editor .............................. 47 Summary of XEDIT Subset ................................... 49 -1 ] ] ] ] J ] J J : J ] J J J J :J J :J J =:J =:J =.J :J J '-- Contents IX Chapter 2. Exercise 1. Exercise 2. Exercise 3. Exercise 4. Exercise 5. A Practice Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a File .................................. Using Power Typing .............................. Using Prefix Subcommands ......................... Making Changes ................................. Getting It All Together ............................ Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing a File ............................................. XEDIT Command ........................................ Entering Data ............................................. INPUT Subcommand ..................................... Column Pointer ......................................... Moving through a File ...................................... Line Pointer ............................................ TYPE Subcommand ...................................... UP and DOWN Subcommands .............................. TOP and BOTTOM Subcommands ........................... Making Changes in a File ................................... CLOCATE Subcommand ................................... CFIRST Subcommand ..................................... CINSERT Subcommand ................................... CDELETE Subcommand ................................... CAPPEND Subcommand ................................... CHANGE Subcommand ................................... Inserting and Deleting Lines ................................. Moving and Copying Lines ................................... MOVE Subcommand ...................................... COpy Subcommand ...................................... LPREFIX Subcommand ................................... Ending an Editing Session ................................... FILE Subcommand ....................................... QUIT Subcommand ....................................... SET AUTOSAVE Subcommand ............................. Inserting Data from Another File .............................. Inserting a Whole File .................................... Inserting Part of Another File .............................. Using Special Characters .................................... Summary of XEDIT Subset ................................... 51 52 53 55 57 58 61 61 61 62 62 64 64 64 65 66 67 68 68 69 69 71 72 73 74 78 78 79 80 80 80 80 81 82 82 83 86 89 Chapter 4. Using Targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 What Is a Target? .......................................... 91 Using a Target to Change Which Line Is Current ................. 92 A Target Entered By Itself ................................. 92 A Target as the Operand of a LOCATE Subcommand ............ 95 A Target Preceding a Subcommand .......................... 95 U sing a Target as a Subcommand Operand ...................... 95 Types of Targets ........................................... 98 A Target as an Absolute Line Number ........................ 98 A Target as a Relative Displacement from the Current Line ...... 100 A Target as a Line Name ................................. 102 x VM/SP System Product Editor User's Guide L r r \ r ( [ r l r r r l ~") J J J J ] J ~J A Target as a Simple String Expression ...................... 105 A Target as a Complex String Expression .................... 110 Using Column-Targets ..................................... 114 Chapter 5. Editing Multiple Files . . . . . . . . . . . . . . . . . . . . . . . . . The XEDIT Subcommand ................................... Creating a Ring of Files in Storage ........................... Editing the Files in the Ring ................................ . Ending an Editing Session .................................. Multiple Logical Screens ................................... SET SCREEN Subcommand ............................... Multiple Views of the Same File ............................ Multiple Views of Different Files ........................... Order of Processing ..................................... Cursor Considerations ................................... 117 117 117 118 119 120 120 121 123 123 124 ] Chapter 6. Tailoring the Screen . . . . . . . . . . . . . . . . . . . . . . . . .. 127 ] -1 .-J . __ ., .-J Chapter 7. The Macro Language . . . . . . . . . . . . . . . . . . . . . . . . . What Is an XEDIT Macro? .................................. Creating a Macro File ..................................... Using XEDIT Subcommands in a Macro ........................ Communicating between the Editor and the Interpreter .......... Displaying Data on the Editor's Screen ...................... Saving and Restoring Editing Variables ...................... Issuing CMS and CP Commands ............................ Avoiding Name Conflicts ................................. Walking through an XEDIT Macro ........................... A Profile Macro for Editing ................................. Executing a Profile Macro ................................ Writing a Profile Macro .................................. Writing Prefix Macros ..................................... Creating a Sample Prefix Macro .............................. What Information Is Passed to the Macro? ...................... Current Line Positioning ................................. Creating a Second Prefix Macro .............................. Examining the Source String ................................ Using the Information That Is Passed ......................... Handling Blocks .......................................... Assigning a Synonym for a Prefix Macro ..................... Using the "Pending List" ................................. Examining the Argument String .............................. Positioning the Cursor ..................................... How the Prefix Area Is Decoded .............................. Using the XEDIT Subcommand .............................. Additional Examples ....................................... The L Prefix Macro ....................................... Appendix A. A Summary of XEDIT Subcommands and Macros 137 137 138 138 139 141 143 143 144 145 150 150 150 153 153 153 154 154 154 155 156 156 157 158 160 160 160 161 162 . 163 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Contents Xl xu VM/SP System Product Editor User's Guide J J ] - ) -1 -, ~ ] ] Figures -, -.J J J J J J J ] ~] ] J J ] J J J -, -1 ~ J J J 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. The Screen Layout ...................................... 2 Input Mode - Typing the Data ............................. 6 Input Mode - Continue Typing ............................ 7 Input Mode - Data Entered in the File ...................... 7 Power Typing ......................................... 10 Power Typing - Data Entered in the File .................... 10 Prefix Subcommands A and D - "Before" and "After" .......... 17 RECOVER Subcommand - Replacing Two Lines .............. 18 Prefix Subcommand SI - Adding the First New Line ........... 20 Prefix Subcommand SI - Continuing to Add New Lines ........ 21 Prefix Subcommand SI - "After" .......................... 22 Prefix Subcommands M and F - "Before" and "After" .......... 25 The DOWN Subcommand - "Before" and "After" ............. 28 Using PF5 and PF6 to Make a Selective Change .............. 33 Using the PF4 Key for Tabbing ............................ 38 Inserting a Whole File .................................. 42 Inserting Part of a File - Call Out the Second File ............ 45 Inserting Part of a File - Put Lines to Be Inserted, Then QUIT 46 Inserting Part of a File - GET ............................ 46 Inserting Part of a File - The Lines Are Inserted .............. 47 Using a Target to Move the Line Pointer .................... 94 U sing a Target as a Subcommand Operand ................... 97 A Target as an Absolute Line Number ...................... 99 A Target as a Relative Displacement ...................... 101 A Target as a Line Name ............................... 104 A Target as a Simple String Expression .......... ;......... 109 A Target as a Complex String Expression ................... 113 A Ring of Files in Storage ............................... 118 Editing Files in the Ring ................................ 119 Multiple Horizontal Views of the Same File ................. 122 Multiple Vertical Views of Different Files .................. 125 The SET PREFIX Subcommand - "Before" and "After" ........ 130 The SET CMDLINE Subcommand - "Before" and "After" ...... 131 The SET CURLINE Subcommand - "Before" and "After" ...... 132 The SET SCALE Subcommand - "Before" and "After" ........ 133 The SET TABLINE Subcommand - "Before" and "After" ...... 134 SET MSGLINE on Multiple Lines with Overlay .............. 135 A Sample Macro ...................................... 146 A PROFILE XEDIT Macro .............................. 152 162 A Sample Prefix Macro. J J J ] Figures XUl The VM/SP Library Evaluation Index GENERAL INFORMATION INTRODUCTION GC20-1838 GC19-6200 LIBRARY GUIDE, GLOSSARY, AND MASTER INDEX GC19-6207 Planning Installation PLANNING GUIDE AND REFERENCE RUNNING GUEST OPERATING SYSTEMS DISTIlIBUTED DATA PROCESSING GUIDE RB..EASE 4 GUIDE INSTALLATION GUIDE SYSTEM DEFlNmON ALES SC19-6201 GC19-6212 SC204-52o41 SC24-52048 SC24-5237 SC24-5256 Administration ': Operation Applications SYSTEM PROGRAMMER'S GUIDE GCS GUIDE GCS MACRO REFERENCE OPERATOR'S GUIDE APPLICATION DEVELOPMENT GUIDE SC19-8203 SC204-52o49 SC24-5250 SC19-6202 SC204-52o47 TERMINAL REFERENCE CMS PRIMER CMS PRIMER FOR LlNEORIENTED TERMINALS CMS USER'S GUIDE GC19-6206 SC24-5236 SC24-5242 SC19-6210 CMS COMMAND AND MACRO REFERENCE SP EDITOR USER'S GUIDE SP EDITOR COMMAND AND MACRO REFERENCE CP COMMAND REFERENCE SC19-6209 SC24-5220 SC24-5221 SC19-6211 SP INTERPRETER USER'S GUIDE SP INTERPRETER REFERENCE EXEC 2 REFERENCE SC204-5238 SC204-5239 SC204-6219 l. End Use Reference Summaries To order all the Reference Summaries, use order number SeOF 3221 ------------------------------------------------------II I I II QUICK REFERENCE I I I ~~~ I I I I I I I I 1______ -----------------------------------------------_ XIV VM/SP System Product Editor User's Guide J J ] ] ] J J J -1 ~ ] J ] J J J J ] J Figures J xv l. r L r L r l. r l XVI VM/SP System Product Editor User's Guide r J ] -] J J ] ] J -1 -.J ] This chapter is written primarily for the person who has limited data processing experience; however, some Virtual Machine/System Product (VM/SP) CMS experience is assumed. For example, you must know how to log on to VM/SP and enter the CMS environment. You should also be familiar with the concept of a CMS file. ] ] ---1 ] When you finish this chapter, you should have a working knowledge of the editor. The subcommands presented here comprise a subset of XEDIT subcommands, with which you can create a file, enter data, manipulate the screen, make changes to the file, and transfer data between files. J The editor has many additional capabilities, which are described in the rest of this book and in the publication VM/ SP System Product Editor Command and Macro Reference. ] This subset has been selected for text processing on a display terminal used in full-screen mode. (If you have a typewriter terminal, refer to Chapter 3.) ~ J J Editing a File J To edit a file means to make changes, additions, or deletions to a CMS file that is on a disk, and to make these changes interactively: you instruct the editor to make a change, the editor makes it, and then you request another change. J ] You can edit a file that does not exist; when you do so, you are creating a file. J ~] J J -] XEDIT Command After you log on to VM/SP and enter the CMS environment, you are ready to enter the edit environment and begin creating a file. The editor is invoked with the CMS command XEDIT, whose format is as follows: XEDIT filename filetype ] In Figure 1, the editor was invoked with the following command: J ] ] Chapter 1. An XEDIT Subset: Full-Screen Text Processing 1 XEDIT INVENTOR SCRIPT Before we see how to enter data in the file, let's look at the screen layout illustrated in Figure 1.1 Screen Layout INVENTOR SCRIPT Al V 132 Trunc=132 Size=O Line=O Col=l Alt=O Creating new file:~ ~ MESSAGE LINE 1 FILE IDENTIFICATION LINE FILE AREA PREFIX AREA l. ~AREA ====> INPUT Figure 1. ----0 COMMAND LINE XED I T 1 File The Screen Layout l. File Identification Line The first line on the screen identifies the file being edited. The following information is displayed: If your screen layout differs from Figure 1, or some of the commands or PF keys work differently than this guide says they will, you may have a PROFILE XEDIT macro tailoring your editing session. To keep the PROFILE XEDIT macro from executing, add the NOPROFILE option: . XEDIT filename filetype (NOPROFILE See "A Profile Macro for Editing" on page 150 for more information on the PROFILE XEDIT macro. If these problems continue while using NOPROFILE, be sure this guide was written for your system's release level of VM/SP. See the front cover of this guide for its release level and use QUERY CMSLEVEL (see "QUERY" in the VM/SP eMS Command and Macro Reference) to find the release level of your system's VM/SP. If they are different, use the guide that matches your system's VM/SP release level. 2 VM/SP System Product Editor User's Guide l. rI. a. filename, filetype, filemode If you do not specify a filemode, the editor assigns a filemode of "AI," which means that the file is to become part of a file collection called your "A-disk". h. record format and record length The record format and record length (V 132) shown in the example mean that iri this file, the length of a line can vary and the file will hold lines up to 132 characters long. Therefore, a file line can be longer than a screen line. c. truncation column (Trunc =) Notice that the truncation column is the same as the record length (132). Since a file line can be only 132 characters long, any data that is entered beyond 132 characters (in total) may be truncated. d. current number of lines in the file (Size =) (Since we have not yet entered data in the file, the number of lines is zero.) e. file line number of the current line (Line =) (See number 7, below.) f. position of the column pointer (Col =) (See number 8, below.) g. alteration count (Alt =) The alteration count is the number of alterations that have been made to the file since the last AUTOSA VE (which is explained later in this chapter). J J ] -=-J J =J J ] ® ® --] -] Message Line The editor communicates with you by displaying messages on the second and third lines of the screen. These messages tell you if you have made an error, or they provide information. In Figure 1, the message line shows that you are creating a new file. Command Line The large arrow (= = = = » at the bottom of the screen points to the command input area. One of the ways you communicate with the editor is by entering XEDIT subcommands on this line. Subcommands can be typed in either uppercase or lowercase, or a combination of both, and many can be abbreviated. For example, "INPUT," "Input," and "i" are all valid ways to type the INPUT subcommand. After typing a subcommand on the command line, you must press the ENTER key to execute the subcommand. Figure 1 shows the subcommand "INPUT" typed in the command line. (To move the cursor from any place on the screen to the command line, just press the ENTER key or PF12). Chapter 1. An XEDIT Subset: Full-Screen Text Processing 3 @ ® Status Area The lower right corner displays the current status of your editing session, for example, edit mode or input mode, and the number of files you are editing. The status area in Figure 2 shows that one file is being edited. Prefix Area The prefix area is the five left-most columns on the screen and displays five equal signs (= = = = =). Each line in the file has a prefix area associated with it. You can perform various editing tasks, like deleting a line, by entering short commands, ·called "prefix subcommands," in the prefix area of any line. @ File Area The rest of the screen is available to display the file. You can make changes to the file by moving the cursor under any line and typing over the characters, or by using special keys to insert or delete characters. You can make as many changes as you want on the displayed lines before pressing the ENTER key. When you press the ENTER key, the corresponding changes are made to the copy of the file that is kept in virtual storage. At the end of the editing session, a FILE subcommand will permanently record those changes on the copy of the file that resides on disk. l. Since a file may be too long to fit on one screen, various subcommands are used to scroll the screen so that you can move forward and backward in a file. ® The Current Line The current line is the file line in the middle of the screen (above the scale). It appears brighter than the other file lines; we say it is "highligh ted." In Figure 2, the current line is the "Top of File" line; at this point, the file contains no data. The current line is an important concept, because most subcommands perform their functions starting with the current line. Naturally, the line that is current changes during an editing session as you scroll the screen, move up and down, and so forth. When the current line changes, we say that the line pointer (not visible on the screen) has moved. Many XEDIT subcommands perform their functions starting with the current line, and move the line pointer when they are finished. ® 4 Scale The scale appears under the current line to assist you in editing. It's like the margin scale on a typewriter. VMjSP System Product Editor User's Guide '. / J ~J ] r--- --:-.-.. -.--- -.---.--.--.. . .-.. -..-------.---.. -------.---.-.. ---.------- ] The vertical bar (I) that appears in column one on the scale is the . column pointer. Various subcommands perform their functions within a line starting at the column pointer, which you can move to different positions on the scale by using XEDIT subcommands that will be discussed later. The column under which the column pointer is positioned is called the current column. J ] ] J J J Entering Data After you enter the XEDIT command, you are in edit mode. You must be in edit mode to enter XEDIT subcommands. J You can enter data into the file using input mode or power typing mode, which are discussed in the following sections. J J J J INPUT Subcommand To enter input mode, type the following subcommand in the command line and press the ENTER key: --J ====> INPUT J You can then type in your data in the input zone, which is the bottom half of the screen (between the scale and the command line). ~J J _J J J ] J Figure 2 through Figure 4 is the same file, INVENTOR SCRIPT, that is shown in Figure 1. However, the INPUT subcommand has been entered and the lines of data have been typed on the screen. Notice how the screen changes in input mode: the prefix areas (= = = = =) disappear; the message line and status area tell you that you are in input mode; the command line contains the phrase "Input Zone," which marks the end of the input zone and reminds you that you cannot enter subcommands in input mode. In Figure 2, the entire input zone has been filled. To stay in input mode and type more data, press the ENTER key once. The lines that you typed move to the top half of the screen, with the last line you typed becoming the new current line. The input zone is available to type more data, as shown in Figure 3. _J ~J -] ~ J J J ~J Chapter 1. An XEDIT Subset: Full-Screen Text Processing 5 INVENTOR SCRIPT Input mode: A1 V 132 Trunc=132 Size=9 Line=O Col=l Alt=O * * * Top of File * * * I ••• + .... 1 •... + .... 2 ...• + .... 3 .. '.• + .... 4 •... + .... 5 ...• + .... 6 .••• + .... 7 .... + .... THE ELECTRONIC COMPUTER (1946) THE WORLD'S FIRST ELECTRONIC COMPUTER WAS CALLED ENIAC, ELECTRONIC NUMERICAL INTEGRATOR AND COMPUTER. IT WAS BUILT BY A GROUP OF RESEARCHERS LED BY AMERICAN PHYSICIST JOHN MAUCHLY AT THE UNIVERSITY OF PENNSYLVANIA. UNLIKE EARLIER COMPUTERS, THIS ONE RAN ON RADIO TUBES - 18,000 OF THEM IN TOTAL. IT FILLED A ROOM 30 FEET BY 50 FEET AND COST $400,000. ====> * * * Input Zone * * * Input-mode 1 File Figure 2. Input Mode - Typing the Data If you have no more data to type, pressing the ENTER key again takes you out of input mode and back into edit mode. Figure 4 shows how the data looks in the file, after the ENTER key has been pressed twice. The display is restored to the edit mode screen layout described in Figure 1, and the file contains the data. During an editing session, you can enter input mode at any time to insert new lines of data in the file. As you have seen, after the INPUT subcommand is eritered, the editor makes room for you to type new lines of data after the current line. In this example, since the file was new and the INPUT subcommand was the first subcommand entered, the Top of File line was the current line. Later, you will see how to make any line current, so that you can use input mode to insert lines between any two existing lines in the file. 6 VM/SP System Product Editor User's Guide L ,] 11 ] -] ] J INVENTOR SCRIPT A1 V 132 Trunc=132 Size=18 Line=9 Col=l Alt=g ] * * * Top of File * * * THE ELECTRONIC COMPUTER (1946) ] THE WORLD'S FIRST ELECTRONIC COMPUTER WAS CALLED ENIAC, ELECTRONIC NUMERICAL INTEGRATOR AND COMPUTER. IT WAS BUILT BY A GROUP OF RESEARCHERS LED BY AMERICAN PHYSICIST JOHN MAUCHLY AT THE UNIVERSITY OF PENNSYLVANIA. UNLIKE EARLIER COMPUTERS, THIS ONE RAN ON RADIO TUBES - 18,000 OF THEM IN TOTAL. IT FILLED A ROOM 30 FEET BY 50 FEET AND COST $400,000. I ••• + .... 1 .••• + .... 2 ...• + .... 3 ...• + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 .... + .... USING TEN-DIGIT NUMBERS, IT COULD DO 5,000 ADDITIONS A SECOND. 'J J -OJ ~J J ~J ====> * * * Input Zone * * * Input-mode 1 File ""] J Figure 3. Input Mode - Continue Typing .J J INVENTOR SCRIPT A1 V 132 Trunc=132 Size=10 Line=10 Col=l Alt=10 XEDIT: THE ELECTRONIC COMPUTER (1946) .sp THE WORLD'S FIRST ELECTRONIC COMPUTER WAS CALLED ENIAC, ELECTRONIC NUMERICAL INTEGRATOR AND COMPUTER. IT WAS BUILT BY A GROUP OF RESEARCHERS LED BY AMERICAN PHYSICIST JOHN MAUCHLY AT THE UNIVERSITY OF PENNSYLVANIA. UNLIKE EARLIER COMPUTERS, THIS ONE RAN ON RADIO TUBES - 18,000 OF THEM IN TOTAL. IT FILLED A ROOM 30 FEET BY 50 FEET AND COST $400,000. USING TEN-DIGIT NUMBERS, IT COULD DO 5,000 ADDITIONS A SECOND. I ••• + .... 1 .... + .... 2 .... + .... 3 .... + .... 4 ...• + .... 5 .... + .... 6 .... + .... 7 ... * * * End of File * * * .J ~ ~J ~ ~J J =J =l ====> XED I T ~J ~J Figure 4. 1 File Input Mode - Data Entered in the File ~ :J _J -.J '-J "- Chapter 1. An XEDIT Subset: Full-Screen Text Processing 7 ~~----------------------------------------------------------------------------------~ POWERINP Subcommand The easiest way to enter a large amount of text, like one long paragraph, is by using "power typing." To use power typing, enter the following subcommand: ====> POWER [ The advantage of using power typing is that you can enter data as if the screen were one long line. You do not have to be concerned with line length or word length - you can start typing a word on one line of the screen and finish it on the next. In fact, if you're a skilled typist, you don't even have to look at the screen. When you reach the end of a line, the editor automatically "wraps around" to the beginning of the next line. You can type continuously until the screen is filled. If you fill up a screen and want to continue typing in power typing mode, press the ENTER key once. The last line you typed is displayed at the top of the screen; the rest of the screen is blank and you can continue typing. When you are finished typing, press the ENTER key twice to exit from power typing and reenter edit mode. The editor automatically divides the data into appropriate screen lines and reconstructs any split words. During an editing session, you can use power typing at any time by entering the POWERINP subcommand. The data entered using power typing is inserted after the current line, as it if} when you use the INPUT subcommand. Causing A Break In the Data If you want to cause a break in the data that you type in power typing mode, that is, you want data to start on a new line (for example, a new paragraph or SCRIPT/VS control words, which must start in column one), you can type a line end character before the data that you want to start on a new line. The default line end character is a pound sign (#). For example, if the following data is typed in power typing mode: .sp#A pound sign causes the data to start on a new line.#.sp The data will be entered in the file as: .sp A pound sign causes the data to start on a new line . . sp 8 VM/SP System Product Editor User's Guide J J ] J J J J J ] ] ] ] ] J ] J ] ] ] J ] Inserting Characters If you want to insert characters or spaces in a line while you are in power typing mode, you can use the insert mode key. When characters are inserted, the entire stream of data shifts to the right; it's like inserting a box car in a train. Remember to press the RESET key when you are finished inserting characters. An Example of Power Typing Figure 5 illustrates the same file, INVENTOR SCRIPT, but the data was typed in power typing mode, after the POWERINP subcommand was entered. The screen changes in several ways in power typing mode: the prefix and status areas disappear; the line that was current when the POWERINP subcommand was entered moves to the top of the screen, and the rest of the screen is available for typing data. Notice how a word can start at the end of a line and finish on the next. The entire screen can be filled with data, but it doesn't have to be. Notice the pound signs (#) in the eighth line (from the top of the screen). A pound sign causes the data that follows it to begin on a new line when it is entered into the file. The pound sign itself is not entered in the file. Figure 6 shows how the screen looks after the ENTER key was pressed twice. The screen layout is restored, and the words and lines are reconstructed. After you press the ENTER key twice, the lines you typed are entered and the pound sign line separator is interpreted. Any data that was preceded by a pound sign begins on a new line. The last line entered becomes the current line. In order to display the entire file on your screen, change the current line to a point above the End of File line by placing a slash (/) in the prefix area and pressing the ENTER key. Figure 6 was produced by placing a slash in the prefix area of the line beginning, "DOING EXPERIMENTS WITH ... " and pressing the ENTER key. ] ] ] ] ] J ~ J J J ~ Chapter 1. An XEDIT Subset: Full-Screen Text Processing 9 INVENTOR SCRIPT Al * * * Power T y p i n g * * * Alt=O * * * Top of File * * * THE WORLD'S FIRST ELECTRONIC COMPUTER WAS CALLED ENIAC, ELECTRONIC NUMERICAL INT EGRATOR AND COMPUTER. IT WAS BUILT BY A GROUP OF RESEARCHERS LED BY AMERICAN PH YSICIST JOHN MAUCHLY AT THE UNIVERSITY OF PENNSYLVANIA. UNLIKE EARLIER COMPUTER S, IT RAN ON RADIO TUBES - 18,000 OF THEM IN TOTAL. IT FILLED A ROOM 30 FEET BY 50 FEET AND COST $400,000. USING TEN-DIGIT NUMBERS, IT COULD DO 5,000 ADDITION S A SECOND.#.sp#A GERMAN PHYSICIST, ROENTGEN, DISCOVERED THE XRAY BY ACCIDENT. HE WAS DOING EXPERIMENTS WITH A CROOKES TUBE, WHICH PRODUCED STREAMS OF ELECTRON S CALLED CATHODE RAYS. ONE DAY HE LEFT AN ACTIVATED CROOKES TUBE ON A BOOK BEFO RE LEAVING THE LABORATORY. HE DID NOT REALIZE THAT A KEY AND SOME PHOTOGRAPHIC FILM WERE SANDWICHED IN THE BOOK. LATER, WHEN HE DEVELOPED THE FILM, HE SAW THE IMAGE OF THE KEY. THUS WAS THE FIRST XRAY ACCIDENTALLY TAKEN. [- [r l l t l l [[ Figure 5. Power Typing t' l [0 INVENTOR SCRIPT A1 V 132 Trunc=132 Size=14 Line=9 Col=l Alt=15 [- THE WORLD'S FIRST ELECTRONIC COMPUTER WAS CALLED ENIAC, ELECTRONIC NUMERICAL INTEGRATOR AND COMPUTER. IT WAS BUILT BY AMERICAN PHYSICIST JOHN MAUCHLY AT THE UNIVERSITY OF PENNSYLVANIA. UNLIKE EARLIER COMPUTERS, IT RAN ON RADIO TUBES - 18,000 OF THEM IN TOTAL. IT FILLED A ROOM 30 FEET BY 50 FEET AND COST $400,000. USING TEN-DIGIT NUMBERS, IT ----- COULD DO 5,000 ADDITIONS A SECOND . . sp A GERMAN PHYSICIST, ROENTGEN, DISCOVERED THE XRAY BY ACCIDENT. HE WAS DOING EXPERIMENTS WITH A CROOKES TUBE, WHICH PRODUCED STREAMS OF 1 ••• ~ [_ 0 [: l-' + ••.. 1 ..•. + ••.• 2 .... + ...• 3 .... + •.•• 4 ••.. + •••• 5 .•.• + •• · •• 6 •..• + •••• 7 •.• [" ELECTRONS CALLED CATHODE RAYS. ONE DAY HE LEFT AN ACTIVATED CROOKES TUBE ON A BOOK BEFORE LEAVING THE LABORATORY. HE DID NOT REALIZE THAT A KEY AND SOME PHOTOGRAPHIC FILM WERE SANDWICHED IN THE BOOK. LATER, WHEN HE DEVELOPED THE FILM, HE SAW THE IMAGE OF THE KEY. THUS WAS THE FIRST XRAY ACCIDENTALLY TAKEN. * * * End of File * * * l [ r ====> XED I T Figure 6. . 1 File l Power Typing - Data Entered in the File l !/ l l 10 VM/SP System Product Editor User's Guide l. [ J ] J J Using Program Function (PF) Keys ] J ] Each PF key is set to an XEDIT subcommand, which is executed when the key is pressed. Using the PF key saves you the time it takes to type that subcommand on the command line and press the ENTER key. ] You can use the following subcommand to display the PF key settings: J ====> J The following subcommands are initially assigned to the PF keys: J PFI PF2 PF3 PF4 PF5 PF6 PF7 PF8 PF9 PFIO PFll PF12 ] J J :] J QUERY PF BEFORE HELP MENU BEFORE SOS LINEADD BEFORE QUIT BEFORE TABKEY BEFORESCHANGE6 ONLY? BEFORE BACKWARD BEFORE FORWARD ONLY = BEFORE RGTLEFT BEFORE SPLTJOIN BEFORE CURSOR HOME ] ~ These are the subcommands that the editor assigns to the PF keys. For information on the "BEFORE" and "ONLY" operands shown above, see the SET PF subcommand in the VM/ SP System Product Editor Command and Macro Reference. =-J If you would rather have a different subcommand assigned to one (or more) ~ of the PF keys, you can use the SET PF subcommand, whose format is as follows: ~] ~ ====> =:J where "n" is a PF key number, and "subcommand" is any XEDIT subcommand. ~ For example: ~ ====> ~ When you assign a subcommand to a PF key, the setting remains in effect only for the current editing session. In the next editing session, the initial settings shown above are in effect. .~ :J =:J .J SET PFl INPUT assigns the INPUT subcommand to the PFI key. Pressing the PFI key would immediately place you in input mode. ~ ~ SET PFn subcommand " The following sections show how to use some of the PF keys (initial settings). Others will be discussed where appropriate. Chapter 1. An XEDIT Subset: Full-Screen Text Processing 11 Splitting and Joining Lines The PFll key enables you to split a line or join two lines, at the cursor position. If the cursor is positioned before (or at) the last character in a line, the line is split. If the cursor is positioned after the data, the next line is joined to it. Splitting a Line (PF11) ,- To split a line in two, simply move the cursor under the character where you want the line to be split, and press the PFll key. l In the following line, note the position of the cursor, under the "F" in "FOOD". ===== GILA MONSTERS HOLD RESERVE EOOD SUPPLIES IN THEIR TAILS. Pressing the PFll key produces the following lines: GILA MONSTERS HOLD RESERVE FOOD SUPPLIES IN THEIR TAILS. The PFll key is particularly useful if you want to add information to a line. In the following line, the cursor is placed under the "I" in "IN": ===== BIRD SPECIES HAVE DWINDLED ~N THE LAST 70 MILLION YEARS. When the PFll key is pressed, the line is split in two: BIRD SPECIES HAVE DWINDLED ===== IN THE LAST 70 MILLION YEARS. Now there's room to add information on the line: BIRD SPECIES HAVE DWINDLED FROM 1.5 MILLION TO 10,000_ IN THE LAST 70 MILLION YEARS. Joining Two Lines (PF11) Pressing the PFll key joins two lines at the cursor position, when the cursor is positioned after the end of the data in a line. For example: These lines are too short. Note the cursor position above, after the end of the data. Pressing the PFll key produces the following line: ===== These lines are ~oo short. The PFll key also takes care of leading blanks when a line is split or joined. 12 VM/SP System Product Editor User's Guide l J ] ] J For example: J Things get worse gnder pressure. J When the line is split, the second line lines up under the first: ] Things get worse under pressure. J The same is true when lines are joined: ] Join these lines without leading blanks. J J J The leading blanks are removed: Join these lines without leading blanks. J Scrolling Backward and Forward J When a file is too long to fit on one screen, you can use the PF7 and PF8 keys to scroll back and forth through the file. ] Pressing the PF7 key, which is set to the BACKWARD subcommand, scrolls the screen backward, toward the top of the file, for one screen display. J J Conversely, pressing the PF8 key, which is set to the FORWARD subcommand, scrolls the screen forward, toward the end of the file, for one screen display. :J ~ You can press either key repeatedly to scroll back or forth for as many screens as you wish. J ~ Redisplaying a Subcommand J After a subcommand that has been typed in the command line is executed, the command line is cleared. Sometimes, you'd like to be able to see the last subcommand that was executed. Perhaps you didn't enter a subcommand the way you intended to. ~ ~ Pressing the PF6 key (which is set to the? subcommand) displays, in the command line, the last subcommand that was executed (from the command line). =.J =:J You can then reexecute the subcommand simply by pressing the ENTER key. If the subcommand was entered incorrectly, you can correct the error by typing over the subcommand displayed in the command line and then pressing the ENTER key. ~ ~ ~ =:J ~ .J " Chapter 1. An XEDIT Subset: Full-Screen Text Processing 13 Reexecuting a Subcommand Use the PF9 key, which is set to the = subcommand, to reexecute the last subcommand entered. The subcommand does not appear in the command line, as it does when the PF6 key (which is set to the? subcommand) is used. Each time the PF9 key is pressed, the subcommand is executed, thereby saving you the time it takes to retype the subcommand. Inserting Words in a Line Using the Insert Mode Key and a NULL Key (PA2) One way to insert letters, spaces, or words in a line is by pressing the P A2 key (or its equivalent) and then by using the insert mode key. The PA2 key is initially set to NULLKEY. For information about how to change the initial P A key settings (SET PAn), please refer to the VM/ SP System Product Editor Command and Macro Reference. The P A2 key replaces blank spaces at the end of a line with null characters; it "makes room" for the characters in the line to be shifted over so that new ones can be inserted. The P A2 key operates on only one line at a time; if you move the cursor to another line and want to use insert mode, you must press the P A2 key again. Remember to press the RESET key when you are finished using insert mode. This method may be used in both input mode and edit mode, but not in power typing mode. Using the SET NULLS Subcommand [ If you have insertions to make on many lines, you can issue the following subcommand: [- ====> [- SET NULLS ON Then, you can use the insert mode key without pressing the PA2 key for each line. When you are finished inserting words, issue the following subcommand: l ====> L l- r SET NULLS OFF (In power typing mode, you can use the insert mode key without issuing a SET NULLS ON subcommand and without pressing the PA2 key.) / L 14 VM/SP System Product Editor User's Guide . Using Prefix Subcommands Prefix subcommands are one- or two-character commands used to perform basic editing tasks on a particular line. The following prefix subcomrriands are described in this section: A (add) D (delete) 81 (structured input) (duplicate) M (move) C (copy) F (following) P (preceding) / (set current line) II Prefix sub commands are entered by typing over any position of the five-character prefix area on one or more lines. When the ENTER key is pressed, all of the prefix sub commands that have been typed on the screen are executed. Adding and Deleting Lines A Prefix Subcommand To add a line, type the single character "A" in the prefix area. When the ENTER key is pressed, a blank line is inserted immediately following the line containing the "A". A number may precede or follow the "A" to indicate that more than one line is to be added. For example, "A5" causes five blank lines to be added. The following are valid ways to type the A prefix subcommand: ====A a==== lOa== ===A5 Adds Adds Adds Adds one blank line after this line. one blank line after this line. ten blank lines after this line. five blank lines after this line. Information may then be typed in the added lines. If no information is typed, the blank lines remain in the file throughout the editing session and after the file is written to disk. Chapter 1. An XEDIT Subset: Full-Screen Text Processing 15 D Prefix Subcommand To delete a line, enter the single character "D" in the prefix area of a line. A number may precede or follow the "D" to indicate that more than one line is to be deleted. To delete a group of consecutive lines, that is, a block of lines, you can enter the double character "DD" in the prefix area of both the first and last lines to be deleted. This method makes it unnecessary for you to count the number of lines to be deleted. For example: r ==dd= This This This This ===dd This is is is is is the the the the the first line I want to remove. second. third. fourth. fifth. l When the ENTER key is pressed, the above lines are deleted. The first and last lines of the block need not be on .the same screen; you may scroll the screen before entering the second "DD". When one "DD" has been typed and the ENTER key pressed, the status area of the screen displays DD pending.... You can use the PF7 or PF8 keys to scroll the screen until you find the last line of the block, and then type "DD" in its prefix area. When the ENTER key is pressed, the entire block of lines is deleted. I I Figure 7 is a before-and-after example of the A and D prefix subcommands. r L r l. 16 VM/SP System Product Editor User's Guide J J J J ] ANIMALS FACTS Al F 80 Trunc=80 Size=14 Line=9 Col=1 Alt=O * * * Top of File * * * D==== THE HIPPOPOTAMUS IS DISTANTLY RELATED TO THE PIG. ELEPHANT TUSKS CAN WEIGH MORE THAN 300 POUNDS. LAND CRABS FOUND IN CUBA CAN RUN FASTER THAN A DEER. ELECTRIC EELS CAN DISCHARGE BURSTS OF 625 VOLTS, =2a== 40 TIMES A SECOND. THE ANCIENT ROMANS AND GREEKS BELIEVED THAT BEDBUGS HAD MEDICINAL PROPERTIES WHEN TAKEN IN A DRAFT OF WATER OR WINE. ==DD= STURGEON IS THE LARGEST FRESHWATER FISH AND CAN WEIGH 2250 POUNDS. ANTS ARE EQUIPPED WITH FIVE DIFFERENT NOSES. EACH ONE IS DESIGNED TO I ••• + .... 1 •.•. + .... 2 •..• + .... 3 .... + .... 4 .••. + .... 5 .... + .... 6 . . . . + .... 7 ... =DD== ACCOMPLISH A DIFFERENT TASK. ==A== ALL OSTRICHES ARE POLYGAMOUS. SNAKES LAY EGGS WITH NONBRITTLE SHELLS. THE PLATYPUS HAS A DUCK BILL, OTTER FUR, WEBBED FEET, LAYS EGGS, AND EATS ITS OWN WEIGHT IN WORMS EVERY DAY. * * * End of File * * * J ] ] ] J J ] J J J J ====> XED I T ANIMALS J FACTS Al F 80 1 File Trunc=80 Size=13 Line=9 Col=l Alt=l * * * Top of File * * * ELEPHANT TUSKS CAN WEIGH MORE THAN 300 POUNDS. LAND CRABS FOUND IN CUBA CAN RUN FASTER THAN A DEER. ELECTRIC EELS CAN DISCHARGE BURSTS OF 625 VOLTS, 40 TIMES A SECOND. J ~ J THE ANCIENT ROMANS AND GREEKS BELIEVED THAT BEDBUGS HAD MEDICINAL PROPERTIES WHEN TAKEN IN A DRAFT OF WATER OR WINE. ALL OSTRICHES ARE POLYGAMOUS. I ••• + .... 1 •.•. + .... 2 ..•. + .... 3 . . . . + .... 4 •... + .... 5 . . . . + .... 6 . . . . + .... 7 ... ~ SNAKES LAY EGGS WITH NONBRITTLE SHELLS. THE PLATYPUS HAS A DUCK BILL, OTTER FUR, WEBBED FEET, LAYS EGGS, AND EATS ITS OWN WEIGHT IN WORMS EVERY DAY. * * * End of File * * * ~ ~ =:J =:J ====> ~ Figure 7. XED I T 1 File Prefix Subcommands A and D - "Before" and "After" ~ =.J ~ =.J :=J .J \',Chapter 1. An XEDIT Subset: Full-Screen Text Processing 17 Lost and Found Department If you delete one or more lines, you can recover them at any time during an editing session by using the RECOVER subcommand. The following subcommand returns lines deleted in an editing session: ====> RECOVER n where "n" represents the number of lines you wish to recover. Recovered lines. are inserted starting at the current line. The last lines deleted are the first lines recovered. If the lines were deleted from different places in the file; you'll have to put them back where they belong (by using the M prefix subcommand, discussed below.) If you want to recover all lines that were deleted during an editing session, use the form: ====> RECOVER * In the previous example of the A and D prefix subcommands, four lines were deleted. Entering, [ RECOVER 2 results in: ANIMALS FACTS Al F 80 Trunc=80 Size=15 Line=9 Col=l Alt=2 2 line(s) recovered. * * * Top of File * * * ELEPHANT TUSKS CAN WEIGH MORE THAN 300 POUNDS. LAND CRABS FOUND IN CUBA CAN RUN FASTER THAN A DEER. ELECTRIC EELS CAN DISCHARGE BURSTS OF 625 VOLTS, 40 TIMES A SECOND. THE ANCIENT ROMANS AND GREEKS BELIEVED. THAT BEDBUGS HAD MEDICINAL PROPERTIES WHEN TAKEN IN A DRAFT OF WATER OR WINE. ANTS ARE EQUIPPED WITH FIVE DIFFERENT NOSES. EACH ONE IS DESIGNED TO , ... + ...• 1 .•.. + .... 2 .... + ..•. 3 ...• + .... 4 •.•. + .... 5 ..•• + .... 6 ..•• + .... 7 ••. ACCOMPLISH A DIFFERENT TASK. ALL OSTRICHES ARE POLYGAMOUS. SNAKES LAY EGGS WITH NONBRITTLE SHELLS. THE PLATYPUS HAS A DUCK BILL, OTTER FUR, WEBBED FEET, LAYS EGGS, AND EATS ITS OWN WEIGHT IN WORMS EVERY DAY. * * * End of File * * * ====> Figure 8. 18 XED I T RECOVER Subcommand - Replacing Two Lines VM/SP System Product Editor User's Guide 1 File [ J J J SI Prefix Subcommand ] J J J To continuously add lines of indented text, type the characters "81" in the prefix area. When the ENTER key is pressed, a line is added immediately following the line that contains "81." The cursor is positioned at the same column where the text on the previous line begins, making it easier for you to enter indented text. Figure 9 shows how the first new line is added. J ] J J ~ J ~ =.J Chapter 1. An XEDIT Subset: Full-Screen Text Processing 19 The prefix subcommand "81" is typed in the prefix area. CHOCOLAT COOKIES Al F 80 Trunc=80 Size=6 Line=6 Col=1 Alt=O * * * Top of File * * * Chocolate-Nut Cookie Ingredients ----SI=== 1/2 Pound of butter 1 1/2 Cups of graham cracker crumbs 3 1/2 Ounces coconut flakes 2 Ounces chopped nuts I ••• + .... 1 . . . . + .... 2 .... + .... 3 .... + .... 4 •.•. + .... 5 .... + .... 6 . . . . + .... 7 ••. * * * End of File * * * [ l ====> XED I T 1 File r I. 1 When ENTER is pressed a new line is added. CHOCOLAT COOKIES Al F 80 Trunc=80 Size=7 Line=6 Col=1 Alt=O L . * * * Top of File * * * Chocolate-Nut Cookie Ingredients 1/2 1 1/2 Pound of butter Cups of graham cracker crumbs 3 Ounces coconut flakes 1/2 I ••• + .... 1 .... + .... 2 . . . . + .... 3 .•.. + .... 4 ...• + .... 5 •.•• + .•.. 6 •••. + .... 7 •.. 2 Ounces chopped nuts * * * End of File * * * l ====> I Figure 9. l pending ... Prefix Subcommand SI - Adding the First New Line r / l 20 VM/SP System Product Editor User's Guide l l -"' -.J ] -, -1 J Text is entered on the new line. J J CHOCOLAT COOKIES A1 F 80 Trunc=80 Size=7 Line=6 Col=l Alt=l ] * * * Top of File * * * Chocolate-Nut Cookie Ingredients ] 1/2 Pound of butter 1 1/2 Cups of graham cracker crumbs 8 Ounces sweetened condensed milk_ 3 1/2 Ounces coconut flakes I ••• + .... 1 . . . . + .... 2 . . . . + .... 3 . . . . + .... 4 .... + .... 5 . . . . + .... 6 . . . . + .... 7 ... 2 Ounces chopped nuts * * * End of File * * * --1 ---1 J ] J J -,_J ====> I J pending ... J When ENTER is pressed, a new line is automatically added following the one you just typed on. Each time that you type on the new line and press the ENTER key, another new line will be added. =J ~] J CHOCOLAT COOKIES A1 F 80 Trunc=80 Size=8 Line=6 Col=l Alt=l J :J * * * Top of File * * * Chocolate-Nut Cookie Ingredients :J 1/2 1 1/2 ~ 8 Pound of butter Cups of graham cracker crumbs Ounces sweetened condensed milk + .... 1:- ..• + .... 2 ..•. + .... 3 .... + .... 4 .••. + .... 5 .... + .... 6 .... + .... 7 ... 3 1/2 Ounces coconut flakes 2 Ounces chopped nuts * * * End of File * * * 1 ••• ~ ~ ~ ~ ====> ~ ~ ~ ~ ~ I ( ',,-- Figure lOa pending ... Prefix Subcommand SI - Continuing to Add New Lines Chapter 1. An XEDIT Subset: Full-Screen Text Processing 21 I'· If you do not want to add more lines, then press the ENTER key one more time without typing anything on the new line. CHOCOLAT COOKIES A1 F 80 Trunc=80 Size=7 Line=6 Col=l Alt=l r L * * * Top of File * * * Chocolate-Nut Cookie Ingredients 1/2 1 1/2 Pound of butter Cups of graham cracker crumbs ~ Ounces sweetened condensed milk 3 1/2 Ounces coconut flakes , ... + .... 1 .... + .... 2 .... + .... 3 .... + .... 4 . . . . + .... 5 .... + .... 6 . . . . + .... 7 ... 2 Ounces chopped nuts * * * End of File * * * ~- L lr- l ====> XED I T Figure 11. 1 File Prefix Subcommand SI - "After" To add a blank line in a file while using 81, make at least one change on the line that contains ". . . . .". (Pressing the spacebar once will change the line.) Merely moving the cursor using the cursor position keys over a line does not change the line. You can leave the line you are adding and make corrections elsewhere in the file if you type something on the new line first. When you press the ENTER key while the cursor is away from the new line, another new line is added following the last line that was added. 81 will only be canceled if you press ENTER and no text has been typed on the new line. Duplicating Lines To duplicate a line, enter the character of a line. A number may precede or follow the time. II II (double quote) in the prefix area to duplicate the line more than one For example: =3"== I want three more copies of this line. ===== Oh, yeah? r When the ENTER key is pressed, the file looks like this: ,I 22 VM/SP System Product Editor User's Guide l J r r r r want three want three want three want three Oh, yeah? more more more more copies copies copies copies of of of of thi's this this this line. line. line. line. To duplicate a block of lines either one time or a specified number of times, you can type (two double quotes) in the first and last lines of the block. (for example, 5 to duplicate A number can precede or follow the first the block more than one time. 1111 II II II " ) When one has been typed and the ENTER key pressed, the status area of the screen displays '""' pending .... This allows you to scroll the screen before completing the block and pressing the ENTER key. II II Moving and Copying Lines To move one line, enter the single character "M" in the prefix area of the line to be moved. You must indicate its destination by entering either the character "F" (following) or "P" (preceding) in the prefix area of another line. When the ENTER key is pressed, the line containing the "M" is removed from its original location and is inserted in one of the following: • immediately following the line containing the "F" • immediately preceding the line containing the "P." A number may precede or follow the "M" to indicate that more than one line is to be moved, for example, "5M" or "M5" in the prefix area. The line to be moved and the destination line can be on different screens. When either an "M" or "F" (or "P") has been entered, the status area of the screen displays a pending notice. This pending status allows you to scroll the screen before entering the other prefix subcommand. To move a block of lines, enter the double character "MM" in the prefix area of both the first and last lines to be moved. The first and last lines to be moved, and the destination line may all be on different screens. You can use PF keys to scroll the screen before pressing the ENTER key. The procedure for copying lines is the same as for moving lines, except that a "C" or "CC" prefix subcommand is used instead of "M" or "MM". The copy operation leaves the originalline(s) in place, and makes a copy at the destination line, which must be indicated by "F" or "P". Figure 12 is a before-and-after example of the M prefix subcommand. Chapter 1. An XEDIT Subset: Full-Screen Text Processing 23 ,:~." ., .,. r:3L:l ~tJ[J :.'. :.:,,'/.,.I ... Setting the Current Line (/) Many subcommands begin their operations starting with the current line. For example, the INPUT subcommand makes room for you to enter data after the current line. You have already seen the INPUT subcommand used to insert lines after the Top of File line. The / (diagonal) prefix subcommand can be typed in the prefix area of any line on the screen. When the ENTER key is pressed, that line becomes the current line. Then, if you enter an INPUT subcommand, the new lines entered in input mode will be inserted between the current line and the line that followed it. Canceling Prefix Subcommands If you have entered one or more prefix subcommands that create a pending status, you can cancel all these prefix subcommands by entering the following subcommand in the command line: ====> RESET [ r When the ENTER key is pressed, all prefix subcommands disappear from the display and the prefix areas are restored with equal signs (= = = = =). L. If you have typed any prefix subcommands (even those that do not cause a pending status) but have not yet pressed the ENTER key, you can press the CLEAR key to remove them. r l. 24 VM/SP System Product Editor User's Guide ' -1 - ) J J ] ] ] ] J ANIMALS FACTS A1 V 132 Trunc=132 Size=22 Line=10 Col=l Alt=O CHAMELEONS, REPTILES THAT LIVE IN TREES, CHANGE THEIR COLOR WHEN EMOTIONALLY AROUSED. THE GUPPY IS NAMED AFTER THE REVEREND ROBERT GUPPY, WHO FOUND THE FISH ON TRINIDAD IN 1866. AN AFRICAN ANTELOPE CALLED THE SITATUNGA HAS THE RARE ABILITY TO SLEEP UNDER WATER. =rnrn== THE KILLER WHALE EATS DOLPHINS, PORPOISES, SEALS, PENGUINS, AND SQUID. ALTHOUGH PORCUPINE FISHES BLOW THEMSELVES UP AND ERECT THEIR SPINES, THEY ARE SOMETIMES EATEN BY SHARKS. NO ONE KNOWS WHAT EFFECT THIS I ••• + .... 1 .... + .... 2 .... + .... 3 ..•. + .... 4 •••• + .... 5 .••• + .... 6 ••.. + .... 7 •.. ===rnrn HAS ON THE SHARKS. A LIZARD OF CENTRAL AMERICA CALLED THE BASILISK CAN RUN ACROSS WATER. OCTOPI HAVE LARGE BRAINS AND SHOW CONSIDERABLE CAPACITY FOR LEARNING. f==== THE LION ROARS TO ANNOUNCE POSSESSION OF A PROPERTY. A FISH CALLED THE NORTHERN SEA ROBIN MAKES NOISES LIKE A WET FINGER DRAWN ACROSS AN INFLATED BALLOON. STINGAREES, FISH FOUND IN AUSTRALIA, CAN WEIGH UP TO 800 POUNDS. ====> XED I T 1 File ---1 ---1 J ANIMALS FACTS A1 V 132 Trunc=132 Size=22 Line=7 Col=l Alt=l * * * Top of File * * * CHAMELEONS, REPTILES THAT LIVE IN TREES, CHANGE THEIR COLOR WHEN EMOTIONALLY AROUSED. THE GUPPY IS NAMED AFTER THE REVEREND ROBERT GUPPY, WHO FOUND THE FISH ON TRINIDAD IN 1866. AN AFRICAN ANTELOPE CALLED THE SITATUNGA HAS THE RARE ABILITY TO SLEEP UNDER WATER. A LIZARD OF CENTRAL AMERICA CALLED THE BASILISK CAN RUN I ••• + .... 1 •... + .... 2 .... + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 •... + .... 7 ... ACROSS WATER. OCTOPI HAVE LARGE BRAINS AND SHOW CONSIDERABLE CAPACITY FOR LEARNING. THE LION ROARS TO ANNOUNCE POSSESSION OF A PROPERTY. THE KILLER WHALE EATS DOLPHINS, PORPOISES, SEALS, PENGUINS, AND SQUID. ALTHOUGH PORCUPINE FISHES BLOW THEMSELVES UP AND ERECT THEIR SPINES, THEY ARE SOMETIMES EATEN BY SHARKS. NO ONE KNOWS WHAT EFFECT THIS HAS ON THE SHARKS. ====> XED I T Figure 12. 1 File Prefix Sub commands M and F - "Before" and "After" Chapter 1. An XEDIT Subset: Full-Screen Text Processing 25 Moving through a File The following subcommands are discussed in this section: BACKWARD FORWARD TOP BOTTOM UP DOWN BACKWARD and FORWARD Subcommands Scrolling the screen is like turning the pages of a book. You have already seen that the PF7 and PF8 keys are set to the BACKWARD and FORWARD subcommands, which scroll one full screen backward or forward. The BACKWARD and FORWARD subcommands can also be entered in the command line. rI r- - The format of these subcommands is: r' ====> ====> r BACKWARD n FORWARD n where "n" is the number of screen displays you want to scroll backward or forward. (This is like pressing the PF7 or PF8 key "n" times.) If you omit "n," the editor scrolls one screen backward or forward. If you enter a BACKWARD subcommand when the current line is the "Top of File" line, the editor "wraps around" the file, making the last line of the file the new current line. Similarly, if you enter a FORWARD subcommand when the current line is the "End of File" line, the editor makes the first line of the file the new current line. L C' [ ~ TOP and BOTTOM Subcommands Suppose the file is many screens long, and the current screen display is somewhere in the middle of the file. To go back to the beginning of the file, you could enter multiple BACKWARD subcommands - or - you could enter the TOP subcommand. The TOP subcommand makes the "Top of File" line the new current line. Its format is: ====> [ r l TOP The BOTTOM subcommand makes the last line of the file the new current line. Its format is: ====> BOTTOM r l 26 VM/SP System Product Editor User's Guide ' J -, ~ -1 _...J -- ) -.J These subcommands are useful when you want to insert new lines either at the beginning or end of a file. The TOP subcommand followed by an INPUT or POWERINP subcommand makes room for you to add lines at the beginning of a file; use the BOTTOM subcommand followed by INPUT or POWER to add lines to the end of a file. ] --, _J ] -, DOWN and UP Subcommands .-J Suppose that you want to move the file up or down a few lines instead of a whole screen. The DOWN subcommand advances the line pointer one or more lines toward the end of a file. The line pointed to becomes the new current line. For example: --1 ~ ~J ~] ====> -, DOWN 5 makes the fifth line down from the current line the new current line. If the number is omitted, "I" is assumed. .-.J -1 .-J The UP subcommand moves the line pointer toward the beginning of the file. The line pointed to becomes the new current line. For example: J ---1 ====> -..J J UP 5 makes the fifth line up from the current line the new current line. If a number is omitted, "I" is assumed. ---1 ~ Figure 13 is a before-and-after example of the DOWN subcommand. :J ~ :J ~ ~ :J -, _I ~ --1 -.J ~ ~ ~ :J ~ .J \ Chapter 1. An XEDIT Subset: Full-Screen Text Processing 27 r PURIST SCRIPT A1 V 132 Trunc=132 Size=12 Line=5 Co1=1 Alt=O * * * Top of File * * * "THE PURIST" I GIVE YOU NOW PROFESSOR TWIST. A CONSCIENTIOUS SCIENTIST. TRUSTEES EXCLAIMED, "HE NEVER BUNGLES!" I ••• + .... 1 .•.. + .... 2. ~ .. + .... 3 ••.• + .... 4 •..• + ...• 5 •..• + .... 6 ..•. + .... 7 ••• AND SENT HIM OFF TO DISTANT JUNGLES. CAMPED ON A TROPIC RIVERSIDE, ONE DAY HE MISSED HIS LOVING BRIDE. SHE HAD, THE GUIDE INFORMED HIM LATER, BEEN EATEN BY AN ALLIGATOR. PROFESSOR TWIST COULD NOT BUT SMILE. "YOU MEAN," HE SAID, "A CROCODILE." * * * End of File * * * ====> DOWN 5 XED I T 1 File l. l. PURIST SCRIPT A1 V 132 Trunc=132 Size=12 Line=10 Col=l Alt=O "THE PURIST" L I GIVE YOU NOW PROFESSOR TWIST. A CONSCIENTIOUS SCIENTIST. TRUSTEES EXCLAIMED, "HE NEVER BUNGLES!" AND SENT HIM OFF TO DISTANT JUNGLES. CAMPED ON A TROPIC RIVERSIDE, ONE DAY HE MISSED HIS LOVING BRIDE. ----- SHE HAD, THE GUIDE INFORMED HIM LATER, BEEN EATEN BY AN ALLIGATOR. I ••• + .... 1 . . . . + .... 2 . . . . + .... 3 . . . . + .... 4 ...• + .... 5 ..•• + .... 6 .••• + .... 7 .•. PROFESSOR TWIST COULD NOT BUT SMILE. "YOU MEAN," HE SAID, "A CROCODILE." * * * End of File * * * ====> Figure 13. XED I T 1 File The DOWN Subcommand - "Before" and "After" r- ,/ 28 VM/SP System Product Editor User's Guide ] J -1 _.J ] Making Changes in a File ] When you're looking at a screen of data that you have just entered and decide to make some changes, it's easy to type over the information to be changed. ] J ] J However, it's not always that simple. Typically, you have numerous files stored on direct access devices and need to make changes even though you don't know exactly where the data is located in a file. --1 The challenge is two-fold: find the data; then change it. -1 J The following subcommands are discussed in this section: ] CLOCATE CHANGE CINSERT CFIRST J J CLOCATE Subcommand ~J -l The CLOCATE subcommand searches a file, beginning with the column after the current column in the current line, for a character string that you specify. -.l -, _.J ~J If the string is located, two things happen: -J • The line containing the string becomes the new current line; however, if the string is in the current line, the line pointer does not move. • The column poiriter, represented in the scale as a vertical bar (I), moves under the first character of the string. --1 ~ =] These changes are reflected in the file identification area at the top of the screen (Line = nnn and Col = nn). J :] One format of the CLOCATE subcommand is as follows: J ====> J The string should be enclosed in delimiters. In the examples used in this book, the delimiter is a diagonal (/); however, you can use any character except for a plus (+), minus (-), not (I), or period (.) that does not appear in the string itself (for example, CLOCATE?VMjCMS?). J J In the following example, the string to be located is in the current line. Therefore, the line pointer does not move, but look what happens to the column pointer: ::J J J .J .=J CLOCATE/string/ ( "'---- Chapter 1. An XEDIT Subset: Full-Screen Text Processing 29 To be or not to be - that is the question. I ... + .... 1 . . . . + .... 2 . . . . + .... 3 . . . . + .... 4 . . . . + .... 5 . . . . ====> CLOCATE/be/ To be or not to be - that is the question. <.. 1+ .... 1 . . . . + .... 2 . . . . + .... 3 . . . . + .... 4 . . . . + .... 5 . . . . Notice that the column pointer in the scale has moved under the first character (b) in the string (be). If you wanted to find all occurrences of "be" throughout the file, you could enter the CLOCATE/be/ subcommand repeatedly (or use the PF9 key, which is set to the = subcommand, for repeated execution). If a string appears more than once in a line, as in the example above, the line pointer remains the same, but the column pointer moves under the next occurrence of the string. For example, if the CLOCATE/be/ subcommand is entered again, the line looks like this: To be or not to be - that is the question. < •.• + .... 1 .... +.1 .. 2 .•.. + .... 3 .... + .... 4 •... + .... 5 .... [-- Note the position of the column pointer, under the second "be". Each time the CLOCATE/be/ subcommand is entered, the column pointer moves under the next occurrence of "be"; in addition, the line pointer advances, until all occurrences of "be" have been found. If the string that you're searching for is in a backward direction from the current line, toward the top of the file, you can tell the editor to search backward by typing a minus sign (- ) in front of the string. For example: ====> CLOCATE -/glance/ is a backward search for "glance". l. [ r l [ l CHANGE Subcommand Replacing one word with another is the simplest type of change. If the string you want to change is not in the current line, you can use the CLOCATE subcommand to move the line pointer to the line that contains the string. Then, you can use the following form of the CHANGE subcommand, which changes the first occurrence of a word in the current line: ====> CHANGE/oldword/newword/ For example: r l 30 VM/SP System Product Editor User's Guide ] ] -1 _J J A rose is a rose is a rose. I ••• + .... 1 ••.. + .... 2 .... + .... 3 .•.• + ... J ====> -1 CHANGE/rose/daisy/ _J (with apologies to Gertrude Stein) .J A daisy is a rose is a rose. I ••• + .... 1 .••• + .... 2 •... + .... 3 . . . . + ... J ... ] Note that the editor automatically made room in the line for "daisy" even though it is longer than "rose". Conversely, a word can be replaced by a shorter word; the editor removes extra blanks. ._] ~J You can use the CLOCATE and CHANGE sub commands to locate and change any string in a file. If the line containing the string is'the current line, you don't have to use a CLOCATE subcommand; the CHANGE subcommand both locates and changes it. J :J -J Making a Selective Change J Suppose you want to change one word to another only some of the time, that is, you want to make a selective, or "safe" change. You can do this by locating (repeatedly) the string you want to change, and by entering a CHANGE subcommand only when you want to change the string. However, there's an easier way. -. J =J 'J 'J All you have to do is type a CHANGE subcommand (in the form CHANGE/oldword/newword/) in the command line. Then, usethe PF5 key to locate each occurrence of the old word, examine it, and then either change it (by pressing the PF6 key), or go on to the next occurrence (by pressing the PF5 key). -] Here's how to make a selective change: --J :=-J 1. Move the line pointer to the line where you want the search to begin. (You can use TOP, I, DOWN, or UP.) 2. Type a CHANGE subcommand (CHANGE/oldword/newword/) in the command line, but don't press the ENTER key. 3. Press the PF5 key. The cursor moves under the first occurrence of the old word, and the line that contains it is highlighted. --] 4. If you want to change the word, press the PF6 key. If not, press the ~J U sing this sequence, you can locate all the occurrences of the old word, and press the PF6 key to change it only when desired. When all occurrences of the old word on one screen have been located, the editor scrolls the screen forward automatically. ~J ~J "-J =.J PF5 key again, and step number 3 (above) will be repeated. ~] .J -=.J _., __J \ '- .' Chapter 1. An XEDIT Subset: Full-Screen Text Processing 31 ···~··EB Figure 14 is an example of using the PF5 and PF6 keys to locate and change selectively a character string throughout a file. The following subcommand was typed in the command line but the ENTER key was not pressed: ====> CHANGE/rose/daisy/ This subcommand is executed when the PF6 key is pressed. In the top screen, pressing the PF5 key has placed the cursor (and the column pointer) under the first occurrence of "rose". In the bottom screen, the PF5 key was pressed successively until the last occurrence of "rose". Then the PF6 key was pressed to execute the change specified in the command line. If you want to locate all occurrences of a string, but you don't want to make any changes, you can type a CLOCATEjstringj subcommand instead of a CHANGE subcommand. Then, each time you press the PF5 key, the cursor moves under the next occurrence of the string and the line is highlighted. Pressing the PF6 key has no effect. [ [ For more information on making a selective change, see "SCHANGE" in the VMj SP System Product Editor Command and Macro Reference. 32 VM/SP System Product Editor User's Guide r l J ] -l -.l J ] ROSE PETALS A1 F 80 Trunc=80 Size=ll Line=l Col=3 Alt=O String /ROSE/ found. --- PF6 set for selective change. ] ] J ] * * * Top of File * * * A ROSE IS A ROSE IS A ROSE. <.1.+ .... 1 .... + .... 2 .... + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... J A A A A A A A A A J ] J J ROSE ROSE ROSE ROSE ROSE ROSE ROSE ROSE ROSE IS IS IS IS IS IS IS IS IS A A A A A A A A A ROSE ROSE ROSE ROSE ROSE ROSE ROSE ROSE ROSE IS IS IS IS IS IS IS IS IS A A A A A A A A A ROSE. ROSE. ROSE. ROSE. ROSE. ROSE. ROSE. ROSE. ROSE. ====> Macro-read 1 File J :] ROSE PETALS A1 F 80 Trunc=80 Size=11 Line=10 Col=23 Alt=l String /ROSE/ changed to /DAISY/ ::J :J ~ =-J * * * Top of File * * * A ROSE IS A ROSE IS A ROSE. :J < ... + .... 1 .... + .... 2 .. 1.+ .... 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... A A A A A A A A A ::::J ::::J :J ~ ROSE ROSE ROSE ROSE ROSE ROSE ROSE ROSE ROSE IS IS IS IS IS IS IS IS IS A A A A A A A A A ROSE ROSE ROSE ROSE ROSE ROSE ROSE ROSE ROSE IS IS IS IS IS IS IS IS IS A A A A A A A A A ROSE. ROSE. ROSE. ROSE. ROSE. ROSE. ROSE. ROSE. DAISY. ====> Macro-read 1 File ~ Figure 14. -l Using PF5 and PF6 to Make a Selective Change :J :::J \ ~ :::J -::J '--- - Chapter 1. An XEDIT Subset: Full-Screen Text Processing 33 '. :."'~.': 'i '."'''.'~".'.' ,'.,.':. . ;.\:::>:::""" .""".,'•· . . : , ' .'· . . ·''. ,'EE' i' , " Making a Global Change If you want to make a global change, that is, change every occurrence of a word throughout the file, first make sure that the first line of the file is the current line and use the following form of the CHANGE subcommand: ====> CHANGE/oldword/newword/ * * For example: Top rose is rose is rose is rose is * * End * * * A A A A * ====> r- of File * a rose is a rose is a rose is a rose is of File * CHANGE/rose/daisy/ Top of daisy is a daisy is a daisy is a daisy is a * * End of * * * A A A A ----- * l * * a a a a rose. rose. rose. rose. * * * * File * * daisy is daisy is daisy is daisy is File * * * a a a a daisy. daisy. daisy. daisy. * This form of the CHANGE subcommand can also be used to make a global change starting in the middle of a file. Since the change starts with the current line, you would just make current (via /) that line where you want the change to begin. l ' Another variation of the CHANGE subcommand can be used if you want to change a word throughout the file, but you want to change only the first occurrence in each line: ====> CHANGE/oldword/newword/ * CINSERT Subcommand Often, you need to insert words in a line. You have already seen how to use the P A2 and insert mode keys and the SET NULLS subcommand. Another way to insert words is by using the CINSERT subcommand, which allows you to insert characters in the current line immediately before the column pointer. You can use a CLOCATE/string/ subcommand to move the column pointer to the desired position. You can also use another form of the CLOCATE subcommand to move the column pointer: ====> " CLOCATE:n where ":n" represents an absolute column number, easily determined by looking at the scale. ,/ l l 34 VM/SP System Product Editor User's Guide J J --1 _J J For example: ] To be or not to be - that is the question. I ••• + .... 1 . . . . + .... 2 . . . . + .... 3 . . . . + .... 4 . . . . + .... 5 . . . . J ====> J CLOCATE :4 To be or not to be - that is the question. <.. ~] 1+ .... 1-•.•. + ..•. 2 .... + •... 3 . . . . + . . . . 4 .••. + .... 5 . . . . ] The column pcinter has moved to column four. J In the following example, the CLOCATE subcommand is used to move the column pointer; then the CINSERT subcommand is used to insert characters immediately before the column pointer position. J If anything can go, it will. =:J I •.• + ••.. 1 . . . . + ..•. 2 .••• + ..•. 3 ...• + •... 4 .•.. + ...• 5 . . . . J J :J ====> =J ====> CLOCATE/,/ ====> or CLOCATE :19 (move the column pointer) If anything can go, it will. < ... + ...• 1 .... + •.• 12 .... + . . . . 3 .•.. + .•.. 4 .... + .... 5 . . . . CINSERT wrong (insert "wrong" before the column pointer) ] If anything can go wrong, it will. < •.. + .... 1 . . . . + ..• 12 ...• + .... 3 ••.. + •.•• 4 ...• + . . . . 5 •.•. :J -, (In the CINSERT subcommand above, note that there are two spaces between "CINSERT" and "wrong": one is the required space between the subcommand name and the operand; one is the blank space needed between "go" and "wrong".) .--I ~] ~ If only one blank space were used, the result would be the following: =:J ===== If anything can gowrong, it will. ~ The editor allows you to insert blanks with the CINSERT subcommandsimply type the required number of blanks (by pressing the spacebar) in the operand. For example: :J =:J If anything can go wrong, it will. ====> ====> ::J :J CLOCATE/can/ CINSERT (Press the spacebar six times.) =:J ===== If anything can go wrong, it will. ~ :~ .=J -=:J "- Chapter 1. An XEDIT Subset: Full-Screen Text Processing 35 lJ "",'CJCl, . tJL:J " If the inserted characters make the line longer than the screen line, the editor automatically "wraps around" to the next line. Characters can be inserted up to the truncation column, as shown in the following example: It takes less time to do a thing than to explain why you did it. I ... + .... 1 ..•. + •... 2 ...• + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 ...• + .... 7 ••. ====> CLOCATE/than/ (move the column pointer) It takes less time to do a thing than to explain why you did it. <... + .... 1 .... + .... 2 . . . . + .... 3 ... 1+ .... 4 .... + .... 5 .... + ... ;6 . . . . + .... 7 .•. ====> r- I,. CINSERT right (insert the first word. to avoid "rightthan".) You must type one blank after "right" It takes less time to do a thing right than to explain why you did it. <... + .... 1 •... + .... 2 .... + .... 3 ... 1+ .... 4 ..•. + .... 5 .... + .... 6 .... + .... 7 .•• ====> CLOCATE/./ (move the column pointer again) It takes less time to do a thing right than to explain why you did it. <..• + .... 1 . . . . + .... 2 ...• + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 . . . . + .... 1... ====> CINSERT wrong (insert the second word) It takes less time to do a thing right than to explain why you did it wron g. 1-L Even though the resulting line is longer than a screen line, it is considered to be one logical line. Notice that the line has one prefix area associated with it. Any prefix subcommands entered in the prefix area affect the entire logical line. For example, if a D prefix subcommand is entered, the whole sentence is deleted. CFIRST Subcommand After using subcommands that move the column pointer, it's a good idea to reset the column pointer to column one by issuing the CFIRST subcommand. For example: 36 VMjSP System Product Editor User's Guide l" ] ] -, ...J J If anything can go wrong, it will. <... + .... 1 . . . . +.1 .. 2 .... + .... 3 . . . . + .... 4 . . . . + .... 5 ...• ] ====> J CFIRST If anything can go wrong, it will. I ... + .... 1 . . . . + .... 2 .... + .... 3 . . . . + .... 4 . . . . + .... 5 ...• J ] Setting Tabs ] J Sometimes you may want to place information in specific columns. The PF4 key functions like a tab key on a typewriter. Each time the PF4 key is pressed, the cursor is positioned under the next tab column, where you can enter data. ] ] J Initial tab settings are defined by the editor according to filetype; they may be displayed by using the following subcommand: ] ====> J You can change these settings one or more times during an editing session with the SET TABS subcommand. For example: ~] ====> =J The first time the PF4 key is pressed, the cursor moves to column 10 on the screen. The second time, it moves to column 20, and so forth. J QUERY TABS SET TABS 10 20 30 The PF4 key may be used for tabbing in input mode, but not in power typing mode. ] ='1 You can change the tab settings by issuing another SET TABS subcommand, or, if you'd like to see the current tab settings before changing them, you can use the following subcommand: ] J J J ====> MODIFY TABS The current SET TABS subcommand is then displayed in the command line; you can type over the numbers and press the ENTER key to define new tabs. J Figure 15 is an example of data that was entered using the PF4 key as a tab key. The following subcommand was used to define the tab columns: ~] ====> SET TABS 5 35 45 J .J =:J .J ~ -=.J (, "- Chapter 1. An XEDIT Subset: Full-Screen Text Processing 37 TABS EXAMPLE Al F 80 Trunc=80 Size=13 Line=9 Col=l Alt=O * Top of File * * * * * TEN COLDEST CITIES AVERAGE TEMPERATURE ------------- (F) (C) 1. ULAN-BATOR, MONGOLIA 24.8 -4.0 2. CHITA, U.S.S.R. 27.1 -2.7 3. BRATSK, U.S.S.R. 28.0 -2.2 4. ULAN-UDE, U.S.S.R. 5. ANGARSK, U.S.S.R. 28.9 29.7 -1.7 -1.3 6. IRKUTSK, U.S.S.R. 30.7 -1.1 7. KOMSOMOLSK, U.S.S.R. 8. TOMSK, U.S.S.R. 9. KEMEROVO, U.S.S.R. 30.7 30.9 31.3 -0.7 -0.6 -0.4 10. NOVOSIBIRSK, U.S.S.R. 31.8 -0.1 ...- l I ••• + ...• 1 .... + .... 2 •.•. + .... 3 .... + .... 4 ..•. + .... 5 •.•. + .... 6 .... + .... 7 ••. ----- ===== * * * End of File * * * ====> XED I T Figure 15. 1 File ,-' l Using the PF4 Key for Tabbing Ending an Editing Session The following subcommands are discussed in this section: FILE QUIT SET AUTOSAVE FILE Subcommand When you use the XEDIT command to create a new file, the file is created in virtual storage. When you make changes to an existing file, those changes are made to a copy of the file that is brought into virtual storage (when the XEDIT command is entered). However, virtual storage is temporary. To write a new or modified file on disk, which is permanent storage, you must enter the following subcommand: ====> FILE When the FILE subcommand is executed, the file is written on disk and control is returned to eMS. r- 38 VMjSP System Product Editor User's Guide l . ] ] J ] J :] QUIT Subcommand Use the QUIT subcommand to end an editing session and leave the permanent copy of the file intact on the disk. If the file is new, it is not wri tten on disk. J You can execute the QUIT subcommand either by pressing the PF3 key or by entering it on the command line, like this: ] ====> J You would use the QUIT subcommand instead of the FILE subcommand when you edit a file merely to examine, but not to change, its contents, or if you discover you have made errors in changing a file and do not want them to be recorded. ] ] ~] J J J ] ~] QUIT If a file is new or has been changed, the editor gives you a warning message to prevent the inadvertent use of a QUIT instead of a FILE. The message is as follows: File has been changed. Use QQUIT to quit anyway. If you really don't want to save the file, enter "QQUIT" (abbreviated as "QQ"). If you wish to save the changes, enter "FILE". SET AUTOSAVE Subcommand =:J Files on disk are not affected if the system malfunctions, or "goes down." However, a new file that you're creating or the changes you're making to an existing file might be lost if the system fails. You can minimize this danger by using the SET AUTOSAVE subcommand, whose format is as follows: ~ SET AUTOSAVE n '=J :J :J ~ The SET AUTOSAVE subcommand causes your file to be written to disk automatically, after you've typed in or changed a certain number of lines. You specify what that number will be with the "n" operand of the SET AUTOSAVE subcommand. If you want the file written to disk, or "saved," every time you've changed ten lines, enter the following subcommand: :J SET AUTOSAVE 10 '-] The number of alterations you have made to your file since the last AUTOSAVE will be displayed in the alteration count (Alt = n) in the file identification line. When the alteration count is equal to the AUTOSAVE setting, the file is saved on disk and the alteration count is reset to zero. :J =:J :=J -=J ~ ~ The SET AUTOSAVE subcommand can be issued at any time during an editing session. It's a good idea, however, to issue the subcommand right after you issue an XEDIT command to create a new file or to call an existing file from disk. Chapter 1. An XEDIT Subset: Full-Screen Text Processing 39 rl When a file is saved on disk by A UTOSAVE, it is written into a new file. The. filename of this file is a number and its filetype is "AUTOSAVE." If the system goes down while you're editing a file, you can change the fileid back to its original filename and file type by issuing the CMS command ERASE to erase the original file and then by issuing the CMS command RENAME. For example, if your AUTOSAVE file is labeled "100001 AUTOSAVE AI" and the original file is "INVENTOR SCRIPT AI," use the following CMS commands to rename it: ERASE INVENTOR SCRIPT RENAME 100001 AUTOSAVE Al INVENTOR SCRIPT Al r . l Then you'll be back in business and can use the XEDIT command to start editing the file again. If you issue a SET AUTOSAVE subcommand while you're creating a new file, and then issue a QUIT subcommand, the file is not saved. However, the AUTOSAVE file is available on disk. If you issue a SET AUTOSAVE subcommand while you're revising an existing file and then you issue a QUIT subcommand, no revisions are saved. However, the AUTOSAVE file is still available on disk. r- , L ,1 Inserting Data From Another File To insert all or part of one file into another file, you can use the GET subcommand. The chapters in this book were created as separate files and then combined into one file by using the GET subcommand. The GET subcommand inserts another file after the current line in the file you are editing. Therefore, you must move the line pointer to the desired line of the file. For example, if you want to insert another file at the end of a file, you can use the BOTTOM subcommand. If you want to insert another file in the middle of a file, you can use the / prefix subcommand to make the desired line current. Inserting a Whole File Suppose you were writing a cookbook, and you created a separate file for each recipe. To combine two of the recipes into one file, you would use the following form of the GET subcommand: ====> GET filename filetype Figure 16 shows how the GET subcommand is used to insert one whole file at the end of another file: r- l 40 VM/SP System Product Editor User's Guide r l . J J '-1 -J J The top screen shows a file (DESSERT COOKBOOK) that contains a recipe for cream puffs. A recipe for almond cookies is contained in another file, COOKIES COOKBOOK. J J The following subcommand was entered: J ====> J GET COOKIES COOKBOOK In the bottom screen, the message "EOF reached" indicates that the entire file has been inserted. Notice that the last line inserted becomes the new current line. The file DESSERT COOKBOOK now contains two recipes. The file COOKIES COOKBOOK is left intact. ] J J J J ] J J J --j :J =:'1 =:J =:J J :J ~ :J ~ =:J :J .J :J .J I\ '-- Chapter 1. An XEDIT Subset: Full-Screen Text Processing 41 DESSERT COOKBOOK A1 F 80 Trunc=80 Size=8 Line=9 Col=l Alt=O * * * Top of File * * * CREAM PUFFS WITH CHOCOLATE SAUCE 2 1/2 1/2 OUNCES BUTTER TEASPOON SUGAR CUP FLOUR PINCH OF SALT 2 EGGS 2 CUPS HEAVY CREAM, WHIPPED * * * End of File * * * [ I ••• + •.•• 1 ...• + •••• 2 •.•• + •••• 3 . . . . + ..•. 4 •••• + ..•• 5 •..• + ••.. 6 •.•. + •••• 7 .•• r . l ====> GET COOKIES COOKBOOK XED I T 1 File DESSERT COOKBOOK A1 F 80 Trunc=80 Size=15 Line=15 Col=l Alt=l EOF reached. PINCH OF SALT 2 EGGS 2 CUPS HEAVY CREAM, WHIPPED ALMOND COOKIES 6 1/2 2 1 1 TABLESPOONS SOFT BUTTER CUP SUGAR EGG WHITES PINCH SALT CUP ALMONDS, SLICED I .•• + •••• 1 .•.. + •.•. 2 . . . . + ..•. 3 .•.. + •.•. 4 . . . . + •••. 5 . . . . + •••. 6 ..•. + .••• 7 ... * * * End of File * * * ====> XED I T Figure 16. 42 1 File Inserting a Whole File VM/SP System Product Editor User's Guide [" J J -1 _J J Inserting Part of Another File J To insert part of another file, you can specify in the GET subcommand the line number of the first line and the number of lines you want to insert. The following GET subcommand inserts the first ten lines of a second file: J J ====> ='1 J GET FILE2 DATA 1 10 If you don't know the line numbers, you can: call out a second file without ending your current editing session; put the lines you want to insert into a temporary file; and insert them into your current file. J J J -J This might sound complicated, but all you need to learn is one more subcommand - PUT. First, let's identify and explain the steps you would take to insert part of another file and then illustrate them with an example. 1. While editing the first file, enter an XEDIT subcommand to call out the second file. (You do not have to end your current editing session, because the editor allows you to edit multiple files simultaneously.) The second file will appear on the screen . 2. Use the PUT subcommand to indicate which lines are to be inserted in the first file. The PUT subcommand stores lines in a temporary holding area, starting with the cun:ent line, up to an ending, or target, line. Its format is as follows: ] '--1 .--.J =.J ~J ~] ====> =J PUT target where "target" identifies the end of the group of lines to be inserted. It is a signal to the editor to stop "putting" lines. :J A target operand may be specified in various ways, which are described in detail in "Chapter 4. Using Targets." A brief description of three ways to specify a target follows. They are all equivalent; you can choose whichever type you prefer. ~ :J =.J =:J One way to specify the target is to count the number of lines you want to insert, starting with the current line. For example, if a file contains: a loaf of bread a jug of wine thou a portable television ~ :J =.J and the line containing "a loaf of bread" is current, the following subcommand stores all the above lines: ~ ====> PUT 4 :~ =.J =.J ~ \'- '- -- Chapter 1. An XEPIT Subset: Full-Screen Text Processing 43 Another way to specify the target is with a character string; the editor will "put" all the lines, beginning with the current line, up to, but not including, the line containing the string. For example, the following subcommand will "put" the first three lines, but it will not "put" the line containing "a portable television". r ====> r- - PUT/television/ A third way to specify a target is the file line number. To display the line numbers in the prefix area, you must issue the following subcommand: ====> SET NUMBER ON Here's how the above lines might look: 00010 00011 00012 00013 a loaf of bread a jug of wine thou a portable television To specify a target as a line number, type a colon (:) followed by the line number. The following subcommand puts lines up to, but not including, line 13. ====> PUT :13 3. Enter a QUIT subcommand. The first file reappears on the screen. 4. Make sure that the current line is the line after which you want tl~e lines from the second file to be inserted. Then enter the following subcommand: ====> GET r' No operands are required. The lines that were stored by the PUT subcommand are inserted; the last line inserted becomes the new current line. l [ l Figure 17 through Figure 20 shows how the PUT and GET subcommands are used to insert part of a file into another file: l The file DESSERT COOKBOOK promises a recipe for cream puffs with chocolate sauce. The cream puffs recipe is there, but the chocolate sauce is missing. All the sauces are contained in another file called SAUCES COOKBOOK. To insert the recipe for chocolate sauce after the recipe for cream. puffs, first make the desired line current (via /) in the file DESSERT COOKBOOK. Since the sauce recipe must follow the cream puffs recipe, the current line is the last line of the cream puffs recipe (Figure 17). Then enter the following subcommand: ====> 44 XEDIT SAUCES COOKBOOK VM/SP System Product Editor User's Guide r l. r / L [' C- r-' J J J This file appears on the screen. The status area (lower right corner) indicates that two files a~e being edited. Move the line pointer to the beginning of the lines to be inserted, via UP or /. The beginning line contains "CHOCOLATE SAUCE" (Figure 18). Now enter the subcommand to store the chocolate sauce recipe: J J J J ====> PUT/VINAIGRETTE/ The lines that are stored begin with "CHOCOLATE SAUCE" and end with the line preceding "VINAIGRETTE". The PUT subcommand could also have been entered as PUT :15 or PUT 7. In this screen, line numbers are displayed in the prefix area, which means that a SET NUMBER ON subcommand was issued. After the PUT subcommand is executed, you can quit this file by entering: ] J ] ====> QUIT The original file comes back on the screen (Figure 19). Now enter the following subcommand to insert the lines that were "put": ] J ====> GET The sauce recipe is inserted, as shown in Figure 20. The last line inserted is the new current line. J =J J ~] DESSERT COOKBOOK A1 F 80 Trunc=80 Size=15 Line=8 Col=l Alt=O ----- * * * Top of File * * * CREAM PUFFS WITH CHOCOLATE SAUCE 2 OUNCES BUTTER 1/2 TEASPOON SUGAR 1/2 CUP FLOUR 1 PINCH OF SALT 2 EGGS 2 CUPS HEAVY CREAM, WHIPPED I ••• + .... 1 •... + .... 2 . . . . + .... 3 . . . . + .... 4 .... + .... 5 . . . . + .... 6 . . . . + .... 7 ... ALMOND COOKIES ----- TABLESPOONS SOFT BUTTER 1/2 CUP SUGAR EGG WHITES 2 ----PINCH SALT 1 1 CUP ALMONDS, SLICED ----* * * End o;E File * * * ====> XEDIT SAUCES COOKBOOK Figure 17. 6 XED I T 1 File Inserting Part of a File - Call Out the Second File Chapter 1. An XEDIT Subset: Full-Screen Text Processing 45 •...• ! SAUCES .'('1$' I ":',.:,}'.',t' COOKBOOK A1 ':c' .",;.ji" .•.. ,' ijiy F 80 Trunc=80 Size=20 Line=8 Col=l Alt=O 00000 * * * Top of File * * * 00001 00002 APRICOT GLAZE 00003 00004 1 JAR APRICOT PRESERVES (1 POUND) 00005 2 TABLESPOONS KIRSCH 00006 00007 00008 CHOCOLATE SAUCE I •.. + .... 1 .... + .... 2 .... + .... 3 .... + .... 4 .... + .... 5 . . . . + .... 6 .... + .... 7 ... 00009 00010 12 OUNCES SEMI-SWEET CHOCOLATE 00011 2 OUNCES UNSWEETENED CHOCOLATE 00012 1 CUP HEAVY CREAM 00013 2 OUNCES COGNAC 00014 00015 VINAIGRETTE SAUCE 00016 00017 1/2 CUP OLIVE OIL ====> PUT/VINAIGRETTE/ XED I T 2 Files Figure 18. DESSERT F 80 [ r l: [-~ Inserting Part of a File - Put Lines to Be Inserted, Then QUIT COOKBOOK A1 [ Trunc=80 Size=15 Line=8 Col=l Alt=O * * * Top of File * * * CREAM PUFFS WITH CHOCOLATE SAUCE 2 OUNCES BUTTER 1/2 TEASPOON SUGAR 1/2 CUP FLOUR 1 PINCH OF SALT 2 EGGS 2 CUPS HEAVY CREAM, WHIPPED I ••• + .... 1 .... + .... 2 .... + .•.. 3 . . . . + .... 4 .... + .... 5 .•.• + .... 6 .... + .... 7 .•. ALMOND COOKIES 6 TABLESPOONS SOFT BUTTER 1/2 CUP SUGAR 2 EGG WHITES 1 PINCH SALT 1 CUP ALMONDS, SLICED * * * End of File * * * r: ====> GET XED I T Figure 19. Inserting Part of a File - GET 1 File r r rcr l 46 VMjSP System Product Editor User's Guide J J -1 _J [ j ] DESSERT COOKBOOK A1 F 80 Trunc=80 Size=22 Line=15 Col=l Alt=l PINCH OF SALT 1 2 EGGS 2 CUPS HEAVY CREAM, WHIPPED CHOCOLATE SAUCE J J 12 ] 2 1 2 ~] OUNCES SEMI-SWEET CHOCOLATE OUNCES UNSWEETENED CHOCOLATE CUP HEAVY CREAM OUNCES COGNAC I ••• + .... 1 ...• + .•.• 2 . . . . + .... 3 . . . . + •... 4 ...• + •... 5 . . . . + .... 6 ..•. + .... 7 ... ALMOND COOKIES J 6 TABLESPOONS SOFT BUTTER 1/2 CUP SUGAR 2 EGG WHITES 1 PINCH SALT 1 CUP ALMONDS, SLICED * * * End of File * * * J J J ====> XED I T --1 1 File ~ Figure 20. ~J Inserting Part of a File - The Lines Are Inserted ~ ~ Getting Help ~ If you forget how to use a subcommand or would like to see information about subcommands not covered in this subset, you can press the PFI key, which is set to the HELP MENU subcommand. =:J ~ When the PFI key is pressed, a list of all subcommands and macros available with the editor appears on the screen. You then move the cursor to the desired subcommand and press ENTER. The subcommand description appears on the screen, replacing the HELP Menu. Pressing the PF3 key returns you to the previous screen and pressing PF4 takes you out of the HELP display and restores your file on the screen. :J ~ ~ ~ Learning More About the Editor =J The following is a list of additional XEDIT subcommands and macros that are useful in text processing. You can learn how to use them by using the Help facility (described above) or by referring to the publication VM/SP System Product Editor Command and Macro Reference. ~J :J =:J ~ =:J ~ ~ ALL Aliows you to collect lines for editing, while excluding others from display. ( ,--" Chapter 1. An XEDIT Subset: Full-Screen Text Processing 47 ALTER Allows you to change a character to one that is not available on your keyboard, like a backspace character. COMPRESS, EXPAND Allow you to reposition data in new tab columns without retyping it. LEFT, RIGHT Allow you to view columns of data that extend to the left or right of the screen display. [ [ LOWERCAS, UPPER CAS Allo:w you to translate alphabetic characters to all lowercase or all uppercase. MERGE Allows you to combine two sets of lines. SET ARBCHAR Allows you to specify only the beginning and end of a long string that is to be located or changed. SET CASE Allows you to choose whether data that is typed on the terminal is to be entered in the file the same way you type it or translated into uppercase. SET POINT Allows you to assign name(s) to any line; you can reference the name(s) in XEDIT subcommands. r -. l. r -. L. . SET SCREEN Allows you to view multiple files or multiple views of the same file on one screen. I' l SET VERIFY Allows you to view only specified columns of data, in character or hexadecimal or both. SORT Allows you to arrange the file lines in alphabetical order. [ r < (SHIFT LEFT) MACRO A prefix macro that allows you to shift left one line or a block of lines one or more columns to the left. > (SHIFT RIGHT) MACRO A prefix macro that allows you to shift right one line or a block of lines one or more columns to the right. 48 VM/SP System Product Editor User's Guide l. ] <==11==> ~ -.-y-- j II c ---..-..-.-------.-.-.-..-.-.--.---------.----.-----------.------------.-----J J ] J J J j ] Summary of XEDIT Subset The following table summarizes the subcommands that have been presented in this chapter. When a subcommand can be abbreviated, its minimum abbreviation is shown in uppercase letters. Function To create or edit a file To enter data To scroll the screen J J To move the line pointer To move the column pointer To make changes to the file To locate data To recover deleted data To set tabs To display current tab settings To display line numbers in the prefix area To specify whether trailing blanks are replaced with nulls to allow character insertion To end an editing session without sa ving the changes To save automatically after changing a specified number of lines To save the changed file when you have finished working on it To store lines to be inserted in another file by a subsequent GET To imbed a complete or a parttal copy of one file in another To cancel pending prefix subcommands Subcommand/PF Key Xedit Input POWerinp BAckward FOrward TOP Bottom Down Up CLocate CFirst Change CInsert CLocate RECover SET TABS MODify TABS Query TABS SET NUMber ON SET NULls ON QUIT SET AUtosave FILE PUT GET RESet Chapter 1. An XEDIT Subset: Full-Screen Text Processing 49 Function Subcommand/PF Key Prefix subcommands: To add lines A To delete lines To add lines and position cursor for indented text D SI To duplicate lines To move lines To copy lines " M and For P C and F or P To set the current line / PF keys, initial settings: To get a Help display To add a line To end a session without saving To use a tab key To locate and change selectively To redisplay a subcommand To scroll one screen backward To scroll one screen forward To repeat previous subcommand To move the display to the right, and move it back when key is pressed again To split or join lines at the cursor To move the cursor from the screen to the command line, or vice versa r l PFI PF2 PF3 PF4 PF5, PF6 PF6 PF7 [ [ PF8 PF9 PFIO PFll PF12 r-- - l. r- l rl r l 50 VM/SP System Product Editor User's Guide J J -1 _J ~J~. --' This chapter is designed to give you practice in using some of the XEDIT subcommands discussed in Chapter 1. The exercise is divided into five parts. You do not have to do all of them at one time, but you should do them in sequence. Some of the data you will be asked to type contains errors, so that you can use subcommands to correct them. Remember to press the ENTER key each time you type a subcommand in the command line. However, when you press a PF key, do not press the ENTER key. Chapter 2. A Practice Exercise 51 ~ _ _._ _ _ _ _ _.._ _ _._. _._____..___ ._._.._. __._ ......_. ______ .. __ ._.......___....... __.______.....________________________===:J Exercise 1. Creating a File This part of the exercise covers the following subcommands: SET AUTOSAVE, INPUT, QUERY TABS, SET TABS, FILE, and the PF4 key. Your first file will contain a list of famous inventions. The filename is INVENTOR; the filetype is SCRIPT. r l Type the following command in the CMS command line: xedit inventor script Now press the ENTER key. The file identification line appears on the first line of the screen. The message, Creating new file:, appears on the second line (the message line). Take a moment to review the screen layout described in Figure 1. Notice that the cursor is positioned on the command line, after the large arrow (= = = = > ). [ r- ", l To cause your file to be written to disk at periodic intervals, enter the following subcommand: ====> r l. set autosave 20 , r You will enter data in the file using the PF4 key for tabbing. To display the editor's initial tab settings for this filetype, enter: ====> query tabs The tab settings for a SCRIPT filetype are displayed in the message line. You are going to use different tab settings, so enter: ====> l. set tabs 10 30 Now you're ready to begin entering data. Enter: ====> l input r' l. r l The cursor is positioned on the first line of the input zone. Press the PF4 key, and the cursor moves to the column (10) you specified in the SET TABS subcommand. Type: Telescope Press the PF4 key again. The cursor moves to column 30. Type: 1608 Press the PF4 key. The cursor moves to column 10 on the next line of the input zone. Type: r Hot air balloon 52 VM/SP System Product Editor User's Guide c. . ] ~}~ -- J Press the PF4 key and then type: ] 1783 J Using the PF4 key to move the cursor, type the following: J J J ] ] Margarine Tranquilizer Now press the ENTER key. The status area (lower right corner) shows that you are still in input mode. The data you entered has moved up on the screen, with the last line you typed becoming the new current line. If you had more data to type, you could start typing at the cursor position. For now, press the ENTER key to return to edit mode. Checkpoint: If you have done everything correctly, your screen should look like this: ---1 --.J ] * * * Top of File * * * Telescope Hot air balloon Margarine Tranquilizer ~J - , ---' J J -=-J J J 1869 1952 1608 1783 1869 1952 Enter: ====> file Exercise 2. Using Power Typing This part of the exercise covers the following subcomrnands: POWERINP, TOP, BOTTOM, UP, DOWN, /, the PFll key, and the PA2 and insert mode keys. Your second file will contain a description of the invention of the telescope. Enter: xedit telescop script In this file, you will enter the data in power typing mode. Enter: ====> power In power typing mode, you type continuously, without regard to the length of the screen line. If you come to the end of a line and you're in the middle of a word, just keep on typing. The cursor will move to the beginning of the next line. Two of the words that you type will start on one line and end on the next - "accidentally" and "mounted". Chapter 2. A Practice Exercise 53 Now type the following data (with errors): One day in 1608 held a lens in each hand and peered through both at once, accide ntally discovering that two lenses placed in line would magnify an image. #He mo unted lens at each end of a tube and invented the telescope. Press the ENTER key twice. You are now in edit mode. Checkpoint: Your file should look like this: One day in 1608 held a lens in each hand and peered through both at once, accidentally discovering that two lenses placed in line would magnify an image. He mounted lens at each end of a tube and invented the telescope. The two words that began on one line and finished on the next ("accidentally" and "mounted") are put back together. The second sentence starts on a new line, because you typed a puund sign (#) before it. (Remember that a pound sign, the line end character, causes the data that follows it to start on a new line.) r l Obviously, the first sentence is missing some words. One way to insert a long phrase in a line is to split the line in two. Move the cursor under the "h" in "held". Press the PFll key, and the line is split. Now type: a Dutch spectacle maker named Lippershey In the second sentence, the word "a" is missing before the word "lens". Move the cursor under the "1" in "lens". Press the P A2 key, and press the insert mode key. Type the word "a" and press the spacebar once. The sentence has moved over to accommodate the added word. Now press the RESET key, to take you out of insert mode. r l Checkpoint: Your file should look like this: [ One day in 1608 a Dutch spectacle maker named Lippershey held a lens in each hand and peered through both at once, accidentally discovering that two lenses placed in line would magnify an image. He mounted a lens at each end of a tube and invented the telescope. The rest of this exercise will give you practice in moving the line pointer. If your cursor is not on the command line press PF12 to bring it down to the command line and now enter: ====> top rt. 54 VM/SP System Product Editor User's Guide J -1 --.J --, c _J J The new current line is the Top of File line. If you wanted to add data at the beginning of the file in either input mode or power typing mode, you would enter TOP, followed by either INPUT or POWER. J ~] Enter: J ====> J The new current line is the last line of the file. Enter: J ====> =J The new current line is two lines up, toward the top of file. ~] Enter: ~ ====> -, The new current line is two lines down, toward the end of file. ---, --.J Now type a / (diagonal) in the prefix area of any line, like this: -- l ==== / --.J bottom up 2 down 2 or this: == /== or this: /==== ..-J -J When you press the ENTER key, that line becomes the new current line. ~] When your file is too big to fit on one screen, you can use the PF7 and PF8 keys (the BACKWARD and FORWARD subcommands) to scroll the screen. ~] Enter the following subcommand to write this file on disk: ~ ====> file ~J Exercise 3. Using Prefix Subcommands ~ --1 This part covers the RECOVER subcommand and the following prefix subcommands: a, d, m, and p. --.J ::J To create this file, enter: ~ xedit balloon script ~ Enter: ---) ~ ====> input -1 ..---J Type: ----I The heat inflated the petticoat and caused it to rise . The Montgolfier brothers were paper manufacturers. Hot air from a fire lifted the first balloon. ..---J --, ----.J ( -=:J ~ --) -.J "- Press the ENTER key twice to reenter edit mode. Chapter 2. A Practice Exercise 55 ~--------------------------------------------------------------------------------------~ Let's rearrange these sentences. Type an "M" in the prefix area of the second sentence, and a "P" in the prefix area of the first sentence, like this: ====p The heat inflated the petticoat and caused it to rise. ===m= The Montgolfier brothers were paper manufacturers. Now press the ENTER key~ The sentences have been reversed. in the file and press the Type an "a" in the prefix area of the first sentence • 1 ENTER key. Type the following in the blank line you just added: They realized hot air's ability to float a balloon by accident. The cursor is at the end of the line you just typed. Without moving the cursor, press the PF2 key, which adds a new blank line and moves the cursor to the beginning of it. Now type: Jacques' wife washed a petticoat and hung it over a fire to dry. Type "5a" in the prefix area of the last line, and press the ENTER key. Type in anything you want. Now, type "DD" in both the first and last lines you added, like this: r L ., r- =dd== This is your first line. l. =dd== This is your fifth line. Press the ENTER key. Do you really want to keep those lines? If you do, enter: ====> recover r r l * Checkpoint: Your file should look like this: The Montgolfier brothers were paper manufacturers. They realized hot air's ability to float a balloon by accident. Jacques' wife washed a petticoat and hung it over a fire to dry. The heat inflated the petticoat and caused it to rise. Hot air from a fire lifted the first balloon. r l Enter: ====> 56 file VMjSP System Product Editor User's Guide l .. J ~J~. J J ] -- ------, Exercise 4. Making Changes This part of the exercise covers the following subcommands: CHANGE, PF5, and PF6 keys for a selective change. Enter: ] xedit margarin script -1 -J - , _.1 Enter: ====> input Type these lines: Bitter was expensive and in short supply. Napoleon sought a substitute for butter that wasn't bitter. He needed something like bitter that would store well on ships. He held a contest and offered a prize for the best bitter substitute. ] ] .. " Press the ENTER key twice to reenter edit mode . ~ Move the line pointer to the first line of the file by entering: ====> up 3 Enter: ====> change/Bitter/Butter/ Now you're going to practice using the PF5 and PF6 keys to make a selective change. You want to change "bitter" to "butter," but not all of the time. Type the following subcommand in the command line, but do not press the ENTER key. ====> c/bitter/butter/ Now press the PF5 key. The cursor moves under "bitter" in the second sentence, and the line is highlighted. The message line tells you that if you want to make the change, press the PF6 key. This "bitter" is fip.e, so press the PF5 key again. In the third sentence, you want to make the change, so :press the PF6 key. The message line tells you that the change has been made. Press the PF5 key. Press the PF6 key. Chapter 2. A Practice Exercise 57 r- - ~------------------------------------------------------------------------------~ Checkpoint: Your file should look like this: Butter was expensive and in short supply. Napoleon sought a substitute for butter that wasn't bitter. He needed something like butter that would store well on ships. He held a contest and offered a prize for the best butter substitute. r l Enter: ====> file Exercise 5. Getting It All Together r- - This part covers the following subcommands: GET and PUT. r- - You now have the following files: L ,-- -. inventor script telescop script balloon script margarin script l_ r I The following exercise will give you practice in transferring data between files. Enter: xedit inventor script You are going to insert the entire file named TELESCOP SCRIPT at the end of this file. r-- l r L. r- - l To make the last line of this file current, enter: ====> bottom Now enter: ====> get telescop You do not have to specify a filetype when you GET a file if the filetype of the file you are "getting" is the same as the file you're currently editing. The message, "EOF reached" tells you that the entire file has been inserted. The new current line is the last line that was inserted. The file TELESCOP is still on disk; only a copy of it has been inserted. Now you're going to insert part of a file into this one. Enter: 58 r l r l_ VM/SP System Product Editor User's Guide [ r - - - - - - - - - - - - ------------------- --- - - - - - ====> J xedit balloon This file now appears on the screen. Notice that the status area indicates that you are editing two files, that is, two files are in virtual storage. You're going to insert lines two and three into the INVENTOR file. Enter: ====> down 2 Enter: ====> put 2 Enter: ====> quit The INVENTOR file now appears on the screen. Enter: ====> get Lines two and three from the BALLOON file are inserted; the new current line is the last line that was inserted. Now you're going to insert the entire MAR GARIN file. Enter: ====> get margarin The entire file is inserted. Checkpoint: Your file should look like this: Telescope 1608 Hot air balloon 1783 Margarine 1869 Tranquilizer 1952 One day in 1608 a Dutch spectacle maker named Lippershey held a lens in each hand and peered through both at once, accidentally discovering that two lenses placed in line would magnify an image. He mounted a lens at each end of a tube and invented the telescope. They realized hot air's ability to float a balloon by accident. Jacques' wife washed a petticoat and hung it over a fire to dry. Butter was expensive and in short supply. Napoleon sought a substitute for butter that wasn't bitter. He needed something like butter that would store well on ships. He held a contest and offered a prize for the best butter substitute. You have inserted two whole files and one partial file into another file. This is a good place to practice prefix subcommands. Using the "A" prefix subcommand, add lines between the different inventions, and then type headings in those lines. You c'an also rearrange the inventions by using the "M" and "P" (or "F") prefix subcommands. When you are finished, enter: Chapter 2. A Practice Exercise 59 ====> quit A warning message tells you the file has been changed and to enter QQUIT if you want to quit anyway. Enter: ====> qquit [ [~ r ,-- l \. 60 VMjSP System Product Editor User's Guide -l -.J J -1 ,J J ~,ln'~rgJG@r ], Il\n) >~I~lmnU ~'!!'f~"@n: U@5Z\U l~r~~lrn~1 @m @ lJ\¥~WYAY~ilfj@:r lJ@rif~~.~] ] ] ] J J J J Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal This chapter is written primarily for the person who has limited data processing experience; however, some VM/SP eMS experience is assumed. For example, you must know how to log on to VM/SP and enter the eMS environment. You should also be familiar with the concept of a eMS file. ] ,] When you finish this chapter, you should have a working knowledge of the editor. The subcommands presented here comprise a subset of XEDIT subcommands, with which you can create a file, enter data, make changes to the file, and transfer data between files. The editor has many additional capabilities, which are described in the rest of this book and in the publication VM/SP System Product Editor Command and Macro Reference. ] :J ~J This subset has been selected for text processing on a typewriter terminal. ~J 'J Editing a File J ,- J ~. To edit a file means to make changes, additions, or deletions to a eMS file that is on a disk, and to make these changes interactively: you instruct the editor to make a change, the editor makes it, and then you request another change . J .J :J You can edit a file that does not exist; when you do so, you are creating a file. =J XEDIT Command '" J After you log on to VM/SP and enter the eMS environment, you are ready to enter the edit environment. ,. J ~J The editor is invoked with the eMS command XEDIT, whose format is as follows: . ,. J XEDIT filename filetype ~J If the file already exists on your A-disk, a copy of that file is brought into virtual storage; then you can use XEDIT subcommands to make changes or ~ ~ =J \ '- Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 61 corrections to lines in that file. You enter an XEDIT subcommand by typing the subcommand and then pressing the RETURN key. (XEDIT subcommands, like CMS commands, can be typed in either uppercase or lowercase, or a combination of both.) If the file is not found on disk, the editor creates it in virtual storage. When a subcommand changes a line, the editor displays, or "verifies," the changed line. The editor also communicates with you by displaying error or information messages. For purposes of illustration in this chapter, anything displayed by the editor is enclosed in a box. Subcommands or data that you would enter are not. Now let's create a simple file. Its filename and filetype will be POEMl SCRIPT. The following command is entered to begin creating the file: r XEDIT POEMI SCRIPT l Because the file is new, the editor responds with the following messages: r Creating new file: XEDIT: l [ r~ Entering Data The following subcommands are discussed in this section: INPUT QUERY LRECL INPUT Subcommand After you enter the XEDIT command, you are in edit mode. You must be in edit mode to enter XEDIT subcommands. However, to enter data in the file, you must be in input mode. Type the following subcommand and press the RETURN key to enter input mode: r r r r l r [ r INPUT The editor displays the following message: I Input mode: You can then type in the data. Each line that you enter while in input mode is considered to be a data line and will be written in the file. To end a line, press the RETURN key; the line will then be inserted into the copy of the file in virtual storage. 62 VM/SP System Product Editor User's Guide I -, J J -1 ~ r::=:= J No line may be longer than the logical record length of the file, which varies according to filetype. To find out the logical record length of any file, you can enter the following subcommand (in edit mode): ] J QUERY LRECL ] J In the examples used here, the filetype is SCRIPT, which has a logical record length of 132. If you type more than 132 characters in a line before pressing the RETURN key, the editor truncates the extra characters. J N ow let's start typing lines to be entered in the file: ] "THE OCTOPUS," by Ogden Nash Tell me, 0 Octopus, I begs, Is those things arms, or is they legs? I marvel at thee, Octopus; If I were thou, I'd call me Us. =:J ~ When you are finished typing data and want to return to edit mode (either to make changes to the file or to end the editing session), press the RETURN key on a null line. ~ ~ The editor comes back with ~ =] I XEDIT: ---1 During an editing session, you can enter input mode at any time to insert new lines of data in the file. After the INPUT subcommand is entered, the editor inserts the lines you type after the current line. In this example, since the file is new, the lines are inserted at the beginning of the file. Later, you will see how to make any line the current line, so that you can insert lines between any two existing lines in a file. :=J =.J ~J :=J This is how the data looks in the file. The following two subcommands, which will be discussed later, are used to display the data that was entered in input mode: :=J =.1 TOP D I TOF: D ~J TYPE * 'I ~ =J =.J =:J ~ " Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 63 TOF: "THE OCTOPUS," by Ogden Nash Tell me, 0 Octopus, I begs, kS t~ose things arms, or is they legs? k marvel at thee, Octopus; kf I were thou, I'd call me Us. EOF: r [ Column Pointer Notice that the first letter in each line is underscored. Underscores will only show on terminals that allow underscoring (like a 2741). This underscore character L) is not contained in the file, and it will not appear on a printed copy of the file. It represents the column pointer. Various subcommands perform their editing functions within a line starting at the column pointer, which you can move to different column positions by using XEDIT subcommands that will be discussed later. The column under which the column pointer is positioned is called the current column. In the example above, the current column is column one. Moving through a File The following subcommands are discussed in this section: TYPE UP DOWN TOP BOTTOM When you use the XEDIT command to create a new file, the file is created in virtual storage. When the XEDIT command is used to call out an existing file, a copy is brought into virtual storage. In either case, you can picture the file as a series of records, or lines; these lines are available for you to change or delete. You can also insert new lines following any line that is already in the file. Line Pointer The line that you are currently editing is called the current line. Naturally, the line that is current changes as you move up and down in the file to edit various lines. When the line that is current changes, we say that the line pointer has moved. Many XEDIT subcommands perform their 64 VM/SP System Product Editor User's Guide ,-- l [ ] J ~ j000QaDLlDDO~'~ I oaaoaOOOGG Q "I -.J ~GG [ ] functions starting with the current line and move the line pointer when they are finished. ] You can change which line is current, that is, you can move the line pointer, by using the sub commands discussed in this section. J J What you do during an editing session is: ] J J J ] " Position the line pointer at the line you want to edit. o Edit the line (change characters in it, delete it, or insert new lines following it). o Position the line pointer at the next line you want to edit. TYPE Subcommand J ] Many XEDIT subcommands operate either on, or starting with, the current line. For example, the INPUT subcommand inserts new lines of data after the current line. Therefore, you often, need to determine which line is current so that you can move the line pointer, if necessary. ] To display the current line, enter the TYPE subcommand, whose format is: ] TYPE J To display more than one line, enter the TYPE subcommand with the number of lines you want to see. For example, the following subcommand displays 5 lines, beginning with the current line: J J TYPE 5 =J To display the entire file, you must first position the line pointer at the top of the file. The following subcommands move the line pointer to the top of the file and then display the entire file: J ] TOP =-J (moves the line pointer to the top of the file and displays "TOF:") ] 'rYPE J J J J J ~J * (displays all the lines in the file) After the TYPE subcommand is executed, the line pointer is positioned at the last line that was displayed. For example, if you type the entire file, the null "EOF" line will become the new current line. Of course, if you type only one (the current) line, the line pointer will not move. I '", .- -1 --.J J Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 65 UP an~ DOWN Subcommands You can move the line pointer up or down one or more lines. The UP subcommand moves the line pointer toward the beginning of the file and displays the new current line. Its format is: r UP n ,- where "n" is the number of lines you want to move the line pointer. If the number is omitted, "I" is assumed. l r-' The DOWN subcommand moves the line pointer toward the end of the file and displays the new current line. Its format is: r- DOWN n l l- where "n" is the number of lines you want to move the line pointer. If the number is omitted, "I" is assumed. Let's look at the poem file again: L TOP [, l (move the line pointer to the top of the file) [TOF: TYPE lr. . * [- -. (display the whole file) r TOF: ':'THE OCTOPUS," by Ogden Nash Tell me, 0 Octopus, I begs, ~s those things arms, or is they legs? ~ marvel at thee, Octopus; ~f I were thou, lid call me Us. EOF: l r- r r r The TYPE * subcommand was used to display the entire file; since the last line displayed by a TYPE subcommand is the new current line, the "EOF" line is now the current line. [ The following subcommands show how the UP and DOWN subcommands are used to move the line pointer up and down in the file. Each time the line pointer is moved, the editor displays the new current line. [r /' l l 66 VM/SP System Product Editor User's Guide IL [- ] J -, ---.J J UP 2 J (move the line pointer up two lines from the EOF line) J I marvel at thee, Octopus; J J DOWN :J (move the line pointer down one line) =-1 If J :J I were thou, I'd call me Us. ~ To insert new lines of data after any existing file line, you can do the following: :J • Issue the UP or DOWN subcommand to move the line pointer to the line after which you want the data to be inserted. • Then enter the INPUT subcommand. :J =:J TOP and BOTTOM Subcommands :J You can also move the line pointer to the the beginning or end of the file. :J :J To move the line pointer to the null "TOF" line that precedes the first line of the file, issue the following subcommand: =J TOP ~ To move the line pointer to the last file line, issue the following subcommand: ~ BOTTOM :J ~ To begin entering new lines either at the beginning or the end of a file, you can use the following sequence of subcommands: 0 TOP (or BOTTOM) ~ INPUT =:J Then you enter new data lines. ~ :J :=J :J ~J \ '- -- Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 67 Making Changes in a File The following subcommands are discussed in this section: r r CLOCATE CFIRST CINSERT CDELETE CAPPEND CHANGE Often, you need to insert or delete characters in a line or change one word to another. The subcommands discussed in this section enable you to insert, delete, or change characters based on the position of the column pointer, which is represented as an underscore character C) when a line is displayed. rC- r- -: CLOCATE Subcommand r-·' The CLOCATE subcommand is used to move the column pointer to the column where you want to insert, delete, or change characters. [ -' r- The CLOCATE subcommand searches a file, beginning with the current line, for a character string that you specify. Its format is as follows: i-' l CLOCATE/string/ C- ~ The character string should be enclosed in delimiters. The diagonal (/) is the delimiter used in these examples, but it may be any character (except for a plus ( + ), minus (-), not ("-,), or period (.» that does not also appear in the character string (for example, CLOCATE?VM/CMS?). r' L. r--: l If the string is found, two things happen: the line that contains the string becomes the new current line (and is displayed); and the column pointer moves under the first character of the string. l: For example, in the file shown above, the subcommands: C- TOP r-- l (move the line pointer to the top of the file) r- CLOCATE/legs/ (locate the string) l l cause the following line to be displayed: r- / I r68 VM/SP System Product Editor User's Guide [ J J -, ---1 ] J Is those things arms, or is they legs? ] Notice that the line pointer moved to the line containing the string "legs," and the column pointer moved under the first character of the string. J J CFIRST Subcommand J After using subcommands that move the column pointer, it's a good idea to reset the column pointer to the beginning of the line. The following subcommand moves the column pointer to the beginning of the line: ~] J CFIRST J For example, in the line shown above, where the column pointer is under the "1" in "legs," issuing a CFIRST subcommmand results in: =J ~J those things arms, or is they legs? ~s "- J J CINSERT Subcommand J The CINSERT subcommand is used to insert characters immediately before the column pointer. ~ ~J For example, a file contains the following line: =J ~] I ~ ~t. Everest is high. Note the position of the column pointer, in column one. To insert the phrase "exactly 29,000 feet" before the word "high," first move the column pointer to the first character in "high," by using the following subcommand: =.J ~ ~ CLOCATE/high/ ~J The editor moves the column pointer and displays the line: ~ I Mt. Everest is high. :J ~ :J :J :J Now you can insert the phrase: \ "'-, CINSERT exactly 29,000 feet Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 69 r The editor inserts whatever you type in the operand of the CINSERT subcommand. In the subcommand above, the spacebar was pressed once after the word "feet" so that a blank would separate "feet" and "high". The resulting line is displayed: I Mt. Everest is gxactly 29,000 feet high. .- I. f Let's look at another example. The CLOCATE subcommand is used to move the column pointer; then the CINSERT subcommand is used to insert characters immediately before the column pointer position. A file contains the following line: I Xf anything can go, it will. CLOCATE/,/ (move the column pointer) If anything can gOL it will. CINSERT wrong r" . t. ' (insert "wrong" before the column pointer) If anything can go_wrong, it will. (In the CINSERT subcommand above, note that there are two spaces between "CINSERT" and "wrong": one is the required space between the subcommand name and the operand; one is the blank space needed between "go" and "wrong".) If only one blank space were used, the result would be the following: I If anything can go~rong, it will. The editor allows you to insert blanks with the CINSERT subcommandsimply type the required number of blanks (by pressing the spacebar) in the operand. For example: 70 VM/SP System Product Editor User's Guide r I [ [ . J J -1 --.J -, _J ] If anything can J J go~rong, it will. CINSERT (Press the spacebar twice: once to separate the subcommand name and operand; once for the operand.) J J If anything can go_wrong, it will. ] J I _-.l CDELETE Subcommand J The CDELETE subcommand is used to delete one or more characters from the current line, starting at the column pointer. ~] A file contains the following line: --] =-J To be or not to be or not to be - that is the question. J --] The line contains one too many "or not to be". Since deletion starts at the column pointer, first move the column pointer with the following subcommand: J CLOCATE/or/ ~J ~ To be Qr not to be or not to be - that is the question. ~ Then, you can use the CDELETE subcommand to specify the number of characters to be deleted. Count the number of characters to be deleted, starting with the current column: =:J =:J CDELETE 13 :=-J The resulting line looks like this: =.J :J I To be Qr not to be - that is the question. ~ The CDELETE subcommand issued above specified a "13" as the operand; it means, "delete 13 characters, starting at the column pointer." :J .~ ~ =.J '- - Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 71 r - ® '.,'i,','i?),:""', :d If you did not want to count the number of characters, you could have specified the operand of the CDELETE subcommand as a character string. For example: CDELETE/or/ When this form of the CDELETE subcommand is used, it means, "delete characters from the column pointer to the first character of the string specified in the operand." The result would be the same as the line shown above; the extra "or not to be" would be removed. In summary, the CDELETE subcommand removes characters from a line, from the column pointer to the column position specified in the operand. The operand may be specified as the number of characters to be removed, or it may be specified as a character string. After the CDELETE subcommand is executed, the editor displays the changed line. l r CAPPEND Subcommand Use the CAPPEND subcommand to append words to the end of the current line. The format of the CAPPEND subcommand is: CAP PEND text where "text" represents the data you want to add to the end of the line. For example, a file contains the following line: I Xt is an ancient mariner, However, the line should read: It is an ancient mariner, and he stoppeth one of three. The following subcommand adds the desired text: CAPPEND and he stoppeth one of three. (Two blanks separate the subcommand name and the operand.) The resulting line looks like this: ,- It is an ancient mariner,_and he stoppeth one of three. 72 VM/SP System Product Editor User's Guide I J ] -1 -.J J Notice that the column pointer has moved to the first character of the appended text, which was a blank. -l -l ] CHANGE Subcommand J Changing One Word to Another ] Replacing one word with another is the simplest type of change. Use the following form of the CHANGE subcommand to change the first occurrence of a word in the current line: J J CHANGE/oldword/newword/ ] For example, the current line in a file contains the following: ] =J I ~ rose is a rose is a rose. ] CHANGE/rose/daisy/ J The resulting line looks like this: -1 --..J I~ J daisy is a rose is a rose. ~J Note that the editor automatically makes room in the line for "daisy," even though it is longer than "rose". Conversely, a word can be replaced by a shorter word; the editor removes extra blanks. J J You can use the CLOCATE and CHANGE subcommands to locate and change any string in a file. If the line containing the string is the current line, you don't have to use a CLOCATE subcommand; the CHANGE subcommand both locates the string and changes it. J J J Making a Global Change J J If you want to make a global change, that is, change every occurrence of a word, first move the line pointer to the line where you want the change to begin, and use the following form: :J CHANGE/oldword/newword/ ~ In the following example, the word "rose" is changed to "daisy" every time it appears. (The line pointer is already positioned at the first line shown.) :J ~ :J ~ =.J * * ( Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 73 r - 11 11 11 11 rose rose rose rose is is is is a a a a rose rose rose rose CHANGE/rose/daisy/ is is is is a a a a rose. rose. rose. rose. * * r l produces the following changes in the file (the editor displays only those lines that have been changed): r 11 11 11 11 daisy daisy daisy daisy is is is is a a a a daisy daisy daisy daisy is is is is a a a a daisy. daisy. daisy. daisy. r l l r-' Another variation of the CHANGE subcommand can be used when you want to change a word throughout the file, but you want to change only the first occurrence in each line: CHANGE/oldword/newword/ * [ ~ I L .' r- -. l Making a Selective Change Suppose that you want to change one word to another only some of the time. You can use repeated executions of the CLOCATE subcommand to scan the file, issuing a CHANGE subcommand only when you want to make the change. Instead of typing the same CLOCATE subcommand over and over, you can use the = subcommand, which repeats the last subcommand you' entered. U sing the = subcommand saves you the time it takes to retype the subcommand. To enter the = subcommand, simply type an equal sign (=) and press the RETURN key. Inserting and Deleting Lines The following subcommands are discussed in this section: INPUT line DELETE RECOVER REPLACE C- r- , [ [ r- l [-. C- [[ r[ ,l r l r l. 74 VM/SP System Product Editor User's Guide '.~ l r l. J J -'I ---1 J Inserting a Line J You can insert a single line of data between existing lines by using the INPUT subcommand followed by the line of data you want inserted. One blank must separate the subcommand name and the data line. J J For example: J INPUT this is the line I want to insert J inserts a single line following the current line, without leaving edit mode. (If you want t,O insert more than one line, you would issue the INPUT subcommand with no operand to enter input mode.) j J To insert a blank line in the file, enter the INPUT subcommand and press the spacebar at least twice before pressing the RETURN key. A blank line will be inserted after the current line. =:J ~ For example, if a file contains the following lines: J TOF: .J ~ome primal termite knocked ~nd tasted it, and found it ~nd that is why your Cousin on wood good, May, Eell through the parlor floor today. ~ ~ _] .. The current line is the last line displayed above. To insert a title line, issue the following subcommand: ~ INPUT "The Termite," by Ogden Nash ~ Now the file looks like this (TOP and TYPE 6 are used to display the whole file): =.J ~ TOF: ~ome primal termite knocked ~nd tasted it, and found it ~nd that is why your Cousin on wood good, May, Eell through the parlor floor today. ~The Termite," by Ogden Nash =J '-] ,......·1 _J ~J To insert a blank line between the poem and the title line, you could issue the following subcommands: CJ UP ~ (move the line pointer up one line) :J :.J =:J :='J INPUT '- '. (press the spacebar twice before pressing the RETURN key) Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 75 ~ ......• ~==:;l Now the file looks like this: TOF: §ome primal termite knocked on wood ~nd tasted it, and found it good, ~nd that is why your Cousin May, Kell throu9h the parlor floor today. ~The Termite," by Ogden Nash [ [ Deleting Lines Use the DELETE subcommand to delete one or more lines from a file, beginning with the current line. To delete only the current line, use the form: r DELETE To delete more than one line, specify the number of lines in the operand: DELETE 5 deletes five lines, including the current line. To delete the rest of the file, use the form: DELETE * If you want to delete a number of lines, and you don't want to bother counting how many, you can use the form: DELETE/string/ [ Lines will be deleted, starting with the current line, up to (but not including) the line containing the specified string. r' 'l, For example, if a file contains the following lines, and the first line shown is the current line: £ portable television a transistor radio frisbee loaf of bread ~ jug of wine ,thou a a r l r l The following subcommand: DELETE/bread/ r 76 VM/SP System Product Editor User's Guide l. r l ' J J J deletes all lines from the current line up to, but not including, the line containing "bread". Therefore, all that's left is: J -] a loaf of bread jug of wine .:thou ~ J j Lost and Found Department J If you delete one or more lines and change your mind, all is not lost. You can recover the lines at any time during an editing session with the RECOVER subcommand. j J The following subcommand returns lines deleted in an editing session: J RECOVER n ] where n represents the number of lines you wish to recover. J The last lines that were deleted are the first lines to be recovered. For instance, in our previous example of deleting lines, if you entered: J RECOVER 2 J you would get the radio and frisbee back: J ] ~ ~ ~ ~ transistor radio frisbee loaf of bread jug of wine .:thou ~J J .J The recovered lines are inserted starting at the current line. If the lines were deleted from different places in the file, you have to put them back where they belong by using the MOVE subcommand, discussed below. J J If you want to recover all lines that have been deleted during an editing session, use the form: ---) RECOVER .J J =-:J ~ * Replacing a Line You've seen how to insert a new line and delete a line, using INPUT line and QELETE. The REPLACE subcommand does both; it deletes the current line and replaces it with the text you specify. The format of the REPLACE subcommand is: =.J ~ ~J Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 77 REPLACE text However, if you enter the REPLACE subcommand with no text, the editor deletes the current line and automatically places you in input mode. l. [ Moving and Copying Lines The following subcommands are discussed in this section: MOVE COpy MOVE Subcommand Suppose you want to remove some lines from their current location and insert them in another part of the file. You can use the MOVE subcommand to move one or more lines, beginning with the current line, to a different location in the file. The format of the MOVE subcommand is as follows: MOVE from to The first operand represents the number of lines to be moved, starting with the current line. The second operand represents the destination; the line(s) is inserted after the destination line and is deleted from its original location. For example, to move the current line three lines down in the file, you can use the following subcommand: MOVE 1 3 r l To move the current line and the two lines following it three lines down in the file, you can use the following subcommand: MOVE 3 3 To move a line backward in the file, you can specify a minus (-) sign in front of the "to" operand. For example: MOVE 1 -3 moves the current line up two lines in the file. Remember, the "to" operand represents the line after which a line is to be moved; therefore, if the destination is - 3, the line is inserted after that line, or two lines up. To eliminate the need for counting lines, you can specify the "to" operand as a character string. The editor searches the file for a line that contains the string and moves the "from" line(s) after that line. 78 r l. VM/SP System Product Editor User's Guide r·· . I... ] ] -1 -) J For example: J MOVE 1 /string/ J J J J J moves the current line after the line containing the string. Similarly, you can move a line backward in the file by specifying a minus ( - ) sign before the string. For example: MOVE 1 -/string/ moves the current line backward in the file after the line that contains the string. J Let's look at an example: =-J filberts almonds cashews £hestnuts 2,ecans ~J =J ~alnuts =J The following subcommands would each move the line containing "filberts" (the current line) after the line containing "chestnuts". =-J J MOVE 1 3 or MOVE 1 /chestnuts/ =J --J almonds cashews chestnuts filberts 2,ecans ~ ~alnuts ~ =-J :J COpy Subcommand ~ The procedure for copying lines is the same as for moving lines. The COpy subcommand leaves the originalline(s) in place and makes a duplicate at the indicated destination. ~ -- ., _J The format of the COpy subcommand is: ~ COpy from to ~ One or more lines, beginning with the current line, are copied after the destination line. =.J ~ :=J =-'1 '. Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 79 0 J ~ _Uc:::.. I %§DaDClClOOClC>Cl~ ODQODDDt:lOO o - --- 0 '-----------_._--- LPREFIX Subcommand You can use the LPREFIX subcommand to simulate writing in the prefix area of the current line, even though the prefix area is not available on a typewriter terminal. LPREFIX can be used to perform some of the functions (for example, moving or copying lines) provided by prefix subcommands and macros on display terminals. For a description of the LPREFIX subcommand, see the VMjSP System Product Editor Command and Macro Reference. Ending an Editing Session r The following subcommands are discussed in this section: FILE QUIT SET AUTOSAVE FILE Subcommand When you use the XEDIT command to create a new file, the file is created in virtual storage. When you make changes to an existing file, those changes are made to a copy of the file that is brought into virtual storage (when the XEDIT command is entered). However, virtual storage is temporary. To write a new or modified file on disk, which is permanent storage, you must enter the following subcommand: FILE When the FILE subcommand 1S executed, the file is written on disk and control is returned to eMS. QUIT Subcommand Use the QUIT subcommand to end an editing session and leave the permanent copy of the file intact on the disk. If the file is new, it is not written on disk. The format of the QUIT subcommand is as follows: ,.. \ QUIT r L. You would use the QUIT subcommand instead of the FILE subcommand when you edit a file merely to examine, but not to change, its contents, or if you discover you have made errors in changing a file and do not want them to be recorded. 80 VM/SP System Product Editor User's Guide [ . J J J ] J J J ] J J J When a file is new or has been changed, the editor gives you a warning message to prevent the inadvertent use of a QUIT instead of a FILE. The message is as follows: File has been changed. Use QQUIT to quit anyway. If you really don't want to save the file, enter "QQUIT" (abbreviated as "QQ"). If you wish to save the changes, enter "FILE". SET AUTOSAVE Subcommand Files on disk are not affected if the system malfunctions, or "goes down." However, a new file that you're creating or the changes you're making to an existing file might be lost if the system fails. You can minimize this danger by using the SET AUTOSAVE subcommand, whose format is as follows: J SET AUTOSAVE n =J ] The SET AUTOSAVE subcommand causes your file to be written to disk automatically, after you've typed in or changed a certain number of lines. You specify what. that number will be with the "n" operand of the SET AUTOSAVE, subcommand. If you want the file written to disk, or "saved," every time you've changed ten lines, enter the following subcommand: J SET AUTOSAVE 10 J The SET AUTOSAVE subcommand can be issued at any time during an editing session. It's a good idea, however, to issue the subcommand right after you issue an XEDIT command to create a new file or to call an existing file from disk. J J J J J J J J :J' J When a file is saved on disk by AUTOSAVE, it is written into a new file. The filename of this file is a number and its filetype is "AUTOSAVE." If the system goes down while you're editing a file, you can change the fileid back to its original filename and filetype by issuing the CMS command ERASE to erase the original file and then by issuing the eMS command RENAME. For example, if your AUTOSAVE file is labeled "100001 AUTOSAVE AI" and the original file is "POEM 1 SCRIPT AI", use the following CMS commands to rename it: ERASE POEMI SCRIPT RENAME 100001 AUTOSAVE Al POEMI SCRIPT Al Then you'll be back in business and can use the XEDIT command to start editing the file again. ~ ~ Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 81 If you issue a SET AUTOSAVE subcommand while you're creating a new file, and then issue a QUIT subcommand, the file is not saved .. However, the AUTOSAVE file is still available on disk. If you issue a SET A UTOSA VE subcommand while you're revising an existing file and then you issue a QUIT subcommand, no revisions are saved. However, the AUTOSA VE file is still available on disk. r Inserting Data from Another File To insert all or part of one file into another, you can use the GET subcommand. The chapters in this book were created as separate files and then combined into one file by using the GET subcommand. (A file that you "get" is not destroyed; a copy of that file is inserted.) ," The GET subcommand inserts a file after the current line. Therefore, you must move the line pointer to the line after which you want to insert a file. If you want to insert another file at the end of your file, you can use the BOTTOM subcommand to make the last line current. If you want to insert another file somewhere in the middle of your file, you can use the UP or DOWN subcommands to make the desired line current. Inserting a Whole File Suppose you were writing a book of poetry, and you created a separate file for each poem. To combine two of the poems into one file, you would use the following form of the GET subcommand: GET filename filetype When the entire second file has been inserted, the editor displays the following message: r- , l I EOF Reached. For example, if you were editing a file called POEMl SCRIPT and wanted to insert another file called POEM2 SCRIPT, you would enter the following subcommands: i' . l. BOTTOM (move the line pointer to the end of the file) GET POEM2 SCRIPT (insert the whole file) 82 VMjSP System Product Editor User's Guide r 'l . ] ] --I _.J ] J J J Inserting Part of Another File To insert part of another file, you can specify in the GET subcommand the line number of the first line and the number of lines you want to insert. The following GET subcommand inserts the first ten lines of a second file: GET FILE2 DATA 1 10 ] If you don't know the line numbers, you can: call out a second file without ending your current editing session; put the lines you want to insert into a temporary file; and insert them into your current file. This might sound complicated, but all you need to learn is one more subcommand - PUT. First, let's identify the steps you would take to insert part of another file and then illustrate them with an example. 1. While editing the first file, enter an XEDIT subcommand to call out the second file. You do not have to end your current editing session, because the editor allows you to edit multiple files simultaneously. 2. Use the PUT subcommand to indicate which lines are to be inserted in the first file. The PUT subcommand stores lines in a temporary holding area, starting with the current line, up to an ending, or target, line. Its format is as follows: PUT target where "target" identifies the end of a group of lines to be inserted. It is a signal to the editor to stop "putting" lines. A target operand may be specified in various ways, which are described in detail in "Chapter 4: Using Targets." A brief description of two ways to specify a target follows. They are equivalent; you can choose whichever type you prefer. One way to specify the target is to count the number of lines you want to insert, starting with the current line. For example, if a file contains: a loaf of bread a jug of wine thou a portable television and the line containing" a loaf of bread" is current, the following subcommand stores all the above lines: PUT 4 Another way to specify the target is with a character string; the editor will "put" all the lines, beginning with the current line, up to, but not including, the line containing the string. Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 83 For example, the following subcommand will "put" the first three lines, but it will not "put" the line containing "a portable television". PUT/television/ 3. Enter a QUIT subcommand to return to your original file. 4. Make sure that the current line is the line after which you want to insert lines from the second file. Then enter the following subcommand: GET No operands are required. The lines that were stored by the PUT subcommand are inserted; the last line inserted becomes the new current line. 'l. The following example illustrates how the PUT and GET subcommands are used to insert part of a file into another file: A file, DESSERT COOKBOOK, is being compiled. It contains many recipes, among which is a recipe for cream puffs with chocolate sauce. The author of the cookbook keeps a separate file, called SAUCES COOKBOOK, which contains recipes for sauces. Whenever a recipe requires an accompanying sauce, the author can select a sauce recipe from the second file and insert it in the first. In this example, the recipe for chocolate sauce will be inserted after the recipe for cream puffs. (- XEDIT DESSERT COOKBOOK (Call out the first file.) CLOCATE/CREAM PUFFS/ (Locate the recipe.) TYPE 10 (Display the recipe. You could have displayed the whole file by using TYPE *, but it's not necessary.) QREAM PUFFS WITH CHOCOLATE SAUCE 2 1/2 1/2 1 2 2 OUNCES BUTTER TEASPOON SUGAR CUP FLOUR PINCH OF SALT EGGS CUPS HEAVY CREAM, WHIPPED ~LMOND COOKIES 84 VM/SP System Product Editor User's Guide r r -J ] -") -) J UP 1 J J J (Move the line pointer to the line after which you want to insert the sauce recipe. The editor displays the new current line, which is the blank line between "REAVY CREAM" and "ALMOND COOKIES".) -1 -.l J XEDIT SAUCES COOKBOOK - ) _J (Edit the second file.) J CLOCATE/CHOCOLATE SAUCE/ ] (Locate the sauce recipe.) ] TYPE 10 J (Display 10 lines.) ~J QHOCOLATE SAUCE ~J 12 ] 2 1 2 J OUNCES SEMI-SWEET CHOCOLATE OUNCES UNSWEETENED CHOCOLATE CUP HEAVY CREAM OUNCES COGNAC YINAIGRETTE SAUCE =J 1/2 CUP OLIVE OIL .J UP 10 J (Move the line pointer to the beginning of the recipe) J PUT/VINAIGRETTE/ =J Lines are stored, beginning with the line containing "CHOCOLATE SAUCE" and ending with the line preceding the one containing "VINAIGRETTE". The PUT subcommand could also be entered as PUT 7. -·1 _.J ~J QUIT J The original file is now being edited. =J GET -1 -.J The sauce recipe is inserted. J .J :J J The resulting file looks like this: '- Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 85 QREAM PUFFS WITH CHOCOLATE SAUCE 2 1/2 1/2 1 2 2 OUNCES BUTTER TEASPOON SUGAR CUP FLOUR PINCH OF SALT EGGS CUPS HEAVY CREAM, WHIPPED ~HOCOLATE SAUCE 12 2 1 2 OUNCES SEMI-SWEET CHOCOLATE OUNCES UNSWEETENED CHOCOLATE CUP HEAVY CREAM OUNCES COGNAC r- 8LMOND COOKIES l r l Using Special Characters The following subcommands are discussed in this section: SET IMAGE SET TABS QUERY TABS The SET IMAGE subcommand controls how special characters, once entered on an input line, are going to be represented in a file. The special characters affected by the SET IMAGE subcommand are: • Tab characters (X'05') • Backspace characters (X'16'). The format of the SET IMAGE subcommand is: SET IMAGE ON OFF CANON r Tab Characters \. The important thing to remember about tab settings is that there are two kinds: physical and logical. Physical tab settings are set manually on the typewriter; each time you press the TAB key, the type ball moves to the column you set up as the physical tab stop. 86 VM/SP System Product Editor User's Guide r r- ] ] - 1 __ J r-- J J Logical tab settings indicate the column positions where fields within a record begin. They are defined by the SET TABS subcommand, whose format is: -, _J SET TABS nl n2 n3 ... J where nl. .. represents the column numbers for the logical tab settings. J These logical tab settings do not necessarily correspond to the physical tab settings. ] How the data is entered in the file when you pr:ess the TAB key depends on whether the SET IMAGE subcommand has been issued with ON or OFF as the operand. (SET nvtAGE ON is the initial setting for all filetypes except SCRIPT, MACLIB, MODULE, and TEXT.) J ] J If SET IMAGE ON is in effect when you press the TAB key, the logical tab settings determine how the data will be entered in the file. The editor replaces the tab characters with an appropriate number of blanks, starting at the column where you pressed the TAB key, and ending at the last column before the next logical tab setting. The next character entered after the tab becomes the first character of the next field. -, _J J '--l I _J -, For example, if you enter: __ J SET TABS 1 15 ~J and then enter a line that begins with a tab character, the first data character following the tab is written into the file in column 15, regardless of the physical tab stop on the terminal. ._--\ _J ~ --- If SET IMAGE OFF is in effect, a tab character is inserted in the record, just as any other data character is inserted. No blanks are inserted. ) I ----' --J If you want to insert a tab character (X'05') into a record and SET IMAGE ON is in effect, you can issue a SET IMAGE OFF subcommand before entering the line, and then use the TAB key as a character key. Pressing the TAB key causes a tab character to be inserted in a line. _.1 ~ Setting Tabs :J When you create a file, default logical tab settings are in effect; therefore, you do not need to set them. To determine the default tab settings for a particular filetype, you can use the following subcommand: ~] --I _J QUERY TABS ~ ~ =:J ~ ~ ~ ( If you want to change the default tab settings, you can use the SET TABS subcommand. Then, regardless of what physical tab stops have been set up on your terminal, when you press the TAB key with SET IMAGE ON in effect, the data you enter is spaced to the columns you defined. '- Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 87 , I. ~--------------- Note: When the INPUT subcommand is used to enter one line, and SET IMAGE ON is in effect, the specified line is placed in the file starting in the first tab column defined by the SET TABS subcommand. For example, if you enter: SET TABS 5 10 15 20 and then enter an input line: INPUT This is the input line columns 1, 2, 3, and 4 contain blanks; the text begins in column 5. Therefore, make sure that the first number specified in the SET TABS subcommand is the column in which you want the data to begin. ,l Backspace Characters If you use backspaces and underscores in your file, you should issue SET IMAGE OFF or SET IMAGE CANON. SET IMAGE CANON is the initial setting for SCRIPT files. r -, l r - SET IMAGE OFF means that backspace characters (as well as tab characters) are left as they are entered. L__ . r- ' I .. SET IMAGE CANON means that regardless of how the characters are typed in (characters, backspaces, underscores), the editor orders the characters in the file as: character - backspace - underscore, character backspace - underscore, and so forth. If, for example, you want an input line to look like this: r -, [ r-- -, You could enter it as: ABC, 3 backspaces, 3 underscores - or 3 underscores, 3 backspaces, ABC A typewriter types out the line in the following order: A, backspace, underscore B, backspace, underscore C, backspace, underscore [ r' l which results in: If you need to modify a line that has backspaces, and you do not want to rekey all of the characters, you can use the ALTER subcommand to alter r 88 VM/SP System Product Editor User's Guide L I.. ] ~ 1-' -----=:::;>~ j{§LJDuuCJclununs;: ODODUDllOo.O J --I __ J Q~aa\ _ _____________________________________________________________________ ~c_--_--_-_-_-_--- ~ ] all of the backspaces to some other character. The following sequence shows how you can delete all of the backspace characters in a line: j J ALTER 16 + 1 .] * (alter all X'16's to +'s in this line) J ] CHANGE/_+// 1 J * (change all occurrences of" _ +" to null in this line) ] AAAAA --1 ..J ] Summary of XEDIT Subset ] This table summarizes the subcommands that have been presented in this chapter. When a subcommand can be abbreviated, its minimum abbreviation is shown in uppercase letters. ] ] Function To create or edit a file To enter data To control case setting To display file lines To move the line pointer ] =J J J J To move the column pointer -1 -j To locate data To make changes to the file -] J --1 __ ..J To To To To .J ~J To move lines To copy lines =.J ~ ~ =.J ~ recover deleted data insert one line delete lines replace a line Subcommand Xedit Input SET CASE Type Down Up TOP Bottom CLocate CFirst CLocate Change CInsert CDelete CAppend RECover Input line DELete Replace MOve COpy ( \ "- Chapter 3. An XEDIT Subset: Text Processing on a Typewriter Terminal 89 -- l Function To repeat a subcommand To control special characters To define logical tabs To display tab settings To display the logical record length To alter special character To end an editing session without saving the changes To save automatically after changing a specified number of lines To save the changed file when you have finished working on it To store lines in temporary file for subsequent imbed~n another To imbed a complete or a partial copy of one file in another To simulate writing in the prefix area of the current line Subcommand = SET IMage SET TABS Query TABS Query LRecl ALter QUIT SET AU tosave FILE PUT GET LPrefix l ( I. [- ,l rr [ lt·- L ,I, [ rI, ./ l l 90 VM/SP System Product Editor User's Guide [ ,.. ] :] --'I - ) J J - "\ -.J ---J J ~J -- ] What Is a Target? -J J The ability to locate a line from a target is one of the editor's most versatile functions. _.J Very simply, a target is a way that you identify a line to the editor. Targets are used to identify lines for two basic reasons: -J -- ] 1. To change which line is the current line ~J 2. To define the operating range of a subcommana's execution. J A target may be entered in the following ways: .J o By itself -J • As the operand of the LOCATE subcommand ~J • Before any XEDIT subcommand ~J o As the operand(s) in many other XEDIT subcommands. _J When a target is entered either by itself or as the operand of a LOCATE subcommand, the editor makes the target line the new current line. Entered before a subcommand, a target causes the editor to make the target line the new current line before it executes the subcommand. -] ~ ~ When a target is entered as the operand of various other XEDIT subcommands, it defines the range of that subcommand's execution. Most XEDIT subcommands begin their operation with the current line; the target operand is used to specify where the operation is to end. =J The following XEDIT subcommands have target operands: ~ ALL ---J =J ~ ~ ~J EXPAND REPEAT ( " -- Chapter 4. Using Targets 91 ALTER CHANGE COMPRESS COpy COUNT DELETE DUPLICAT EXTRACT HEXTYPE LOWERCAS MERGE MOVE PUT PUTD SET RANGE SET SELECT SHIFT SORT STACK TYPE UPPERCAS Refer to the publication VM/ SP System Product Editor Command and Macro Reference for a complete description of the subcommand formats. I~ There are various ways to specify any given target; all achieve the same result. How fancy you want to be depends on you. If you are a new user, you can specify targets in a simple way. As you become more experienced, you can take advantage of the flexibility that targets offer. A target can be expressed in the following ways: • An absolute line number • A relative displacement from the current line • A line name • A simple string expression • A complex string expression. rL You can use one or all of the above kinds of targets during an editing session; you can even use different kinds of target operands in the same subcommand. lJ~inn ::. tn ~h~nn~ Whi~h in~ I~ ~lIrr~nt - T::.rnpt • - - :;, ............... ................ ••••• ,.., •• I _ ••• "'" .............. ,..., ••• ----~ :I~ A Target Entered By Itself Look at Figure 21. When entered on the command line, any of the targets listed below would change the current line to the one shown in the bottom screen. (The current line is the line above the scale.) All the targets shown below are equivalent; which kind you use depends only on personal preference. How to use each kind of target is discussed throughout this chapter; the purpose of Figure 21 is to show you that there are various ways to identify any given line to the editor. ====> :11 (absolute line number) 92 VMjSP System Product Editor User's Guide [ l I .. J J -1 -.J J ====> +6 (relative displacement from the current line) ] ====> J . CLAUDE (line name previously assigned by SET POINT) ] ====> /egg/ (string) J The editor begins searching for the target with the line following the current line; if the target line is located, it becomes the new current line. I -.J J Notice that in the file identification line at the top of the screen, the "Line =" indicator shows that the current line has changed from line 5 (top screen) to line 11 (bottom screen). ] ] ] ] J ] ] J ] J J J ] ] ] ] I ~ ] J ] ] ( "- Chapter 4. Using Targets 93 TARGET1 00000 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 ====> 00012 00013 00014 00015 A1 V 132 Trunc=132 Size=14 Line=5 Col=l Alt=O l * * * Top of File * * * THE PHOENIX Deep in the study Of eugenics We find that fabled I .•. + .... 1 ..•. + .... 2 . . . . + .... 3 . . . . + .... 4 •••• + .... 5 .••• + .... 6 •••• + .... 7 •.• Fowl, the Phoenix. The wisest bird As ever was, Rejecting other Mas and Pas, It lays one egg, Not ten or twelve, And when it's hatched, Out pops itselve. /egg/ XED I T 1 File TARGET1 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 SCRIPT SCRIPT A1 V 132 Trunc=132 Size=14 Line=ll Co1=1 A1t=0 Deep in the study Of eugenics We find that fabled Fowl, the Phoenix. The wisest bird As ever was, Rejecting other Mas and Pas, It lays one egg, I ••• + .... 1 .... + .... 2 .... + .... 3 ..•. + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... Not ten or twelve, And when it's hatched, Out pops itselve. * * * End of File * * * ====> Figure 21. 94 XED I T 1 File Using a Target to Move the Line Pointer r VM/SP System Product Editor User's Guide l ] ] -1 r::=--------' ~ J A Target as the Operand of a LOCATE Subcommand J The targets listed aboye could have been specified as operands of the LOCATE subcommand, like this: ] ====> ====> ====> ====> ] J J LOCATE LOCATE LOCATE LOCATE :11 +6 .CLAUDE /egg/ You do not need to type "LOCATE" unless you want to. A target specified by itself implies the LOCATE subcommand; the name "LOCATE" is optional. - '1 -..J J -, A Target Preceding a Subcommand --.J A target can be entered in the command line before any XEDIT subcommand. The editor first makes the target line the new current line, and then executes the subcommand. For example: ] J ====> J :10 ADD 5 The editor makes line 10 the new current line and then adds five lines to the file. ] This method is equivalent to entering a target, pressing the ENTER key, entering the subcommand, and pressing the ENTER key. Typing both the target and the subcommand in the command line and pressing the ENTER key only once saves you time. =J J ] =J Using a Target as a Subcommand Operand J When a subcommand format shows that an operand may be specified as a target, the target is usually used to tell the editor how many lines the subcommand is to execute upon; in other words, it defines the range of that subcommand's operation. For example, a format of the UPPER CAS subcommand is: J J J ====> ] This format means, "starting with the current line, translate all lowercase characters to uppercase, up to, but not including, the target line." The translation is not executed on the target line itself. After execution, the last line translated becomes the new current line. ] J J J ~ J J UPPERCAS target Figure 22 is a before-and-after example of an UPPERCAS subcommand. When entered on the command line, any of the following subcommands would effect the translation shown in the bottom screen: /' f ( "- Chapter 4. Using Targets 95 ====> UPPERCAS :14 (absolute line number) ====> UPPERCAS +4 (relative displacement from current line) ====> UPPERCAS .STOP (line name previously assigned) ====> UPPERCAS (string) Isonl r' L J r l 96 VM/SP System Product Editor User's Guide ] J J J ] ] ] J J J J J TARGET2 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 SCRIPT A1 V 132 Trunc=132 Size=17 Line=10 Col=l Alt=O WINTER COMPLAINT Now when I have a cold I am careful with my cold, I consult my physician And I do as I am told. I muffle up my torso In woolly woolly garb, And I quaff great flagons Of sodium bicarb. I munch on aspirin, 1 • • • + .... 1 .... + .... 2 •... + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... I lunch on water, And I wouldn't dream of osculating Anybody's daughter, And to anybody's son I wouldn't say howdy, For I am a sufferer Magna cum laude. * * * End of File * * * ====> UPPERCAS/son/ XED I T J 1 File J J J J J ] J J J J ] TARGET2 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 SCRIPT A1 V 132 Trunc=132 Size=17 Line=13 Col=l Alt=l I consult my physician And I do as I am told. I muffle up my torso In woolly woolly garb, And I quaff great flagons Of sodium bicarb. I MUNCH ON ASPIRIN, I LUNCH ON WATER, AND I WOULDN'T DREAM OF OSCULATING ANYBODY'S DAUGHTER, I ••• + .... 1 .•.• + .... 2 . . . . + .... 3 ..•. + .... 4 .... + .... 5 ..•• + .... 6 •.•. + .... 7 ..• And to anybody's son I wouldn't say howdy, For I am a sufferer Magna cum laude. * * * End of File * * * ====> XED I T 1 File J J Figure 22. Using a Target as a Subcommand Operand J ] J ] J Chapter 4. Using Targets 97 Types of Targets Let's take a closer look at each of the ways to specify targets. A Target as an Absolute Line Number You can display line numbers in the prefix area by issuing the following subcommand: ====> r r- l SET NUMBER ON An absolute line number is represented as a colon (:) followed by the line number, for example, :10. The following examples illustrate targets specified as absolute line numbers: ====> :50 Make file line number 50 the new current line. ====> CHANGE /A/B/ :20 Beginning with the current line, change" A" to "B" in every line up to, but not including, line 20. Figure 23 is a before-and-after example of a COUNT subcommand whose target operand is specified as an 'absolute line number. The COUNT subcommand (top screen) means, "beginning with the current line, count how many times the string 'cone' appears in all lines up to but not including line 14." The string is counted only if it appears in the file exactly the way it is specified in the subcommand (in lowercase). When the ENTER key is pressed (bottom screen), notice that the last line searched (line 13) becomes the new current line, and the editor displays the message, "2 occurrences," in the message line. 98 VM/SP System Product Editor User's Guide r- l. ' ] ] --, _J J J TARGET3 ~] 00000 00001 00002 00003 00004 00005 00006 00007 00008 J J ~J 00009 00010 00011 00012 00013 00014 00015 00016 00017 ====> J J :J J -J SCRIPT A1 V 132 Trunc=132 Size=16 Line=8 Col=l Alt=O * * * Top of File * * * TABLEAU AT TWILIGHT I sit in the dusk, I am all alone. Enter a child and an ice cream cone. A parent is easily beguiled By sight of this coniferous child. The friendly embers warmer gleam, The cone begins to drip ice cream. I ••• + .. ' .. 1 . . . . + .... 2 . . . . + .... 3 . . . . + .... 4 ...• + .... 5 . . . . + .... 6 . . . . + .... 7 ..• Cones are composed of many a vitamin. My lap is not the place to bitamin. Although my raiment is not chinchilla, I flinch to see it become vanilla ... Exit child with remains of cone. I sit in the dusk. I am all alone, Muttering spells like an angry Druid, Alone, in the dusk, with the cleaning fluid. * * * End of File * * * COUNT Iconel :14 XED I T 1 File J ~ A1 V 132 Trunc=132 Size=16 Line=13 Col=l A1t=0 TARGET3 SCRIPT 2 occurrences. 00004 Enter a child and an ice cream cone. 00005 A parent is easily beguiled 00006 By sight of this coniferous child. 00007 The friendly embers warmer gleam, 00008 The cone begins to drip ice cream. 00009 Cones are composed of many a vitamin. 00010 My lap is not the place to bitamin. 00011 Although my raiment is not chinchilla, 00012 I flinch to see it become vanilla ... 00013 Exit child with remains of cone. I .•. + .... 1 . . . . + .... 2 . . . . + .... 3 . . . . + .... 4 . . . . + .... 5 . . . . + .... 6 . . . . + .... 7 ... 00014 I sit in the dusk. I am all alone, 00015 Muttering spells like an angry Druid, 00016 Alone, in the dusk, with the cleaning fluid. 00017 * * * End of File * * * J ~ --, .-J J :J ~] ~ ~ ====> ~ =:J Figure 23. XED I T 1 File A Target as an Absolute Line Number ~ ~ ~ ~ :J =.J '---- - Chapter 4. Using Targets 99 r- - l A Target as a Relative Displacement from the Current Line A relative displacement from the current line is an integer that means the target is a number of lines, either forward or backward, from the current line. The number may be preceded by a plus or minus sign, which indicates a forward (+ ) or backward ( - ) displacement from the current line. If the sign is omitted, a plus (+) is assumed. A relative displacement may also be specified as an asterisk (*), which means the Top of File (- *) or End of File ( + * or *) line. When an asterisk is specified as the target operand of a subcommand, the subcommand executes to the end (or top) of the file. r Examples: ====> ,.-- +3 The target is three logical lines down (toward the end of the file) from the current line. ====> -5 The target is five logical lines up (toward the top of the file) from the current line. ====> l r·· l [ L +* The target is the null End of File (or End of Range) line. ====> -* The target is the null Top of File (or Top of Range) line. l. ====> COpy +3 :25 Copy three lines, starting with the current line, after line number 25. In this example, two targets are specified. The first ( + 3) is a relative displacement from the current line; the second is an absolute line number. ====> DELETE * Delete all lines from the current line to the end of the file. Figure 24 is a before-and-after example of a target specified as a relative displacement. The target typed in the command line, + 9, means, "move the current line nine logical lines forward, toward the end of the file." Notice that line numbers do not have to be displayed in the prefix area to use this kind of target. However, the "Line =" indicator in the file identification area shows the old (Line = 10) and new (Line = 19) numbers of the current line. 100 VM/SP System Product Editor User's Guide r • ] p------------------------------------_._--_.__ ._._------._. __ ._--------.-._--._-_. __ ._---_._.-.. _-_. . . _._--_.---_. __ ._.... _.--.__ .__ ._._- ] J TARGET4 SCRIPT THE PANTHER ] J J J - Trunc=132 Size=28 Line=10 Col=l Alt=O THE CANARY I ••• + .... 1 .... + .... 2 .... + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. ] J J V 132 THE PANTHER IS LIKE A LEOPARD, EXCEPT IT HASN'T BEEN PEPPERED. SHOULD YOU BEHOLD A PANTHER CROUCH, PREPARE TO SAY OUCH. BETTER YET, IF CALLED BY A PANTHER, DON'T ANTHER. ] J A1 THE GIRAFFE I BEG YOU, CHILDREN, DO NOT LAUGH ====> +9 XED I T 1 File J ] TARGET4 A1 V 132 Trunc=132 Size=28 Line=19 Col=l Alt=O THE CANARY J THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. J J THE GIRAFFE ~] J =J J J SCRIPT ====> I BEG YOU, CHILDREN, DO NOT LAUGH I •.. + .... 1 .... + .... 2 .... + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... WHEN YOU SURVEY THE TALL GIRAFFE. IT'S HARDLY SPORTING TO ATTACK A BEAST THAT CANNOT ANSWER BACK. HE HAS A TRUMPET FOR A THROAT, AND CANNOT BLOW A SINGLE NOTE. IT ISN'T THAT HIS VOICE HE HOARDS; HE HASN'T ANY VOCAL CORDS. I WISH FOR HIM, AND FOR HIS WIFE, A VOLUBLE GIRAFTER LIFE. XED I T J ] Figure 24. 1 File A Target as a Relative Displacement :J J .J J J Chapter 4. Using Targets 101 A Target as a Line Name Any line in a file can be assigned a name of one to eight characters preceded by a period (.), for example, .PART2. You can use either the SET POINT subcommand or the .xxxx prefix subcommand to define a name(s) for a line. The SET POINT subcommand is 'used to define a name of one to eight characters, preceded by a period, to the current line. Using the .xxxx prefix subcommand allows you to define a name for any line in whose prefix area the name is entered; the name is one to four characters, preceded by a period. r. Assigning a name to a line makes it unnecessary for you to look up its line number or determine its relative displacement. Although the absolute line number of any given line can change during an editing session as lines are added or deleted from the file, a name stays with a line for the entire editing session. A line name is particularly useful if you plan to refer to a line many times during an editing session. You need assign the name only once; the line can then be referenced by its name at any time. It remains in effect only for the current editing session. Remember to type the line name exactly as it was when originally assigned to the line; the editor always pays attention to uppercase and lowercase characters when looking for a line name. r- l ,-- ., Examples: 1. U sing the SET POINT subcommand to name a line: ====> SET POINT .PART2 Assign the name ".PART2" to the current line. ====> TOP I'.'Iove the line pointer to the Top of File line. ====> CHANGE /A/B/ .PART2 Change "A" to "B" in every line, starting with the current line (in this case, the Top of File line) up to the line named ".PART2." 2. U sing the .xxxx prefix subcommand to name a line: To use the .xxxx prefix subcommand, type a name preceded by a period in the prefix area of any line on the screen, as illustrated below: .STOP data data data This is the line I want to name. data r- r- l l 102 VM/SP System Product Editor User's Guide l • J J -, ...J C J You can name any line on the screen with the .xxxx prefix subcommand; the line does not have to be the current line, as it does with the SET POINT subcommand. After the ENTER key is pressed the assigned name disappears from the prefix area and is replaced by equals signs or line numbers (depending on whether SET NUMBER OFF or SET NUMBER ON is in effect). Then, you can refer to the line by using its assigned name. J J J J Examples of using lines that have been already named: ] ====> J .STOP Make the line named" .STOP" the new current line. ====> ] MOVE 1 .STOP Move the current line after the line named ".STOP". ] Note: After a name is assigned to a line, you must keep track of it. You can issue the subcommand QUERY POINT to display the name(s) of the currerit line, or you can use QUERY POINT * to display all names that have been defined during the editing session. J J Figure 25 is a before-and-after example of a DELETE subcommand that has its target operand specified as a line name. The line that contains "THE PARSNIP" was previously named ".STOP". The subcommand typed in the command line means, "beginning with the current line, delete lines up to but not including the line that has been assigned the name '.STOP'." J J J J J J =-1 ] J :J ~] J ~ :J :J /" ~ ~ .J Chapter 4. Using Targets 103 TARGETS SCRIPT Al V 132 Trunc=132 Size=13 Line=l Col=l Alt=O r ,- * * * Top of File * * * l CELERY I ••• + .... 1 .... + .... 2 .... + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... CELERY, RAW, DEVELOPS THE JAW, BUT CELERY, STEWED, IS MORE QUIETLY CHEWED. THE PARSNIP THE PARSNIP, CHILDREN, I REPEAT, ====> DELETE .STOP XED I T 1 File r- l TARGETS SCRIPT 7 liners) deleted. Al V 132 Trunc=132 Size=6 Line=l Col=l Alt=l r l. * * * Top of File * * * THE PI\RSNIP I •.• + .... 1 . . . . + .... 2 . . . . + .... 3. ",'+'" .4 . . . . + .... 5 . . . . + .... 6 . . . . + .... 7 ... THE PARSNIP, CHILDREN, I REPEAT, IS SIMPLY AN ANEMIC BEET. SOME PEOPLE CALL THE PARSNIP EDIBLE; MYSELF, I FIND THIS CLAIM INCREDIBLE. * * * End of File * * * r r- ====> XED I T 1 File r r I, Figure 25. A Target as a Line Name r l, 104 VMjSP System Product Editor User's Guide [- - J J -1 ..-J [ J A Target as a Simple String Expression J A target can be specified as one or more characters, that is, a string, contained in a file line. The editor looks for the string, making the first line that contains it the target line. J ] If the string target is specified alone or as the operand of a LOCATE subcommand, the line containing the string becomes the new current line. If the string target is an operand of one of the other XEDIT subcommands, the line that contains the string determines the range of the subcommand's execution. J J J The string must be enclosed in delimiters, which can be any character that does not appear in the string itself. However, if you use one of the following special characters as a delimiter, you must also specify a search direction (+ or -): plus (+), minus (-), not ("I), or period (.). The search direction is explained below. j ] J ] For example, the following is a string target, entered alone on the command line: ] ====> ] This means, "beginning with the line following the current line, search for the string 'whatever' and make the line that contains it the new current line." ] The following is an example of a string target used as the operand of a subcommand: -") -.J J J ====> The simplest way to specify a string target, as shown above, is one or more characters surrounded by delimiters. You can also: J J • • • J J By typing a plus (+) or minus (-) sign before a string target, you can tell the editor to search for a string in either a forward or backward direction from the current line. J ] J J Determine the direction of the search Search for a line that does not contain a given string Search for any of several strings. Specifying a Search Direction J J DELETE /whatever/ This means, "delete all lines from the current line up to, but not including, the line that contains 'whatever'." J J /whatever/ \, , A plus sign in front of a string target means that the search for the string starts at the line following the current line in a forward direction, toward the end of the file. If the string is found, the line that contains it becomes Chapter 4. Using Targets 105 the new current line. If a sign is omitted, a plus is assumed. The following targets are equivalent: ====> /whatever/ and ====> +/whatever/ You can also specify that the search occur backward in the file by typing a minus sign before the string target. For example: ====> -/whatever/ means, "search backward in the file, starting with the line preceding the current line, and make the line containing the string the new current line." Let's look at some more examples: ====> DELETE /rosebud/ Delete lines beginning with the current line, up to but not including the line containing "rosebud". ====> COpy /daisy/ -/petunia/ Copy lines starting with the current line, up to the line containing "daisy", and insert them after the line containing "petunia", which is located in a backward direction from the current line. ====> PUT /Chapter2/ [ [ l r r l C [ rl, r' rL Put lines from the current line, up to the line that contains "Chapter2". Using a "NOT" Symbol (-,) You can precede any string target with a NOT symbol (-,), which means that the target is a line that does not contain the specified string. For example: r L ====> i/Part Number/ Beginning with the line following the current line, locate a line that does not contain "Part Number" and make it the new current line. ====> MOVE 1 i/Part Number/ Move the current line after the first line that does not contain "Part Number". Using an "OR" Symbol (I) A string target can comprise multiple strings, separated by an "OR" symbol, each enclosed in delimiters. The editor searches the file one line at a time. The first line that contains one of the specified strings becomes the current line. For .example: r- l If a file contains the following lines: 106 VM/SP System Product Editor User's Guide r l r L ] J apples peaches plums pears oranges The following subcommand: ====> Locate /oranges/I/pears/I/peaches/ will make the following line current: peaches Using an "AND" Symbol (&) You may use an "AND" symbol in the same way that you use the "OR" symbol. The editor searches the file one line at a time and the first line that contains all of the strings specified becomes the current line. For example: If a file contains the following lines: Truffles, Leg of Lamb, Chocolate Mousse Turkey eggs, Leg of Lamb, Savarin Escargot, Leg of Lamb, Bombe the following subcommand: ====> Locate /Leg of Lamb/&/Bombe/ will make the following line current: --, ~ ===== Escargot, Leg of Lamb, Bombe A Summary of Simple String Targets You've seen how to specify a target as a single string, enclosed in delimiters. You've also seen how a plus or minus sign, a NOT symbol, an OR symbol, and an AND symbol can be used to further define a string. In addition, all of these features can be combined to define a single target, that is, a single string, enclosed in delimiters, can be preceded by a plus or minus sign and a NOT symbol. Two or more strings may be separated by OR and/or AND symbols. Furthermore, if the subcommand SET HEX ON is in ~ffect, a string may be specified in hexadecimal notation, for example, /X'C3D4E2' /. The following chart summarizes the format of a simple string expression: Chapter 4. Using Targets 107 [+ 1-] [-,] /stringl [/& [-1] /string2/ [ 1[-,] /string3/] ] ... 1 2 3 4 5 The search direction is toward the end of the file (+) or toward the top of the file (-). If the sign is omitted, a plus (+) is assumed. "NOT" symbol (locate something that is not the specified string) Character (or hexadecimal) string. 4 "AND" symbol (ampersand)(Locate the line containing stringl and string2.) "OR" symbol (vertical bar)(Locate the line containing stringl and string2 or string3.) Examples: ====> /horse/ searches downward in the file, beginning after the current line, for the first line that contains "horse" and makes it the current line. ====> -,/house/ searches downward in the file for the first line that does not contain "house" and makes it the current line. l r l [ ====> /horse/ & /house/ 1 /hay/ searches downward in the file for the first line that contains both "horse" and "house" or that contains "hay," whichever occurs first. ====> /horse/I-,/house/ searches downward in the file for the first line that contains "horse" or does not contain "house". ====) -/x'cl'/I/x'C2'/ searches upward for the first line containing either or both of the strings specified here in hexadecimal (if SET HEX ON has been issued). If SET HEX ON is in effect, the editor locates a line containing "A" or "B." If SET HEX OFF is in effect, the editor locates a line containing "X'Cl'" or "X'C2'." r l Figure 26 is a before-and-after example of a target specified as a simple string expression. The target typed in the command line means, "beginning with the line following the current line, search for a line that either does not contain 'Experience' or for a line that does contain 'experience', and make it the new current line." 108 VM/SP System Product Editor User's Guide r l J J - 1 -1 ] ] TARGET6 SCRIPT A1 V 132 Trunc=132 Size=8 Line=O Col=l Alt=O ] ] ] :J J ] J J J * * * Top of File * * * I·· .+ .... 1 .... + .... 2 .... + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... Experience is a futile teacher, Experience is a prosy preacher, Experience is a fruit tree fruitless, Experience is a shoe-tree bootless ... For sterile wearience and drearience, Depend, my boy, upon experience. I'd trade my lake of experience For just one drop of common sense. * * * End of File * * * ====> ./Experience/I/experience/ XED I T 1 File J J TARGET6 SCRIPT A1 V 132 Trunc=132 Size=8 Line=5 Col=l Alt=O :] ~ * * * Top of File * * * Experience is a futile teacher, Experience is a prosy preacher, Experience is a fruit tree fruitless, Experience is a shoe-tree bootless ... For sterile wearience and drearience, I· .. + .... 1 .... + .... 2 •... -t ••..• 3 .... + .... 4 .... + .... 5 .... + .... 6 . . . . + .... 7 ... Depend, my boy, upon experience. I'd trade my lake of experience For just one drop of common sense. * * * End of File * * * J .J =--J J :J ====> XED I T Figure 26. 1 File A Target as a Simple String Expression ---1 -.J Chapter 4. Using Targets 109 A Target as a Complex String Expressio'n A complex string expression has the same format as a simple string expression (see above), but any string can be expressed as a "complex string," which is a string associated with one or more of the following SET subcommand options: SET ARBCHAR allows you to specify only the beginning and end of a string, using an arbitrary character to represent all characters in the middle. SET CASE allows you to specify whether or not the difference between uppercase and lowercase is to be significant in locating a string target. SET SPAN allows you to specify if a string target must be included in one file line or if it may span a specified number of lines. r r C" SET VARBLANK allows you to control whether or not the number of blank characters between two words is significant in a target search. You can use one or more of these options to suit your individual text processing needs. Each of the options is assigned an initial setting by the editor. You can alter the setting one or more times during an editing session by issuing the appropriate SET subcommand. (See the publication VMj SP System Product Editor Command and Macro Reference for a complete description of these SET subcommand options.) l. Using a Target with SET ARBCHAR r When SET ARBCHAR ON is in effect, you can use a dollar sign ($), which is the default arbitrary character, to represent all characters between the beginning and end of a string target. L i' l Examples: ====> /air$plane/ The beginning of the string is "air"; the end of the string is "plane". The dollar sign is the arbitrary character and represents any characters between "air" and "plane". This string target causes the editor to locate either of the following file lines, and makes current whichever line comes first: The airplane landed. r rl, Cold air surrounded the plane. 110 - l VM/SP System Product Editor User's Guide r l ] ] -, L----____________________-_-_---_ .... _--_-_----__________________________________________________ J Using a Target with SET CASE ~~ --.J ] You can specify whether the editor is to respect or ignore the difference between uppercase and lowercase representations of alphabetic letters by using the SET CASE subcommand. J J The following subcommand tells the editor that uppercase and lowercase representations of the same letter do not match: ] ====> ] SET CASE MIXED RESPECT For example, if a file contains the following line: J -, ===== The Text Editor .-J The following string target will not locate that line: ] ====> J /the text editor/ On the other hand, the following subcommand tells the editor to ignore the difference between uppercase and lowercase: =J ====> --,I SET CASE MIXED IGNORE -.J With this setup, in the example above, the line would be located. J Using a Target with SET SPAN ~] Usually, a string must be included in a single file line in order to be located. You can use the SET SPAN subcommand to specify that a string target may span a specified number of lines and still be located. The line that contains the beginning of the string becomes the new current line. --J ~ ~J ~ In a text file, like a SCRIPT file, a blank separates each file line. The following subcommand tells the editor that a string target may span two lines, separated from each other by a blank: J ====> :J The string target: ====> =J SET SPAN ON BLANK 2 /twigs to probe/ :J would locate in the file: :J ===== :J The string "twigs to probe" begins on one line and ends on the next. Woodpecker finches of the Galapagos Islands use twigs to probe holes in tree trunks for edible insects. ~ :J ~ ~ ~ ( '-- Chapter 4. Using Targets 111 Using a Target with SET VARBLANK The SET VARBLANK subcommand can be used to control whether or not the number of blank characters between two words is significant in a target search. SET VARBLANK ON means that the number of blanks between two words can vary; the number of intervening blanks specified in a string target does not have to be equal to the number in the file. For example: r ====> /the house/ l would locate either of the following lines in the file: the house the house If SET V ARBLANK OFF is in effect (the initial setting), the number of blanks between two words is significant in a target search. In the above example, only the second line would be located. r L . Combining the SET Options You can tailor the SET options, ARBCHAR, CASE, SPAN, and VARBLANK to meet your particular text processing needs. For example, with SET ARBCHAR ON, SET CASE MIXED IGNORE, SET SPAN ON BLANK 2, and SET VARBLANK ON, you can: • Specify only the beginning and end of a string target • Locate a string whether it is in uppercase or lowercase • Allow the string target to locate a string that starts on one line and ends on another • Disregard the number of intervening blanks between two words. Figure 27 is a before-and-after example of using a target specified as a complex string expression. The following subcommands were issued: ====> ====> ====> SET ARBCHAR ON $ SET CASE MIXED IGNORE SET SPAN ON BLANK 2 The string target typed in the command line locates the line shown in the bottom screen. The ARBCHAR option allows the beginning and end to be specified; the CASE option allows the string to be specified in lowercase even though it appears in the file in both uppercase and lowercase; the 112 r [ r r r l VM/SP System Product Editor User's Guide r· \ ] j SPAN option allows the beginning and end of the string to be located on two consecutive lines. ] J TARGET7 ] --------- ] ] --------- ] ----- ] Al V 132 Trunc=132 Size=19 Line=10 Col=1 Alt=O MORE ABOUT PEOPLE J J ] SCRIPT ----====> When people aren't asking questions They're making suggestions And when they're not doing one of those They're either looking over your shoulder or stepping on your toes And then as if that weren't enough to annoy you They employ you. Anybody at leisure Incurs everybody's displeasure. I •.• + .... 1 .... + .... 2 .... + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... It seems to be very irking To people at work to see other people not working. So they tell you that work is wonderful medicine, Just look at Firestone and Ford and Edison, And they lecture you till they're out of breath or something And then if you don't succumb they starve you to death or something. All of which results in a nasty quirk: That if you don't want to work you have to work to earn enough money so that you won't have to work. +/fire$breath/ XED I T 1 File TARGET7 SCRIPT Al V 132 Trunc=132 Size=19 Line=14 Col=1 Alt=O And when they're not doing one of those They're either looking over your shoulder or stepping on your toes And then as if that weren't enough to annoy you They employ you. Anybody at leisure Incurs everybody's displeasure. It seems to be very irking To people at work to see other people not working. So they tell you that work is wonderful medicine, Just look at Firestone and Ford and Edison, I ••• + .... 1 .... + .... 2 .... + .•.. 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... And they lecture you till they're out of breath or something And then if you don't succumb they starve you to death or something. All of which results in a nasty quirk: That if you don't want to work you have to work to earn enough money so that you won't have to work. * * * End of File * * * ====> XED I T Figure 27. 1 File A Target as a Complex String ExpreSSIOn Chapter 4. Using Targets 113 Using Column-Targets The targets discussed so far effect line pointer movement, that is, if the editor locates the target, the line pointer is moved. However, the column pointer is not moved. Furthermore, if a target is expressed as a string, only the first occurrence of the string is located in a line. The CLOCATE subcommand operates on a specialized operand called a column-target. This subcommand is used to locate all occurrences of a string throughout a file and to move the column pointer. The format of the CLOCATE subcommand is as follows: r l ====> CLOCATE column-target where the column-target can be expressed as an absolute column number, a relative displacement from the current column, or a string expression. The following examples show the various ways to express a column-target. Notice how the column pointer moves after each subcommand is executed. Current Line: ,- l c r L John Keats studied medicine and practiced as an apothecary. I ••• + .•.• 1 . . . . + ..•. 2 . . . . + ..•• 3 .••. + •... 4 ..•. + .••. 5 ..•• + •.•. 6 •••• + •.•• 7 ..• ====> CLOCATE :6 (absolute column number) John Keats studied medicine and practiced as an apothecary. < •.. +1 ... 1 . . . . + •..• 2 .... + •..• 3 .••• + •... 4 ...• + •.•• 5 .•.• + •.•. 6 •••. + ..•• 7 •.. [ Current Line: I James Joyce was a school teacher in Dublin. l I ••. + •.•• 1 . . . . + ••.• 2 ••.. + ••.. 3 •••• + ...• 4 .•.• + •... 5 ••.• + •.•• 6 •.•• + .••• 7 ••. ====> CLOCATE +6 (relative column number) James Joyce was a school teacher in Dublin. < ••• +.1 .. 1 .... + •..• 2 •••. + •..• 3 ..•• + •.•. 4 .•.• + •..• 5 .••• + •••. 6 .••• + •.•• 7 .•• Current Line: Herman Melville worked as a customs inspector in N.Y.C. I ••• + .•.. 1 . . . . + .•.. 2 •... + ..•• 3 .•.. + .... 4 .•.• + •.•• 5 ••.• + •.•. 6 •••. + ..•• 7 ••. ====> CLOCATE /customs/ Herman Melville worked as a customs inspector in N.Y.C. <... + ••.• 1 .... + ..•. 2 •..• + .•• 13 .••. + ..•• 4 .•.• + •.•• 5 .•.• + •.•. 6 •••. + ..•• 7 ••• r 114 VM/SP System Product Editor User's Guide ] ---, Current Line: Charles Dickens served as a law clerk and was a reporter. I ... + .... 1 . . . . + .... 2 . . . . + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 . . . . + .... 7 ... --1 ====) CLOCATE /reporter/I/clerk/ -J J J Charles Dickens served as a law clerk and was a reporter. < ... + .... 1 .... + .... 2 .•.. + .... 3 .... + .... 4 .... + ... 15 •••• + .... 6 . . . . + .... 7 ... The CLOCATE subcommand scans the file, starting with the column following (or preceding, depending on the search direction) the column pointer in the current line, for the specified column target, and moves the column pointer to the target, if it is located. In addition, the line pointer is moved (if necessary), so that CLOCATE can be used successively to locate all occurrences of a string in a file. CLOCATE is also necessary because various subcommands perform their operations based on the position of the column pointer. The CLOCATE subcommand is first used to position the column pointer; then another subcommand that operates based on the position of the column pointer can be used. The following is a list of all subcommands that operate based on the position of the column pointer. --1 CAPPEND Appends text to the end of the current line, and moves the column pointer under the appended text. -..l CDELETE Deletes one or more characters from the current line, starting at the column pointer, up to a column-target. CFIRST Moves the column pointer to the beginning of the line. CINSERT Inserts character(s) in a line, starting at the column pointer. CLAST Moves the column pointer to the end of the line. CLOCATE Moves the column pointer to a specified column-target. COVERLAY Replaces characters in the current line, starting at the column pointer; blanks in the operand do not overlay characters in the file line . .. -, ~ CREPLACE Chapter 4. Using Targets 115 Replaces characters in the current line, starting at the column pointer; characters can be replaced with blanks. These subcommands are discussed in detail in the publication VM/SP System Product Editor Command and Macro Reference. Column-targets are discussed in that book in the "Usage Notes" section of the CLOCATE subcommand. The following examples illustrate how to use the CLOCATE and CDELETE subcommands to delete a word: If anything can go wrong, it will. I ••• + .... 1 .... + .... 2 ...• + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... ====> r CLOCATE I wrongl (Move column pointer under first character of string to be deleted.) If anything can go wrong, it will. 12 •••• + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 . . . . + .... 7 ... <... + .... 1 .•.. + ... ====> CDELETE 1,1 (Delete from column pointer up to the comma.) r L If anything can go, it will. <... + .... 1 .... + ... 12 •••• + .... 3 •••• + .... 4 •••• + .... 5 •••• + .... 6 •••• + .... 7 ••• r 116 VM/SP System Product Editor User's Guide l ] ] -j _J J J ] -, -.J -1 --.J ] ] The }(EDIT Subcommand ~J ~J - When you issue the eMS command XEDIT, a copy of the specified file is brought into virtual storage, where it remains until you issue a FILE or QUIT subcommand. In other words, the XEDIT command brings one file at a time into storage. By entering the XEDIT subcommand during an editing session, you can bring more than one file into virtual storage at a time. , _.J -=-J -_OJ The format of the XEDIT subcommand is identical to that of the XEDIT command and is as follows: --.J J ====> -, -) Xedit [fn [ft [fm]]] [(options ... [)]] For a complete description of the XEDIT subcommand operands, refer to the publication VMj SP System Product Editor Command and Macro Reference. -1 _J ~J , ----.J Creating a Ring of Files in Storage ~J Multiple files are kept in virtual storage in a "ring." Each time you issue an XEDIT subcommand with a new fileid, a file is added to the ring and becomes the current file, which is the file that is displayed. ~J ~J A file remains in the ring until a FILE or QUIT subcommand is issued for that file; then the preceding file in the ring is displayed. The number of files you can edit simultaneously is limited only by your virtual storage =-:J ---, _J SIze. -] Figure 28 illustrates a ring of files in storage. :J --1 :=J :J :J .=-.J ( '-, Chapter 5. Editing Multiple Files 117 Figure 28. A Ring of Files in Storage By issuing the following subcommand, you can display the number of files in the ring and the file identification line of each file: ====) r I. QUERY RING Editing the Files in the Ring The order in which you can edit the files in the ring depends on how you specify the XEDIT subcommand: • If you issue the XEDIT subcommand without operands, the next file in the ring appears on the screen. (See Part 1 of Figure 29.) Therefore, a series of XEDIT subcommands issued without operands allows you to switch from the first file to the second, the second to the third, and so forth, all the way around the ring and back to the first file. • You can alter this sequence by issuing the XEDIT subcommand with the fileid of a file in the ring. The specified file becomes the current file and appears on the screen, regardless of it::; relaLive position in the ring. (See Part 2 of Figure 29.) • If you issue an XEDIT subcommand with a fileid of a file that is not already in the ring, that file is added to the ring just after the current file and is displayed. (See Part 3 of Figure 29.) ( l. r l r l. • If the XEDIT subcommand is issued with a fileid and the file does not exist, that file is created, added to the ring just after the current file, and displayed. r l [ r l 118 VMjSP System Product Editor User's Guide [ ~ J ] r' .............--.. ------- .-----.-----..-------------------.-----.--.------:::J .'J J Current File (*) Figure 29. XEDIT Subcommand ===> XEDIT ===> XEDIT FILES ===> XEDIT FI LED New Current File (*) Editing Files in the Ring '-1 Ending an Editing Session When you are finished editing a particular file, you can issue a FILE or QUIT subcommand for that file. The file is removed from the ring, and the previous file in the ring is displayed. To end .the editing session for all of the files and return control to CMS, use the CANCEL macro, whose format is as follows: ====> CANCEL Issuing the CANCEL macro is equivalent to issuing a QUIT subcommand for each file in the ring. If any of the files were modified, the usual warning message is displayed for each of those files: Chapter 5. Editing Multiple Files 119 File has been changed. Use QQUIT to quit anyway. You can then issue either QQUIT or FILE. If none of the files being canceled were modified, control is immediately returned to CMS. Multiple Logical Screens Up unfil now, we have been discussing editing multiple files with one file, the current file in the ring, displayed at a time. By using the SET SCREEN subcommand, you can divide the physical screen into multiple logical screens. The screen can be split vertically, horizontally, or in a combination of vertical and horizontal segments. You can display a different file from the ring in each logical screen, or you can display multiple views of the same file. Each logical screen looks and functions like the physical screen. Each one becomes, in effect, an independent terminal with its own file identification line, command line, and message line. For more information about multiple logical screens, refer to the publication VM/SP System Product Editor Command and Macro Reference. SET SCREEN Subcommand l. , Issuing the command, SET SCR 2, will split the screen horizontally into two screens, one on top of the other. The command SET SCR 2 V, will split the screen vertically into two screens, one beside the other. U sing the SIZE option with the SET SCREEN subcommand allows you to create horizontal screens with the number of lines that you specify. For example, SET SCR SIZE 14 10, will create two screens, one with 14 lines, and another with 10 lines. Likewise, the WIDTH option is used to specify the number of columns each vertical screen will contain. If SET SCR WID 25 25 30 is issued, 3 vertical screens are created, the first with 25 columns, the second with 25 columns, and the third with 30 columns. The initial setting of the SCREEN option is SCREEN SIZE n, where n is the physical screen size. To return to the initial setting, issue the following subcommand: ====> SET SCREEN 1 120 VM/SP System Product Editor User's Guide r r I I. - ] ] -l c=:_______________________________________________________________________ •.J --_-~~~_-_-~_, ~J For more information about this command, refer to the publication, VM/SP System Product Editor Command and Macro Reference. J ] Multiple Views of the Same File ] If only one file is in virtual storage and you issue a SET SCREEN subcommand, identical views of the file appear on the screen. ] Figure 30 is a before-and-after example of a SET SCREEN subcommand that creates two views of the same file. ] ~J Making Changes from Multiple Views of the Same File ~J You can edit a file by typing over the data in any of the views, and by entering subcommands in any of the command lines and prefix areas. You can type related prefix subcommands in different views of a file, even when different parts of the file are displayed. For example, you can type a "C" (copy) prefix subcommand in one view, and a "P" (preceding) prefix subcommand in another view. Changes made to the file from one logical screen are reflected immediately in all screens. ~J -] '] ] However, subcommands that control the screen display, for example, FORWARD, affect only that screen from which they were issued. Therefore, you can see different parts of a file at the same time . =J .J Similarly, PF keys assigned to screen movement subcommands are executed only on the view that contains the cursor when the PF key is pressed. -] ,-J ] :J .] -] ~J ,] 'J '] :J J ~J ~J ~J I I ~ Chapter 5. Editing Multiple Files 121 L - -_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ NASH SCRIPT Al V 132 ._::J Trunc=132 Size=6 Line=6 Col=l Alt=O * * * Top of File * * * THE OCTOPUS TELL ME, 0 OCTOPUS, I BEGS, IS THOSE THINGS ARMS, OR IS THEY LEGS? I MARVEL AT THEE, OCTOPUS: IF I WERE THOU, I'D CALL ME US. I •.• + .... 1 .... + .... 2 .... + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... * * * End of File * * * ====> SET SCREEN 2 XED I T NASH .sCRIPT Al V 132 1 File Trunc=132 Size=6 Line=6 Col=l Alt=O c l TELL ME, 0 OCTOPUS, I BEGS, IS THOSE THINGS ARMS, OR IS THEY LEGS? I MARVEL AT THEE, OCTOPUS: IF I WERE THOU, I'D CALL ME US. I ••• + .... 1 •••• + .... 2 .••• + .... 3 .•.. + .... 4 •... + .... 5 ...• + .... 6 . . . . + .... 7 ..• * * * End of File * * * l. [ C ====> NASH SCRIPT Al V 132 XED I T Trunc=132 Size=6 Line=6 Col=l Alt=O 1 File TELL ME, 0 OCTOPUS, I BEGS, IS THOSE THINGS ARMS, OR IS THEY LEGS? I MARVEL AT THEE, OCTOPUS: IF I WERE THOU, I'D CALL ME US. I ••• + .... 1 . . . . + .... 2 . . . . + .... 3 . . . . + .... 4 . . . . + .... 5 . . . . + .... 6 . . . . + .... 7 ... * * * End of File * * * ====> XED I T 1 File l C l I~ Figure 30. Multiple Horizontal Views of the Same File f l 122 VMjSP System Product Editor User's Guide J J Multiple Views of Different Files When multiple files are being edited and you issue a SET SCREEN subcommand that increases the number of logical screens, the additional screens are immediately filled with files selected from the ring. Figure 31 illustrates how additional logical screens are filled with files from the ring. The ring of files contains files named FILE1 and FILE2; the current file is FILEl. The SET SCREEN subcommand shown in the top screen causes another file to be displayed. If a SET SCREEN subcommand decreases the number of logical screens, files are displayed as long as logical screens are available. Those files for which logical screens are not available are removed from the display. Issuing an XEDIT subcommand from one of multiple screens is just like issuing it when there is only one screen. It does not affect the other logical screens. In all cases, the file is displayed only on the screen from which the XEDIT subcommand was issued. The status area of all the screens displays the number of files in virtual storage, not the number of screens. Order of Processing You can type over the data, type subcommands on the command line, and type prefix subcommands and macros in the prefix area of all views of a file(s) before pressing a key (like the ENTER key) that effects the changes. The editor processes requests typed on different views in the following order: 1. Changes typed over the data in all the views are made first. Changes are processed in the order that the data lines appear on the physical screen, from the top, moving left to right, to the bottom. 2. Prefix subcommands and macros are executed next, as follows: All prefix subcommands and macros are placed in a "pending list" before they are executed. Only one pending list is executed for each file, regardless of the number of views of that file. However, the other views of a file are updated to reflect the changes. The pending list is executed from the first view of each file or from the view that contains the cursor, if any view does. This means that all messages from prefix subcommands and macros will be displayed in the screen from which the pending list was executed. Cursor positioning for prefix subcommands and macros is determined by what lines are displayed in the screen with the cursor. Note that when multiple files are displayed, one pending list is executed for each file, and all views reflect the changes. See other CURSOR considerations below. Chapter 5. Editing Multiple Files 123 For more information on the pending list, see Chapter 7 in this book. 3. Subcommands typed on the command lines are executed last and in the following order: With multiple horizontal screens, the command lines are processed from the top view to the bottom view. With multiple vertical screens, the command lines are processed left to right. With a combination of horizontal and vertical screens, the command lines are processed in the same order that the screens were defined in the SET SCREEN DEFINE subcommand. Cursor Considerations The cursor remains in the view that contained it when the ENTER key (or P A/PF key) was pressed. This is true even if a CURSOR subcommand is issued in another view. If no view of a file contained the cursor (for example, if part of the physical screen was left undefined and your cursor was positioned there), then the cursor is placed in the first logical screen on the physical screen (the top-most screen for horizontal views, the left-most screen for vertical views, or the first view defined via SET SCREEN DEFINE). r' L You can move the cursor from one logical screen to another by issuing SOS TABCMDF or SOS TABCMDB. For more information on the SET SCREEN subcommand, refer to the publication VM/SP System Product Editor Command and Macro Reference. I" l 124 VM/SP System Product Editor User's Guide J j -1 -------------- r: .-..J J ] FILE1 SCRIPT A1 V 132 Trunc=132 Size=7 Line=O Col=l Alt=O J J ] J * * * Top of File * * * I •.• + .... 1 . . . . + .... 2 . . . . + .... 3 . . . . + .•.. 4 ..•. + •... 5 . . . . + .... 6 . . . . + .... 7 ... THE PANTHER THE PANTHER IS LIKE A LEOPARD, EXCEPT IT HASN'T BEEN PEPPERED. SHOULD YOU BEHOLD A PANTHER CROUCH, PREPARE TO SAY OUCH. BETTER YET, IF CALLED BY A PANTHER, DON'T ANTHER. * * * End of File * * * J J ] J ====> set screen 2 v XED I T =J 2 Files J =J FILE1 J SCRIPT A1 V 132 Trunc=132 FILE2 SCRIPT A1 V 132 Trunc=132 J :J =] * * * Top of File * * * I ••• + .... 1 . . . . + .... 2 . . . . + .... 3 ... THE PANTHER THE PANTHER IS LIKE A LEOPARD, EXCEPT IT HASN'T BEEN PEPPERED. SHOULD YOU BEHOLD A PANTHER CROUC PREPARE TO SAY OUCH. BETTER YET, IF CALLED BY A PANTHE DON'T ANTHER. * * * End of File * * * :=J ~ ~] ~ =:J ====> * * * Top of File * * * I ••• + .... 1 . . . . + .... 2 .••. + .... 3 ... THE CANARY THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOtiLTING THEY'RE PRETTY REVOLTING. * * * End of File * * * ====> ~] Figure 31. :J Multiple Vertical Views of Different Files ~ =J ~ =J =J "Chapter 5. Editing Multiple Files 125 r- l ,- l r--, ,- . r-- , L.. 126 VM/SP System Product Editor User's Guide ] J -, ~ J ] J J ] ] j By using the following SET subcommand options, you can tailor the full-screen layout to suit your preferences: J SET SET SET SET SET SET SET SET J J ~] ~ =-J PREFIX CMDLINE MSGLINE CURLINE SCALE TABLINE COLOR NUMBER For a complete description of these options, refer to the SET subcommand description in the publication VMjSP System Product Editor Command and Macro Reference . :J .~ The areas of the screen that can be changed are discussed below. ~ Prefix Area =J Use the SET PREFIX subcommand to control the display of the prefix area. You can display the prefix area on the left or the right side of the screen, or you can remove the prefix area from the display or you can set NULLS in the prefix area. Initially, the prefix area is displayed on the left. ~ :J Command Line ~ Use the SET CMDLINE subcommand to move the command line to the same line as the message line (the second line of the screen), to the last line of the screen, or remove the command line from the screen. Initially, the command line is the last two lines of the screen. If you move the command line to the message line or the last line, the status area is not displayed. ~ ~J :J With SET CMDLINE TOP (command line on line 2) and the default SET MSGLINE setting (line 2), a message overlays the command line, including the arrow. You must press the ENTER. or CLEAR key to recover the command line. To avoid this situation, assign the message line to line 1 or line 3 when using CMDLINE TOP. '··-1 :=J ~ /" I ~ :=J --=.J \ ............ _-- Chapter 6. Tailoring the Screen 127 Message Line Use the SET MSGLINE subcommand to define the location of the message line on the screen, and the number of lines the message may expand to, to avoid clearing the screen to display the message. It may also be used to override the blank line that is normally displayed on the screen for messages. Current Line Use the SET CURLINE subcommand to define a specified line of the screen as the current line. Initially, the current line is in the middle of the screen. Remember that the editor uses the first line of the screen for the file identification line. Therefore, if you want the current line to be the first available screen line, use the subcommand SET CURLINE ON 2. One reason you might want to change the position of the current line is to vary the size of the input zone. When you issue an INPUT subcommand, the editor provides an input zone between the current line and the command line. To get a larger input zone, move the current line higher on the screen; to get a smaller input zone, move it lower on the screen. [- - (- - r --- Scale I Use the SET SCALE subcommand to move the scale to a specified line, or to remove the scale from the display. Initially, the scale is positioned under the current line. If you move the current line, you probably also will want to move the scale. Tab Line r---- r --~ Use the SET TABLINE subcommand to display, on a specified line, a "T" in every tab column, according to the current tab settings (as defined by the SET TABS subcommand). Initially, a tab line is not displayed. If you change the tab settings during an editing session, the tab line will reflect that change, that is, the "T"s will be placed in the new tab columns. r--- l Color Depending on the features supported by your terminal, you can use the SET COLOR subcommand to associate specific colors, highlighting, extended highlightings, and programmed symbol set feaLures with various physical locations on the screen. The physical locations include the arrow, current line, file area, prefix area, command line, scale line, tab line, file identification line, pending message display area, shadow line, status area, top of file and end of file lines, and the message line. Colors associated with those areas can be: blue, red, pink, green, turquoise, yellow, white, or your default terminal display color. You can accentuate this capability by using programmed syn:bo1 sets or extended highlighting features such as blinking, reverse video, and underlining. r 128 VM/SP System Product Editor User's Guide r- ] J -1 c--- _J J J , --------------------------------------------~ For a complete explanation of this function refer to the publication, VM/SP System Product Editor Command and Macro Reference. J Number Use the SET NUMBER subcommand to specify whether the prefix area should contain line numbers. Initially, equal signs are used. J ] Figure 32 through Figure 37 illustrate how some of the sub commands discussed above are used to tailor the screen. Notice how the screen changes when the subcommand shown in the command line of each screen is executed. ] J J J J =J =J =-1 ~] ~ =:J =.] =:J ~ :J =:J J :J :J =.J =J =.J :=J ~ "" Chapter 6. Tailoring the Screen 129 TAILOR SCRIPT Al V 132 * * * Top of File * THE PANTHER Trunc=132 Size=28 Line=9 Co1=1 Alt=O * * THE PANTHER IS LIKE A LEOPARD, EXCEPT IT HASN'T BEEN PEPPERED. SHOULD YOU BEHOLD A PANTHER CROUCH, PREPARE TO SAY OUCH. BETTER YET, IF CALLED BY A PANTHER, DON'T ANTHER. I ••• + .... 1 .... + .... 2 .... + .... 3 .••• + .... 4 .•.. + .... 5 •..• + .... 6 .•.. + .... 7 ..• THE CANARY THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. THE GIRAFFE ====> SET PREFIX ON RIGHT TAILOR SCRIPT Al V 132 XED I T 1 File Trunc=132 Size=28 Line=9 Col=l Alt=O * * * Top of File * * * THE PANTHER r- . l THE PANTHER IS LIKE A LEOPARD, EXCEPT IT HASN'T BEEN PEPPERED. SHOULD YOU BEHOLD A PANTHER CROUCH, PREPARE TO SAY OUCH. BETTER YET, IF CALLED BY A PANTHER, DONiT ANTHER. r_- I ••• + .... 1 .... + .... 2 .... + .... 3 .... + .... 4 .... + .... 5 •... + .... 6 .•.. + .... 7 •.. THE CANARY THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. THE GIRAFFE ====> XED I T Figure 32. 130 The SET PREFIX Subcommand - "Before" and "After" VMjSP System Product Editor User's Guide 1 File J J -1 ~J j J J TAILOR SCRIPT A1 V 132 Trunc=132 Size=28 Line=9 Col=l Alt=O * * * Top of File * * * THE PANTHER J THE PANTHER IS LIKE A LEOPARD, EXCEPT IT HASN'T BEEN PEPPERED. SHOULD YOU BEHOLD A PANTHER CROUCH, PREPARE TO SAY OUCH. BETTER YET, IF CALLED BY A PANTHER, DON'T ANTHER. ] =J I •.. + .... 1 . . . . + .... 2 . . . . + .... 3 . . . . + .... 4 . . . . + .... 5 •... + .... 6 . . . . + .... 7 .•. THE CANARY ~J THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. J J THE GIRAFFE J ====> SET CMDLINE TOP XED I T J 1 File ~ ~] TAILOR SCRIPT A1 V 132 ====> * * * Top of File * * * THE P,A.NTHER ~ ~ Trunc=132 Size=28 Line=9 Col=l Alt=O THE PANTHER IS LIKE A LEOPARD, EXCEPT IT HASN'T BEEN PEPPERED. SHOULD YOU BEHOLD A PANTHER CROUCH, PREPARE TO SAY OUCH. BETTER YET, IF CALLED BY A PANTHER, DON'T ANTHER. ~ ~-] ~J I ••• + .... 1 . . . . + .... 2 .•.. + .... 3 ...• + .... 4 ...• + .... 5 . . . . + .... 6 . . . . + .... 7 ..• THE CANARY :J THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. ~ :J :J =:J THE GIRAFFE I BEG YOU, CHILDREN, DO NOT LAUGH WHEN YOU SURVEY THE TALL GIRAFFE. Figure 33. ~J The SET CMDLINE Subcommand - "Before" and "After" ~ ._] :=J :J ~ "- Chapter 6. Tailoring the Screen 131 TAILOR SCRIPT Al V 132 ====> SET CURLINE ON 3 * * * Top of File * * * THE PANTHER Trunc=132 Size=28 Line=9 Col=l Alt=O THE PANTHER IS LIKE A LEOPARD, EXCEPT IT HASN'T BEEN PEPPERED. SHOULD YOU BEHOLD A PANTHER CROUCH, PREPARE TO SAY OUCH. BETTER YET, IF CALLED BY A PANTHER, DON'T ANTHER. I ••• + .... 1 .••. + .... 2 ••.• + .... 3 ...• + .... 4 •••• + .... 5 .•.. + .... 6 .•.. + .... 7 ••• THE CANARY THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. THE GIRAFFE I BEG YOO, CHILDREN, DO NOT LAUGH WHEN YOU SURVEY THE TALL GIRAFFE. TAILOR ====> SCRIPT Al V 132 Trun6=132 Size=28 Line=9 Col=l Alt=O r- l THE CANARY THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. THE GIRAFFE I •.• + .... 1 . . . . + .... 2 .... +.!' .3 . . . . + .... 4 . . . . + .... 5 . . . . + .... 6 . . . . + .... 7 ... I BEG YOU, CHILDREN, DO NOT LAUGH WHEN YOU SURVEY THE TALL GIRAFFE. IT'S HARDLY SPORTING TO ATTACK A BEAST THAT CANNOT ANSWER BACK. HE HAS A TRUMPET FOR A THROAT, AND CANNOT BLOW A SINGLE NOTE. IT ISN'T THAT HIS VOICE HE HOARDS; HE HASN'T ANY VOCAL CORDS. I WISH FOR HIM, AND FOR HIS WIFE, A VOLUBLE GIRAFTER LIFE. * * * End of File * * * Figure 34. r [ The SET CURLINE Subcommand - "Before" and "After" r- l 132 VM/SP System Product Editor User's Guide ] J --------, r-------------------------------- ---------------------- TAILOR SCRIPT Al ====> SET SCALE OFF V 132 Trunc=132 Size=28 Line=9 Col=l Alt=O THE CANARY THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. THE GIRAFFE I ••• + .... 1 .... + .... 2 .... + .... 3 .... + .... 4 .... + .... 5 .... + .... 6 .... + .... 7 ... I BEG YOU, CHILDREN, DO NOT LAUGH WHEN YOU SURVEY THE TALL GIRAFFE. IT'S HARDLY SPORTING TO ATTACK A BEAST THAT CANNOT ANSWER BACK. HE HAS A TRUMPET FOR A THROAT, AND CANNOT BLOW A SINGLE NOTE. IT ISN'T THAT HIS VOICE HE HOARDS; HE HASN'T ANY VOCAL CORDS. I WISH FOR HIM, AND FOR HIS WIFE, A VOLUBLE GIRAFTER LIFE. * * * End of File * * * TAILOR ====> SCRIPT Al V 132 Trunc=132 Size=28 Line=9 Col=l Alt=O THE CANARY THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. THE GIRAFFE I BEG YOU, CHILDREN, DO NOT LAUGH WHEN YOU SURVEY THE TALL GIRAFFE. IT'S HARDLY SPORTING TO ATTACK A BEAST THAT CANNOT ANSWER BACK. HE HAS A TRUMPET FOR A THROAT, AND CANNOT BLOW A SINGLE NOTE. IT ISN'T THAT HIS VOICE HE HOARDS; HE HASN'T ANY VOCAL CORDS. I WISH FOR HIM, AND FOR HIS WIFE, A VOLUBLE GIRAFTER LIFE. * * * End of File * * * Figure 35. The SET SCALE Subcommand - "Before" and "After" Chapter 6. Tailoring the Screen 133 TAILOR SCRIPT Al V 132 ====> SET TABLINE ON 4 Trunc=132 Size=28 Line=9 Col=1 Alt=O THE CANARY THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. r THE GIRAFFE [ I BEG YOU, CHILDREN, DO NOT LAUGH WHEN YOU SURVEY THE TALL GIRAFFE. IT'S HARDLY SPORTING TO ATTACK A BEAST THAT CANNOT ANSWER BACK. HE HAS A TRUMPET FOR A THROAT, AND CANNOT BLOW A SINGLE NOTE. IT ISN'T THAT HIS VOICE HE HOARDS; HE HASN'T ANY VOCAL CORDS. I WISH FOR HIM, AND FOR HIS WIFE, A VOLUBLE GIRAFTER LIFE. * * * End of File * * * TAILOR ====> SCRIPT T T T THE CANARY T Al T V 132 T Trunc=132 Size=28 Line=9 Col=l Alt=O T T T T T T T T [-: T THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. THE GIRAFFE I BEG YOU, CHILDREN, DO NOT LAUGH WHEN YOU SURVEY THE TALL GIRAFFE. IT'S HARDLY SPORTING TO ATTACK A BEAST THAT CANNOT ANSWER BACK. HE HAS A TRUMPET FOR A THROAT, AND CANNOT BLOW A SINGLE NOTE. IT ISN'T THAT HIS VOICE HE HOARDS; HE HASN'T ANY VOCAL CORDS. I WISH FOR HIM, AND FOR HIS WIFE, A VOLUBLE GIRAFTER LIFE. * * * End of Fil~ * * * Figure 36. The SET TABLINE Subcommand - "Before" and "After" rl rL 134 VM/SP System Product Editor User's Guide r- L J J -1 _..J c J J J TAILOR SCRIPT Al V 132 Trunc=132 Size=28 Line=9 Col=1 Alt=O ====> SET MSGLINE ON 3 15 OVERLAY T T T THE CANARY ] T T T T T T T T T T T T THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. ] J THE GIRAFFE ~J I BEG YOU, CHILDREN, DO NOT LAUGH WHEN YOU SURVEY THE TALL GIRAFFE. IT'S HARDLY SPORTING TO ATTACK A BEAST THAT CANNOT ANSWER BACK. HE HAS A TRUMPET FOR A THROAT, AND CANNOT BLOW A SINGLE NOTE. IT ISN'T THAT HIS VOICE HE HOARDS; HE HASN'T ANY VOCAL CORDS. I WISH FOR HIM, AND FOR HIS WIFE, A VOLUBLE GIRAFTER LIFE. * * * End of File * * * J :J J :J -1 -.J ~ ~ TAILOR SCRIPT ====> QUERY COLOR =.J T T T THE CANARY :J THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. ~ =.J * T Al T V 132 T Trunc=132 Size=28 Line=9 Col=1 Alt=O T T T T T T T T T THE GIRAFFE I BEG YOU, CHILDREN, DO NOT LAUGH WHEN YOU SURVEY THE TALL GIRAFFE. IT'S HARDLY SPORTING TO ATTACK A BEAST THAT CANNOT ANSWER BACK. HE HAS A TRUMPET FOR A THROAT, AND CANNOT BLOW A SINGLE NOTE. IT ISN'T THAT HIS VOICE HE HOARDS; HE HASN'T ANY VOCAL CORDS. I WISH FOR HIM, AND FOR HIS WIFE, A VOLUBLE GIRAFTER LIFE. * * * End of File * * * ~ :J =:J :J .J .J Figure 37 (Part 1 of 2). SET MSGLINE on Multiple Lines with Overlay =:J =J " ~ "-- - ~] ~ Chapter 6. Tailoring the Screen 135 '!,.'\,.'.I".:.'.,'::i.I)J,;::,:.!';,'::".":':'.'~ , ' . : . ' . " ' · ' B t ·. \ ";"®:'."':" ' '" , :. ,: 0·""" ~ TAILOR ====> COLOR COLOR COLOR COLOR COLOR COLOR COLOR COLOR COLOR COLOR COLOR COLOR COLOR SCRIPT ARROW CMDLINE CURLINE FILEAREA IDLINE MSGLINE PENDING PREFIX SCALE SHADOW STATAREA TABLINE TOFEOF Al V 132 DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT RED DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT Trunc=132 Size=28 Line=9 Col=l Alt=O NONE NONE NONE NONE NONE NONE NONE NONE NONE NONE NONE NONE NONE HIGH NOHIGH HIGH NOHIGH HIGH HIGH HIGH NOHIGH HIGH NOHIGH HIGH HIGH NOHIGH PSO PSO PSO PSO PSO PSO PSO PSO PSO PSO PSO PSO PSO THE CANARY THE SONG OF CANARIES NEVER VARIES. AND WHEN THEY'RE MOULTING THEY'RE PRETTY REVOLTING. , .. l THE GIRAFFE Figure 37 (Part 2 of 2). SET MSGLINE on Multiple Lines with Overlay r' l I r: l r ~- r- I ~ 136 VM/SP System Product Editor User's Guide J J -'1 _.J J J J J J j J J J The macro language is one of the most powerful facilities that the editor provides. By writing macros, you can: ] ~J ] -1 =J J J • Expand the prefix subcommand language • Tailor the language to your own application o Eliminate repetitive tasks. What Is an XEDIT Macro? J An XEDIT macro is a REXX file that is invoked from the XEDIT environment. J ] (A macro may also be written using the EXEC 2 language. However, all examples in this chapter are based on the REXX language.) :=J You execute a macro the same way you execute XEDIT subcommands; type the macro name on the command line (or the prefix area) and press the ENTER key. A macro may be executed by entering only its name (or synonym), or its execution may also depend on arguments you enter when the macro is invoked. ~] -J :J A macro file can contain: ::J • • • " ~ J =.J Expand the basic subcommand language This chapter explains how to write an XEDIT macro, discusses those XEDIT subcommands designed for use in macros, describes' an XEDIT macro written for a text processing application, explains a profile macro, and explains how to write prefix macros. You should be familiar with the Restructured Extended Executor (REXX) language, which is described in the publications VM/ SP System Product Interpreter User's Guide and VM/ SP System Product Interpreter Reference before you read this chapter. --'1 -1 ~] • XEDIT subcommands REXX instructions CMS and CP commands. Chapter 7. The Macro Language ~ 137 r- l Creating a Macro File Because an XEDIT macro is a normal CMS file, it may be created in any of the ways that CMS provides for file creation. It can even be created dynamically, by using the XEDIT multiple file editing capability (see "Chapter 5. Editing Multiple Files"). As soon as a FILE subcommand is executed for the macro file, the macro can be used. Like any CMS file, a macro file is identified by filename, filetype, and filemode. The file identifier for a macro file must follow certain rules: o For macros entered from the command line, the filename is a string of one to eight alphameric characters. This name is used to invoke the macro. For example, if the filename is SEND, entering "SEND" during an editing session causes the macro to be executed. (For information on the search order and handling filenames that contain numbers, see "Avoiding Name Conflicts" later in this chapter.) r [ [ Prefix macro filenames may be one to eight characters, but they may not contain numbers. (Because the prefix area is only five positions long, you can define a synonym for a prefix macro filename that is longer than five characters. For more information on defining synonyms for prefix macros, see "Writing Prefix Macros," later in this chapter, and the SET PREFIX subcommand description in the VM/SP System Product Editor Command and Macro Reference.) o The filetype must be XEDIT. • The filemode can specify any of your accessed disks, for example, AI. Using XEDIT Subcommands in a Macro r l A macro can contain any XEDIT subcommand, with the following exceptions: prefix macros cannot contain READ, QUIT, FILE, SET RANGE, SORT, and LPREFIX. However, some subcommands perform functions that are meaningful only in the context of a macro, for example, one that passes information to the System Product Interpreter. The following list summarizes these subcommands; some are then discussed according to function. For detailed information on all of these subcommands, refer to the publication VM/SP System Product Editor Command and Macro Reference. CMS CMSG 138 RESTORE SET CTLCHAR r l VM/SP System Product Editor User's Guide l. J J -1 _J J COMMAND CP CURSOR EMSG EXTRACT MACRO MSG PRESERVE READ ] J J J SET COLOR SET DISPLAY SET MSGLINE SET MSGMODE SET PENDING SET RESERVED SET SCOPE SET SELECT STACK =J Communicating between the Editor and the Interpreter J The following subcommands are discussed in this section: ~ READ EXTRACT =:J -, -----.J Both READ and EXTRACT can supply a macro with information. ~] The READ subcommand is used to find out what the user has entered on the screen. It places fields that have been changed on the screen in the console stack. Once something is in the console stack, it cannot be used by the macro until it has been taken out of the console stack. The REXX PULL instruction is used to take information out of the console stack and assign it to program variables, which can then be examined by the macro. =.J =.J ~ The EXTRACT subcommand can supply a macro with information about internal XEDIT variables or about file data. The information is returned in one or more variables, which can then be examined or used by the macro. ~ :J The following sections provide examples of using READ and EXTRACT. =J READ Subcommand :J When a READ subcommand is issued from a macro, the editor displays "Macro-read" in the status area of the user's screen and waits for the user to enter data and/or press a key. (The file image remains on the screen.) After a key is pressed, the data is placed in the console stack. =:J :=J ~ Operands of the READ subcommand can be used to specify how much information is placed in the console stack. The READ subcommand can be used to place either the command line or all changed lines in the console stack. In addition, you can request that a tag identifying the origin of the line(s) be inserted at the beginning of each line stacked. :J =:J =.J A subsequent REXX PULL instruction assigns the data to program variable(s), and the macro continues executing. ::J :=J :=J ,- The READ subcommand has the following format: \ :J =.J Chapter 7. The Macro Language 139 Cmdline Tag I Notag All Number Tag I Notag Nochange Number Tag I Notag READ Where: r Cmdline only the command line is stacked. r r L All anything changed on the screen is stacked. [ Nochange same as ALL, but the copy of the file in storage is not updated. Number changed file lines are prefixed by their line numbers. Tag tags that identify the origin of changed lines precede lines placed in the stack. r L ., Notag no tags are stacked. No~mally, a macro displays a message requesting that you enter data on the command line before it issues a READ. For example: MSG ENTER FILENAME FILE TYPE FILEMODE ("ENTER fILENAME FILETYPE FILEMODE" is displayed.) READ CMDLINE (User enters MYFILE SCRIPT A in the command line and READ puts it in the console stack.) PULL FN FT FM: (Takes the fileid out of the stack and assigns MYFILE, SCRIPT, and A to FN, FT, and FM, respectively.) The EXTRACT Subcommand The EXTRACT subcommand returns information about editing options (options defined by the SET subcommand) as well as other file data that is not explicitly "set." The information is returned as one or more variables in the form "name.n", where "name" is the same as the variable requested and "n" is a subscript that distinguishes the different values returned for each option requested. 140 VM/SP System Product Editor User's Guide ' .. J J 1 r-----------··----------- _J -, ---1 For example, if a macro wants Issue: J inform~tion apout,the case setting it can ] EXTRACT ICASEI J This returns information about the contents of the case setting in the following variables: J CASE.O CASE.l CASE.2 ] J J number of variables returned MIXEDIUPPER RESPECT I IGNORE The macro could use this information as follows: msg "The current case setting is" case.l J case.2 Displaying Data on the Editor's Screen J The following subcommands are discussed in this section: ] MSG EMSG CMSG SET MSGMODE SET RESERVED SET CTLCHAR CURSOR J =J ~] -1 MSG, EMSG, and CMSG Subcommands -.J -J A macro can communicate with the user by displaying messages in the message line of the screen. Messages are used for various reasons, for example, requesting the user to enter data, telling a user that an error has occurred during processing, and so forth . ::J .J ~ The following two subcommands display a message in the message line of the screen: ~ MSG displays a message in the message line. =.J :J EMSG displays a message in the message line and sounds the alarm. ~ For example: =.J MSG ENTER FILE NAME Displays "ENTER FILE NAME" in the message line. ~ :J =.J =.J ~ ( '" '----- EMSG MISSING OPERANDS Displays "MISSING OPERANPS" in the message line and sounds the alarm. Chapter 7. The Macro Language 141 Note: REXX also provides an instruction, SAY, that displays one line of data at the terminal. However, the SAY instruction causes the screen to be cleared before the data is displayed. The XEDIT subcommands MSG and EMSG keep the file image on the screen and display the data in the message line. Therefore, you should use them instead of SAY in a macro. The following subcommand displays a message in the command line of the screen: r CMSG [ l When issued from a macro, the CMSG subcommand can be used to redisplay input that the user has entered incorrectly, so that it can be corrected and reentered. SET MSGMODE Subcommand The SET MSGMODE subcommand is used to cqntrol whether or not messages are displayed: SET MSGMODE ON SET MSGMODE OFF All messages are displayed. No messages are displayed. :' By turning the message mode on and off during a macro, you can select when you want messages to be displayed. SET RESERVED Subcommand When issued from a macro, the SET RESERVED subcommand reserves a specified line on the screen for use by the macro, thereby preventing the editor from using that line. The line can be used for displaying blank or specified information, which can optionally be displayed in various ways for emphasis. For example, depending on the features supported by your terminal, the line can be displayed highlighted, using a programmed symbol set, in various colors, or with extended highlighting features (blinking, reverse video, or underlining). [ For example, the following subcommand: r l SET RESERVED 10 HIGH YOU CAN'T USE THIS LINE. l displays, on the tenth line of the screen, "You can't use this line." The line is highlighted. r Another example of SET RESERVED is shown with SET CTLCHAR, discussed below. [ / ,- r- 142 VMjSP System Product Editor User's Guide l ! -. -l -1 J -1 __ J c -1 ~ SET CTLCHAR Subcommand J The SET CTLCHAR subcommand is used to specify attributes for fields within a reserved line. Depending on the features supported by your terminal, these fields may be displayed highlighted, protected, invisible, in various colors, using different programmed symbol sets, or with extended highlighting features (blinking, reverse video, or underlining). ] =-J ] In the following example, note how SET RESERVED and SET CTLCHAR are used to control exactly how the reserved lines are displayed. =J J /* This XEDIT macro will show examples of using SET CTLCHAR */ 'SET CTLCHAR % ESCAPE' 'SET CTLCHAR + PROTECT BLUE REVVIDEO NOHIGH' 'SET CTLCHAR J NOPROTECT GREEN UNDERLINE NOHIGH' 'SET RESERVED 3 YEL HIGH This is Yellow%+And this is Blue and Reversed.' 'SET RESERVED 5 RED BLINK NOH Red and Blinking%JGreen and Underlined.' =-J =J ~J ~ CURSOR Subcommand ~J The CURSOR subcommand can be used to move the cursor to a specified position on the screen, and optionally, to assign a priority to that position. For example, the editor has a macro called SCHANGE, which looks for a string and moves the cursor under the string if it is found. For an example of using the CURSOR subcommand, see "Positioning the Cursor," later in this chapter. ~J ~ ~ =:J Saving and Restoring Editing Variables =J The PRESERVE subcommand is used to save the settings of various editing variables until a subsequent RESTORE subcommand is issued. For example, you might want to preserve a setting so that you can change it for the duration of the macro, and restore it before the macro finishes executing. For a complete list of the variables affected, refer to the PRESERVE subcommand description in the publication VM/ SP System Product Editor Command and Macro Reference. ----I -.J ~ =.J =.J Issuing CMS and CP Commands =J ~ As you have seen, an XEDIT macro can contain XEDIT subcommands, REXX instructions, and CMS and CP commands. CMS and CP commands can be issued as operands of the XEDIT subcommands CMS and CP, respectively. =.J ~ For example: :=J \ CMS ERASE FILEA SCRIPT ~ =.J =.J Chapter 7. The Macro Language 143 (CMS and CP commands can also be issued by using the REXX instructions, ADDRESS CMS or ADDRESS COMMAND.) Avoiding Name Conflicts The following subcommands are discussed in this section: COMMAND MACRO SET MACRO SET SYNONYM l. Use the COMMAND subcommand to cause the editor to execute a specified subcommand without first checking to see if a synonym or macro with the same name exists. This subcommand overrides SET SYNONYM ON or SET MACRO ON (discussed below). For example: COMMAND PRESERVE r executes the PRESERVE subcommand, even if a synonym or macro with the same name exists. Similarly, use the MACRO subcommand to cause the editor to execute a specified macro without first checking to see if a subcommand of the same name or a synonym exists. (Of course, this cannot be used for prefix macros.) l .. r l. r The MACRO subcommand can also be used to avoid name conflicts, in the following manner. When a subcommand has a number as its operand, a blank is not required between the subcommand name and the operand. For example, both "NEXT8" and "N8" are interpreted by the editor aR being the subcommand "NEXT 8". Therefore, if a macro name were also "N8," the macro would not be executed; the subcommand "NEXT 8" would be executed instead. To execute the macro, you could enter the following: The macro whose name is "N8" would then be executed. l r L r r The SET MACRO subcommand can be used to control the order in which the editor searches for subcommands and macros. SET MACRO ON tells the editor to look for macros before it looks for subcommands; SET MACRO OFF reverses the order. In addition, SET SYNONYM can be used to specify whether or not the editor looks for synonyms. 144 VM/SP System Product Editor User's Guide l r -j ___J J -1 __ J j Walking through an XEDIT Macro J The following XEDIT macro is an example of the type of macro you might write to make life a little easier. The application is typical of a text processing file arrangement, where many SCRIPT files are imbedded in a master file, via the SCRIPT control word" .im". J J - -1 ....J The problem with this type of setup is that if YOt-l have to make a global change throughout all the files, you have to edit each file, make the change, and then file each file. ] ~J When issued from the master file, this macro edits each file, performs a global change, and files it. - 1 _J J The macro is invoked by entering the macro name, GLOBCHG; the arguments passed to the macro are the old data and the new data, enclosed in delimiters: =J GLOBCHG :J /string~/string2/ For example, if a file called MASTER SCRIPT contains: --) -) .irn FILEI .irn FILE2 ~ -1 ------' .irn FILEIOO -1 _J and the following commands are issued: =:J XEDIT MASTER SCRIPT ~ GLOBCHG/WAR AND PEACE/SENSE AND NONSENSE/ :J "WAR AND PEACE" is changed to "SENSE AND NONSENSE" each time it occurs in every file. (In this macro, no attempt is made to execute the change on files that may be imbedded at the next level.) --, .-J =:J The GLOBCHG macro can also be used to delete data throughout the files, by changing a string to a null string, for example: :J ~:] GLOBCHG /bad data// ~ The following is a listing of the macro, whose fileid is GLOBCHG XEDIT AI. After the listing, each line in the macro is explained. For more information on the System Product Interpreter statements used in the macro, see the publication VM/ SP System Product Interpreter Reference. =.J ~ ~ ~ ~ ~ ( "------, Chapter 7. The Macro Language 145 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 /* Do a global change on imbedded Script files */ /* Input to this macro is the CHANGE command to be executed on */ /* the file currently being xedited and on any files it imbeds. */ parse arg operand /* Get passed CHANGE cmd */ if operand = " then do /* If omitted, then error */ emsg 'EXE545E Missing operand(s) , /* Give error message */ parse source me /* Get this macros name */ cmsg me /* Put it on command line */ exit /* Leave this macro */ end /* End of DO loop */ preserve /* Save current status */ set wrap off /* Set wrap off */ set msgmode on /* Set message mode on */ set case mixed ignore /* Set proper case */ top /* Go to TOP of file */ find .im /* Find first imbed file */ if rc ,= 0 then do /* If none found, give msg */ restore /* Restore previous status */ emsg 'No IMBED found.' /* Give message */ exit /* Leave this macro */ end /* End of DO loop */ do while rc=O /* Imbed found, process it */ extract '/curline/' /* Get current line */ parse upper var curline.3 fname /* Separate out file name */ address command state fname 'SCRIPT *'/* Does this file exist? */ if rc ,= 0 then do /* If not, issue message */ msg 'IMBEDed file' fname 'SCRIPT does not exist, bypassed.' find .im /* Search for next imbed */ iterate /* Cause next loop iterat'n*/ end /* End of inner DO loop */ xedit fname 'SCRIPT (NOPROFILE' /* File exists, XEDIT it */ extract '/fname/ftype/fmode/' /* Get name, type, mode */ msg 'Processing file' fname.1 ftype.l fmode.l /* Issue message */ change operand '* *' /* Issue CHANGE command */ file /* Save the file & quit */ find .im /* Find the next imbed */ end /* End of outer DO loop */ restore /* Loop ends, restore */ msg 'No more .imbeds found, global change completed.' /* Give msg */ exit /* All done, leave macro */ ~- l. ( L. [ l_ . J r I L r Figure 38. A Sample Macro Now, let's walk through the macro, a line at a time. 00001 /* Do a global change on imbedded Script files */ System Product Interpreter comment line. This is a required line and tells the Interpreter this is a REXX file. 00004 parse arg operand Place the passed arguments into the variable called OPERAND. l. r r l r 00005 if operand = " then do If no arguments were entered when the macro was invoked, execute the following statements until an END is reached (DO loop). (OPERAND was set to a null in line 4.) 146 VM/SP System Product Editor User's Guide r- l J .j J 00006 emsg 'EXE545E Missing operand(s)' Display this message. 00007 parse source .. me . Look at the source string and place the name of this macro into the variable ME. 00008 cmsg me The macro name (in the variable ME) is displayed on the command line. 00009 exit Return control to the editor. 00010 end This statement signals the end of the DO loop that began in line 5. 1 _.-1 J J J ] J ] J J J J J ~J J J J 00011 preserve This subcommand saves the editor settings until a subsequent RESTORE subcommand is issued (line 37). 00012 set wrap off Wrapping during the target search is turned off. When the end of the master file is reached the macro will end, rather than wrapping around, searching for ".im," and getting caught in a loop. 00013 set msgmode on Messages will be displayed. By turning the message mode on and off, you can select which messages you want displayed. 00014 set case mixed ignore In target searches, uppercase and lowercase representations of the same letter will match. 00015 top Move the line pointer to the top of the master file, which is the file from which the macro was invoked. 00016 find .im Search forward in the master file for the first line that contains" .im" in column 1, that is, locate the first line that imbeds a file. J 00017 if rc 1 = 0 then do If there is a non-zero return code from the FIND subcommand (previous statement), then do the following statements up to the END (another DO loop). ~ 00018 =J J J J restore Restore the settings of XEDIT variables to the values they had when the PRESERVE subcommand was issued (line 11). Chapter 7. The Macro Language 147 00019 emsg 'No IMBED found.' Display this message. 00020 exit Return control to the editor. r 00021 end This statement signals the end of the DO loop that was started in line 16. 00022 do while rc = 0 Repeat the following statements (up to the END in line 36), as long as the return code (RC) is 0. The initial value for RC is set by the FIND subcommand in line 15; we reach this point only if RC was set to 0, which means an imbedded file was found. The last statement in this loop is also a FIND subcommand, and RC will be reset to the return code for that FIND subcommand just before we return to this point to execute the statements again. When the return code is not 0, this macro will continue with the statement following the END (line 36). 00023 00024 00025 148 extract '/curlinel' Return information about the current line in macro variables, in the form "curline.n," where the subscript distinguishes among the variables. parse upper var curline.3 . fname . CURLINE.3 contains the contents of the current line (as returned by the EXTRACT subcommand above). In this case the current line is the .im statement that was found via a "find .im". This statement takes the second blank delimited word from the variable CURLINE.3 and puts it into the variable FNAME. address command state fname 'SCRIPT *, The 8T ATE command is a CIvIS command that verifies the existence of a file. This statement checks to see if the file named in the .im statement exists. The quotes are needed around the asterisk to avoid confusion with the REXX multiplication operator. Enclosing the word SCRIPT and the asterisk in quotation marks makes it a literal string. 00026 if rc I = 0 then do If the return code from the ST ATE command is not zero, then do the following statements up to the END statement in line 29 (DO loop). 00027 msg 'IMBEDed file' fname 'SCRIPT does not exist, bypassed.' Display this message. REXX will substitute the value of "fname" in the message before it is displayed. 00028 find .im This locates the next imbed control word in the file. ,-l ,- L r- - ,- - l , L r \ rl VMjSP System Product Editor User's Guide r ] J ] J 00029 iterate This statement tells REXX to go to the END statement and complete the processing for this iteration of the DO loop. 00030 end This statement signals the end of the DO loop that was started in line 25 above. 00031 xedit fname 'SCRIPT (NOPROFILE' This statement will invoke the editor (XEDIT) for the file specified. REXX will substitute the value of "fname" in this line before passing it to XEDIT. 00032 extract' /fname/ftype/fmode/' Returns the filename, filetype, and filemode in macro variables. 00033 msg 'Processing file' fname.1 ftype.1 fmode.1 Displays the message, with the file identification as returned by EXTRACT. 00034 change operand '* *' The global change is executed. OPERAND contains the arguments entered when the macro was invoked (see line 4). 00035 file The changed file is written to disk. 00036 find. im The editor resumes editing the master file, searching for the next".im filename" statement. J J 00037 end This statement signals the end of the DO loop that was started in line 21. 00038 restore Restore the settings of XEDIT variables to the values they had when the PRESERVE subcommand was issued (line 11). 00039 msg 'No more .imbeds found, global change completed.' Display this message. 00040 exit Return control to the editor. You can then issue a QUIT subcommand for the master file. Chapter 7. The Macro Language 149 A Profile Macro for Editing As a CMS user, you are familiar with a PROFILE EXEC macro, which contains the CMS and CP commands you normally issue at the start of a terminal session and is executed automatically after you issue the IPL CMS command. The editor offers a similar profile capability with a PROFILE XEDIT macro, which contains XEDIT subcommands that tailor each editing session to suit your needs and is executed automatically after you issue an XEDIT command (or subcommand). r l r Executing a Profile Macro The filetype of a profile macro must be "XEDIT". If the fileid is PROFILE XEDIT, the macro is executed automatically when an XEDIT command (or subcommand) is issued. You can write a PROFILE XEDIT macro, file it, and forget about it. It will be executed before each file is brought into storage. If you do not want a PROFILE XEDIT macro to be executed for a particular editing session, you can issue the following XEDIT command: XEDIT fn ft (NOPROFILE The PROFILE XEDIT macro is bypassed, and the file is brought into storage. rl Although the file type of a profile macro must be "XEDIT," the filename does not have to be "PROFILE". If your profile macro has a name other than "PROFILE," you must indicate its filename in the PROFILE option of the XEDIT command. l r [ For example, if the fileid is MYPROF XEDIT, you must issue the following XEDIT command: XEDIT fn ft (PROFILE MYPROF The macro labelled MYPROF XEDIT is executed, even if a macro labelled PROFILE XEDIT exists. Writing a Profile Macro A profile macro can be as simple or complex as you wish. Like any macro, it can contain System Product Interpreter statements, CMS and CP commands, and any XEDIT subcommands or macros. It usually contains one or more SET subcommands that create an editing environment to your liking. c r [ r [ r 150 VMjSP System Product Editor User's Guide l ] I(JI' ] J It can also contain a LOAD subcommand, which can be issued only from a profile macro. When the profile macro begins execution, a copy of the file has not yet been brought into virtual storage. Therefore, a LOAD subcommand, which has the same format and options as the XEDIT command, can be used to supply editing options that are not specified in the XEDIT command itself. Within the profile macro, the LOAD subcommand must be the first XEDIT subcommand. If it is not, a LOAD subcommand is automatically issued by the editor; its operands are the same as those issued in the XEDIT command. (System Product Interpreter statements and CMS commands can be issued before the LOAD.) The profile macro can be used to prompt the user for XEDIT command options or to assign values to editing variables before issuing the LOAD subcommand. For example, a SCRIPT user might program his profile to use a LOAD subcommand that does defaulting of filetype. The options specified in the LOAD subcommand have a lower priority than those specified in an XEDIT command. For example, an UPDATE option specified in the LOAD subcommand would be overridden by a NOUPDATE option specified in the XEDIT command. When the LOAD subcommand is executed, the file is brought into virtual storage. If the LOAD fails, a non-zero return code is generated. All subsequent subcommands in the profile macro are rejected with a unique "6" return code. For detailed information on the LOAD subcommand, refer to the publication VM/ SP System Product Editor Command and Macro Reference. An Example of a Profile Macro An example of a profile macro is shown in Figure 39. Chapter 7. The Macro Language 151 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 /* Sample XEDIT profile parse arg fn ft ' ( , options if ft= ' , then ft= 'SCRIPT' load fn ft ' (' options set tabline on 22 set scale on 22 set fullread on set nulls on set number on set pf10 save set synonym fiel 4 file exit /* /* /* /* /* /* /* /* /* /* /* put arguments into variables if no filetype, use SCRIPT issue LOAD statement put tab line on line 22 put scale on line 22 full-screen read on end of line nulls on line numbers to be used PF10 to SAVE when my fingers don't work exit this macro [ */ */ */ */ */ */ */ */ */ */ */ */ ~ l [ [- l' r.. [Figure 39. A PROFILE XEDIT Macro l 00001 /* Sample XEDIT profile */ Identifies the macro as a System Product Interpreter file. [ 00002 parse arg fn ft '(' options Puts argument into variables. C r l .. 00003 if ft = "then ft = 'SCRIPT' If there is no filetype assigned, this will assign a filetype of SCRIPT. r r- 00004 load fn ft '(' options Loads the file. I l rI 00005 set tabline on 22 Sets the tabline on line 22 of the screen. [ l 00006 set scale on 22 Superimposes the scale on line 22 of the screen. r: 00007 set fullread on Sets the full-screen read on to allow recognition by XEDIT of 3270 null characters in the middle of the screen lines. rC 00008 set nulls on Sets NULLS ON to replace all trailing blanks with nulls. [ [ 00009 set number on Sets NUMBER ON to assign a line number to each line in the file. ,r 00010 set pflO save Sets PFIO to save the file. [ r 00011 set synonym fiel 4 file Sets a synonym "fiel" for the subcommand "file". r /' I.. 00012 exit r 152 VMjSP System Product Editor User's Guide J p'-- • • . " . . . . . . . _.- •• -.,~ •.• ,,-~ •. -.-,--.--.~--~.-.-, ..•- - - - - - - . - . " . - - . - - ,... - - - - , - _ . _ - - - - _ . _ - . _ - - - - - - - _ . _ - - - - - - - - - - _ . , - - - - - L _ _._. _ _ _ _ _ _ _ _ _ _ _ _ J Exit the macro. J J Writing Prefix Macros J You can write prefix macros for a variety of purposes, from performing a function from the prefix area th,at is normally accomplished by entering a subcommand on the command line, to creating an entirely new function. ] J You must be familiar with the REXX language before reading this section. More information on REXX can be found in the publications cited at the beginning of this chapter. :J J J Creating a Sample Prefix Macro ] The U prefix macro gives the user the ability to translate one or more lines in a file to uppercase, which normally is accomplished by issuing the UPPER CAS subcommand in the command line. When U is entered in the prefix area of a line, that line is translated to uppercase. A number may be specified before or after the U to translate more than one line; for example, 3U= = = or =U5= =. J J J ] The file is created with the XEDIT command: .- J XEDIT U XEDIT The U prefix macro looks like this: J J 00001 00002 00003 00004 00005 J .J /* This macro translates a line(s) to uppercase. */ arg . . pline op . If op = "then op = 1 'COMMAND: 'pline 'UPPERCAS' op Exit 0 ] J What Information Is Passed to the Macro? =J An argument string is automatically passed to a prefix macro when it is invoked. It can supply a macro with information critical to its execution, like the line number of the prefix area in which the macro was entered. ] J J ] \ J J J "--- - LIne 2 (above) is a REXX statement that parses (splits up) the string, according to the template shown. (The argument string is described in greater detail later in this chapter.) Pline represents the line number of the prefix area, and op represents the optional operand. These variable names provide the macro with answers to the following questions: Chapter 7. The Macro Language 153 On which line was the macro entered? How many lines are to be translated to uppercase? Line 3 determines if an operand was entered. If the operand is null, a default of 1 is assumed. Line 4 makes the line in which the prefix macro was entered (pline) the new current line and then issues the UPPER CAS subcommand, with the operand. Current Line Positioning Note that in line 4, :pline is an absolute line number target. It is used to make the prefix line (pline) current for the UPPERCAS subcommand, which operates on the current line. After the pending list is finished executing, the current line is returned automatically to the line that was current when it began execution. Therefore, even though pline is made current for the UPPERCAS subcommand, the macro need not restore the current line. For information on overriding this automatic current line return, see the SET PENDING subcommand in the VM/ SP System Product Editor Command and !J1acro Reference. Creating a Second Prefix Macro Let's create another prefix macro called L, which gives the user the ability to translate one or more lines in a file to lowercase, which normally is accomplished by issuing the LOWERCAS subcommand in the comrriand line. This macro is simjlar in function to the U macro described above; however, we will give the user the additional ability of specifying a block of lines to be translated, by entering LL on both the first and last lines of the block. This macro is presented in segments, to illustrate various concepts. The entire macro is shown at the end of this chapter. Examining the Source String You have already seen that an argument string is passed to a prefix macro when it is invoked. A source string is also passed. 00007 parse source . . . . . name . 00008 arg pref func pline op extra 154 VM/SP System Product Editor User's Guide L .J Line 7 parses the source string according to the template shown. In this example, we're using the source string to get the name of the prefix macro as the user entered it (without operands). Later, you will see how the macro uses name to determine if it was invoked in its simple form (L) or block form (LL). The source string is described in detail in the VM/SP System Product Interpreter Reference, under "Parse Source." In line 8, the argument string is parsed. For now, note that pline is the line number of the prefix area, and op is the optional operand. The rest of the argument string is described later in this chapter, under "Examining the Argument String." In this example, if L8 were entered in the prefix area of line 3 of a file, name would be L, pline would be 3, and op would be 8. Using the Information That Is Passed The following part of the macro shows how some of the information derived from the strings is used. 00007 parse source . . . . . name . 00008 arg pref func pline op extra 00019 00020 00021 00022 00023 00024 when length(name)=l then do If op = " then op = 1 If datatype(op,'W') then, 'COMMAND: 'pline 'LOWERCAS' op else call error "Invalid operand :" op end In lines 19 through 24, you can see that the source and argument strings supply the answers to these questions: What name was used to invoke the macro? On which line was it entered? How many lines are to be changed to lowercase? U sing the variable names assigned in the templates, lines 19 through 24 perform the following functions: 1. 2. See if the macro was entered in its simple form (L). When the length of name is one, the macro was entered in its simple form. If no operand was entered, assign a default of 1 or determine if the operand (if any) is a valid whole number (lines 20 and 21). Otherwise, go to an error routine (line 23). Chapter 7. The Macro Language 155 3. Make the line in which the prefix macro was entered (pline) current and issue the LOWER CAS subcommand, with the operand (line 22). Handling Blocks A block is a group of consecutive lines. Several XEDIT prefix subcommands and macros (for example, D and » allow you to specify blocks by doubling the name and entering it on both the first and last lines of the block (for example, DD entered on the first and last lines of a block deletes the entire block of lines). Let's expand the L prefix macro to accept blocks (specified by entering LL on the first and last lines of the block). This section explains the following: • How to assign a synonym for a prefix macro o How to examine the pending list of prefix subcommands and macros for a matching block entry • How to display a pending notice in the status area of the screen. 00018 select 00019 when length(name)=l then do 00020 If op = " then op = 1 00021 If datatype(op,'W') then, 00022 'COMMAND: 'pline 'LOWERCAS' 9P 00023 else call error "Invalid operand :" op 00024 end 00025 00026 when length(name)=2 then do 00027 If op ,= " then call error, 00028 'Invalid operand:' op 00029 'COMMAND EXTRACT IPENDING BLOCK' name ':0 : 'pline 'I' 00030 if oendina.O,=O then do 00031 'COMMAND: 'pending.1 'SET PENDING OFF' 00032 'COMMAND: 'pending.1 'LOWERCAS : 'pline+1 00033 end 00034 else 'COMMAND: 'pline 'COMMAND SET PENDING BLOCK' name 00035 End Assigning a Synonym for a Prefix Macro The user must issue the following subcommand in order to be able to specify the block form of the L macro. You can enter this subcommand in the PROFILE XEDIT file: SET PREFIX SYNONYM LL L Now, the user can invoke the L prefix macro by entering either L (with an optional numeric operand) or LL. In line 19, the macro checks for its 156 VMjSP System Product Editor User's Guide J J J simple form (when the length of name is 1). In line 26, the macro checks for its block form (when the length of name is 2). Synonyms can also be assigned for other reasons. For example: o A prefix macro filename can be up to eight alphabetic characters long, but the prefix area is only five positions long. You can use SET PREFIX SYNONYM to assign a synonym that is up to five characters long. o The synonym can be a special character that is not permitted as part of a CMS filename. For example, the filename for the XEDIT prefix macro > is PRFSHIFT. o A macro can perform different functions, depending on how it is entered. Different synonyms can signify different functions to the macro. For example, the XEDIT prefix macro PRFSHIFT shifts the screen right if > is entered and left if < is entered. The synonyms assigned to this macro are: 1 J J J ] SET SET SET SET o ] =.1 J J J ~J ] PREFIX PREFIX PREFIX PREFIX SYNONYM SYNONYM SYNONYM SYNONYM > < > < PRFSHIFT PRFSHIFT > PRFSHIFT < PRFSHIFT Prefix macros can also use the names of prefix subcommands such as F (following) or P (preceding). To use a prefix subcommand in a prefix macro, you should ei.ther define a synonym (see SET PREFIX in the VM/SP System Product Editor Command and Macro Reference) or override the prefix subcommand by using SET MACRO ON. To determine what prefix macro synonyms are in effect, use the QUERY PREFIX SYNONYM subcommand, which is described in detail in the VM/SP System Product Editor Command and Macro Reference. Using the "Pending List" You have seen that the source and argument strings are two sources of information upon which a prefix macro can base decisions. Another is the "pending list." - 1 -.J ] J =-l J J ] J The "pending list" is a list of prefix subcommands and macros that have not yet been executed. Every time the editor reads the screen, the pending list is updated (automatically) with any new prefix subcommands and macros that have been entered, each of which causes an entry to be added to the list. Each entry is associated with a specific line in the file. The pending list is executed when it is changed. If a prefix macro returns a non-zero return code, execution of the pending list stops and all entries not executed remain pending, until the user presses the ENTER (or PF/or PA) key. Chapter 7. The Macro Language 157 An entry is deleted .from the pending list when it is executed or overtyped on the user's screen with a new prefix subcommand, prefix macro, or blanks. For example, when the L prefix macro is invoked, it is removed from the pending list. A prefix macro can control its execution and display or remove the pending notice from the status area of the screen by examining information in the pending list (EXTRACT/QUERY PENDING) and by adding or deleting entries in it (SET PENDING). Refer to the VM/SP System Product Editor Command and Macro Reference for detailed information on these subcommands. The pending notice is displayed in the status area as follows: 'value' pending ... where "value" is the name of the prefix subcommand or macro that was entered in the prefix area, as derived from the source string (see line 34). (If multiple prefix subcommands or macros are pending, the first one, starting from the top of file, is displayed in the pending notice.) In our example, suppose that the user entered the block form (LL), which is determined by line 26. First, the macro needs to know if another LL has been entered, that is, if the pending list contains a matching block entry. To determine this, the macro examines the pending list by issuing the EXTRACT subcommand shown in line 29. This subcommand searches the pending list for a matching block entry, which must be located in the file within the range specified by the targets, that is, between the top of file (:0) and the prefix line (:pline), inclusive. If no matching entry is found, the screen is placed in a pending status (line 34). If a second LL was entered, the pending status of the screen will not be seen because the macro is automaticallj?' involtcd again as the pending list is executed. This time, the EXTRACT subcommand (line 29) finds the matching block entry, the pending notice is removed (line 31) and the LOWER CAS subcommand is executed for the block of lines (line 32). Examining the Argument String The argument string is as follows: PREFIX SETI SHADOW I CLEAR pline [opl[op2[op3]]] Where: PREFIX indicates that this is a prefix call. 158 VMjSP System Product Editor User's Guide l. 1 J J J J J J J SET indicates that the prefix macro was entered on some line in the file displayed. SHADOW indicates that a prefix macro was entered on a shadow line (see SET SHADOW in the VMj SP System Product Editor Command and Macro Reference ). CLEAR indicates that a new prefix subcommand or macro or new blank area replaces a previously pending prefix subcommand or macro on the same line, or the RESET subcommand was entered. In this case, this macro is invoked with "PREFIX CLEAR pline". J J ] pline is the line number on which the prefix macro was entered. J ] J J opl op2 op3 are the optional operands of the macro, entered either to its left or right (for example, 5M or M5). (Operands are recognized according to the rules explained in "Section 4: Prefix Subcommands and Macros" in the VMjSP System Product Editor Command and Macro Reference.) Let's see how this macro uses the argument string for validity checking. ] J ] J J 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 arg pref func pline op extra If pref ,= 'PREFIX' then call error1, 'This macro must be invoked from the PREFIX area.' If func = 'CLEAR' then exit If func = 'SHADOW' then call error1, 'Invalid on shadow line.' If func ,= 'SET' then call error1, 'This macro must be invoked from the PREFIX area.' If extra ,= " then call error, 'Extraneous parameter:' extra J J J 00042 /* error routines */ 00043 error: 'COMMAND: 'pline 'SET PENDING ERROR' name I lop 00044 error1: parse arg t 00045 'COMMAND EMSG' t 00046 Exit J :] J J =J Lines 9 through 17 verify that the macro is a prefix call and was entered on a valid prefix line, that is, not on a shadow line. Lines 42 through 45 are the associated error routines. Line 43 is a form of the SET PENDING subcommand used to notify the user the macro was entered incorrectly. In this case, if an extra operand was entered (determined in line 16), the incorrect macro is displayed highlighted in the prefix area, prefixed by a question mark. For example, if the user J J J Chapter 7. The Macro Language 159 _ _ _ _,::::J entered L3 4, the prefix area displays ?L3 and the user gets the message 'Extraneous parameter: 4'. SET PENDING ERROR does not cause a pending notice to be displayed. When the user presses the ENTER key again, the prefix area is reset. This prevents subsequent attempts to execute an incorrectly-entered macro. Positioning the Cursor The cursor is positioned in the line in which the prefix macro was entered by using the following subcommand: 00039 'COMMAND CURSOR FILE' pline 'PRIORITY 30' By using the CURSOR subcommand, user-written prefix macros can specify a priority that is associated with cursor positioning. The cursor is positioned at the location specified that has the highest priority when all pending prefix subcommands and any macros are executed. [r For more information on the CURSOR subcommand and various priorities associated with prefix subcommands and macros, see the VMjSP System Product Editor Command and Macro Reference, the CURSOR subcommand and "Section 4: Prefix Subcommands and Macros." The rest of this chapter presents additional information which may be useful in writing prefix macros or tells you where the information can be found. How the Prefix Area Is Decoded l See the VMj SP System Product Editor Command and Macro Reference, "Section 4: Prefix Subcommands and Macros" for a description of how the editor interprets what is entered in the prefix area. r. r Using the XEDIT Subcommand A prefix macro can issue the XEDIT subcommand to edit a different file in the ring. However, when the macro finishes executing, control automatically returns to the file from which it was invoked. 160 VM/SP System Product Editor User's Guide [" ..•..•. _._._.. _----_.-. __. - - - - - - - - _ . _ - - --_.....•. __.__ .. _... _..__ .. _.__ ._--_.] J Additional Examples J For additional examples of prefix macros, you can examine the IBM-supplied prefix macros, which are as follows: J J J J Macro synonym(s) File Identifier X,XX 8 PREFIXX XEDIT PRF8HOW XEDIT PRF8HIFT XEDIT 81 XEDIT <, >, » , « J J J J ] J ] ] J J J J J ] ] J J J ] J \ J J J "'--.- - Chapter 7. The Macro Language 161 The L Prefix Macro 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 1* 1* 1* 1* 1* 1* Use this macro to translate a line or lines in a file to lowercase. You may specify nL, Ln, L-n or L to lowercase a line. If you add the following prefix synonym to your profile, you may also use LL for specifying blocks: SET PREFIX SYNONYM LL L parse source . . . . . name . arg pref func pline op extra If pref ,= 'PREFIX' then call error1, 'This macro must be invoked from the PREFIX area.' If func = 'CLEAR' then exit If func = 'SHADOW' then call error1, 'Invalid on shadow line.' If func ,= 'SET' then call error1, 'This macro must be invoked from the PREFIX area.' If extra ,= " then call error, 'Extraneous parameter:' extra select when length(name)=l then do If op = " then op = 1 If datatype(op,'W') then, 'COMMAND: 'pline 'LOWERCAS' op else call error "Invalid operand :" op end when length(name)=2 then do If op ,= " then call error, 'Invalid operand:' op 'COMMAND EXTRACT IPENDING BLOCK' name ':0 :'pline 'I' if pending.O,=O then do 'COMMAND: 'pending.1 'SET PENDING OFF' 'COMMAND:' pending.1 'LOWERCAS : 'pline+1 end ' else 'COMMAND :'pline 'COMMAND SET PENDING BLOCK' name End Otherwise call error "Invalid macro synonym." End 'COMMAND CURSOR FILE' pline 'PRIORITY 30' Exit 1* error routines *1 error: 'COMMAND: 'pline 'SET PENDING ERROR' name I lop error1: parse arg t 'COMMAND EMSG' t Exit Figure 40. 162 *1 *1 *1 *1 *1 *1 A Sample Prefix Macro. VM/SP System Product Editor User's Guide r l Appendix A. A Summary of XEDIT Subcommands and Macros Subcommand Add ALL ALter - -1 J BAckward Bottom CANCEL CAppend CDelete CFirst Change CInsert CLAst CLocate ~J CMS ~l ] CMSG COMMAND - 1 COMPress "- 1 _J COpy COUnt COVerlay CP CReplace CURsor Purpose Add n lines after current line. Select a collection of lines for display/editing. Change a single character to another (character or hex). Scroll backward n frames. Go to last line of file. Terminate all files. Add text to end of current line. Delete characters, starting at column pointer. Move column pointer to beginning of line (zone). Change one string to another. Insert text in the current line. Move the column pointer to the end of the line (zone). Locate a string; move the column pointer and the line pointer. Pass a command to CMS, or enter CMS subset mode. Display message in command line of user's screen. Execute a subcommand without checking for synonym or macro. Prepare line(s) for realignment by replacing blanks with tab characters. Copy line(s) at specified location. Display the number of times a string appears. Replace characters, starting at column pointer. Pass command to VM/SP control program. DUPlicat EMSG Replace characters, starting at the column pointer. Move the cursor to specified position on the screen, and optionally assign a priority for this position. Delete line(s). Move line pointer n lines toward end of file (same as NEXT). Duplicate line(s). Display a message and sound the alarm. EXPand Reposition data according to new tab settings. DELete Down Appendix A. A Summary of XEDIT Subcommands and Macros 163 Subcommand EXTract FILE Find FINDUp FOrward GET Help HEXType Input Join LEft LOAD Locate LOWercas LPrefix MACRO MErge MODify MOve MSG Next l\.TV~~..1 J..,.L' .u~u NFINDUp Overlay PARSE POWerinp PREServe PURge PUT PUTD 164 Purpose Return information about internal XEDIT variables and file data. Write file on disk. Search for line that starts with specified text. Search for a line that starts with specified text; searches in a backward direction. Scroll forward n frames. Insert lines from another file. Request online display of XEDIT subcommands and macros; invoke the CMS HELP facility. Display line(s) in hexadecimal and EBCDIC. Insert a single line, or enter input mode. Join lines. View data to the left of column one. Read file into storage; use in profile macro only. Move line pointer to specified target. Change uppercase letters to lowercase. Simulate writing in the prefix area of the current line and pressing the ENTER key. Execute macro without checking for subcommand or synonym. Combine two sets of lines. Display a SET subcommand current values in the command line, so it can be overtyped and reentered. Move line(s) to another place in the file. Display message in message line. Move line pointer n lines toward end of file (same as DOWN). Search for first line that does not match ope<.;ified text. Search backward for first line that does not match specified text. Replace characters in current line. Scan a line of a macro to check the format of its operands. Enter an input mode for continuous typing. Save settings of variables until RESTORE. Remove macro from virtual storage. Insert lines into another file (new or existing), or into a buffer (to be retrieved by GET from another file). Same as PUT, but delete original lines. VM/SP System Product Editor User's Guide Subcommand Query QUIT READ RECover RENum REPEat Replace ·J .1 RESet .J RESTore ] RGTLEFT ·1 RIght _J J SAVE SCHANGE SET ALT J 1 _.J ~J SET APL SET ARBchar -1 _J '-1 _J SET AUtosave - 1 _.J SET BRKkey ~J - '1 SET CASE _.J J SET CMDline SET COLOR =-J ~J SET COLPtr ~J SET CTLchar -1 --.1 ~J SET CURLine Purpose Display the current value of editing options. End an editing session without saving changes. Place information from the terminal in the console stack. Replace deleted lines. Renumber VSBASIC or FREEFORT file. Advance line pointer and reexecute last subcommand. Replace current line, or delete current line and enter input mode. Remove prefix subcommands or macros when screen is in "pending" status. Restore settings of XEDIT variables to values they had when PRESERVE was issued. Shift display to the right; reissue to shift back to original display. View data to the right of the last (right-most) column. Write file on disk and remain in edit mode. Make a selective change, using PF keys. Change the number of alterations that have been made to the file since the last AUTOSAVE and/or since the last SAVE. Inform the editor if APL keys are used. Define an arbitrary character, which allows you to specify only the beginning and the end of a character string that is the object of a target search. Automatically issue a SAVE subcommand at specified intervals. Specifies whether or not CP should break in when the "BRKKEY " (defined by CP TERMINAL BRKKEY) is pressed. Uppercase or lowercase control; specify if case is significant in target searches. Move the position of the command line. Associate specific colors and attributes with various fields on the XEDIT screen. Specify if column pointer is displayed (typewriter terminals only). Define a control character(s), which associate parts of a reserved line with highlighting, protection, visibility, various colors, extended highlighting, and Programmed Symbol Sets. Define the position of the current line on the screen. =J ":'J "- --1 _J J Appendix A. A Summary of XEDIT Subcommands and Macros 165 Subcommand SET DISPlay SET ENTer SET ESCape SET ETARBCH SET ETMODE SET FILler SET FMode SET FName SET FType SET FULLread SET HEX SET IMage SET IMPcmscp SET LASTLorc SET LINENd SET LRecl SET MACRO QV,..-, 1\"" A ClTT ~ .I.f~r1.:J.U.. IJ.J..:J SET MSGLINE SET MSGMode SET NONDisp SET NULls SET NUMber SET PAn SET PACK 166 Purpose Indicate which selection levels of lines will be displayed on the screen. Define a meaning for the ENTER key. Define a character that allows you to enter a subcommand while in input mode (typewriter terminals only). Define an arbitrary character within a file containing Double-Byte Character Set (DBCS) characters. Allows you to specify only the beginning and end of a character string that is the object of a target search. Inform the editor that there are Double-Byte Character Set strings in the file. Define a character that is used when a line is expanded. Change the filemode of the current file. Change the filename of the current file. Change the filetype of the current file. Determine whether or not the editor recognizes null characters in the middle of screen lines. Allows string targets to be specified in hexadecimal. Control how tabs and backspaces are handled. Control whether subcommands not recognized by the editor are transmitted to CMS andCP. Define the contents of the last locate or change buffer. Define a line end character. Define a new logical record length. Control the order in which the editor searches for subcommands and macros. Define a new mask, which is the contents of added lines and the input zone. Define position of message line and the number of lines a message may expand to. Control the message display. Define a character that is used in place of non-displayable characters. Specify whether trailing blanks are replaced with nulls to allow character insertion. Specify whether file line numbers are displayed in the prefix area. Define a meaning for a P A key. Specify if the file is to be written to disk in packed format. VM/SP System Product Editor User's Guide l. J Subcommand SET PENDing SET PFn SET Point SET PREfix J J SET RANge SET RECFm SET REMote SET RESERved SET SCALe SET SCOPE J .1 _1 J -'1 -.J SET SCReen J SET SELect J SET SERial SET SHADow J J SET SIDcode -1 -J SET SPAN SET SPILL J J SET STAY ~J SET STReam J SET SYNonym J J SET TABLine SET TABS SET TERMinal SET TEXT SET TOFEOF SET TRANSLat SET TRunc ] .J J ~ Purpose Add an entry to the pending list and display a pending notice in the status area, or notify the user that a prefix macro was entered incorrectly. Define a meaning for a PF key. Define a symbolic name for the current line. Control the display of the prefix area; define a synonym for a prefix subcommand. Define anew "top" and "bottom" for the file. Define the record format. Control the way data transmission is handled. Reserve a line, which cannot be used by the editor. Control the display of the scale line. Specify whether the editor operates on the entire file or on only those lines displayed. Divide the screen into logical screens, for multiple views of the same or of different files. Assign a selection level to a line or group of lines in a file. Control file serialization. Specify whether the file is to be displayed with or without shadow lines indicating where lines have been excluded from the display. Specify a character string that is to be inserted into every line of an update file. Allows a string target to span a number of lines. Control whether or not truncation will occur for certain subcommands. Specify for certain subcommands whether the line pointer moves when searching for a string. Specify whether the editor searches only the current line or the whole file for a column-target. Specify whether the editor looks for synonyms; assign a synonym. Control the display of the tab line. Define the logical tab stops. Specify whether a terminal is used in line mode or full-screen mode . Inform the editor if TEXT keys are used. Control the display of TOF/EOF lines. Control user-defined uppercase translation. Define the truncation column. ~ ~ ~ J J '-- Appendix A. A Summary of XEDIT Subcommands and Macros' 167 Subcommand SET VARblank SET Verify SET WRap SET Zone SET = SHift SI SORT SOS SPlit SPLTJOIN STAck STATus TOP TRAnsfer Type Up UPPercas Xedit & = ? Prefix A C D E F I M 168 Purpose Specify whether the number of blanks between two words is significant in a target search. Control whether lines changed by subcommands are displayed; define the columns displayed and whether displayed in EBCDIC or hexadecimal or both. Control whether the editor wraps around the file if EOF (or TOF for backwards searches) is reached during a search. Define new limits within each line for target searches. Insert string into the equal buffer. Move data right or left (data loss possible). Continuously add lines and position cursor for indented text. Sort all or part of a file, in ascending or descending order. Specify functions for screen operation simulation. Split a line into two or more lines. Split a line or join two lines at the cursor. Place line(s) from the file into the console stack. Display SET subcommand current settings; create a macro that contains these settings. Move line pointer to null TOP OF FILE line. Place editing variable(s) in the console stack, for use by a macro. Display lines. Move line pointer toward top of file. Translate all lowercase characters to uppercase. Edit multiple files. Use before a subcommand for repeated execution. Reexecute the last subcommand or macro. Display the last subcommand executed. Subcommands Add line(s). Copy line(s). Delete line(s). Extend a line. Move or copy following this line. Insert line(s). Move line(s). VM/SP System Product Editor User's Guide rl. r-- L r- l l [ J Prefix p J SI II J / SCALE TABL .xxxx J _J J X ] < J J > - S Subcommands Move or copy preceding this line. Continuously add lines and position cursor for indented text. Duplicate line(s). Make this line the current line. Display the scale on this line. Display the tab line on this line. Assign symbolic name to this line . Exclude line(s) from display. Show excluded line(s). Shift line(s) to the left. Shift line(s) to the right. J ] -) -l J J :] J ] J J J ] J J --, -.J =.J -1 .-J ~ J J '---- Appendix A. A Summary of XEDIT Subcommands and Macros 169 rl. r . L r r r l I r L 170 VM/SP System Product Editor User's Guide I Special Characters I ·1 ] 1 _.J .~ J ~) . 1 _.-' ··1, .xxxx prefix subcommand 102 < SHIFT LEFT MACRO 48 $ (as arbitrary character) 110 / prefix subcommand 24 practice exercise using 53 > SHIFT RIGHT MACRO 48 ? subcommand 13 # (as line end character) 8, 9 ' .....' pending 20 """ pending 23 'DD' pending 16 = subcommand 14 " prefix subcommand 22 'C' or 'CC' pending 23 'F' pending 23 'M' or 'MM' pending 23 'P' pending 23 A prefix subcommand 15 practice exercise using 55 absolute column number 34 absolute line number, target as 98 example of 99 adding lines continuously 19 of indented text 19 using A prefix subcommand 15 using SI 19 adding subcommands 137 adding text to end of line 115 in typewriter mode 72 alarm, sounding 141 ALL 47 Alt= 3 ALTER 47 in typewriter mode 88 alteration count 3, 39 altering a character 47 in typewriter mode 88 AND symbol, used in string target 107 appending text to line 115 in typewriter mode 72 arbitrary character 110 assigning a name to a line 102 automatic save 3, 39 in typewriter mode 81 backspace characters in typewriter mode 86, 88 BACKWARD 26 backward search 30, 105 blank characters in targets, significance of 112 block of lines copying 23 deleting 16 duplicating 23 moving 23 BOTTOM 26 in typewriter mode 67 practice exercise using 53 bypassing profile macro 150 C prefix subcommand 23 CANCEL 119 CAPPEND 115 in typewriter mode 72 case changing 48 specifying 110 CDELETE 115 in typewriter mode 71 CFIRST 36, 115 in typewriter mode 69 CHANGE 30 in typewriter mode 73 practice exercise using 56 with absolute line number as target 98 changing data globally 34 in typewriter mode 73 selectively 31 in typewriter mode 74 using CHANGE 30 in typewriter mode 73 using COVERLA Y 115 using CREPLACE 115 changing data position 48 changing definition of a character 47 in typewriter mode 88 changing tab settings 37 in typewriter mode 87 changing the screen layout 127 character delete, using CDELETE 115 character insert, using CINSERT 34, 115 character overlay, using COVERLAY 115 character replace, using CREPLACE 115 Index 171 CINSERT 34, 115 in typewriter mode 69 CLAST 115 CLEAR key, to remove prefix subcommands 24 CLOCATE 29,114 in typewriter mode 68 CMS commands, issuing from a macro 143 CMS subcommand 143 CMSG 142 Col= 3 color, defining with SET COLOR 128 with SET CTLCHAR 143 with SET RESERVED 142 column pointer defined 5 displayed in the scale 5 displayed on typewriter terminal 64 indicator in file identification line 3 moving 29, 114 in typewriter mode 68 to beginning of line 115 to end of line 115 resetting 36, 115 in typewriter mode 69 sub commands based on position of 68, 115 column-target 114 columns, specifying for viewing 48 combining files 40 in typewriter mode 82 combining SET options 112 command input area 3 command line changing location 127 example of 131 defining display features 128 displaying message in 142 location on screen 3 commands, issuing from a macro 143 complex,~tring expression as target 110 exa~ple of 113 COMPRESS 48 concantenating files 40 in typewriter mode 82 con~ole stack 139 COpy in typewriter mode 79 copying lines in typewriter mode 79 using C prefix subcommand 23 COUNT 98 example of 99 COVERLA Y 115 CP commands, issuing from a macro 143 CP subcommand 143 creating a file 1 in typewriter mode 61 creating a macro file 138 CREPLACE 115 current column 5 in typewriter mode 64 172 VMjSP System Product Editor User's Guide current line appending words to 115 in typewriter mode 72 as starting place for subcommands 4 changing using j 24 using a target 92 using Q~PCATE 29 using DOWN 27 using UP 27 changing location on screen 128 example of 132 defining display features 128 displaying in typewriter mode 65 indicator in file identification line 3 location on screen 4 replacing, in typewriter mode 77 using target as displacement from 100 CURSOR 143 cursor placement in multiple screens 124 cursor, moving to command line 3 to specified location 143 L D prefix subcommand 16 practice exercise using 55 data, changing globally 34 in typewriter mode 73 selectively 31 In typewriter mode 74 using CHANGE 30 in typewriter mode 73 using COVERLA Y 115 using CREPLACE 115 data, entering on display terminal 5 on, typewriter terminal 62 data, locating using a target 105 using CLOCATE 2~ in typewriter mode 68 defining screen size 120 DELETE in typewriter mode 76 deleting characters 115 in typewriter mode 71 deleting lines block of lines 16 recovering 18 in typewriter mode 77 using D prefix subcommand 16 using DELETE in typewriter mode delimiters, using 29 in typewriter mode 68 destination line 76 J OJ F prefix subcommand 23 for copied lines 23 for moved lines 23 P prefix subcommand 23 display features 128 display screen layout 2 displaying data from a macro 141 displaying help menus 47 displaying line numbers 44 displaying lines on typewriter terminal 63 displaying messages on editor screen 141 displaying more than one file 121 displaying tab settings 37 in typewriter mode 87 dividing screen 120 DOWN 27 example of 28 in typewriter mode 66 practice exercise using 53 duplicating lines 22 J ° 1 _J ~J - ] ~J ~) J J edit environment 1 in typewriter mode 61 edit mode 5 in typewriter mode 62 editing multiple files 117 illustration of 119 editing one file 1 in typewriter mode 61 edi ting options See editing variables editing variables preserving 143 restoring 143 transferring 140 editing, defined 1 in typewriter mode 61 editor, invoking 1 in typewriter mode 61 EMSG 141 ending editing session 38, 119 in typewriter mode 80 entering data 5 using INPUT 5 in typewriter mode 62 using POWERINP 8 entering prefix subcommands 4, 15 entering subcommands 3 entering XEDIT subcommands 5 on typewriter terminal 61 EOF 65 error message display 3 in typewriter mode 62 EXEC 2 file used as XEDIT macro 137 executing a subcommand 3 exercises, practice 51 exiting the editor 38, 119 in typewriter mode 80 EXPAND 48 extended highlighting, defining with SET COLOR 128 with SET CTLCHAR 143 with SET RESERVED 142 EXTRACT 139 F prefix subcommand 23 FILE 38 in typewriter mode 80 practice exercise using 51 file area on screen 4 file identification line 2 file, inserting 40 in typewriter mode 82 filemode 3 filemode of XEDIT macro 138 filename of XEDIT macro 138 filename of XEDIT prefix macro filetype of XEDIT macro 138 finding data using a target 105 using CLOCATE 29 in typewriter mode 68 FORWARD 26 forward search 105 full-screen mode 1 138 GET 4o,44;,~; in typewH ter mode 82 practice exercise using 57 global change 34 in typewriter mode 73 HELP 47 help display 47 highlighting, defining with SET COLOR 128 with SET CTLCHAR 143 with SET RESERVED 142 horizontal screens, multiple 120 Index 173 information message display 3 in typewriter mode 62 initial setting of PF keys 11 INPUT practice exercise using 51 to enter input mode 5 on typewriter terminal 62 to enter line in typewriter mode INPUT line 75 input mode 5 on typewriter terminal 62 input zone 5 changing size 128 insert mode key 9, 14 practice exercise using 53 inserting a blank line 75 inserting a file in typewriter mode 82, 83 part of 43 example of 46 whole file 40 example of 42 inserting characters in input mode 14 in power typing mode 9, 14 using CINSERT 34, 115 in typewriter mode 69 using P A2 key 14 using SET NULLS 14 using the insert mode key 14 inserting data from another file 40 in typewriter mode 82 using CINSERT 34, 115 in typewriter mode 69 inserting lines using INPUT 6 in typewriter mode 63, 67, 75 inserting words using CINSERT 34, 115 in typewriter mode 69 invoking the editor 1 in typewriter mode 61 joining files 40 in typewriter mode joining lines 11 174 75 82 VM/SP System Product Editor User's Guide labelling a line 102 LEFT 48 line end character 8 line name, target as 102 example of 104 line number, displaying 44 line pointer 4 in typewriter mode 64 moved by target 92 Line= 3 LOAD 150 LOCATE 95 locating data using a target 105 using CLOCATE 29 in typewriter mode 68 logical record length 62 logical screens, multiple 120 LOWERCAS 48 LPREFIX in typewriter mode 80 M prefix subcommand 23 practice exercise using 55 MACRO 144 macro language 137 macro, XEDIT argument string 158 avoiding name conflicts 144 creating 138, 153 cursor position 160 definition of 137 examples of 143, 145, 151, 153, 162 executing 137 file identifier 138 handling blocks 156 information passed 139, 153, 155 prefix 153 profile 150 search order, specifying 144 source string 154 subcommands used in 138 XEDIT prefix macro 160 MERGE 48 message controlling display of 142 displaying in command line 142 displaying on editor screen 141 error 3 in typewriter mode 62 information 3 issued from a macro 141 r ,- l J i ~ J J J J J J J J J -, -.J ] J ~J ] J J J warning, example 39 message line changing location 128 defining display features 128 location on screen 3 MODIFY TABS 37 modifying tab settings 37 MOVE in typewriter mode 78 moving cursor to command line 3 moving cursor to specified location 143 moving display right or left 48 moving lines 78 in typewriter mode 78 using M prefix subcommand 23 moving through a file using BAeKW ARD 26 using BOTTOM 26 in typewriter mode 67 using DOWN 27 in typewriter mode 66 using FORWARD 26 using PF keys 13 using TOP 26 in typewriter mode 67 using UP 27 in typewriter mode 66 MSG 141 multiple files displaying 117 editing 118 illustration of 119 ending editing sessions for 119 on one screen 123 example of 125 multiple logical screens defining 120 example of 122 multiple views of different files 123 example of 125 of same file 121 example of 122 making changes in 121 order of processing in 123 J J J J ] J ] ] names, avoiding conflicts of macro 144 naming a line 48, 102 NOT symbol, used in string target 106 NULLKEY 14 number of files being edited 3 operand, target as 95 OR symbol, used in string target 106 order of processing with multiple screens 123 P prefix subcommand 23 practice exercise using 55 PA2 key 14 practice exercise using 53 pending list 123, 157 pending notice ' ..... ' pending 20 """ pending 23 'DD' pending 16 'e' or 'ee' pending 23 'F' pending 23 'M' or 'MM' pending 23 'P' pending 23 cancelling 24 defining display features 128 location on screen 3 PF keys changing settings of 11 displaying settings of 11 initial settings of 11, 50 using 11 power typing mode example of 9 inserting characters in 9 typing data in 5, 8 using line end character in 8 POWERINP 8 practice exercise using 53 practice exercise 51 prefix area changing location or display 127 example of 130 defining display features 128 location on screen 4 simulate in typewriter mode 80 prefix macro assigning a synonym 156 examples of 153 writing 153 prefix subcommands .xxxx 102 I 24 A 15 example of 17 23 canceling 24 D 16 example of 17 e Index 175 defined 15 F 23 example of 25 list of 15, 49 M 23 example of 25 P 23 practice exercise using 55 SI 19 example of 19 where to enter 4 PRESERVE 143 preserving editing variables 143 processing with multiple screens, order of 123 profile macro, XEDIT definition of 150 example of 151 programmed symbol sets, defining with SET COLOR 128 with SET CTLCHAR 143 with SET RESERVED 142 PUT 43 in typewriter mode 83 practice exercise using 57 QQUIT 39 in typewriter mode 81 QUERY LRECL 63 QUERY PF 11 QUERY POINT 103 QUERY RING 118 QUERY TABS 37 in typewriter mode 87 practice exercise using 51 QUIT 39 in typewriter mode 80 range of operation of subcommands, defining READ 139 record format 3 record length 3 in typewriter mode 62 RECOVER 18 example of 18 in typewriter mode 77 practice exercise using 55 recovering deleted lines 18 in typewriter mode 77 redefining a character 47 in typewriter mode 88 176 redisplaying a subcommand 13 reexecuting a subcommand 14 referring to a line 102 relative displacement, target as 100 example of 101 repeating the display of a subcommand 13 repeating the execution of a subcommand 14 REPLACE in typewriter mode 77 replacing a line in typewriter mode 77 replacing data globally 34 in typewriter mode 73 selectively 31 in typewriter mode 74 using CHANGE 30 in typewriter mode 73 using COVERLA Y 115 using CREPLACE 115 reposition data 48 reserving a screen line for use by a macro RESET 24 RESET key 14 to end insert mode 9 RESTORE 143 restoring editing variables 143 REXX file used as XEDIT macro 137 RIGHT 48 ring of files 117 editing 118 illustration of 118 r- l r \. r l 95 VM/SP System Product Editor User's Guide save, automatic 39 in typewriter mode 81 saving editing variables 143 scale changing location or display 128 defining display features 128 example of 133 location on screen 4 screen layout 2 changing 127 screen size, defining 120 scrolling the screen using BACKWARD 26 using FORWARD 26 using PF keys 13 search direction, specifying 105 search order of macros and subcommands, specifying 144 searching for data using a target 105 using CLOCATE 29 in typewriter mode 68 selective change 31 example of 33 J J J ] J ] ) J 1 .J J J J . , ..J J J J J j ] J J ] ] J J ] j ] J in typewriter mode 74 SET ARBCHAR 48, 110 SET AUTOSAVE 39 in typewriter mode 81 practice exercise using 51 SET CASE 48, 111 SET CMDLINE 127 example of 131 SET COLOR 128 SET CTLCHAR 143 SET CURLINE 128 example of 132 SET HEX 108 SET IMAGE in typewriter mode 86,88 SET MACRO 144 SET MSGLINE 128 example of 135 SET MSGMODE 142 SET NULLS 14 SET NUMBER 44, 98, 129 SET options, combining 112 SET PFn 11 SET POINT 48, 102 SET PREFIX 127 example of 130 SET RESERVED 142 SET SCALE 128 example of 133 SET SCREEN 48, 120 example of 122, 125 SET SPAN 110,111 SET SYNONYM 144 SET TAB LINE 128 SET TABS 37 example of 134 in typewriter mode 87 practice exercise using 51 SET VARBLANK 110, 112 SET VERIFY 48 setting tabs 37 in typewriter mode 87 shifting display right or left 48 SI prefix subcommand 19 simple string expression as target example of 109 format of 107 size of file 3 size of logical screen 120 Size= 3 SORT 48 sorting 48 spanning lines 111 special characters in typewriter mode altering 88 using 86 splitting lines 11 splitting screen 120 status " , , , ,'pending 20 l i l l i ' pending 23 'DD' pending 16 'C' or 'CC' pending 23 'F' pending 23 'M' or 'MM' pending 23 'P' pending 23 status area defining display features 128 during macro processing 139 location on screen 3 status of editing session 3 string expression complex target as 110 simple target as 105 string target 105 string, locating using a target 105 using CLOCATE 29 in typewriter mode 68 structured input 19 subcommands, XEDIT , defining range of operation 95 entering on display terminal 3 entering on typewriter terminal 61 used in macros, list of 138 wi th target operands 9,1 writing your own 137 summary of initial PF key settings 50 of prefix sub commands 168 of subset for full-screen 49 of subset for typewriter terminals 89 of XEDIT subcommands and macros 163 symbolic name, assigning 48 synonym assigning 156 not checking for 144 System Product Interpreter 137 tab characters in typewriter mode tab key in typewriter mode 86 using PF key as 37 example of 38 tab line defining display features 128 displaying 128 example of 134 tab settings 37 in typewriter mode 86 tabbing using PF key 37 tabs displaying 37 86 Index 177 r example of 38 in typewriter mode 87 setting 37 in typewriter mode 87 tailoring the screen 127 target as absolute line number 98 example of 99 as complex string expression 110 example of 113 as line name 102 example of 104 as operand of LOCATE 95 as relative displacement 100 example of 101 as simple string expression 105 example of 109 format of 107 as subcommand operand 95 example of 97 definition of 91 entered alone 92 entered before subcommand 95 how to express 91 types of 98 used in PUT 83 used in subcommands 91 used to change current line 92 used to move line pointer 92 example of 94 TOF 65 TOP 26 in typewriter mode 67 practice exercise using 53 translating characters 48 Trunc= 3 truncation column 3 TYPE 65 typewriter mode 61 typing lines to terminal 65 178 VM/SP System Product Editor User's Guide UP 27 in typewriter mode 66 practice exercise using 53 UPPERCAS 48 example of 97 variables, XEDIT See editing variables vertical screens, multiple example of 125 120 wri ting file on disk 38 in typewriter mode 80 writing macros 137 writing your own subcommands 137 XEDIT command 1 in typewriter mode 61 practice exercise using 51 used to bypass profile macro 150 used to specify profile macroname XEDIT macro See macro, XEDlT XEDIT subcommand 117,121 issued from a logical screen 121 XEDIT subcommands 5 XEDIT variables See editing variables r- 150 l :] ._-, --.J SC24-5220-2 < ::;: ............ (f) "'U (f) -< en r-+ CD 3 ...."'U o Q. c:: (") r-+ m Q. ~: o .... C en CD ..... en G) c:: Q. CD "T1 CD z 9, c. u.. ••...L o ............ +::> w o o I W to "'U :::::!. :::J r-+ CD Q. ::l C (f) ~ (f) () N +::> I Ul N N o I N --- ---- ------- -----~ -~-. VM/SP System Product Editor User's Guide Order No. SC24-5220-2 J READER'S COMM~NT FORM This manual is part of a library that serves as a reference source for systems analysts, programmers, and operators of IBM systems. You may use this form to communicate your comments about this publication, its organization, or subject matter, with the understanding that IBM may use or distribute whatever information you supply in any way it believes appropriate without incurring any obligation to you. ' , Your comments will be sent to the author's department for whatever review and action, if any, are deemed appropri,fe. Comments may be written in your Qwn language; English is not required. . Note: Copies of IBM publications are n.ot stocked at the location to which this form is addressed. Please direct any requests for copies of publications, 'or for assistance in using your IBM system, to your IBM representative or to the IBM branch office serving your locality. g ~ c:: 0 E CI) ::I - OJ '+- Yes No o o o o o o o o o o .::- :.c J C" OJ ~ C) CI) .=t - • Does the publication meet your needs? 0 J O OJ CI) c.. :=;3 • Did you find the material: Easy to read and understand? co J J E~ "C ~ co E o -::I Organized for convenient use? E E Complete? ::I C) .... OJ .c Well illustrated? Written for your technical level? COo J ::§ 5 ] :s: OJ CI) .::: E OJ ::c e J .'!::: CI) ::I CI) CI) CI) (.c::.) c.. CO (..) - 1 __ J CI) Q.) How do you use this publication: As an introduction to the subject? Q.) For advanced knowledge of the subject? Q.) To learn about operating procedures? CI) ::I o o o As an instructor in class? As a student in class? As a reference manual? o o o Q.) c..~ CO What is your occupation? CI) OJ ::I o § c..e CO • o Q.) Ci5c:: Your comments: I --.J J J ~J -- ~I J J If you would like a reply, please supply your name and address on the reverse side of this form. Thank you for your cooperation. No postage stamp necessary if mailed in the U.S.A. (Elsewhere, an IBM office or representative will be happy to forward your comments or you may mail directly to the address in the Edition Notice on the back of the title page.) SC24- 5220- 2 (") S Reader's Comment Form Q "T1 0 a: ~ 0 ::J co c: ::J CP < ~ ........... CJ) -u I~ C/l r-+ CD 3 -u Fold and Tape Please Do Not Staple Fold and Tape ." ......................................................................................................,............................................................................................................................................................................................• I o"'" c. c (") r-+ m c. NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES ;:=+: o "'" cC/l CD ""'. C/l G) C ~ BUSINESS REPLY MAIL FIRST CLASS PERMIT NO. 40 CD :!'! ARMONK, N.Y. CD z o POSTAGE WILL BE PAID BY ADDRESSEE: CJ) W -......I o ........... ~ International Business Machines Corporation Department G60 P. O. Box 6 Endicott, New York 13760 w o oI W ~ -u ..., ::! . ;::t. ................................................................................................................................................................................................................................................................................................... Fold Fold CD c. 5' c CJ) If you would like a reply, please print: Your Name ____..,.--_______________________ Company Name ________________ Department ______ Street Address _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ Cuy _____________________________________ State ________________ Zip Code _ _ _ _ __ IBM Branch Office serving you ____________________________ - --........ --- - - --- ~--- -... -~® ~ CJ) ("') N ~ I Ul N N oI N .-, ~) . VM/SP System Product Editor User's Guide Order No. SC24-5220-2 ~ I READER'S COMMENT FORM J J J This manual is part of a library that serves as a reference source for systems analysts, programmers, and operators of IBM systems. You may use this form to communicate your comments about this publication, its organization, or subject matter, with the understanding that IBM may use or distribute whatever information you supply in any way it believes appropriate without incurring any obligation to you. J Your co~ments will be sent to the author's department for whatever review and action, if any, are deemed appropriate. Comments may be written in your own language; English is not required. ] J J J Note: Copies of IBM publications are not stocked at the location to which this form is addressed. Please direct any requests for copies of publications, or for assistance in using your IBM system, to your IBM representative or to the IBM branch office-serving your locality. ...;c g 0 E Q) - en J :::J g-ro Q) .=t C) J O en .ttl ~ ~J ttl E o J • Did you find the material: Easy to read and understand? ;: .- Complete? :::J C) -o ..c: Organized for convenient use? .... Q) ..c: Well illustrated? Written for your technical level? .... D D o D D D .:=: o en Q) :::J c..e U C ttl U en Q) en en D What is your occupation? c.. • How do you use this publication: As an introduction to the subject? Q) For advanced knowledge of the subject? Q) To learn about operating procedures? en :::J D D D As an instructor in class? As a student in class? As a reference manual? D D D Q) c..~ ttl o Q) !ii'~ :c ~ :::J ttl D D D D 0 en en ~ Does the publication meet your needs? E E ttl ;;a J Q) c.. ~ :::J - ~ • en E~ "'C _J No 0 J J Yes .~:..c: Q) U5a:: Your comments: J ~J J .J ~ J ~J ] J If you would like a reply, please supply your name and address on the reverse side of this form. J Thank you for your cooperation. No postage stamp necessary if mailed in the U.S.A. (Elsewhere, an IBM office or representative will be happy to forward your comments or you may mail directly to the address in the Edition Notice on the back of the title page.) J SC24-5220-2 (") s Reader's Comment Form cr0: l> o::::I a:l c: ~ < :5: ........... Ul ""0 Ul -< ·en .-+ (1) 3 ...,""0 Fold and Tape Please Do Not Staple Fold and Tape ....................................................................................................................................................................................................................................................................................................., o c 0(') .-+ m 0- NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES ;:;: o ..., en G) c ~ BUSINESS REPLY MAIL FIRST CLASS PERMIT NO. 40 CD ~ ARMONK, N.Y. (1) z 9 POSTAGE WILL BE PAID BY ADDRESSEE: Ul W --...J o ........... +::. International Business Machines Corporation Department G60 P. O. Box 6 Endicott, New York 13760 w o oI W ~ ""0 ~. ::J .-+ (1) ................................................................................................................................................................................................................................................................................................... Fold Fold 0::J C Ul If you would like a reply, please print: Your Name _______________________________________________________ Company Name _____________________________ Department ______ Street Address ______________________ Ciry _____________________________________ State _______________________ Zip Code _______ IBM Branch Office serving you __________________________________ --- - . . . --------- - - ---_._- -..-~ ® ~ Ul (') N +::. I 01 N N oI N SC24-5220-2
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.3 Linearized : No XMP Toolkit : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37 Producer : Adobe Acrobat 9.31 Paper Capture Plug-in Modify Date : 2010:03:20 13:15:27-08:00 Create Date : 2010:03:20 13:15:27-08:00 Metadata Date : 2010:03:20 13:15:27-08:00 Format : application/pdf Document ID : uuid:bd308616-4f93-433d-bc40-c103206b9600 Instance ID : uuid:71a790aa-af62-42cc-9170-320955953a4c Page Layout : SinglePage Page Mode : UseNone Page Count : 202EXIF Metadata provided by EXIF.tools