ISPF Edit
ISPF Edit
SC34-4820-05
SC34-4820-05
Note Before using this document, read the general information under Notices on page 417.
Sixth Edition (September 2006) This edition applies to ISPF for Version 1 Release 8.0 of the licensed program z/OS (program number 5694-A01) and to all subsequent releases and modifications until otherwise indicated in new editions. IBM welcomes your comments. A form for comments appears at the back of this publication. If the form has been removed and you have ISPF-specific comments, address your comments to: IBM Corporation Reader Comments DTX/E269 555 Bailey Avenue San Jose, CA 95141-1003 U.S.A. Internet: [email protected] If you would like a reply, be sure to include your name and your address, telephone number, e-mail address, or FAX number. Make sure to include the following in your comment or note: v Title and order number of this document v Page number or topic related to your comment When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. The ISPF development team maintains a site on the World Wide Web. The URL for the site is: http://www.ibm.com/software/awdtools/ispf/ Copyright International Business Machines Corporation 1984, 2006. All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Contents
Figures . . . . . . . . . . . . . . vii Preface . . . . . . . . . . . . . . . ix
About this document . . . . . . . . . Who should use this document . . . . . . How to read the syntax diagrams . . . . . Using LookAt to look up message explanations. Using IBM Health Checker for z/OS . . . . . . . . ix . ix . ix . . x . . xi Changed Lines . . . . . . . . . . . Error Lines . . . . . . . . . . . . Special lines . . . . . . . . . . . . Edit boundaries . . . . . . . . . . . . Initial macros . . . . . . . . . . . . . Application-wide macros . . . . . . . . . Statistics for PDS members . . . . . . . . Effect of Stats mode when beginning an edit session . . . . . . . . . . . . . . Effect of Stats mode when saving data . . . Version and modification level numbers . . . . Sequence numbers . . . . . . . . . . . Sequence number format and modification level Sequence number display. . . . . . . . Initialization of number mode . . . . . . Enhanced and language-sensitive edit coloring . Language support . . . . . . . . . . The HILITE command and dialog . . . . . Highlighting status and the edit profile . . . Edit recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 22 23 23 25 26 26 26 26 27 27 27 28 28 29 29 34 38 39
Whats in the z/OS V1R8.0 ISPF library? . . . . . . . . . . . . . . xiii The ISPF user interface . . . . . . . xv
Some terms you should know . . . . . . How to navigate in ISPF using the action bar interface . . . . . . . . . . . . . Action bars . . . . . . . . . . . Command nesting . . . . . . . . . Action bar choices . . . . . . . . . Point-and-shoot text fields . . . . . . Function keys . . . . . . . . . . Selection fields . . . . . . . . . . . . . . xv . xvi . xvi . xviii . . xix . . xx . . xx . . xxi
. 3
. 3 . 3 . 4 . 4 . 4 . 4 . 12 . 12 . 13 . 13 . 14 . 14 . 15 . 16 . 16
. . . . . . profile. . . . . . . . . . . . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
17 17 17 19 19 19 20 21 22
iii
Entering Text (Power Typing) . . . . Using Tabs . . . . . . . . . . . Types of Tabs . . . . . . . . . . Defining and Controlling Tabs . . . . Defining Software Tab Positions . . . Defining Hardware Tab Positions . . . Using Attribute Bytes . . . . . . . Undoing Edit Interactions . . . . . . UNDO Processing . . . . . . . . Understanding Differences in SETUNDO Processing . . . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . .
60 61 61 62 62 63 64 64 65
Recovery Macros . . . . . . . . . . Return Codes from User-Written Edit Macros. . Return Codes from PDF Edit Macro Commands Selecting Control for Errors . . . . . . . .
. 66
189
Edit Primary Command Summary . . . . . . 189 AUTOLISTCreate a Source Listing Automatically 191 AUTONUMNumber Lines Automatically . . . 193
iv
AUTOSAVESave Data Automatically . . . . . BOUNDSControl the Edit Boundaries . . . . BROWSEBrowse from within an Edit Session BUILTINProcess a Built-In Command . . . . CANCELCancel Edit Changes . . . . . . . CAPSControl Automatic Character Conversion CHANGEChange a Data String . . . . . . COLSDisplay Fixed Columns Line . . . . . COMPAREEdit Compare . . . . . . . . . COPYCopy Data . . . . . . . . . . . CREATECreate Data . . . . . . . . . . CUTCut and Save Lines . . . . . . . . . DEFINEDefine a Name . . . . . . . . . DELETEDelete Lines . . . . . . . . . . EDITEdit from within an Edit Session . . . . EDITSETDisplay the Editor Settings Dialog . . ENDEnd the Edit Session . . . . . . . . EXCLUDEExclude Lines from the Display . . . FINDFind a Data String . . . . . . . . . FLIPReverse Exclude Status of Lines . . . . . HEXDisplay Hexadecimal Characters . . . . HIDEHide Excluded Lines Message . . . . . HILITEEnhanced Edit Coloring . . . . . . IMACROSpecify an Initial Macro . . . . . . LEVELSpecify the Modification Level Number LOCATELocate a Line. . . . . . . . . . MODELCopy a Model into the Current Data Set MOVEMove Data . . . . . . . . . . . NONUMBERTurn Off Number Mode . . . . NOTESDisplay Model Notes . . . . . . . NULLSControl Null Spaces . . . . . . . . NUMBERGenerate Sequence Numbers . . . . PACKCompress Data . . . . . . . . . . PASTEMove or Copy Lines from Clipboard . . PRESERVEEnable Saving of Trailing Blanks . . PROFILEControl and Display Your Profile . . . RCHANGERepeat a Change . . . . . . . RECOVERYControl Edit Recovery. . . . . . RENUMRenumber Data Set Lines . . . . . . REPLACEReplace Data . . . . . . . . . RESETReset the Data Display . . . . . . . RFINDRepeat Find . . . . . . . . . . . RMACROSpecify a Recovery Macro . . . . . SAVESave the Current Data . . . . . . . . SETUNDOSet the UNDO Mode . . . . . . SORTSort Data . . . . . . . . . . . . STATSGenerate Library Statistics . . . . . . SUBMITSubmit Data for Batch Processing . . . TABSDefine Tabs . . . . . . . . . . . UNDOReverse Last Edit Interaction . . . . . UNNUMBERRemove Sequence Numbers . . . VERSIONControl the Version Number . . . . VIEWView from within an Edit Session . . . .
194 196 197 198 199 199 200 203 204 207 211 215 216 218 219 222 225 225 227 229 232 234 236 240 240 242 243 247 250 251 252 253 254 255 256 256 259 260 261 263 267 269 269 270 271 272 274 275 276 278 280 282 283
BOUNDSSet or Query the Edit Boundaries . . . BROWSEBrowse from within an Edit Session BUILTINProcess a Built-In Command . . . . CANCELCancel Edit Changes . . . . . . . CAPSSet or Query Caps Mode . . . . . . . CHANGEChange a Search String . . . . . . CHANGE_COUNTSQuery Change Counts . . . COMPAREEdit Compare . . . . . . . . . COPYCopy Data . . . . . . . . . . . CREATECreate a Data Set or a Data Set Member CURSORSet or Query the Cursor Position . . . CUTCut and Save Lines . . . . . . . . . DATA_CHANGEDQuery the Data Changed Status . . . . . . . . . . . . . . . . DATA_WIDTHQuery Data Width . . . . . . DATAIDQuery Data ID . . . . . . . . . DATASETQuery the Current and Original Data Set Names . . . . . . . . . . . . . . DEFINEDefine a Name . . . . . . . . . DELETEDelete Lines . . . . . . . . . . DISPLAY_COLSQuery Display Columns . . . DISPLAY_LINESQuery Display Lines . . . . DOWNScroll Down . . . . . . . . . . EDITEdit from within an Edit Session . . . . ENDEnd the Edit Session . . . . . . . . EXCLUDEExclude Lines from the Display . . . EXCLUDE_COUNTSQuery Exclude Counts . . FINDFind a Search String . . . . . . . . FIND_COUNTSQuery Find Counts . . . . . FLIPReverse Exclude Status of Lines . . . . . FLOW_COUNTSQuery Flow Counts . . . . . HEXSet or Query Hexadecimal Mode . . . . HIDEHide Excluded Lines Message . . . . . HILITEEnhanced Edit Coloring . . . . . . IMACROSet or Query an Initial Macro . . . . INSERTPrepare Display for Data Insertion . . . LABELSet or Query a Line Label . . . . . . LEFTScroll Left . . . . . . . . . . . . LEVELSet or Query the Modification Level Number . . . . . . . . . . . . . . . LINESet or Query a Line from the Data Set . . LINE_AFTERAdd a Line to the Current Data Set LINE_BEFOREAdd a Line to the Current Data Set . . . . . . . . . . . . . . . . . LINE_STATUSQuery Source and Change Information for a Line in a Data Set . . . . . . LINENUMQuery the Line Number of a Labeled Line . . . . . . . . . . . . . . . . LOCATELocate a Line. . . . . . . . . . LRECLQuery the Logical Record Length . . . MACROIdentify an Edit Macro . . . . . . MACRO_LEVELQuery the Macro Nesting Level MASKLINESet or Query the Mask Line . . . . MEMBERQuery the Current Member Name . . MENDEnd a Macro in the Batch Environment MODELCopy a Model into the Current Data Set MOVE Move a Data Set or a Data Set Member NONUMBERTurn Off Number Mode . . . . NOTESSet or Query Note Mode . . . . . . NULLSSet or Query Nulls Mode . . . . . . NUMBERSet or Query Number Mode . . . .
Contents
294 296 297 297 298 299 302 303 306 307 308 310 311 312 313 314 315 316 318 319 319 321 321 322 325 325 328 328 329 330 331 332 335 336 337 338 339 340 342 343 345 346 347 349 350 351 352 353 353 353 355 356 357 358 359
PACKSet or Query Pack Mode . . . . . . PASTEMove or Copy Lines from Clipboard . PRESERVEEnable Saving of Trailing Blanks . PROCESSProcess Line Commands . . . . PROFILESet or Query the Current Profile . . RANGE_CMDQuery a Command That You Entered . . . . . . . . . . . . . . RCHANGERepeat a Change . . . . . . RECFMQuery the Record Format . . . . . RECOVERYSet or Query Recovery Mode . . RENUMRenumber Data Set Lines . . . . . REPLACEReplace a Data Set or Data Set Member . . . . . . . . . . . . . . RESETReset the Data Display . . . . . . RFINDRepeat Find . . . . . . . . . . RIGHTScroll Right . . . . . . . . . . RMACROSet or Query the Recovery Macro . SAVESave the Current Data . . . . . . . SAVE_LENGTHSet or Query Length for Variable-Length Data . . . . . . . . . . SCANSet Command Scan Mode . . . . . SEEKSeek a Data String, Positioning the Cursor SEEK_COUNTSQuery Seek Counts . . . . SESSIONQuery Session Type . . . . . . SETUNDOSet UNDO Mode . . . . . . . SHIFT (Shift Columns Left . . . . . . . SHIFT )Shift Columns Right . . . . . . . SHIFT <Shift Data Left . . . . . . . . SHIFT >Shift Data Right . . . . . . . . SORTSort Data . . . . . . . . . . . STATSSet or Query Stats Mode . . . . . . SUBMITSubmit Data for Batch Processing . . TABSSet or Query Tabs Mode . . . . . . TABSLINESet or Query Tabs Line . . . . . TENTERSet Up Panel for Text Entry . . . . TFLOWText Flow a Paragraph . . . . . .
. . . . . . . . . . . . . . . .
362 363 364 365 367 369 369 370 371 373 374 375 376 377 378 379
TSPLITText Split a Line . . . . . . UNNUMBERRemove Sequence Numbers UPScroll Up . . . . . . . . . . USER_STATESave or Restore User State . VERSIONSet or Query Version Number . VIEWView from within an Edit Session . VOLUMEQuery Volume Information . . XSTATUSSet or Query Exclude Status of a
. . . . . . . . . . . . . . Line
. . . . . . .
. 380 . 381 382 . 384 . 385 . 385 . 387 . 387 . 388 . 389 . 390 . 392 . 393 . 394 . 396 . 397 . 398
Notices . . . . . . . . . . . . . . 417
Programming Interface Information . Trademarks . . . . . . . . . . . . . . . . . . 418 . 419
Index . . . . . . . . . . . . . . . 421
vi
Figures
1. Panel with an Action Bar Pull-Down Menu xvii 2. Pop-Up Selected from an Action Bar Pull-Down . . . . . . . . . . . . xviii 3. Panel with an Action Bar and Point-and-Shoot Fields . . . . . . . . xviii 4. An Unavailable Choice on a Pull-Down xix 5. Edit Entry Panel (ISREDM01) . . . . . . . 5 6. Creating a New Data Set (ISREDDE2) . . . . 9 7. Example Primary Edit Panel (ISREDDE2) 10 8. Edit Profile Display (ISREDDE2) . . . . . 18 9. HILITE Initial Screen (ISREP1) . . . . . . 35 10. HILITE Language Element Specification Screen (ISREPC1) . . . . . . . . . . . . . 37 11. HILITE Language Keyword List (ISREPK) 38 12. Examples of Edit Profile Lines showing HILITE options . . . . . . . . . . . 38 13. Edit Recovery Panel (ISREDM02) . . . . . 39 14. Before FIND Command (ISREDDE2) . . . . 53 15. After FIND Command . . . . . . . . . 53 16. Before CHANGE Command . . . . . . . 53 17. After CHANGE Command . . . . . . . 54 18. Before EXCLUDE Command . . . . . . . 54 19. After EXCLUDE Command . . . . . . . 54 20. Model Classes Panel (ISREMCLS) . . . . . 68 21. CLIST Models Panel (ISREMCMD) . . . . . 69 22. DISPLAY Service Model . . . . . . . . 70 23. Panel Models Panel (ISREMPNL) . . . . . 71 24. Changed Panel Models Panel (ISREMPNL) 72 25. Changed )PROC Section of Panel Models Panel (ISREMPNL) . . . . . . . . . . 72 26. Source Code for Block Letter Model Selection Panel. . . . . . . . . . . . . . . 73 27. ISRDASH Macro . . . . . . . . . . . 78 28. ISRDASH Macro - Before Running . . . . . 78 29. ISRDASH Macro - After Running . . . . . 79 30. ISRTDATA Macro . . . . . . . . . . 79 31. ISRTDATA Macro - Before Running . . . . 80 32. ISRTDATA Macro - After Running . . . . . 80 33. ISRCOUNT Macro . . . . . . . . . . 81 34. ISRCOUNT Macro - Before Running . . . . 81 35. ISRCOUNT Macro - After Running . . . . 82 36. ISRSLREX REXX Macro . . . . . . . . 88 37. ISRSLPLI PL/I Macro . . . . . . . . . 89 38. ISRSLCOB COBOL Macro . . . . . . . . 90 39. ISRTDATA Macro with CLIST WRITE Statements . . . . . . . . . . . . 110 40. Results of ISRTDATA Macro with CLIST WRITE Statements . . . . . . . . . . 111 41. ISRTRYIT Macro . . . . . . . . . . 112 42. ISRTRYIT Macro - Before Running . . . . 112 43. ISRTRYIT Macro - After Running . . . . . 113 44. ISRBOX Macro . . . . . . . . . . . 115 45. ISRBOX Macro - Before Running . . . . . 117 46. ISRBOX Macro - After Running . . . . . 117 47. ISRIMBED Macro . . . . . . . . . . 118 48. LIST with Imbed Statements . . . . . . 119
Copyright IBM Corp. 1984, 2006
49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97.
ISRIMBED Macro - After Running . . . . ISRMBRS Macro . . . . . . . . . . ISRCHGS Macro . . . . . . . . . . ISRCHGS Macro - Before Running . . . . ISRCHGS Macro - After Running . . . . . ISRMASK Macro . . . . . . . . . . ISRMASK Macro - Before Running . . . . ISRMASK Macro - After Running . . . . . Before the ( (Column Shift Left) Line Command . . . . . . . . . . . . After the ( (Column Shift Left) Line Command . . . . . . . . . . . . Before the ) (Column Shift Right) Line Command . . . . . . . . . . . . After the ) (Column Shift Right) Line Command . . . . . . . . . . . . Before the < (Data Shift Left) Line Command After the < (Data Shift Left) Line Command Before the > (Data Shift Right) Line Command . . . . . . . . . . . . After the > (Data Shift Right) Line Command Before the A (After) Line Command . . . . After the A (After) Line Command . . . . Before the B (Before) Line Command After the B (Before) Line Command . . . . Before the BOUNDS Line Command After the BOUNDS Line Command . . . . Before the C (Copy) Line Command . . . . After the C (Copy) Line Command . . . . Before the COLS Line Command . . . . . After the COLS Line Command . . . . . Before the D (Delete) Line Command After the D (Delete) Line Command . . . . Before the F (Show First Line) Line Command After the F (Show First Line) Line Command Before the I (Insert) Line Command . . . . After the I (Insert) Line Command . . . . Before the L (Show Last Line) Line Command After the L (Show Last Line) Line Command Before the LC (Lowercase) Line Command After the LC (Lowercase) Line Command Before the M (Move) Line Command After the M (MOVE) Line Command Before the MASK Line Command . . . . . After the MASK Line Command . . . . . Before the MD (Make Dataline) Line Command . . . . . . . . . . . . After the MD (Make Dataline) Line Command . . . . . . . . . . . . Before the O (Overlay) Line Command After the O (Overlay) Line Command Before the R (repeat) Line Command After the R (Repeat) Line Command . . . . Before the S (Show) Line Command . . . . After the S (Show) Line Command . . . . TAB Line Command Example . . . . . .
120 121 123 125 126 127 128 129 136 137 138 139 140 141 142 143 144 145 146 147 149 149 151 152 153 153 155 155 156 157 158 159 160 160 162 162 164 165 166 167 168 169 171 171 173 173 175 175 177
vii
98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125. 126. 127.
Before the TE (Text Entry) Line Command After the TE (Text Entry) Line Command Sample Text During Text Entry Mode. Sample Text After Text Entry Mode. . . . . Before the TF (Text Flow) Line Command After the TF (Text Flow) Line Command Before TS (Text Split) Line Command After TS (Text Split) Line Command . . . . Before the UC (Uppercase) Line Command After the UC (Uppercase) Line Command Before the X (Exclude) Line Command After the X (Exclude) Line Command Member with COLS Indicator Line . . . . Edit Compare Settings Panel . . . . . . Member Before Data is Copied . . . . . . Edit Copy Panel (ISRECPY1) . . . . . . Contents of member to be copied . . . . . Member After Data Has Been Copied Member Before New Member Is Created Edit Create Panel (ISRECRA1) . . . . . . Member After New Member Has Been Created . . . . . . . . . . . . . New Member Created . . . . . . . . EDIT Primary Command Example . . . . Edit Command Entry Panel (ISREDM03) Nested Member Editing Example . . . . . Edit and View Settings Panel (ISREDSET) EDITSET Primary Command Example Example of Data Set . . . . . . . . . Example of Data Set with Excluded Lines Example of Data Set using FLIP on Excluded Lines . . . . . . . . . . . . . .
179 180 180 181 182 183 184 184 186 186 188 188 204 207 209 210 210 211 213 213 214 214 220 221 221 222 224 231 231 232
128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153. 154. 155. 156.
Member With Hexadecimal Mode Off Hexadecimal Display, Vertical Representation Hexadecimal Display, Data Representation Before the HIDE primary command . . . . After the HIDE primary command . . . . Member With Modification Level of 03 Member With Modification Level Reset to 00 Before Model Command . . . . . . . . REXX Models Panel (ISREMRXC) . . . . . REXX Model of VGET Service . . . . . . Member Before Data is Moved . . . . . . Edit Move Panel (ISREMOV1) . . . . . . Data Set to be Moved . . . . . . . . . Member After Data Has Been Moved Edit Profile Display . . . . . . . . . Member Before Lines Are Renumbered Member After Lines Are Renumbered Member Before Other Member Is Replaced Edit - Replace Panel (ISRERPL1) . . . . . Member After the Other Member Has Been Replaced . . . . . . . . . . . . . Other Member Replaced . . . . . . . . SETUNDO STORAGE and RECOVERY OFF Member Before Lines Are Deleted . . . . Member After Lines Are Deleted . . . . . Member After Lines Have Been Restored Member Before Lines Are Unnumbered Member After Lines Are Unnumbered Member Before Version Number is Changed Member After Version Number is Changed
233 234 234 235 236 241 241 246 246 247 249 249 250 250 259 263 263 265 266 266 267 272 279 280 280 281 282 283 283
viii
Preface
This document describes the ISPF editor and provides conceptual, usage, and reference information for the ISPF edit line, primary, and macro commands.
If choosing one of the items is optional, the entire stack is displayed below the main path.
ix
STATEMENT optional_choice1 optional_choice2 v An arrow returning to the left above the main line indicates an item that can be repeated.
STATEMENT
repeatable_item
v The required part of keywords appear in uppercase letters (for example, REPlace). The abbreviated or whole keyword you enter must be spelled exactly as shown (REP, REPL, or REPLACE). v Variables (for example, member) appear in lowercase letters. They represent user-supplied names or values.
Preface
xi
xii
xiii
xiv
xv
Action bars
Action bars give you another way to move through ISPF. If the cursor is located somewhere on the panel, there are several ways to move it to the action bar: v Use the cursor movement keys to manually place the cursor on an action bar choice. v Type ACTIONS on the command line and press Enter to move the cursor to the first action bar choice. v Press F10 (Actions) or the Home key to move the cursor to the first action bar choice. If mnemonics are defined for action bar choices, you can: In 3270 mode, on the command line, type ACTIONS and the mnemonic letter that corresponds to an underscored letter in the action bar choice text. This results in the display of the pull-down menu for that action bar choice. In 3270 mode, on the command line enter the mnemonic letter that corresponds to an underscored letter in the action bar choice text, and press the function key assigned to the ACTIONS command. This results in the display of the pull-down menu for that action bar choice. In GUI mode, you can use a hot key to access a choice on an action bar or on a pull-down menu; that is, you can press the ALT key in combination with the mnemonic letter that is underscored in the choice text to activate the text. Use the tab key to move the cursor among the action bar choices. If you are running in GUI mode, use the right and left cursor keys.
xvi
F2=Split F12=Cancel
F3=Exit
F7=Backward
F8=Forward
F9=Swap
To select a choice from the Options pull-down menu, type its number in the entry field (underlined) and press Enter or select the choice. To cancel a pull-down menu without making a selection, press F12 (Cancel). For example, if you select choice 6, ISPF displays the Dialog Test Application ID pop-up, as shown in Figure 2 on page xviii. Note: If you entered a command on the command line before selecting an action bar choice, the command is processed and the pull-down menu is not displayed. The CANCEL, END, and RETURN commands are exceptions. These three commands are not processed and the cursor is repositioned to the first input field in the panel body. If there is no input field, the cursor is repositioned under the action bar area. If you are running in GUI mode and
The ISPF user interface
xvii
F2=Split F12=Cancel
F3=Exit
F7=Backward
F8=Forward
F9=Swap
F2=Split F12=Cancel
F3=Exit
F7=Backward
F8=Forward
F9=Swap
1 2 3
Action bar. You can select any of the action bar choices and display a pull-down. Options. The fields in this column are point-and-shoot text fields. Dynamic status area. You can specify what you want to be displayed in this area.
Command nesting
You can use the action bars to suspend an activity while you perform a new one.
xviii
Note: If a choice displays in blue (the default) with an asterisk as the first digit of the selection number (if you are running in GUI mode, the choice will be grayed), the choice is unavailable for one of the following reasons: v Recursive entry is not permitted here v The choice is the current state; for example, RefMode is currently set to Retrieve in Figure 4.
Menu RefList RefMode Utilities Workstation Help 1 1. List Execute ry Panel *. List Retrieve More: + ISPF Library: Project . . . PDFTDEV Group . . . . STG . . . . . . . . . Type . . . . GML Member . . . (Blank or pattern for member selection list) Other Partitioned, Sequential or VSAM Data Set: . . .
xix
Function keys
ISPF uses CUA-compliant definitions for function keys F1-F12 (except inside the Edit function). F13-F24 are the same as in ISPF Version 3. By default you see the CUA definitions because your Primary range field is set to 1 (Lower - 1 to 12). To use non-CUA-compliant keys, select the Tailor function key display choice from the Function keys pull-down on the ISPF Settings (option 0) panel action bar. On the Tailor Function Key Definition Display panel, specify 2 (Upper - 13 to 24) in the Primary range field. The following function keys help you navigate in ISPF:
xx
F2
F16
Selection fields
ISPF uses the following CUA-compliant conventions for selection fields: A single period (.) Member lists that use a single period in the selection field recognize only a single selection. For example, within the Edit function you see this on your screen:
EDIT Name . MEM1 . MEM2 USER1.PRIVATE.TEST VV MM Created 01.00 94/05/12 01.00 94/05/12 ROW 00001 of 00002 Changed Size Init Mod ID 94/07/22 40 0 0 USER1 94/07/22 30 0 0 KEENE
You can select only one member to edit. A single underscore (_) Selection fields marked by a single underscore prompt you to use a slash (/) to select the choice. You may use any nonblank character. For example, the Panel display CUA mode field on the ISPF Settings panel has a single underscore for the selection field:
Options Enter "/" to select option _ Command line at bottom _ Panel display CUA mode _ Long message in pop-up
Note: In GUI mode, this type of selection field displays as a check box; that is, a square box with associated text that represents a choice.
xxi
xxii
Chapter 2. Controlling the Edit environment . What is an edit profile? . . . . . . . . . Using edit profile types . . . . . . . . Displaying or defining an edit profile. . . . Modifying an edit profile . . . . . . . . Locking an edit profile . . . . . . . . Edit modes . . . . . . . . . . . . . Edit profile modes . . . . . . . . . . Edit mode defaults . . . . . . . . . . Site-wide Edit Profile Initialization. . . . Creating a ZDEFAULT edit profile . . . . Flagged lines . . . . . . . . . . . . . Changed Lines . . . . . . . . . . . Error Lines . . . . . . . . . . . . Special lines . . . . . . . . . . . . Edit boundaries . . . . . . . . . . . . Initial macros . . . . . . . . . . . . . Application-wide macros . . . . . . . . . Statistics for PDS members . . . . . . . . Effect of Stats mode when beginning an edit session . . . . . . . . . . . . . . Effect of Stats mode when saving data . . . Version and modification level numbers . . . . Sequence numbers . . . . . . . . . . . Sequence number format and modification level Sequence number display. . . . . . . . Initialization of number mode . . . . . . Enhanced and language-sensitive edit coloring . Language support . . . . . . . . . . Automatic language selection . . . . . Language processing limitations and idiosyncracies . . . . . . . . . . The HILITE command and dialog . . . . . The HILITE dialog . . . . . . . . . Highlighting status and the edit profile . . .
Copyright IBM Corp. 1984, 2006
Defining and Controlling Tabs . . . . . . Defining Software Tab Positions . . . . . Defining Hardware Tab Positions . . . . . Limiting the Size of Hardware Tab Columns Using Attribute Bytes . . . . . . . . . Undoing Edit Interactions . . . . . . . . UNDO Processing . . . . . . . . . . Understanding Differences in SETUNDO Processing . . . . . . . . . . . . . Chapter 4. Using Edit Models . What Is an Edit Model? . . . How Models Are Organized . . How to Use Edit Models . . . Adding, Finding, Changing, and Adding Models . . . . . Finding Models . . . . . Changing Models . . . . Deleting Models . . . . . . . . . . . . . . . . . Deleting . . . . . . . . . . . .
. 62 . 62 . 63 63 . 64 . 64 . 65 . 66
. . . . 67 . . . . 67 . . . . 67 . . . . 69 Models 70 . . . . 70 . . . . 73 . . . . 74 . . . . 74
What is ISPF?
The Interactive System Productivity Facility (ISPF) is a dialog manager that provides tools to improve program, dialog, and development productivity and control. The PDF component of ISPF is an integrated work environment used to develop programs, dialogs, and documents. PDF provides an MVS-compatible hierarchical library and many productivity-improving functions. Some examples of these functions are: v ISPF dialog test tools v Full-screen editor, with a dialog interface called edit macros v Multiple update access to data sets v Online tutorials v Data set management v Customized library controls This document describes the ISPF editor and its dialog interface. A dialog is a program running under ISPF. The interface allows a dialog to access the usual ISPF dialog functions and the ISPF editor functions.
Distributed editing
ISPF enables you to edit host data on a workstation, and workstation data on the host. ISPF calls this function distributed editing. The ISPF Workstation Tool Integration dialog, or tool integrator, is a workstation customization tool that enables any workstation application to use data from an MVS host system. After setting up the tool integrator, your workstation-installed applications can interact with the ISPF View and Edit functions and services. Data flow goes both ways with the tool integrator connection. You can work with workstation files on the host or with host files on the workstation. For more information about distributed editing, refer to the z/OS ISPF Users Guide Vol II and the z/OS ISPF Services Guide.
Menu RefList RefMode Utilities Workstation Help Edit Entry Panel ISPF Library: Project . . Group . . . Type . . . Member . .
. . .
. . .
. . .
Other Partitioned, Sequential or VSAM Data Set: Data Set Name . . . Volume Serial . . . (If not cataloged) Workstation File: File Name . . . . . Initial Macro . . . . Profile Name . . . . . Format Name . . . . . Data Set Password . . Command ===> F1=Help F2=Split F10=Actions F12=Cancel Options / Confirm Cancel/Move/Replace Mixed Mode Edit on Workstation Preserve VB record length F3=Exit F7=Backward F8=Forward F9=Swap
Member The name of an ISPF library or other partitioned data set member. Leaving this field blank or entering a pattern causes PDF to display a member list. See z/OS ISPF Users Guide Vol I for information about entering patterns. Data Set Name Any fully qualified data set name, such as USERID.SYS1.MACLIB, or a VSAM data set name. If you include your TSO user prefix (defaults to user ID), you must enclose the data set name in apostrophes. However, if
File Edit Edit_Settings Menu Utilities Compilers Test Help EDIT SBURNF.PRIVATE.DATA(EDITOLD) - 01.00 Columns 00001 00072 ****** ***************************** Top of Data ****************************** 000100 PROC 0 000200 EX PDFTOOL.COMMON.EXEC.(ALLOCPDF) REL(DEV) FVT NOTOOLS 000300 PDF ****** **************************** Bottom of Data ****************************
Command ===> ________________________________________________ Scroll ===> CSR F1=Help F2=Split F3=Exit F5=Rfind F6=Rchange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
Primary Edit Panel Action Bar Choices: The Primary Edit panel action bar choices function as follows: File. The File pull-down offers you the following choices: 1. Save 2. Cancel Executes the SAVE command. Executes the CANCEL command (which ignores all changes made to the member) and redisplays the Edit Entry panel. Executes the END command (which saves the data set or member) and redisplays the Edit Entry panel.
3. Exit Edit
The Edit pull-down offers you the following choices: 1. Reset 2. Undo 3. Hilite 4. Cut 5. Paste Performs the RESET command. Performs the UNDO command. Displays the Edit Color Settings pop-up. Cuts the selected data from the file, placing it on the clipboard. Puts the selected data from the clipboard into the chosen area of the current file.
Edit_Settings When selected, causes an additional panel to display to enable you to set the characteristics of your edit sessions. 1. Edit settings Causes the additional panel to display.
Menu See Menu action bar choice on page xix for information on the Menu pull-down. Utilities See Utilities action bar choice on page xx for information on the Utilities pull-down.
10
Editing the data set: When the editor displays existing data, each line consists of a 6-column line command field followed by a 72-column data field. The line command fields contain the first 6 digits of the sequence numbers in the data. If the data has no sequence numbers, the line command fields contain relative numbers that start at 1 and are incremented by 1. Based on your action, the ISPF editor places the cursor in the most useful position. To help you find the cursor, the editor intensifies the line command field that contains the cursor. If the data contains characters that cannot be displayed, blanks replace those characters on the panel but not in the data. You cannot type over the blanks. You can display and edit undisplayable characters by entering hexadecimal mode or by using the FIND and CHANGE commands with hexadecimal strings. See HEXDisplay Hexadecimal Characters on page 232 for information on entering hexadecimal mode. Printer control characters, if present, are displayed and are treated as part of the data. ASA control characters are alphanumeric and you can edit them. Machine control characters, however, cannot be displayed and are replaced on the panel with blanks. When you are editing existing data, the selected member or sequential data set is read into virtual storage, where it is updated during edit operations. Use of virtual storage for editing work space results in high performance, but might require a large user region. If you use all available storage, an ABEND occurs, and you lose the work space unless recovery mode is on.
11
v To insert a line between existing lines, type I over a number in the line command field and press Enter. The line command field is the 6-column row displayed on the left side of the panel when you create or edit a data set. The new line is inserted after the one on which you typed the I. Note: The editor does not distinguish between input mode and edit mode. Use the I or TE line commands to insert new lines, either between existing lines or at the end of the data. v To delete a line, type D over the number to the left and press Enter. v To save your work and leave the editor, type END on the command line and press Enter.
12
Edit commands
You can use two kinds of commands to control editing operations: line commands and primary commands.
Line Commands
Line commands affect only a single line or block of lines. You enter line commands by typing them in the line command field on one or more lines and pressing Enter. The line command field is usually represented by a column of 6-digit numbers on the far left side of your display. When you are editing an empty data set or member, however, the line command field contains quotes. This field can also be used to define labels and to display flags that indicate special lines, such as the =NOTE= flag, which indicates a note line. You can use line commands to: v Insert or delete lines v Repeat lines v Rearrange lines or overlay portions of lines v Simplify text entry and formatting v Define an input mask v Shift data v Include or exclude lines from the display v Control tabs and boundaries for editing v Convert some types of special temporary lines to data lines You can enter edit line commands as primary commands on the command line by prefixing them with a colon (:) and placing the cursor on the target line. For
13
Edit commands
example, if you enter :D3 on the command line and move your cursor to line 12 of the file, the three lines 12, 13, and 14 are deleted from the file. This technique is normally used for PF key assignments. See Chapter 3, Managing Data for ways you can use line commands to manipulate data and Chapter 9, Edit Line Commands for the line command syntax.
Primary commands
Primary commands affect the entire data set being edited. You enter primary commands by typing them on the command line (Command ===>), usually located on line 2, and pressing Enter. Any command entered on the edit command line is first intercepted by ISPF. If the command entered is an Edit Primary Command or an Edit Macro, PDF processes the command. You can use primary commands to: v Control your editing environment v Find a specific line v Find and change a character string v Combine several members into one v Split a member into two or more members v Submit data to the job stream v Save the edited data or cancel without saving v Sort data v Delete lines v Access dialog element models v Run an edit macro You can prefix any primary command with an ampersand to keep the command displayed on the command line after the command has processed. This technique allows you to repeat similar commands without retyping the command. For example, if you type:
&CHANGE ALL ABCD 1234
the command is displayed after the change has been made, which allows you then to change the operands and issue another CHANGE command. You can recall previous commands with the ISPF RETRIEVE command. See Chapter 3, Managing Data for some of the ways you can use primary commands to manipulate data and Chapter 10, Edit Primary Commands for the primary command syntax.
14
Edit commands
If the word after the scroll command PF key definition begins with a numeric character (0-9), you get a message telling you the scroll amount was not valid. Otherwise, edit processes the contents of the command line as an edit command, then processes the scroll command using the default scroll amount. In this case, the processing of the command line contents as an edit command bypasses the command table, because the command table is used to resolve the scroll key. v If the concatenation of the scroll command PF key definition and the contents of the command line does create a valid scroll command edit scrolls the screen the specified amount. If you manually type a scroll command on the command line (you do not use any PF keys) and it has an operand, the operand is checked for validity. However, in the case of a scroll operand that is not valid, the operand is not processed as a separate edit command as it is when used with a PF key. When you use a PF key defined as RFIND or RCHANGE, first the command line is processed and then the PF key is actioned. For example, if you type a Find command then press PF5, the new find string is passed to RFIND:
Command F STR1 F STR2 Action press Enter press PF5 Result Edit finds the next occurrence of STR1 RFIND finds the next occurrence of STR2
If you type C STR1 STR2 and press Enter to change STR1 to STR2, then on the command line type F STR3 and press the RCHANGE key, this results in the command C STR3 STR2 being run:
Command C STR1 STR2 F STR3 Action press Enter press PF6 Result Edit changes the next occurrence of STR1 to STR2 RCHANGE changes the next occurrence of STR3 to STR2
You can change this behavior of RCHANGE by using the EDITSET command to set an option, Force ISRE776 if RCHANGE passed arguments. If this option is set, RCHANGE will treat anything that you type on the command line as an invalid parameter and will return an error message ISRE776.
Edit macros
Edit macros are primary commands that you write. You can save time and keystrokes by using macros to perform often-repeated tasks. To run a macro, type its name and any operands on the command line, and press Enter. Your installation may have written and documented common macros for your use. Of course, you can also write your own edit macros. The rules for running a specific macro, and the expected results, depend on the particular macro. Your installation is responsible for documenting these rules and results. If you want to write your own macros, read Part 2, Edit Macros and Chapter 11, Edit Macro Commands and Assignment Statements. ISPF enables the installer of the program to specify an edit macro that runs for all users. If a macro name is specified in the ISPF configuration table, then that macro runs before any macros specified in the users profiles, in programs that invoke edit, or on the edit entry panels.
Chapter 1. Introducing the ISPF Editor
15
Edit macros
The site-wide macro can be used to alter existing profiles, enforce site-wide standards, track edit usage, deny edit and view of a data set member, or for any other purposes for which edit macros are designed. Site-wide macros normally end with a return code of 1 (one) in order to place the cursor on the command line. Site-wide macros must be available to each user in the appropriate data set concatenation (SYSPROC, STEPLIB, and so forth) or in Linklist or LPA (program macros only). Users can also set an application-wide macro if they choose. See Application-wide macros on page 26 for more information. The effect of running a macro depends on the implementation of the macro. Results such as cursor positioning, output messages, and so on, may or may not conform to the results that you expect from built-in edit commands.
Packing data
Data can be saved in either packed or standard format. You can control the format by using the PACK primary command to change the edit profile. The editor reads the data in and you can edit it the way you normally would. When you end the editing session, the data is packed and stored. See PACKCompress Data on page 254 and PACKSet or Query Pack Mode on page 362 for more information. The packed data format has the advantage of saving space. It allows for a more efficient use of DASD by replacing repeating characters with a sequence that shows the repetition. There are two disadvantages: v The space saving is at the expense of additional processing when the data is read or written. v The data cannot be directly accessed by programs. You must access the data through PDF dialogs and library access services. You would not, for example, pack an executable such as a CLIST or REXX exec. A packed CLIST or REXX exec would not run, because pack mode analysis is not done before the member is passed to the system for execution.
16
17
where name is the name of the edit profile that you want to display and number is a number from 0 to 9.
Note: See Primary Edit Panel Action Bar Choices on page 10 for information on the action bar choices on this panel. The first five lines of the edit profile (Figure 8) are the current mode settings. The remaining lines are the current contents of the =TABS>, =MASK>, and =BNDS> lines, with the =COLS> positioning line. When no operands are entered, the first five lines, which contain the =PROF> flags, are always displayed. However, the =MASK> and =TABS> lines do not appear if they contain all blanks. If the =MASK> and =TABS> lines do contain data, they are displayed, followed by the =COLS> line. The =BNDS> line does not appear if it contains the default boundary positions. It does appear when the bounds are set to something other than the default, and no number parameter is entered into the PROFILE command. Note: If enhanced edit coloring is not enabled for the edit session, the profile line displaying HILITE status is not shown. If highlighting is available, and if you explicitly set the language, then the language appears in RED on color terminals. If you include the name of an existing profile, the editor immediately switches to the specified profile and displays it. If you include a new profile name, the editor defines a profile using the current modes, options and temporary lines.
18
Edit modes
The edit modes control how your edit session operates. To set these modes, use the associated primary commands. For example, if you are editing a COBOL program that is in uppercase and you want all your input to be converted to uppercase, set caps mode on by entering CAPS ON. The following list summarizes the primary commands you use to display and change your edit profile. See Chapter 10, Edit Primary Commands for a complete description and for the operands you can type with the commands. PROFILE AUTOLIST AUTONUM AUTOSAVE Displays the current setting of each mode in this list and controls whether changes to these settings are saved. Controls whether a copy of the saved data is automatically stored in the ISPF list data set. Controls whether lines of data are automatically renumbered when the data is saved. Controls whether data is saved when you enter END.
19
Edit modes
CAPS HEX HILITE IMACRO NOTES NULLS Controls whether alphabetic characters are stored in uppercase when the data is saved. Controls whether data is displayed in hexadecimal format. Controls the use of enhanced edit color. Names an edit macro used at the start of the edit session. Controls whether tutorial notes are included in an Edit model. Controls whether blank spaces at the end of a line are written to the panel as blanks or nulls. The difference is that nulls allow you to insert data; blanks do not. Controls the generation of sequence numbers in a data set. Controls whether ISPF packs (compresses) the data when it is saved. Controls the recovery of an edit session following a system failure. Controls the method of saving changes for the UNDO command. Controls whether statistics for a data set are generated. Controls tab settings for aligning data.
Number mode
Stats mode
The ISPF editor changes the special data modes even if the original edit profile of the member edit profile is locked. However, for locked profiles, it does not save the changes to the profile. For your convenience, the editor changes the special data modes automatically to correspond to the data. This allows you to use the default edit profile with a single data set, even though some members may contain programs (CAPS ON) while other members contain text (CAPS OFF). Some of the members may have statistics to be maintained, while other members are stored without statistics. Some members may be in packed data format, while others are in standard data format. Finally, some members may have sequence numbers while others do not.
20
Edit modes
When the editor changes your edit profile to correspond to the data, special message lines appear. If you want to override the change, enter the appropriate command. For example, if the editor changes caps mode from on to off because it finds lowercase characters in the data, type CAPS ON and press Enter to reset it. If you have special requirements, you might not want the editor to change the special modes. You may want to have caps mode on, even if the data contains lowercase data, or you may want to generate statistics on output, regardless of whether the member originally had statistics. If so, you can write an initial macro to specify how the editor is to run these special modes. You would then use IMACRO to associate the initial macro with the edit profile. See Initial macros on page 25 for more information on initial macros.
ISPF provides two methods for setting defaults for new edit profiles. You can set up a profile called ZDEFAULT in the ISPTLIB concatenation, or you can modify the edit profile defaults in the ISPF configuration table. The ISPF configuration table method is recommended because it is easier to maintain than the ZDEFAULT method. The ZDEFAULT method can still be used by individual users.
21
Edit modes
profile in their edit profile. Individual users can delete their ZDEFAULT profiles using the PROFILE RESET command from within an edit session. Doing so allows them to use the site-wide configuration for new profiles. You can also use a site-wide edit initial macro to issue a PROFILE RESET for all users. ISPF does not ship any edit profiles. Note: If you use the force settings such as PACK OFF, edit macro commands that attempt to change forced settings will not receive a failing return code, but the settings will not change.
The number of profiles you can establish also is described in the configuration table. See Displaying or defining an edit profile on page 17 for more details. When you finish, exit ISPF. Your entire set of edit profiles is saved in your profile library (referenced by ddname ISPPROF) as the ISREDIT member.
Flagged lines
Flagged lines are lines that contain highlighted flags in the line command field. These lines can be divided into the following categories: v Changed lines v Error lines v Special lines The flags in the line command field are not saved when you end an edit session.
Changed Lines
==CHG> Shows lines that were changed by a CHANGE or RCHANGE command.
Error Lines
==ERR> Shows lines in which ISPF finds an error when you enter a line command, primary command, or macro command. For example, when you enter a CHANGE command, and there is not enough room on the line to make the change.
22
Flagged lines
Special lines
Special lines can be divided into two categories: v Edit profile lines. The values associated with these lines are stored in your edit profile. =PROF> Contains the settings of the individual edit modes. This line is not saved as part of your data set or member. See Edit modes on page 19 for more information. =TABS> Defines tab positions. This line is not saved as part of your data set or member. =MASK> Can contain data to be inserted into your data set or member when you use the I (insert) line command. This line is not saved as part of your data set or member. =BNDS> Specifies left and right boundaries that are used by other commands. This line is not saved as part of your data set or member. =COLS> Identifies the columns in a line. The column identification line can be saved as part of the data set or member if you use the MD (make dataline) line command to convert it to a data line. v Message lines, note lines, and information lines. These lines are not saved as part of the data set or member unless you use the MD (make dataline) line command to convert them to data lines. ==MSG> Message lines inform you of changes to the edit profile. These changes are caused by inconsistencies between the data to be edited and the edit profile settings. Message lines also warn you that the UNDO command is not available when edit recovery is off. You can insert message lines manually by using an edit macro that contains the LINE_AFTER and LINE_BEFORE assignment statements. =NOTE= Note lines display information when you insert edit models. However, these lines do not appear if the edit profile is set to NOTE OFF. You can insert note lines manually by using an edit macro that contains the LINE_AFTER and LINE_BEFORE assignment statements. ====== Temporary information lines are lines you can add to provide temporary information that is not saved with the data. They can be inserted into an edit session by using an edit macro containing the LINE_AFTER and LINE_BEFORE assignment statements.
Edit boundaries
Boundary settings control which data in a member or data set is affected by other line, primary, and macro commands. You can change the boundary settings by using the BOUNDS line command, primary command, or macro command. Table 1 shows commands that work within the column range specified by the current boundary setting:
Table 1. Commands for Use with Boundary Setting Column Range Line Commands < > ( Primary Commands CHANGE EXCLUDE FIND Macro Commands CHANGE EXCLUDE FIND SHIFT < SHIFT > SHIFT (
23
Edit boundaries
Table 1. Commands for Use with Boundary Setting Column Range (continued) Line Commands ) O TE TF TS Primary Commands LEFT RCHANGE RFIND RIGHT SORT Macro Commands LEFT RCHANGE RFIND RIGHT SEEK SHIFT ) SORT TENTER TFLOW TSPLIT USER_STATE
This column range is in effect unless you specify overriding boundaries when entering a command. See the individual command descriptions for the effect the current bounds settings have. If you do not explicitly set bounds, the editor uses the default bounds. These bounds change as the number mode changes. If you have changed the bounds settings for a data set and would like to revert to the default settings, you can use any BOUNDS command to do so. Table 2 shows the default bounds settings for various types of data sets:
Table 2. Default Bounds Settings for Data Sets RECFM FIXED Data Set Type ASM Number Mode ON STD OFF COBOL OFF ON STD ON COBOL STD ON COBOL OTHER ON STD OFF VARIABLE ALL ON STD OFF BNDS When LRECL=80 1, 71 1, 71 1, 80 1, 72 7, 72 7, 80 1, 72 1, 80 9, record length 1, record length BNDS Using Other LRECL 1, LRECL-8 1, LRECL 1, LRECL 1, LRECL-8 7, LRECL-8 7, LRECL 1, LRECL-8 1, LRECL N/A N/A
If the default boundaries are in effect, they are automatically adjusted whenever number mode is turned on or off. If you have changed the bounds from the default settings, they are not affected by the setting of number mode. If a left or right scroll request would cause the display to be scrolled past a left or right bound, the scrolling stops at the bound. A subsequent request then causes scrolling beyond the bound. This scrolling feature is especially useful when you are working with data that has sequence numbers in the columns to the left. It allows left and right scrolling up to (but not past) the bounds so that the sequence numbers are normally excluded from the display. If you specify an invalid value for either the left or right boundary when changing the current boundary settings, the editor resets the value for that boundary to the default. The following constitute invalid boundary values:
24
Edit boundaries
v A right boundary value that is greater than the logical record length of a fixed-block file if the file is unnumbered. v A right boundary value that is greater than the logical record length-8 of a fixed-block file if the file with standard numbers. v A right boundary value that is greater than the logical record length-4 of a variable-block file. v A left boundary value that is less than or equal to 8 for a variable-block file with standard numbers v A left boundary value that is less than or equal to 6 for a file that is numbered with COBOL numbers
Initial macros
The editor runs an initial macro after the data is first read but before the data is displayed. An initial macro can be used to do tasks such as initializing empty data sets, defining program macros, and initializing function keys. For example, if you want caps mode on even if the data contains lowercase data, create an initial macro with a CAPS ON command. The editor first reads the edit profile and the data, then it sets caps mode to correspond to the data. Next, it runs your initial macro, which overrides the edit profile setting of caps mode. To store an initial macro name in the edit profile, use the IMACRO command:
IMACRO initmac
See IMACROSpecify an Initial Macro on page 240 for more information on the IMACRO command. To execute an initial macro for the current session, use one of the following methods: v Type the macro name in the INITIAL MACRO field on the Edit Entry panel:
INITIAL MACRO ===> initmac
Once the initial macro is stored in a profile, it runs at the start of each edit session that uses the profile. It can be overridden by an initial macro typed in the INITIAL MACRO field on the Edit Entry panel or specified on the EDIT service call. You can type NONE in the INITIAL MACRO field to suppress the initial macro defined in the profile. Notes: 1. If the current profile is locked, the IMACRO command cannot be run. 2. Remember that commands referencing display values (DISPLAY_COLS, DISPLAY_LINES, DOWN, LEFT, RIGHT, UP, LOCATE) are invalid in an initial macro because no data has been displayed. 3. If the initial macro issues either an END or CANCEL command, the member is not displayed.
25
Application-wide macros
Application-wide macros
You can specify a macro to run at the beginning of your edit sessions by placing a variable called ZUSERMAC in either the shared or profile pool. ZUSERMAC must contain the name of the macro and cannot include any operands. ZUSERMAC must not be longer than 8 characters. If ZUSERMAC exists in the profile or shared pool, the macro it specifies is run after the site-wide initial macro, and before the initial macro specified on the edit panel, on EDIT service command, or in the edit profile. If you want to remove the user application-wide macro, you can issue the VERASE service to remove ZUSERMAC from the shared or profile pool.
26
Sequence numbers
Each line on the panel represents one data record. You can generate and control the numbering of lines in your data with the following commands: AUTONUM NUMBER RENUM Automatically renumbers data whenever it is saved, preserving the modification level record. Turns number mode on or off, and selects the format. Renumbers all lines, preserving the modification level number.
UNNUMBER Turns off numbering and blanks the sequence number fields on all lines. This deletes all modification level records.
27
Sequence numbers
For members of partitioned data sets, the format of standard sequence numbers depends on whether statistics are being generated. If statistics are being generated, standard sequence numbers are 6 digits followed by a 2-digit modification level number. The level number flag reflects the modification level of the member when the line was created or last changed. If, for example, a sequence number field contains 00040002, the line was added or last changed at modification level 02. The sequence number is 000400. If STATS mode is off, or if you are editing a sequential data set, standard sequence numbers are 8 digits, right-justified within the field. v The COBOL sequence field is always the first 6 characters of the data and is valid only for fixed-length records. Use the NUMBER ON COBOL or NUMBER ON STD COBOL to generate COBOL sequence numbers. Attention: If number mode is off, make sure the first 6 columns of your data set are blank before using either the NUMBER ON COBOL or NUMBER ON STD COBOL command. Otherwise, the data in these columns is replaced by the COBOL sequence numbers. If that happens and if edit recovery or SETUNDO is on, you can use the UNDO command to recover the data. Or, you can use CANCEL at any time to end the edit session without saving the data. COBOL sequence numbers are always 6 digits and are unaffected by the setting of STATS mode. Sequence numbers usually start at 100 and are incremented by 100. When lines are inserted, the tens or units positions are used. If necessary, one or more succeeding lines are automatically renumbered to keep the sequence numbers in order.
28
Sequence numbers
If the first setting of the number mode differs from the setting in the edit profile, a message indicating that the editor has changed the mode is displayed. For new members or empty sequential data sets, the first setting of number mode is determined by the current edit profile. For a new edit profile, the default is NUMBER ON for standard sequence fields, and NUMBER ON COBOL if the data set type is COBOL.
Language support
The following languages are supported for language-sensitive coloring: v Assembler v BookMaster v C v COBOL
Chapter 2. Controlling the Edit environment
29
COBOL HTML
ISPF Skeleton ) in column 1 in a file that does not seem to be a panel. JCL Any of the following: v //anything followed by the word COMMAND, DD, ELSE, ELSEIF, EXEC, IF, INCLUDE, JCLLIB, JOB, OUTPUT, PROC, SET, XMIT, or any word beginning with the characters MSG v //* in column 1 v // in column 1, and the data set type is .CNTL, .JCL, or ISPCTLx v Any of the following in column 1:
30
REXX SuperC
XML
Other
HILITE AUTO selects a language based on the first nonblank line, and in some cases, the last qualifier of the data set name. ISPF only scans up to the first 72 bytes in each line to determine the language. If the data that would identify the language is past the 72nd column, the language may be determined incorrectly.
31
32
move the operand starting with DATA to the same line as the previous operand:
//DCOBA2 PROC PROG=, // OPTCOB=DYN, DATA=DATA(24), // OUT=*, // USER=D0000,
PL/I: For fixed-length record format data sets, column 1 is not scanned after the first nonblank line, except to search for *PROCESS statements. REXX: Logic highlighting does not support a terminating semicolon in the IF expression, or a semicolon before the THEN or ELSE instructions. In addition, IF statements which have the THEN keyword on the following line but do not have a continuation character at the end of the IF expression will cause highlighting errors. For example, although the following statements are valid in REXX, the ELSEs will be highlighted as a mismatched ELSEs.
33
SuperC: Supports both ISPF SuperC (ISRSUPC) and High Level Assembler Tooklit SuperC (ASMFSUPC). Page, column, and section headings are used to determine the different sections within a SuperC listing. Most forms of the SuperC listing are supported, including SuperC search-for and SuperC file, line, word, and byte compares. Both Wide and Narrow listings, with or without the printer control column, are supported. SuperC SRCHFOR and SRCHFORC strings are highlighted (as FIND strings) within the source section of the listing. Other SRCHFOR and SRCHFORC statements parameters are processed and the ANYC process option is used for case insensitivity. No specific action is taken with any other SuperC process option or process statement. Other: When OTHER is in effect, ISPF tries to determine if the program is a CLIST by checking for a first word of PROC, CONTROL, ISPEXEC or ISREDIT. If ISPF determines that the data being edited is a CLIST, then CLIST comment closure and continuation rules apply.
34
File Languages Colors Help Edit Color Settings More: + Language: 1 1. Automatic Coloring: 3 1. Do not color program 2. Assembler 2. Color program 3. BookMaster 3. Both IF and DO logic 4. C 4. DO logic only 5. COBOL 5. IF logic only 6. HTML 7. IDL Enter "/" to select option 8. ISPF DTL Parentheses matching 9. ISPF Panel / Highlight FIND strings 10. ISPF Skeleton / Highlight cursor phrase 11. JCL 12. Pascal Note: Information from this panel is 13. PL/I saved in the edit profile. Command ===> F1=Help F2=Split F3=Exit F7=Backward F8=Forward F9=Swap F10=Actions F12=Cancel Figure 9. HILITE Initial Screen (ISREP1)
This dialog enables you to do the following: v Specify a language to be used for coloring, or enable automatic language detection. v Assign colors for different language elements on a language-by-language basis or for all languages at once. v Enable or disable logic or parenthesis matching. v Turn FIND coloring on or off and assign the color for FIND highlighting. v Turn cursor coloring on or off and assign the color for cursor phrase highlighting. v Specify special symbols to be highlighted on a language-by-language basis. v View keyword lists for each language. Note: Keyword lists and default highlighted symbols for each language are supplied with ISPF. IBM does not supply facilities for adding additional languages. However, it is possible to add or remove keywords. This facility involves assembling and link-editing an installation-modified keyword or symbol list. The keyword and symbol lists, and directions for changing them, are in member ISRPXASM in the IBM-supplied ISPF sample library. HILITE initial panel action bar: Some of the functions of the HILITE dialog are provided through the action bar. The action bar choices on the HILITE Initial panel are: File Restart application Resets all settings on all panels back to the point that HILITE was invoked.
35
Set Overtype, Find String, Cursor Phrase Color action bars: These action bar choices function as follows: File The File pull-down offers these choices: Reset Resets the settings on this panel to the values they had when the panel first appeared. Default Sets the values to the IBM-supplied defaults. Save and Exit Exits this panel. Changes will be saved when the HILITE dialog completes, unless Cancel is specified. Cancel Exits this panel and discards changes. Immediately enters help panels for the HILITE command and dialog.
Help
After selecting a specific language from the Languages pull-down on the HILITE Initial panel (Figure 9 on page 35), Figure 10 on page 37 is displayed:
36
File View Help Language Element Specification for PLI Command ===> _____________________________________________ Language Element Color Highlight Default . . . . . . . . GREEN NORMAL Comments . . . . . . . TURQ NORMAL Keywords . . . . . . . RED NORMAL Quoted Strings . . . . WHITE NORMAL Compiler Directives . . BLUE NORMAL Special Characters . . YELLOW NORMAL Special Characters to Highlight . . . . . . . +-*/=<>&|: Left Right Margins . . . . . . . . * * F1=Help F2=Split F3=Exit F7=Backward F8=Forward F9=Swap F10=Actions F12=Cancel
| |
Notes: 1. If the selected language supports alternate margins (such as PL/I in Figure 10), you can enter left and right boundaries in the Margins input field. 2. If the JCL language is selected, the Compiler Directives field in the pop-up window is replaced by a field named DD * and Data Lines. 3. If a field is not applicable to a language, it is supplied with *n/a*. 4. When a new color is typed in, the input field is shown in that color when you press Enter. Edit Color Settings action bar: The Edit Color Settings action bar choices function as follows: File The File pull-down offers these choices: Restart language Resets colors and symbols to the settings they had upon entry to this panel. Defaults Resets colors and symbols to default values. Save and Exit Exits this panel. Changes will be saved when the HILITE dialog completes, unless Cancel is specified. Cancel Exits this panel and discards changes. The View pull-down choice is: View Keywords Displays a list of keywords for a particular language. See Figure 11 for an example of a Language Keyword list. Immediately enters help panels. If no keywords exist for a given language choice, a message is displayed instead of a Language Keyword list.
View
Help
37
File Help Language Keyword List Command ===> Language: PLI Number of keywords: 549 (Includes preprocessor keywords) More: + ABNORMAL FOFL PLISRTB ABS FORMAT PLISRTC ACOS FORTRAN PLISRTD ACOSF FREE PLITDLI ADD FROM POINTER ADDBUFF FROMALIEN POINTERADD ADDR FS POINTERDIFF ADDRDATA GAMMA POINTERSUBTRACT ALIAS GENERIC POINTERVALUE ALIGNED GENKEY POLY ALL GET POS ALLOC GETENV POSITION F1=Help F2=Split F3=Exit F7=Backward F8=Forward F9=Swap F10=Actions F12=Cancel
Language Keyword List action bar: The Language Keyword List action bar choices function as follows: File The File pull-down choice is: Cancel Help Exit this panel. (No changes are possible on this panel.)
PLI LOGIC CURSOR FIND MARGINS(5,70).......................... PLI LOGIC PAREN CURSOR FIND MARGINS(2,80).................... COBOL CURSOR FIND............................................ OFF..........................................................
The information shown on the PROFILE command is saved in the edit profile.
38
Edit recovery
Edit recovery
Edit recovery helps you to recover data that might otherwise be lost. For example, you would use edit recovery to re-establish the edit session at the point of failure after a power outage or system failure. Turning recovery mode on causes the data to be written to a temporary backup file. This is independent of whether changes have been made to the data. You can turn on edit recovery mode by doing either of the following: v Entering the RECOVERY primary command:
RECOVERY ON
If recovery mode is on when a system crash occurs, automatic recovery takes place the next time you attempt to use edit. Recovery mode is remembered in your edit profile. When you begin an edit session, if there is data to recover, the Edit Recovery panel appears, shown in Figure 13.
Edit - Recovery ***************************************** * EDIT AUTOMATIC RECOVERY * ***************************************** The following data set was being edited or viewed when a system failure or task abend occurred: Data set. : Instructions: Press ENTER key to continue editing or viewing the data set, or Enter END command to return to the previous panel, or Enter DEFER command to defer recovery of the specified data set, or Enter CANCEL command to cancel recovery of the data set. To continue editing or viewing a password protected data set, specify: Data Set Password. . . Command ===> _________________________________________________________________ F1=Help F2=Split F3=Exit F9=Swap F12=Cancel
Note: For information about the Data Set Password field, refer to the chapter on Libraries and Data Sets in z/OS ISPF Users Guide Vol I. If you continue with, defer, or cancel recovery and you have other data to be recovered, the Edit Recovery panel is displayed again for the next data set. You can control the number of data sets to be recovered with the edit recovery table, a system data set that contains entries for each level of nested editing sessions that can be recovered. For information on changing edit recovery operands, refer to z/OS ISPF Planning and Customizing.
39
Edit recovery
Note: You cannot recursively edit data while you are in an edit session which is the result of an edit recovery. Attention: If the data set to be recovered was edited by another user before you continue with edit recovery, the changes made by the other user are lost if you save the data. If you press Enter to continue editing the data set, the editor runs a recovery macro if you had previously specified one by using the RMACRO primary or macro command. See Recovery Macros on page 106 and the descriptions of the RMACRO primary and macro commands for more information. Despite edit recoverys benefits in recovering data, there are times when you might not want to use it. You might want to turn edit recovery off in the following situations: v Operating with recovery mode off eliminates the I/O operations that maintain the recovery data and can therefore result in improved response time. v Besides recording actual data changes, recovery mode records temporary changes, such as excluding lines and defining labels. These temporary changes are recorded to allow UNDO to undo other edit interactions besides those that change data. Therefore, when edit recovery is on, the recording of both data and temporary changes affects the amount of DASD space that is used. You can turn off edit recovery mode by doing either of the following: v Entering the RECOVERY primary command:
RECOVERY OFF
See Chapter 10, Edit Primary Commands for details on using RECOVERY.
40
Press ENTER key to allow replace with truncation. Enter END command to cancel replace.
41
Shifting Data
When you edit data, the editor automatically shifts characters on a line to the left or right to accommodate insertions or deletions. This shifting can be either implicit or explicit . Implicit shifts occur when the CHANGE command string2 length is different from the string1 length. Explicit shifts occur when you use the following commands: v Line commands ( Column Shift Left ) Column Shift Right < Data Shift Left > Data Shift Right v Macro commands Shift ( Column Shift Left Shift ) Column Shift Right Shift < Data Shift Left Shift > Data Shift Right See the descriptions of these commands for the syntax and examples of usage.
42
Shifting Data
Two columns is the default for shift operations. When shifting a block of lines more or less than the default, enter the amount on the first or last line of the block. If you enter it in both places, the line shifts only if: v Both amounts are the same, or v The amounts differ, but one is the default (2). Here, the lines shift according to the non-default amount. If the shift amounts are different and neither amount is the default, an error message appears and the shift is not performed. Shifting occurs within column boundaries. The default boundaries are typically the first and last columns in which you can type source code for the particular programming language. See Edit boundaries on page 23 for a discussion of default boundaries and the procedures for changing them.
Column Shift
The simplest kind of shift is a column shift. Column shifting moves all characters within the bounds without altering their relative spacing. Characters shifted past the bounds are deleted. That is, blanks are inserted at the bound from which the characters are being shifted, and the characters are deleted at the opposite bound. So, this shift is called a destructive shift because information shifts within column boundaries without regard to its contents, and can result in the loss of data with no error being noted. If the UNDO mode was on before you entered the shift command, you can recover by using the UNDO command. Otherwise, you can use CANCEL.
43
Shifting Data
falls on the same DBCS field as the left boundary, and it also falls on the first byte of a DBCS character, the right boundary is shifted to the right by 1 byte. v If you use the data shift or column shift line command to shift a DBCS field and you specify an odd-length shift amount, the shift amount is decreased by one to preserve DBCS data integrity. v If a shift cannot be completed, it is partially done and the line number is replaced by the following intensified warning message: ==ERR>. Remove the message by issuing the RESET primary command, or type over the message or data on that line. v If a request to shift an odd number of bytes causes an odd-length DBCS string, the shift volume is decreased by one and the operation is performed. The line number is replaced with the following intensified warning message: ==ERR>.
Data Shift
Data shifting attempts to shift the body of a program statement without shifting the label or comments, and prevents loss of data. This shift is non-destructive because it stops before it shifts a nonblank character past the bound. This shift is explicitly done with the < and > line commands, and the SHIFT < and SHIFT > macro commands. The CHANGE command can cause an implicit shift of the same nature. For data shift left attempts that exceed the current BOUNDS setting, text stops at the left bound and PDF marks the shifted lines with ==ERR> flags. If an error occurs in an excluded line, you can find the error with LOCATE, and remove the error flag by using RESET. Data shifts are designed to work with typical program sources. In doing so, it makes certain general assumptions about the format of the source code. For instance, the editor assumes: v Anything beginning at the left bound is a label and should not be shifted. v If there are two or more consecutive blanks, one can be added or deleted. v Blanks within quotes ( or ") are to be treated as nonblanks. v Source statements appear on the left followed by comments on the right. v Single blanks are used between source code and comment words. Therefore, the only strings of multiple blanks appear between the source code and the comment, and between the comment and its ending delimiter (if there is one). In the following example, LABEL and */ are at the left and right bounds, respectively:
LABEL: DO I=1 TO 5; A=A+B(I); END; /* The comment... /* The comment... */ */
Keeping the previous assumptions in mind, the editor attempts to move only the source code statement when shifting data. The label and comments are left unchanged. However, if necessary, it shifts the comment also. Although the editor always uses these assumptions, data shifting is not language-sensitive. It only makes generalities about syntax and individual code entry style.
44
CHANGE
EXCLUDE
The scrolling and positioning of the string can be controlled using the Edit_Settings action bar choice or the EDITSET primary command when editing the data. See EDITSETDisplay the Editor Settings Dialog on page 222 for more information. The syntax of each command is a variation of that listed below. See the command descriptions in Chapter 10, Edit Primary Commands and Chapter 11, Edit Macro Commands and Assignment Statements for the exact syntax.
.ZLAST labelb
45
You must use delimiters if a string contains embedded blanks or commas, or if a string is the same as a command or keyword. You delimit strings with quotes, either or ". For example, to change the next occurrence of EVERY ONE to ALL, type:
CHANGE EVERY ONE ALL
Note: When using a DBCS terminal, if you specify a text string that contains any SO and SI characters, the string is considered a character string.
Character Strings
Use a character string in a FIND, CHANGE, or EXCLUDE command if you want the search to be satisfied by an exact character-by-character match. Lowercase alphabetic characters match only with lowercase alphabetic characters, and uppercase alphabetic characters match only with uppercase.
46
If you are using an APL or TEXT keyboard, you can use the following additional characters in a picture string: P P_ Any APL-specific or TEXT-specific character Any underscored nonblank character
A picture string can include alphanumeric characters, which represent themselves, mixed with other characters. If the character does not have a special meaning (such as @ standing for any alphabetic), the character is treated as itself. When using a DBCS terminal, you cannot specify a DBCS field as the subject of a picture string for the FIND operation. Picture String Examples: v To find a string of 3 numeric characters:
FIND P###
v To find any 2 characters that are not blanks but are separated by a blank:
FIND P
v To find the next line with a blank in column 1 and a character in column 2 that is not a blank:
FIND P 1
47
Picture String Examples: v To change an alphabetic, alphabetic, numeric, numeric string so that the alphabetic characters become uppercase characters and the numeric characters are unchanged:
CHG P@@## P>>==
48
FIRST Starts at the top of the data and searches ahead to find the first occurrence of string1. LAST Starts at the bottom of the data and searches backward to find the last occurrence of string1. PREV Starts at the current cursor location and searches backward to find the previous occurrence of string1. If you specify NEXT, ALL, or FIRST, the direction of the search is forward. When you press the assigned function keys, the RFIND or RCHANGE commands find or change the next occurrence of the designated string. If you specify LAST or PREV, the direction of the search is backward. When you specify those operands, the editor finds or changes the previous occurrence of the string. The search proceeds until the editor finds one or all occurrences of string1, or the end of data.
49
In the following example, the editor would find the highlighted strings only:
CHARS DO - DO DONE ADO ADOPT DO +ADO (DONE) ADO-
50
All lines containing the search string XYZ are redisplayed with XYZ changed to ABC and with the cursor at the end of the first string changed. Similarly, you can enter a FIND command:
FIND ALL XYZ
Here, all lines containing the search string XYZ are redisplayed with the cursor at the beginning of the first string found.
51
followed by:
CHANGE * XYZ
first shows you where ABC is, and then replaces it with XYZ. However, you can do this more easily by typing:
CHANGE ABC XYZ
Then press F5/17 to repeat FIND. The editor finds the next occurrence of ABC. You can either press F5/17 to find the next ABC, or F6/18 to change it. Continue to press F5/17 to find remaining occurrences of the string. The previous value of a search string, specified by an asterisk or by use of RFIND or RCHANGE, is retained until you end your editing session.
Examples
FIND Command Example
To find all occurrences of MIMIC in a member such as the one shown in Figure 14, type FIND ALL MIMIC on the command line.
52
File Edit Edit_Settings Menu Utilities Compilers Test Help EDIT SBURNF.PRIVATE.EXEC(FCEXMP) - 01.00 Columns 00001 00072 Command ===> find all mimic Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 /* REXX */ 000002 /* REXX */ 000003 ADDRESS TSO 000004 /* */ 000005 /* RECREATE THE OLD BACKUP DATA SETS */ 000006 /* */ 000007 CALL MIMIC "ALLOC DA(PDFTDEV.SVT2.ARCHDEF)" 000008 CALL MIMIC "ALLOC DA(PDFTDEV.SVT2.CLIST)" 000009 CALL MIMIC "ALLOC DA(PDFTDEV.SVT2.CPP)" 000010 CALL MIMIC "ALLOC DA(PDFTDEV.SVT2.EXEC)" 000011 CALL MIMIC "ALLOC DA(PDFTDEV.SVT2.GIF)" 000012 CALL MIMIC "ALLOC DA(PDFTDEV.SVT2.GMLINC)" 000013 CALL MIMIC "ALLOC DA(PDFTDEV.SVT2.HPP)" 000014 CALL MIMIC "ALLOC DA(PDFTDEV.SVT2.HSAS65)" 000015 CALL MIMIC "ALLOC DA(PDFTDEV.SVT2.LEL)" 000016 CALL MIMIC "ALLOC DA(PDFTDEV.SVT2LMAP)" 000017 CALL MIMIC "ALLOC DA(PDFTDEV.SVT2.LOAD)" F1=Help F2=Split F3=Exit F5=Rfind F6=Rchange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
After you press Enter, the editor searches for the string starting at the top of the data, places the cursor at the beginning of the first occurrence ( 1 ), and displays the number of occurrences ( 2 ) as shown in Figure 15.
File Edit Edit_Settings Menu Utilities Compilers Test Help EDIT SBURNF.PRIVATE.EXEC(FCEXMP) - 01.00 2 21 CHARS MIMIC Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 /* REXX */ 000002 /* REXX */ 000003 ADDRESS TSO 000004 /* */ 000005 /* RECREATE THE OLD BACKUP DATA SETS */ 000006 /* */ 000007 CALL 1 MIMIC "ALLOC DA(PDFTDEV.SVT2.ARCHDEF)" . . .
The editor changes all occurrences of the string starting at the top of the data and inserts a ==CHG> flag next to each changed line, as shown in Figure 17.
53
File Edit Edit_Settings Menu Utilities Compilers Test Help EDIT SBURNF.PRIVATE.EXEC(FCEXMP) - 01.00 CHARS MIMIC changed Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 /* REXX */ 000002 /* REXX */ 000003 ADDRESS TSO 000004 /* */ 000005 /* RECREATE THE OLD BACKUP DATA SETS */ 000006 /* */ ==CHG> CALL WILLY "ALLOC DA(PDFTDEV.SVT2.ARCHDEF)" ==CHG> CALL WILLY "ALLOC DA(PDFTDEV.SVT2.CLIST)" ==CHG> CALL WILLY "ALLOC DA(PDFTDEV.SVT2.CPP)" ==CHG> CALL WILLY "ALLOC DA(PDFTDEV.SVT2.EXEC)" ==CHG> CALL WILLY "ALLOC DA(PDFTDEV.SVT2.GIF)" ==CHG> CALL WILLY "ALLOC DA(PDFTDEV.SVT2.GMLINC)" ==CHG> CALL WILLY "ALLOC DA(PDFTDEV.SVT2.HPP)" ==CHG> CALL WILLY "ALLOC DA(PDFTDEV.SVT2.HSAS65)" ==CHG> CALL WILLY "ALLOC DA(PDFTDEV.SVT2.LEL)" ==CHG> CALL WILLY "ALLOC DA(PDFTDEV.SVT2LMAP)" ==CHG> CALL WILLY "ALLOC DA(PDFTDEV.SVT2.LOAD)" F1=Help F2=Split F3=Exit F5=Rfind F6=Rchange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
54
Excluding Lines
Excluding Lines
You can exclude lines from a data set using the X (exclude) line command as well as the EXCLUDE primary command. When you are editing a program that exceeds the screen size, it can be difficult to determine whether the control structure and indentation levels are correct. Excluding lines allows you to remove one line or a block of lines from the display so that you can see the general control structure. Each block of excluded lines is replaced by a single line containing a message in the form n Line(s) not Displayed. Excluded lines are treated as valid data lines. They are excluded from the display, but are not deleted from the data. The X line command can be entered in the following ways:
X Xn XX
The first two forms allow you to exclude one line or a specified number of lines. The third form allows you to exclude a block by typing XX on the first and last lines of the block of lines that you want to exclude. The first and last lines do not need to be on the same page; after typing the first XX you can scroll to the second XX. You can enter any line command that usually operates on a single line in the line command field of the excluded lines message. For example, if you enter the D (delete) line command, the complete block of excluded lines is deleted.
FIND and CHANGE also cause any excluded lines that meet the search criteria to appear again.
55
Excluding Lines
The S line command causes the editor to scan a block of excluded lines, and one or more lines is selected to be appear again. The selected lines are those with the leftmost indentation levels; that is, the lines that contain the fewest leading blanks. If you type S3, for example, the three lines with the leftmost indentation level are displayed again. If more than three lines exist at this indentation level, only the first three are displayed. Note: If you enter an S line command to display all but one line of an excluded block, then that line is also displayed. This could result in more lines being displayed than the number you requested. For example, if five lines are excluded in a block, an S4 command causes all five lines to be displayed.
To reverse the exclude status of specified lines, use the following syntax:
FLIP .a .b
56
Editor-Assigned Labels
The editor automatically assigns special labels that begin with the letter Z. Only the editor can assign a special label. These built-in labels are: .ZCSR .ZFIRST .ZLAST The data line on which the cursor is currently positioned. The first data line (same as relative line number 1). Can be abbreviated .ZF. The last data line. Can be abbreviated .ZL.
Unlike other labels, .ZCSR, .ZFIRST, and .ZLAST do not stay with the same line. Label .ZCSR stays with the cursor, and labels .ZFIRST and .ZLAST remain with the current first and last lines. Note: Labels that are five characters long and begin with the letter O have special meaning to the HILITE feature of the ISPF editor. When a 5-character label starting with O, such as .OAAAA, is shown on the screen, the language highlighting features are disabled and the lines with these special labels are displayed in blue. This feature is used by the COMPARE command.
Specifying a Range
Labels allow you to specify a line or a range of lines on a primary command. You can specify two labels to define a range of lines to be processed on the following commands:
CHANGE DELETE EXCLUDE FIND LOCATE REPLACE RESET SORT SUBMIT
The range operand is always optional. If you do not specify a range, it defaults to .ZFIRST and .ZLAST. For example, the command:
CHANGE ALL TEST FINAL
starts at the first line of the data being edited and scans all lines up to and including the last line, changing all occurrences of TEST to FINAL. However, the command:
CHANGE .ZCSR .ZLAST ALL TEST FINAL
specifies a range, and is thus interpreted differently. The command changes only the last part of the data. When you use labels to specify a range, you must always use two labels to define the first and last lines, inclusively. To process a single line, repeat the label:
CHANGE ALL " " "_" .A .A
The command in the previous example is interpreted as Change all blanks to underscores on the .A line. The order in which you specify the labels is not important. The editor assumes that the line closer to the beginning of the data set is the first line of the range, and the line closer to the end of the data set is the last.
Chapter 3. Managing Data
57
v The following command changes the last occurrence of PRE to POST between the first line and the line marked with the .HERE label:
CHANGE LAST PRE POST .HERE .ZFIRST
v The following command changes all occurrences of PRE to POST from the .MYLAB line to the last line of the data set:
CHANGE PRE POST ALL .MYLAB .ZL
v The following command finds the word HIGHER between the .START line and the .END line:
FIND HIGHER WORD .START .END
Word Processing
This section is a general overview of three line commands for word or text processing: TF (text flow), TS (text split), and TE (text entry). The editor also provides three corresponding edit macro commands: TFLOW, TSPLIT, and TENTER. For the sake of simplicity, only the line commands are referred to. However, the descriptions apply to the macro commands, as well. TF, TS, and TE assume that the data is grouped in paragraphs. A paragraph is a group of lines that begin in the same column. The first line of a paragraph is excluded from the grouping. The editor interprets any indentation or blank line as representing a new paragraph. It also recognizes word processor control words that are used by the Document Composition Facility as the beginning of a paragraph. These control words begin with a period, a colon, or an ampersand. If you use text line commands frequently, you can assign both the TS and TF commands to function keys. Use KEYS to reassign the keys. For example:
F10 ===> :TS F11 ===> :TF
Now you can split text by moving the cursor to the desired split point within a line and pressing F10. Having typed the new material, press F11 to restructure the text from the line containing the cursor to the end of the paragraph.
Formatting Paragraphs
The TF (text flow) line command formats paragraphs. It assumes that the sentences are roughly in paragraph form with a ragged right margin when it attempts to recognize groupings. TF can be followed by a number (TF72 for example) that specifies the desired right side column for the paragraph. If you do not specify a number, the right side of the panel is used unless you have set bounds different
58
Word Processing
from the default. In that case, the right boundary is used. The editor assumes that because the first line of a paragraph may be at a different indentation level than the remainder of the paragraph, the starting column of the second line is the left side of the paragraph. When formatting paragraphs, the editor: v Moves text so that each line contains the maximum number of words. TF limits its activity to within the bounds. Thus, it can be used to flow text within a border. v Keeps any blanks between words. v Assumes one blank between the word at the end of a line and the word on the next line except when the line ends with a period. In that case, the editor inserts two blanks. The end of the paragraph is denoted by a blank line, a change in indentation, or the special characters period (.), colon (:), ampersand (&), or left angle bracket (<) in the left boundary column. These special characters are used as Document Composition Facility (SCRIPT/VS) control word delimiters. The restructure operation removes trailing blanks on a line by using words from the following line. It does not, however, remove embedded blanks within a line. Accordingly, if one or more words in a line are to be removed, delete the words rather than type over them. The text to be restructured is taken from within the currently defined column boundaries. Any text outside the bounds is not included in the restructuring. The restructured text is also positioned within the current boundaries. If the original text was indented from the left boundary, that indentation is preserved.
59
Word Processing
If the right boundary does not fall on the same field as the left boundary, it is shifted to the last byte of the field that contains the left boundary. If it falls on the same DBCS field as the left boundary, and it also falls on the first byte of a DBCS character, the right boundary is shifted to the right by 1 byte. v If you specify the column number with the TF command, and if the column falls on the first byte of a DBCS character in a DBCS field, the column number increases by one.
Splitting Lines
The TS (text split) line command splits a line into two lines. The cursor shows where the line is to be split. The editor moves the characters to the right of the cursor or to a new line following the original line and aligns the new line with the left side of the paragraph. As mentioned earlier, the left side of a paragraph is determined by looking for a pattern in the lines preceding or succeeding a paragraph. If the line being split is the first line in a paragraph, the new line is aligned with the rest of the lines in the paragraph. If there are no other lines in the paragraph, the portion of the line to the right of the cursor aligns itself with the first portion of the line. One or more blank lines are inserted after the line being split, depending on what you specify when you enter the TS command. Note that the TSPLIT macro command inserts only one blank line. To rejoin lines, use the TF (text flow) line command. See Formatting Paragraphs on page 58 for more information.
60
Word Processing
the left of the display disappears, so that you can type all of your data as if it were one continuous line. Because the editor is doing the formatting, you can continue typing and ignore the wrap around on the display. Any explicit cursor movement is interpreted as your personal formatting and results in embedded blanks. The editor assumes that you are typing text as paragraphs. If you explicitly move the cursor down and leave a blank line, the editor assumes that the blank line should be there. The text that follows the blank line is consequently a new paragraph. Similarly, if you leave a specified number of blanks between words, the editor leaves them there. Also, if you tab to the beginning of the next line before completing the current line, the editor does not flow these sentences together. Remember that skipping a line specifies the start of a new paragraph. Note: You cannot use logical or hardware tabs during text entry. When you press Enter, the text is flowed in the same manner as the TF (text flow) line command, except that it uses the bounds as the right and left sides of the paragraphs.
Using Tabs
This section discusses hardware, software, and logical tabs, defining and controlling tabs, defining tab positions, and using attribute bytes.
Types of Tabs
Software and Hardware Tabs
The editor uses software and hardware tabs to reposition the cursor within the current display window. You can define tabs with the TABS line command. Use underscores (_) or hyphens (-) to define software tabs and asterisks (*) to define hardware tabs.
Logical Tabs
The editor uses logical tabs to reposition strings of data. You can use TABS primary and macro commands, and the TABS assignment statement to define a special character. The tab character locates the beginning of each string. Edit repositions the strings one space to the right of hardware tab positions.
61
Using Tabs
Notes: 1. You cannot use the command delimiter that you defined on the Terminal Characteristics panel (option 0.1) as a special tab character. 2. Tabs are not functional when you are using the TE (text entry) line command.
62
Using Tabs
3. Press Enter again to start the tabs. You can move the cursor from one column position to the next by continuing to press Enter. See Using Software and Hardware Tabs on page 176 for an example of using software tabs.
When tabs mode is turned on using either the ON or ALL operand, the Tab Forward and Tab Backward keys can be used to move the cursor to the space following the next attribute byte. Note: If the ALL operand is not used, attribute bytes are inserted only in spaces that contain a blank or null character, causing the Tab Forward and Tab Backward keys to recognize only these tab definitions. When tabs mode is turned on using the tab-character operand, the Tab Forward and Tab Backward keys do not recognize hardware tab definitions because no attribute bytes are inserted.
2. Type TABS ALL on the command line and press Enter again. This command causes PDF to insert an attribute byte at each hardware tab position defined by an asterisk (*). 3. Using the TABS line command, change the =TABS> line as follows:
=COLS> -1----+----2----+----3----+----4----+ =TABS> * ***** *****
63
Using Tabs
With the =TABS> line altered as shown, the cursor automatically skips to the next tab column when 5 characters, blank spaces, or a combination of both are typed in each column.
64
UNDO Processing
When the storage allocated for changes is exhausted, UNDO recycles itself and puts up the message UNDO RECYCLED. Recycling is the process of saving the current image of the file as a new base from which to work. UNDO is then available after the next transaction. No transactions made before the recycling can be undone. This is because UNDO saves an image of the original file and keeps an incremental list of changes to that image. If there is not enough storage to save the initial image, UNDO attempts to use the recovery file for undo processing. If recovery is off or suspended, the message UNDO SUSPENDED is shown with an alarm, and the profile status line is changed to SETUNDO SUSP. If recovery is available, the message UNDO FROM RECOVERY is shown with an alarm, and the profile status line is changed to SETUNDO REC. This affects the display but does not affect the edit profile values. To resume SETUNDO STG, enter the SETUNDO primary command. If there is still not enough storage to hold the original copy of the file, the recycling procedure is repeated. Note: Edit recovery can no longer process edit recovery files created under previous releases of ISPF/PDF. A panel is displayed, but no other action is taken if an old recovery file is used.
Chapter 3. Managing Data
65
66
67
Model Hierarchy
Model Classes Enter number or Class of model. Enter END command to cancel MODEL command. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 CLIST - ISPF services in CLIST commands COBOL - ISPF services in COBOL programs EXEC - ISPF services in EXEC commands FORTRAN - ISPF services in FORTRAN programs MSGS - Message format PANELS - Panel formats and statements PLI - ISPF services in PLI programs SKELS - File tailoring control statements PASCAL - ISPF services in PASCAL programs REXX - ISPF services in TSO/REXX commands DTL - ISPF Dialog Tag Language formats and statements C - ISPF services in C/370 programs SCLM - SCLM Project Definition Macros ARCHDEF - SCLM Architecture Definition templates
F2=Split
F3=Exit
F7=Backward
F8=Forward
F9=Swap
You can use the default for this part of the logical name whenever the edit profile name matches the class of the model desired. The second part of the logical name is the model name, which identifies the specific model within the model class. Frequently, it uniquely identifies a model and completes the logical name. To uniquely identify a model, you can define optional qualifiers. Qualifiers are used, for example, to differentiate among the various kinds of panel verification (VER) statements. A hierarchy of selection panels defines the hierarchy of models. The different parts of the logical name of a model are selections on the panels that you can choose either by keyword name or option identifier. This allows you to be prompted by selection panels if you do not know the logical name of the model you want or to bypass the display of these panels if you do know the name. Usually, you do not need to worry about the model class. You must specify it only if you want to use a class that is different from the edit profile name. The model function of the editor recognizes PANELS as a valid type qualifier for panel models, so you do not need to specify the class when requesting a panel model from a data set with a type qualifier of PANELS (assuming you allow the edit profile name to default to panels). Assume, however, that you call your panels screens and maintain them in a data set with a type of SCREENS. When you want to use a model to develop a new panel, you enter the MODEL command. The model function does not recognize SCREENS as a model class, so you are prompted to identify the class you want, which is the PANELS class in this situation. Once you have specified a class, whether by panel selection or by use of the MODEL CLASS command, that class remains in effect until you change it. The two ways to change the class specification are by typing a data set name with a different type qualifier, or by leaving the Edit Entry panel.
68
F2=Split
F3=Exit
F7=Backward
F8=Forward
F9=Swap
If you select option D1 (DISPLAY), the editor inserts the model for the DISPLAY service in your CLIST, as shown in Figure 22 on page 70. The lines are inserted at the location you specify with a label or an A or B line command. Notes are identified by the characters =NOTE= in the line command field.
69
File Edit Edit_Settings Menu Utilities Compilers Test Help EDIT LSACKV.PRIVATE.CLIST(EDITOLD) - 01.01 Columns 00001 00072 ****** ***************************** Top of Data ****************************** 000100 ISPEXEC DISPLAY PANEL(PANELNAM) MSG(MSG-ID) + 000200 CURSOR(FIELDNAM) CSRPOS(POS#) + 000300 COMMAND(COMMANDS) RETBUFFR(BUF-NAME) + 000400 RETLGTH(LNG-NAME) MSGLOC(MSG-FIELD) =NOTE= =NOTE= PANELNAM - OPTIONAL, NAME OF THE PANEL TO BE DISPLAYED. =NOTE= MSG-ID - OPTIONAL, IDENTIFIER OF A MESSAGE TO BE DISPLAYED ON =NOTE= THE PANEL. =NOTE= FIELDNAM - OPTIONAL, NAME OF THE FIELD WHERE THE CURSOR IS TO BE =NOTE= POSITIONED. =NOTE= POS# - OPTIONAL, POSITION OF CURSOR IN FIELD. DEFAULT IS 1. =NOTE= COMMANDS - OPTIONAL, NAME OF A VARIABLE WHICH CONTAINS THE CHAIN =NOTE= OF COMMANDS. =NOTE= BUF-NAME - OPTIONAL, NAME OF A VARIABLE WHICH CONTAINS THE =NOTE= REMAINING PORTION OF THE COMMAND CHAIN TO BE STORED =NOTE= IF AN ERROR OCCURS. =NOTE= LNG-NAME - OPTIONAL, NAME OF A VARIABLE WHICH CONTAINS THE LENGTH Command ===> Scroll ===> PAGE F1=Help F2=Split F3=Exit F5=Rfind F6=Rchange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
With the notes as a guide, you can edit the CLIST to change the DISPLAY service call parameters for your function. The error-handling source code shown serves as a skeleton which you can update. Finally, use RESET to eliminate the notes from the panel, leaving the service call, the error-handling logic, and the comments. Some models also include examples in NOTE lines. Use the MD line command to turn NOTE lines into data lines.
Adding Models
To create a new model, you must: 1. Determine the data set name and member name for the model. For actual use, the model must be in a skeleton library. 2. Create the source code for the model. Consider whether you should create all new source code or change an existing model under a new name. When you create a COBOL model, make sure number mode is on. Then, when you save the model, turn number mode off.
70
Once the model for each letter is built, you must update the selection panel in the prompting sequence that deals with panel model selection. This panel is named ISREMPNL and is stored in the system panel library. Figure 23 shows the last few lines in ISREMPNL:
Panel Models Option ===> Enter number or statement name. Enter END command to cancel MODEL command. More: . . . S18 CUAATTR S19 *REXX P0 PANSECT - CUA attributes - Rexx in panel procedures - Panel Sections - Other definitions -
F3=Exit
F7=Backward
F8=Forward
F9=Swap
Copy the panel shown in Figure 23 into your panel data set and change it by adding a format F1, BLOCKLTR. See Figure 24 on page 72 for an example.
71
Panel Models Option ===> Enter number or statement name. Enter END command to cancel MODEL command. More: . . . S18 CUAATTR S19 *REXX P0 PANSECT - CUA attributes - Rexx in panel procedures - Panel Sections - Other definitions -
F3=Exit
F7=Backward
F8=Forward
F9=Swap
If there are several new models, this panel should be updated so that when you select F2, a new Block Letter selection panel is displayed. Therefore, you should change the )PROC section of panel ISREMPNL to include item F2. See Figure 25 for an example.
This concept allows you and other users to have sets of individual models, and allows the installation to have its own set of general models, without having multiple copies of the PDF model selection panels. For each model class, the installation could provide two additional entries on the selection panel: one for installation-wide models and one for your models. Each entry could point to a selection panel, with each user having a copy of the selection panel to customize for individual use. Note that the entry for F2, BLOCKLTR, points to a new panel, ISRBLOCK, which you would now build.
72
% )INIT .CURSOR = ZCMD .HELP = ISRxxxxx IF (&ISRMDSPL = RETURN ) .RESP = END )PROC &ZSEL = TRANS(TRUNC (&ZCMD,.) 1,PGM(ISRECMBR) PARM(BLKI) I,PGM(ISRECMBR) PARM(BLKI) 2,PGM(ISRECMBR) PARM(BLKJ) J,PGM(ISRECMBR) PARM(BLKJ) 3,PGM(ISRECMBR) PARM(BLKK) K,PGM(ISRECMBR) PARM(BLKK) *,? ) IF (&ZSEL = ?) .MSG = ISRYM012 &ISRMMEND = N /* IF (.RESP = END ) /* IF (&ISRMONCL = Y) /* IF (&ISRMDSPL = RETURN ) /* &ISRMMEND = Y /* )END
SET THE END INDICATOR TO NO IF ENDING, WHY ... WHO CAUSED MAKE SURE ITS NOT A CLASS OP. MAKE SURE ITS NOT END ON MBR. NO - ITS BECAUSE USER HIT END
*/ */ */ */ */
Figure 26. Source Code for Block Letter Model Selection Panel
Finding Models
Before you change or delete a model, you must determine the physical name of the model in the skeleton library. See z/OS ISPF Planning and Customizing for a list of the names of the models of dialog elements distributed with PDF. In addition, you can use the following method to find the member name for any model.
73
Changing Models
To change a model that currently exists, copy the existing model from the skeleton data set into your own data set. Then use the editor to change the model in the same way you would change any text data set. Note: Any lines that are to contain notes must have )N in positions 1 and 2, followed by one or more blanks, as shown in the following example.
)N )N )N )N )N )N VARIABLE = VALUE VARIABLE - A DIALOG VARIABLE OR A CONTROL VARIABLE. VALUE - A LITERAL VALUE CONTAINING: SUBSTITUTABLE VARIABLES, A DIALOG VARIABLE, A CONTROL VARIABLE, OR AN EXPRESSION CONTAINING A BUILT-IN FUNCTION. EXAMPLES: &DEPT = Z59 &A = &B &C =
When the model is later accessed using MODEL, the lines with )N indicators are flagged with =NOTE= in the line command field (Figure 22 on page 70).
Deleting Models
You can delete models by deleting the references to them. To delete the references, remove the entry referencing the model in both the )BODY and )PROC sections of the model selection panel. Generally, you can leave the model itself in the skeleton library. However, if you are deleting a substantial number of models, you can delete those members from the library and then compress it.
74
Chapter 6. Creating Edit Macros . . . . . . CLIST and REXX Edit Macros . . . . . . . Edit Macro Commands and Assignment Statements . . . . . . . . . . . . . Using the REXX ADDRESS Instruction . . Command Procedure Statements . . . . . ISPF and PDF Dialog Service Requests . . . TSO Commands . . . . . . . . . . . Program Macros . . . . . . . . . . . . Differences between Program Macros, CLISTs, and REXX EXECs . . . . . . . . . . Passing Parameters in a Program Macro . . . Program Macro Examples . . . . . . . Writing Program Macros . . . . . . . . Running Program Macros . . . . . . . Using Commands in Edit Macros . . . . . . Naming Edit Macros . . . . . . . . . Variables . . . . . . . . . . . . . Variable Substitution . . . . . . . . Character Conversion . . . . . . . . Edit Assignment Statements . . . . . . . Value . . . . . . . . . . . . . Keyphrase . . . . . . . . . . . . Overlays and Templates . . . . . . . Using Edit Assignment Statements . . . Passing Values . . . . . . . . . . Manipulating Data With Edit Assignment Statements . . . . . . . . . . . . Differences Between Edit, CLIST, and REXX Assignment Statements . . . . . . . Performing Line Command Functions . . . Parameters . . . . . . . . . . . . Passing Parameters to a Macro . . . . . . Using Edit Macros in Batch . . . . . . . Edit Macro Messages . . . . . . . . . Macro Levels . . . . . . . . . . . . Labels in Edit Macros . . . . . . . . Using Labels . . . . . . . . . . Referring to Labels . . . . . . . . Passing Labels . . . . . . . . . . Referring to Data Lines . . . . . . . . Referring to Column Positions . . . . . . Defining Macros . . . . . . . . . . Defining an Alias . . . . . . . . . Resetting Definitions . . . . . . . . Replacing Built-In Commands . . . . . Implicit Definitions . . . . . . . . Using the PROCESS Command and Operand
. . . .
. 95 . 96 . 96 . 97 . 97 . 99 . 99 . 99 . 100 . 100 . 101 . 102 . 102 . 102 . 103 . 103 . 103 . 103 . 104 104
75
76
77
When you run this macro, it deletes all lines beginning with a dash, except the first one. To run the macro, type isrdash on the command line (Figure 28). The dash macro deletes all lines that began with a dash except the first one (Figure 29 on page 79).
78
To run the test macro, type isrtdata on the command line (Figure 31 on page 80). The macro numbers the first nine lines of data (Figure 32 on page 80).
79
80
/*********************************************************************/ /* */ /* 5647-A01 (C) COPYRIGHT IBM CORP 1995, 2003 */ /* */ /* ISRCOUNT counts the number of occurrences of a string, and */ /* returns a message. */ /* */ /*********************************************************************/ ISREDIT MACRO (PARMSTR) ISREDIT SEEK ALL &PARMSTR IF &LASTCC > 12 THEN DO SET &ZEDSMSG = &STR(SEEK ERROR ) SET &ZEDLMSG = &STR(STRING NOT FOUND ) END ELSE DO ISREDIT (COUNT) = SEEK_COUNTS SET &COUNT = &COUNT SET &ZEDSMSG = &STR("&PARMSTR" FOUND &COUNT TIMES) SET &ZEDLMSG = &STR(THE STRING "&PARMSTR " WAS FOUND + &COUNT TIMES.) END ISPEXEC SETMSG MSG(ISRZ000) EXIT CODE (0)
To run the ISRCOUNT macro, type isrcount TEST on the command line (Figure 34). The macro does not change the data but displays return messages to show the number of times it found the string. The editor always displays the short message in the upper right corner of the screen. Enter HELP (the default is F1) to produce the long message (Figure 35 on page 82).
81
82
then data sets DS1, DS2, and DS3 must contain only REXX EXECs. However, DSA, DSB, and DSC can contain either REXX EXECs or CLISTs; if these data sets contain REXX EXECs, the first line of each EXEC must be a REXX comment line. As in an ISPF dialog, program macros must be made available as load modules in either the ISPLLIB, STEPLIB, or LINKLST library.
83
A description of each edit macro command and assignment statement is in Chapter 11, Edit Macro Commands and Assignment Statements.
For information on using the REXX ADDRESS instruction, refer to z/OS TSO/E REXX Reference.
84
For more information on ISPF services, refer to z/OS ISPF Services Guide.
TSO Commands
Any statement that is not recognized as a command procedure statement and does not begin with ISPEXEC or ISREDIT is assumed to be a TSO command. TSO commands can be either CLISTs, REXX EXECs, or programs. When the command processor finds a TSO command, it processes the command. Examples of TSO commands are:
CLIST Statements ALLOCATE ... FREE ... DELETE ... RENAME ... REXX Statements ADDRESS TSO ALLOCATE ... FREE ... DELETE ... RENAME ...
For more information on TSO commands, refer to z/OS TSO/E Command Reference.
Program Macros
Not all edit macros are written in CLIST or REXX. You can also write edit macros in a programming language such as PL/I, COBOL, FORTRAN, APL2, Pascal, or C. These are called program macros. There are four basic reasons to write and debug a program macro: v A macro runs faster in a language that can be precompiled than in CLIST or REXX. This can be valuable for macros that you run many times. v A macro that must read data containing symbols can confuse an interpretive language processor. Particularly, ampersands in the data can cause problems. v Complex logic can be handled better in a programming language. v To pass mixed data or strings (those that contain both EBCDIC and DBCS characters) as parameters, you must use a program macro. Although CLIST does not allow mixed data strings, the following edit macro commands and assignment statements allow you to supply data or string operands:
CHANGE EXCLUDE FIND LINE LINE_AFTER LINE_BEFORE MASKLINE SEEK TABSLINE
85
Program Macros
where the following definitions apply: 'ISREDIT' length The service name. A fullword number indicating the length of the command buffer. When a zero length is passed, the maximum buffer length is 255 bytes. Can contain any edit command that is valid from a macro, typed with the same syntax used in a CLIST or REXX exec. Any PDF edit command that is valid from a macro, typed with the same syntax used in a CLIST or REXX exec.
buffer command
86
Program Macros
where: LEN0 LEN8 LEN16 A fullword program variable with a value of 0. A fullword program variable with a value of 8. A fullword program variable with a value of 16.
In each of these examples, the rest of the command is typed as a literal value. The first two examples use the ISPLINK syntax. In the ISPLINK call, ISREDIT is passed as the first parameter and is omitted from the command buffer. The first example uses a special interface. A zero length can be passed, but only when the command is delimited by a special character. A special character cannot be an alphanumeric character. If the length is zero and if a valid delimiter is the first character in the command buffer, a scan of the command is done to find the next occurrence of that character. The command length is the number of characters between the two delimiters. Here, the cent sign () is used as a delimiter. When a zero length is passed, the maximum buffer length is 255 bytes. In the second example, an explicit length of 8 is used and the command buffer contains the command without delimiters. The third example uses the ISPEXEC syntax. This syntax always requires the length of the command buffer to be passed. The command buffer includes the ISREDIT prefix, and is typed the same way as a CLIST or REXX command.
87
Program Macros
/* Rexx **************************************************************/ /***** Sample Edit Macro *********************************************/ /* */ /* 5647-A01 (C) COPYRIGHT IBM CORP 1995, 2003 */ /* */ /* ISRSLREX - separates lines with a line of dashes. */ /* */ /*********************************************************************/ TRACE ADDRESS ISPEXEC ISREDIT MACRO ISREDIT (SAVE) = USER_STATE ISREDIT RESET ISREDIT EXCLUDE ----- 1 ALL ISREDIT DELETE ALL X LASTL = 1 LINE = 0 LINX = COPIES(-,70) LL = LASTL + 1 DO WHILE LINE < LL ISREDIT LINE_AFTER LINE = (LINX) ISREDIT (LASTL) = LINENUM .ZLAST LL = LASTL + 1 LINE = LINE + 2 END ISREDIT USER_STATE = (SAVE) EXIT
88
Program Macros
/* /* 5647-A01 (C) COPYRIGHT IBM CORP 1995, 2003 /* /* ISRSLPLI - EDIT MACRO PROGRAM TO INSERT SEPARATOR LINES /* PL/I /* ISRSLPLI: PROC OPTIONS (MAIN); /* DECLARE LINEX CHAR (70) INIT ((70)-) , /* SEPARATOR LINE --LASTL FIXED BIN(31,0) INIT (0), /* LAST LINE OF TEXT LINE FIXED BIN(31,0) INIT (0), /* CURRENT LINE NUMBER LEN0 FIXED BIN(31,0) INIT (0), /* LENGTHS - 0 LEN1 FIXED BIN(31,0) INIT (1), /* LENGTHS - 1 LEN4 FIXED BIN(31,0) INIT (4), /* LENGTHS - 4 LEN70 FIXED BIN(31,0) INIT (70); /* LENGTHS - 70 /* DECLARE /* ISPLINK ENTRY OPTIONS(ASM,INTER,RETCODE); /* LINK TO ISPF /* CALL ISPLINK(VDEFINE,(LASTL),LASTL,FIXED,LEN4); CALL ISPLINK(VDEFINE,(LINE), LINE, FIXED,LEN4); CALL ISPLINK(VDEFINE,(LINEX),LINEX,CHAR, LEN70); CALL CALL CALL CALL CALL ISPLINK(ISREDIT,LEN0, ISPLINK(ISREDIT,LEN0, ISPLINK(ISREDIT,LEN0, ISPLINK(ISREDIT,LEN0, ISPLINK(ISREDIT,LEN0, MACRO ); (SAVE) = USER_STATE ); RESET ); EXCLUDE ------ 1 ALL ); DELETE ALL X );
*/ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */
LASTL = 1; LINE = 0; DO WHILE (LINE < (LASTL + 1)); CALL ISPLINK(ISREDIT,LEN0, LINE_AFTER &LINE = (LINEX) CALL ISPLINK(ISREDIT,LEN0, (LASTL) = LINENUM .ZLAST ); LINE = LINE + 2; END; CALL ISPLINK(ISREDIT,LEN0, USER_STATE = (SAVE) ); END ISRSLPLI; );
89
Program Macros
ID DIVISION. PROGRAM-ID. ISRSLCOB. * * EDIT MACRO PROGRAM TO INSERT SEPARATOR LINES * ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 LINEX PIC X(70) VALUE * SEPARATOR LINE -----01 LASTL PIC 9(6) VALUE * LAST LINE OF TEXT 01 LYNE PIC 9(6) VALUE * CURRENT LINE NUMBER 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ISREDIT VDEFINE ZLASTL ZLINE ZLINEX FIXED CHAR LEN0 LEN4 LEN70 EM1 EM2 EM3 EM4 EM5 EM6 EM7 EM8 PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC X(8) X(8) X(8) X(8) X(8) X(8) X(8) 9(6) 9(6) 9(6) X(10) X(24) X(10) X(25) X(18) X(30) X(28) X(23) VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE ALL 0 0 "-". COMP. COMP.
"ISREDIT ". "VDEFINE ". "(LASTL )". "(LINE )". "(LINEX )". "FIXED ". "CHAR ". 0 COMP. 4 COMP. 70 COMP. " MACRO ". " (SAVE) = USER_STATE ". " RESET ". " EXCLUDE ------ 1 ALL 0". " DELETE ALL X ". " LINE_AFTER &LINE = (LINEX) ". " (LASTL) = LINENUM .ZLAST ". " USER_STATE = (SAVE) ". ZLASTL ZLINE ZLINEX LEN0 LEN0 LEN0 LEN0 LEN0 LASTL LYNE LINEX EM1. EM2. EM3. EM4. EM5. FIXED LEN4. FIXED LEN4. CHAR LEN70.
MOVE 1 TO LASTL. MOVE 0 TO LYNE. PERFORM LOOP UNTIL LYNE IS NOT LESS THAN (LASTL + 1). CALL "ISPLINK" USING ISREDIT LEN0 EM8. GOBACK. LOOP. CALL "ISPLINK" USING ISREDIT LEN0 EM6. CALL "ISPLINK" USING ISREDIT LEN0 EM7. ADD 2 TO LYNE.
90
Program Macros
can define a macro as a program macro either by entering a DEFINE command or by prefixing the macro name with an exclamation point (!) when you type the macro name on the command line. If a macro named FINDIT is a CLIST or REXX exec macro, for example, you can run it by typing FINDIT on the command line and pressing Enter. If it is a program macro, you can type !FINDIT, or FINDIT if it had previously been defined as a program macro by the DEFINE command. The first time you enter a macro with an exclamation point (!) prefix implicitly defines that macro as a program macro. Thereafter, you can omit the prefix. To use the DEFINE command to define a program as a macro, type the following command and press Enter:
DEFINE name PGM MACRO
The operands can be typed in either order. That is, DEFINE name MACRO PGM is also valid.
Variables
Variables function in edit macros in the same way as in CLISTs and REXX EXECs. The only exceptions are dialog variablesvariables that communicate with ISPF and the PDF componentwhich can only have names from 1 to 8 characters in length. This topic presents a brief introduction on using variables; for more
91
Variable Substitution
Scan mode controls the automatic replacement of variables in command lines passed to the editor. Use the SCAN assignment statement either to set the current value of scan mode (for variable substitution), or to retrieve the current value of scan mode and place it in a variable. When scan mode is on, command lines are scanned for ampersands (&). If an ampersand followed by a nonblank character is found, the characters between the ampersand and the next blank or period are treated as the name of a dialog variable. The value from the variable pool is substituted in the command for the variable name before the command is processed. For example, &DVNAME. and &DVNAME are both interpreted as a dialog variable called DVNAME. The period after the variable allows concatenation of the variable value without an intervening blank delimiter. Remember this when using program macros that do not have the CLIST processor to substitute variable values.
Character Conversion
A CLIST automatically converts all character strings to uppercase before passing them to the editor. Therefore, if you want an edit macro command or assignment statement that you process from a CLIST to find a character string in lowercase, you must precede the command or statement with the TSO CONTROL ASIS statement. This statement passes lowercase characters to the editor.
Value
The value part of an edit macro assignment statement can be one of the following: v A literal character string can be one of the following types:
92
Any string starting and ending with a quote (either or "), but not containing embedded quotes. The delimiting quotes are not considered to be part of the data. v A dialog variable name enclosed in parentheses (varname). If the dialog variable name is on the right, the entire contents of the variable are considered part of the data, including any quotes, apostrophes, blanks, commas, or other special characters. If the dialog variable name is on the left, its content is totally replaced. Delimited Notes: 1. In the CLIST environment, the CLIST variable pool and the dialog function variable pool are merged. Therefore, variables in parentheses are the same as ampersand variables, except that the editor does the symbolic substitution rather than the CLIST processor. 2. In the REXX environment, the REXX variable pool and the dialog function variable pool are also merged. Therefore, quoted variable names in parentheses are the same as unquoted variable names, except that the editor does the symbolic substitution rather than the REXX processor. 3. In a program macro, you must use the VDEFINE service for any variables that are passed to the editor.
Keyphrase
A keyphrase is either a single keyword, or a keyword followed by a line number or label. The keyphrase can be either a single-valued keyphrase or a double-valued keyphrase. Keyphrase Syntax: Single-valued keyphrases can have the following syntax:
ISREDIT ISREDIT ISREDIT ISREDIT keyphrase keyphrase keyphrase keyphrase = = = = keyphrase value keyphrase + value value + value
where value-pair is one of the following: v Two literals, which can be separated by a comma or blank. For example:
CLIST Statements ISREDIT CURSOR = 1,40 ISREDIT CURSOR = 1 40 REXX Statements ADDRESS ISPEXEC ISREDIT CURSOR = 1,40 ISREDIT CURSOR = 1 40
Apostrophes or quotes cannot be used when specifying two numeric values. All of the following, for example, are incorrect:
CLIST Statements ISREDIT CURSOR = 1,40 ISREDIT CURSOR = 1,40 REXX Statements ADDRESS ISPEXEC "ISREDIT CURSOR = 1,40" "ISREDIT CURSOR = 1,40"
93
Note: Even though you can use blanks instead of commas to separate paired variables or values, you must use a leading comma whenever the first variable or value has been omitted.
The first example causes two slashes to replace the first two column positions of the current line (the line containing the cursor). The remainder of the line is unchanged. The second example uses a template to cause columns 40-41 of the current mask line to be replaced with /* and columns 70-71 to be replaced with */. Again, remember that the template replaces the corresponding positions on the left only if those left positions are blank. The template shown in the preceding example has the form:
<col1 literal1 col2 literal2 ... >
It can be designed with col1 and col2 indicating a starting column position, and literal1 and literal2 indicating the data to start in that column. The entire template is delimited with less-than (<) and greater-than (>) signs. A template can be designed by using variable names (enclosed in parentheses) for either col1, col2, literal1, literal2, or for all four. All of the following forms are valid:
<(colvar1) (datavar1) (colvar2) (datavar2) ... > <(colvar1,datavar1) (colvar2,datavar2) ... > <(colvar1) literal1 col2 (datavar2) ... >
94
In the preceding example statements, the parentheses around CAPMODE indicate to the ISPF editor that the enclosed name is the name of a symbolic variable. If the name happened to be preceded by an ampersand (&), rather than enclosed in parentheses, the CLIST processor would replace the name of the variable with its actual value, and the editor would not see the name. In a REXX statement, the variable name must be within quotes so that the name, not the value, is passed. Only names with 8 or fewer characters are allowed by the ISPF editor. When the editor finds a variable name in parentheses in a position where a value is required, it substitutes the value assigned to that variable. In the following examples the edit macro sets the edit CAPS mode:
CLIST Statements ISREDIT CAPS = ON ISREDIT CAPS = (CAPMODE) ISREDIT CAPS = &CAPMODE REXX Statements ADDRESS ISPEXEC ISREDIT CAPS = ON ISREDIT CAPS = (CAPMODE) ISREDIT CAPS = capmode
The CLIST and REXX command processors replace the variable CAPMODE with its assigned value before the ISPF editor processes the statement. This makes the last statement equivalent to the first statement; in this case, the variable has a value of ON. The second statement differs in that the editor receives the variable name and retrieves its value from the dialog variable pool.
Passing Values
Some information can best be passed back and forth between the editor and the macro in pairs. The following examples show assignment statements that pass two values:
CLIST Statements ISREDIT (LB,RB) = BOUNDS ISREDIT BOUNDS = (LB,RB) REXX Statements ADDRESS ISPEXEC ISREDIT (LB,RB) = BOUNDS ISREDIT BOUNDS = (LB,RB)
In the first statement, the current left and right boundaries are stored into the variables LB (LEFTBND) and RB (RIGHTBND). In the second statement, the values from the variables LB and RB are used to change the current boundaries. For more information on which edit macro commands take one variable and which take two, see Chapter 11, Edit Macro Commands and Assignment Statements.
95
To copy line 1 from the data set into the variable LINEDATA, use:
CLIST Statement ISREDIT (LINEDATA) = LINE 1 REXX Statements ADDRESS ISPEXEC ISREDIT (LINEDATA) = LINE 1
To replace the first line in the data set, using the data from the variable LINEDATA, use:
CLIST Statement ISREDIT LINE 1 = (LINEDATA) REXX Statements ADDRESS ISPEXEC ISREDIT LINE 1 = (LINEDATA)
To add a new line after line 1 in the data set using the variable NEWDATA, use:
CLIST Statement ISREDIT LINE_AFTER 1 = (NEWDATA) REXX Statements ADDRESS ISPEXEC ISREDIT LINE_AFTER 1 = (NEWDATA)
96
For example:
CLIST Statement ISREDIT TFLOW 1 REXX Statements ADDRESS ISPEXEC ISREDIT TFLOW 1
causes the paragraph starting on line 1 to be flowed in the same way as a TF (text flow) line command would if entered on the first line. For more information on line command functions in edit macros, see Chapter 11, Edit Macro Commands and Assignment Statements.
Parameters
If you want to supply information to a macro as parameters, you must identify these parameters on the ISREDIT MACRO statement by enclosing them in parentheses. For example, if you have the following macro command in an edit macro named FIXIT:
CLIST Statement ISREDIT MACRO (MEMNAM) REXX Statements ADDRESS ISPEXEC ISREDIT MACRO (MEMNAM)
97
variable PARM1 is assigned the value GOOD, PARM2 is assigned the value BAD, and REST is assigned the value AND UGLY. If the parameters passed were GOOD BAD, variable REST would be null. Also, if the parameters are enclosed in quotation marks, such as:
FIXIT GOOD BAD AND UGLY
PARM1 would be set to GOOD BAD, PARM2 would be set to AND UGLY, and REST would be null. For another example, see the ISRTRYIT macro (Figure 41 on page 112). If the MACRO statement contains two variables (ISREDIT MACRO (command,parm)), entering:
ISRTRYIT RESET
sets the variables command to RESET and parm to null. Conversely, the following command:
ISRTRYIT FIND A
sets command to FIND and parm to A. To find out what was actually typed on the command line, a macro may examine the variable ZEDITCMD, which is in the shared variable pool. ZEDITCMD is a character variable, the length if which depends on the length of the command entered. Therefore, you should either VDEFINE ZEDITCMD to be sufficiently large to hold the expected command, or use the VCOPY service to get the length.
98
ISRZ001 &ZEDSMSG .ALARM = YES .HELP = ISR2MACR &ZEDLMSG ISRZ002 &ZERRSM .ALARM = &ZERRALRM .HELP = &ZERRHM &ZERRLM
For example, if you want your macro to sound an alarm and to issue the short message INVALID PARAMETER and the long message PARAMETER MUST BE 4 DIGITS, use the following statements:
CLIST Statements SET &ZEDSMSG = &STR(INVALID PARAMETER) SET &ZEDLMSG = &STR(PARAMETER MUST BE 4 DIGITS) ISPEXEC SETMSG MSG(ISRZ001) REXX Statements ADDRESS ISPEXEC zedsmsg = Invalid Parameter zedlmsg = Parameter must be 4 digits SETMSG MSG(ISRZ001)
Note: ZEDLMSG only displays when you enter the HELP command.
Macro Levels
Each macro operates on a separate and unique level. A person at the keyboard always operates at level 0. If that person starts a macro, it operates at level 1; the macro started by a level-1 macro operates at level 2, and so on. The level is the degree of macro nesting. Edit macros are primary commands; thus, nested macros are started by prefixing them with ISREDIT.
Chapter 6. Creating Edit Macros
99
The current level number is stored in the specified variable. ISPF supports up to 255 levels of macro nesting.
Note: Unlike other labels, .ZCSR, .ZFIRST, and .ZLAST do not stay with the same line. Label .ZCSR stays with the cursor, and labels .ZFIRST and .ZLAST point to the current first and last lines, respectively.
Using Labels
In a macro, you can assign a label to a line by using the LABEL assignment statement. For example:
CLIST Statements SET &LNUM = 10 ISREDIT LABEL &LNUM = .HERE REXX Statements ADDRESS ISPEXEC lnum = 10 ISREDIT LABEL lnum = .HERE
This assigns the label .HERE to the line whose relative line number is contained in variable LNUM (line 10 here). The .HERE label allows the macro to keep track of a line whose relative line number may change. When the macro finishes running, the .HERE label is removed. Labels can be used as part of a keyphrase instead of a line number. For example:
CLIST Statements ISREDIT LINE .NEXT = (DATAVAR) ISREDIT LINE_AFTER .XYZ = (DATAVAR) REXX Statements ADDRESS ISPEXEC ISREDIT LINE .NEXT = (DATAVAR) ISREDIT LINE_AFTER .XYZ = (DATAVAR)
The first example stores new data into the line that currently has the label .NEXT. The second example creates a new line after the line whose label is .XYZ, and stores data into the new line.
100
This example stores the relative line number of the line with label .ABC into variable LNUM2 and tests to see if that label did exist. Labels have a variety of uses. For example, because both the FIND and SEEK commands position the cursor at the search string after the macro has been started, you may want to assign the data from the line on which the cursor is positioned to the variable CSRDATA. To do so, use the following statement:
CLIST Statements ISREDIT FIND IT ISREDIT (CSRDATA) = LINE .ZCSR REXX Statements ADDRESS ISPEXEC ISREDIT FIND IT ISREDIT (CSRDATA) = LINE .ZCSR
The label .ZCSR names the line in which the cursor is positioned. The .ZCSR label is moved to a new line when one of the following commands moves the cursor: FIND, CHANGE, SEEK, EXCLUDE, TSPLIT or CURSOR. The labels .ZFIRST and .ZLAST can also move when data is added or deleted. If you assign a labeled line a new label that is blank, the previous label becomes unassigned (if both labels are at the same level). For example:
CLIST Statement ISREDIT LABEL .HERE = REXX Statements ADDRESS ISPEXEC "ISREDIT LABEL .HERE = "
removes the label from the line. If a label in use is assigned to another line, the label is moved from the original line to the new line (if the new assignment is at the same level as the original).
Referring to Labels
A nested macro can refer to all labels assigned by higher-level macros and to labels that you assign. When a macro assigns labels, they are associated by default with the assigning macro level. The labels are automatically removed when the macro finishes running. The labels belong to the level at which they are assigned and can have the same name as the labels at other levels without any conflict. When a macro ends, the labels at the current nesting level are deleted. To set a label for the next higher level, the macro can issue the MACRO_LEVEL assignment statement to obtain the current level and decrease the level by 1. A macro can determine the level of a label with the LABEL assignment statement, as shown in the following syntax:
ISREDIT (varname1,varname2) = LABEL lptr
101
Passing Labels
You can create a label at any level above its current level by explicitly stating the level:
Here, if the label previously existed at the explicitly specified level, its old definition is lost. A label assigned at a higher level remains after the macro ends and is available until the level at which it was assigned ends or the label is explicitly removed. If a macro sets a label without indicating a level, or if its value is equal to or greater than the level at which the macro is running, the label is set at the macro level that is currently in control and does not affect any labels set in a higher level. If a macro queries a label without specifying a level, or uses the label as a line pointer, the search for the label starts at the current macro level and goes up, level by level, until the label defined closest to the current level is found. If you specify a level parameter that is outside the currently active levels, it is adjusted as follows: a value less than zero is set to zero; a value greater than the current nesting level is set to the current nesting level. This means that a higher-level macro cannot set a label at the level of the macro that it is going to start.
102
Defining Macros
You can use DEFINE to give macros names that are different from their data set names, make aliases for built-in edit commands, identify macros as program macros, or set a command as disabled. DEFINE commands are usually issued in an initial macro. For more information, refer to the description of the DEFINE command in Chapter 11, Edit Macro Commands and Assignment Statements.
Defining an Alias
To establish an alias or alternate name for a primary command, enter a DEFINE followed by the new name, the ALIAS operand, and then the original command name. For example, the following command:
DEFINE FILE ALIAS SAVE
establishes FILE as an alias for SAVE, allowing you to enter FILE to save the data currently being edited instead of SAVE.
Resetting Definitions
To reset the last definition for a command and return the command to its previous status, use the DEFINE command with the RESET operand. For example, having established FILE as an alias for SAVE, you can enter this command to cause FILE to be flagged as an invalid command:
DEFINE FILE RESET
When defining a command as DISABLED, you cannot reset the disabled function.
103
The ellipses (...) represent other FIND command operands such as the search string.
Implicit Definitions
When you or your macro issue a command unknown to the editor, PDF searches for a CLIST or REXX exec with that name. If the editor finds the command, it is implicitly defines it as an edit macro. Program macros can be implicitly defined by preceding the name of the macro with an exclamation point (!). Remember that the name must be 7 characters or less, excluding the exclamation point. Program macros are similar to ISPF dialogs in that they must be made available as load modules in either the ISPLLIB, STEPLIB, or LINKLST library. See Program Macros on page 85 for more information.
ISREDIT MACRO
104
Specifying a Destination
If you include the following process statement in an edit macro:
CLIST Statement ISREDIT PROCESS DEST REXX Statements ADDRESS ISPEXEC ISREDIT PROCESS DEST
the macro expects you to specify a destination line. A destination line is always specified using either A (after) or B (before). The editor sets the dialog variable .ZDEST to the line preceding the destination. However, if neither A nor B is specified, .ZDEST is set to the last data line. In this situation, a return code shows that no destination was specified.
Specifying a Range
If you use the following syntax for a PROCESS macro command in an edit macro:
ISREDIT PROCESS RANGE operand
the macro expects to receive a specified range of lines to process. The operand following the RANGE operand identifies either one or two commands that are to be accepted. For example, the command PROCESS RANGE Q Z allows the line commands Q or Z (but not both) to be processed with this macro. The line commands could take any of the following forms: v Q or Z, to specify a single line. v QQ or ZZ, to specify a block of lines. This form is obtained by doubling the last letter of the single-line command. v Qn or Zn where n is a number that specifies a series of lines. After the PROCESS command is completed, the dialog variable .ZFRANGE is automatically set to the first line of the specified range. The dialog variable .ZLRANGE is set to the last line of the specified range. These labels can refer to the same line. If no range is entered, the range defaults to the entire data set. In this situation, a return code shows that no range was specified. Two line command names can be specified for PROCESS In this situation, use the RANGE_CMD assignment statement to return the value of the command entered. For example, if you issue the following PROCESS command:
CLIST Statement ISREDIT PROCESS RANGE Z $ REXX Statements ADDRESS ISPEXEC ISREDIT PROCESS RANGE Z $
The RANGE_CMD assignment statement returns either a Z or a $. The names of line commands that define the range can be 1 to 6 characters, but if the name is 6 characters long, it cannot be used as a block format command by doubling the last character. The name can contain any alphabetic or special character except blank, hyphen (-), apostrophe (), or period (.). It cannot contain any numeric characters.
Example
In the example that follows, the NOPROCESS operand on the MACRO command defers processing of the panel data until the line with the cursor is assigned to a
Chapter 6. Creating Edit Macros
105
Recovery Macros
After a system failure, you might want to restore the command definitions and aliases that you were using when the system failed, but you do not want to destroy the profile changes you made during the edit session before the failure. To help to recover after a system failure, you can provide a recovery macro which can restore command definitions and aliases while not destroying profile changes made before the failure. The recovery macro, like an initial macro, runs after the data has been read but before it is displayed. However, the macro is run whenever the recovery data set is being edited. You can specify a recovery macro: v By entering the RMACRO primary command:
RMACRO name
where name sets the name of the macro for the edit session. The name operand is used to specify the name of the macro to be run after a data set has been recovered. Note: Recovery macros are only in effect for the duration of a particular Edit session. They must be specified again each time a new member or data set is edited.
4 and 8
106
Each command description in Chapter 11, Edit Macro Commands and Assignment Statements includes a list of return codes that are possible for the command. Because &LASTCC (CLIST) or RC (REXX) is set for every statement, you must either test it in the statement immediately following the command that sets it, or you must save its value in another variable. Use a command such as:
SET &RETCODE = &LASTCC
The variable (&RETCODE or RETCODE) can then be tested anywhere in the macro until it is changed.
2, 4, and 8 Information return codes. They show a special condition that is not necessarily an error. These return codes can be tested or ignored, depending on the requirements of the macro. For some cases of RC=8, the ISPF system variables ZERRSM (short error message text) and ZERRLM (long error message text) are set. For more information on ZERRSM and ZERRLM, see z/OS ISPF Dialog Developers Guide and Reference. 12 and higher Error return codes. Normally an error return code causes the macro to end abnormally and an error panel to appear. The error panel shows the kind of error and lists the statement that caused the error condition. The ISPF system variables ZERRSM (short error message text) and ZERRLM (long error message text) are set for error return codes. For more information on ZERRSM and ZERRLM, see z/OS ISPF Dialog Developers Guide and Reference. Often, the only two possible return codes are 0 and 20. The CAPS command is an example of such a command. Any valid form of CAPS issues a return code of 0.
107
If errors occur, control returns to the macro. On the other hand, to return error handling to the default mode, include the following:
ISPEXEC CONTROL ERRORS CANCEL
If an error occurs, the macro ends. If you want to do both, you can include any number of ISPEXEC CONTROL statements in your macro to turn error handling on and off.
108
Handling Errors
There are two kinds of errors that you may encounter when you debug macros: edit command errors and dialog service errors. Both kinds of errors are controlled by the ISPEXEC CONTROL ERRORS RETURN command. For more information about the CONTROL service, refer to z/OS ISPF Services Guide.
109
/*********************************************************************/ /* */ /* 5647-A01 (C) COPYRIGHT IBM CORP 1995, 2003 */ /* */ /* ISRTDWRI - generates test data */ /* */ /*********************************************************************/ ISREDIT MACRO SET &COUNT = 1 /* Initialize loop counter */ DO WHILE &COUNT <= 9 /* Loop up to 9 times */ ISREDIT FIND TEST-# /* Search for TEST-# */ SET &RETCODE = &LASTCC /* Save the FIND return code */ WRITE RESULT OF FIND, RC = &RETCODE IF &RETCODE = 0 THEN /* If string was found, */ DO /* */ ISREDIT CHANGE # &COUNT /* Change # to a digit and */ SET &COUNT = &COUNT + 1 /* increment loop counter */ WRITE COUNT IS NOW UP TO &COUNT END /* */ ELSE /* If string is not found, */ SET &COUNT = 10 /* Set counter to exit loop */ END EXIT CODE (0)
Remember that the macro ISRTDATA creates test data with variations of the same line by putting ascending numbers 1 through 9 in the data. When WRITE statements are included in the data, a step-by-step breakdown of the procedure appears on your screen. If there are no errors in the ISRTDATA macro, the return codes and count appear on your screen in TSO line mode. Asterisks at the bottom of the screen prompt you to press Enter and return to ISPF full-screen mode (Figure 40 on page 111).
110
RESULT OF FIND, COUNT IS NOW UP RESULT OF FIND, COUNT IS NOW UP RESULT OF FIND, COUNT IS NOW UP RESULT OF FIND, COUNT IS NOW UP RESULT OF FIND, COUNT IS NOW UP RESULT OF FIND, COUNT IS NOW UP RESULT OF FIND, COUNT IS NOW UP RESULT OF FIND, COUNT IS NOW UP RESULT OF FIND, COUNT IS NOW UP ***_
RC TO RC TO RC TO RC TO RC TO RC TO RC TO RC TO RC TO
= 0 2 = 0 3 = 0 4 = 0 5 = 0 6 = 0 7 = 0 8 = 0 9 = 0 10
111
/*********************************************************************/ /* */ /* 5647-A01 (C) COPYRIGHT IBM CORP 1995, 2003 */ /* */ /* ISRTRYIT - a simple macro for trying out edit macro statements. */ /* */ /*********************************************************************/ ISREDIT MACRO (COMMAND) SET &RETCODE = 0 /* Initialize return code */ IF &STR() = &STR(&COMMAND) THEN /* If no command specified */ WRITE MISSING COMMAND PARAMETER /* indicate problem */ ELSE DO /* Else parameter exists; */ ISREDIT &COMMAND /* Invoke edit command, */ SET &RETCODE = &LASTCC /* save the return code */ WRITE &COMMAND RETURN CODE IS &RETCODE /* and display it */ END /* and the command name */ EXIT CODE(&RETCODE)
The ISRTRYIT macro tests both the SEEK and AUTONUM commands (Figure 42). When you run the macro, it displays the return codes from the commands on your screen (Figure 43 on page 113).
File Edit Edit_Settings Menu Utilities Compilers Test Help EDIT SBURNF.PRIVATE.DATA(TESTDATA) - 01.00 Columns 00001 00072 Command ===> isrtryit seek "test"; isrtryit autonum on Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000100 TEST-# 000200 TEST-# 000300 TEST-# 000400 TEST-# 000500 TEST-# 000600 TEST-# 000700 TEST-# 000800 TEST-# 000900 TEST-# 001000 TEST-# 001100 TEST-# 001200 TEST-# 001300 TEST-# ****** **************************** Bottom of Data ****************************
F1=Help F8=Down
F2=Split F9=Swap
F3=Exit F10=Left
F5=Rfind F11=Right
F6=Rchange F12=Cancel
F7=Up
112
ISREDIT SEEK "TEST" RETURN CODE IS 0 ISREDIT AUTONUM ON RETURN CODE IS 0 ***_
REXX example:
Address TSO ISREMSPY
v You can define a breakpoint for ISREDIT in dialog test (option 7.8) and then run the macro under dialog test (option 7.1). When the breakpoint is triggered, you can type TSO ISREMSPY to view the current state of the edit data. This technique can be used to look at edit data during execution of a macro without having to modify the edit macro source and is particularly useful for debugging program macros (macros not written in CLIST or REXX). v You can define ISREMSPY as a program macro using the editor DEFINE command and then use ISREMSPY as an editor command.
113
114
ISRBOX Macro
The ISRBOX macro draws a box with its upper left corner at the cursor position. This macro comes in handy when you want to make a note to yourself or others reading the data. You can start the ISRBOX macro in one of two ways: v Type ISRBOX on the command line as an edit primary command and press Enter. v Type KEYS on the command line, press Enter, set a function key to the ISRBOX macro, and enter the END command. If you have defined a function key for ISRBOX, position the cursor on a data line where you want the box drawn. Press the function key that you have defined to start the ISRBOX macro. After the box is drawn, the cursor is positioned inside, ready for you to type enough text to fill the box. If any of the macro commands fail, a warning message appears.
/*********************************************************************/ /* */ /* 5647-A01 (C) COPYRIGHT IBM CORP 1995, 2003 */ /* */ /* ISRBOX - Draw a box with its upper left corner at the */ /* cursor position */ /* */ /*********************************************************************/ ISREDIT MACRO ISREDIT (ROW,COL) = CURSOR /* Get cursor position */ ISPEXEC CONTROL ERRORS RETURN /* No macro error panel */ /* Draw box over existing */ /* lines */ + + + + + + < < < < < < &COL &COL &COL &COL &COL &COL +--------------------+> | |> | |> | |> | |> +--------------------+>
= = = = = =
IF &MAXCC > 0 THEN DO /* If error occurred while */ SET ZEDSMSG = &STR(INCOMPLETE BOX) /* overlaying lines */ SET ZEDLMSG = &STR(NOT ENOUGH LINES/COLUMNS TO DRAW COMPLETE BOX) ISPEXEC SETMSG MSG(ISRZ001) /* Issue error message */ END SET &COL = &COL + 2 SET &ROW = &ROW + 1 ISREDIT CURSOR = (ROW,COL) EXIT CODE(0) /* Position cursor within */ /* the box */
115
ISRBOX Macro
The following list explains the logical sections of the ISRBOX macro: 1. The variables &ROW and &COL are set to the cursor position.
ISREDIT (ROW,COL) = CURSOR
2. The dialog service allows the macro to handle severe errors, allowing a message to be displayed when the cursor is placed too close to the end of the data. The LINE assignment statement fails if the row it is setting does not exist.
ISREDIT CONTROL ERRORS RETURN
3. The LINE assignment statements overlay existing data on a line with the characters which form a box. LINE uses a merge format to include the existing line data and then a template to put the overlaying data at the cursor column position. The CLIST &EVAL function increments the relative line numbers before the statement is passed to the editor.
ISREDIT ISREDIT ISREDIT ISREDIT ISREDIT ISREDIT LINE LINE LINE LINE LINE LINE &ROW &EVAL(&ROW+1) &EVAL(&ROW+2) &EVAL(&ROW+3) &EVAL(&ROW+4) &EVAL(&ROW+5) = = = = = = LINE LINE LINE LINE LINE LINE + + + + + + < < < < < < &COL &COL &COL &COL &COL &COL +----------------+> | |> | |> | |> | |> +----------------+>
4. The CLIST IF statement checks the &MAXCC variable, and if it is nonzero, calls the dialog service SETMSG to display a message. &MAXCC is a variable updated by the CLIST processor to contain the highest condition code.
IF &MAXCC > 0 THEN
5. The message used in SETMSG is one of two messages (ISRZ000 and ISRZ001) reserved for macro use. Each message uses two variables: v &ZEDSMSG to set the text for the short message (up to 24 characters) that is displayed when the macro ends. v &ZEDLMSG to set the text for the long message that appears when the HELP command is entered. Message ISRZ001 sounds the alarm to indicate an error; message ISRZ000 does not sound the alarm.
DO SET ZEDSMSG = &STR(INCOMPLETE BOX) SET ZEDLMSG = &STR(NOT ENOUGH LINES/COLUMNS + TO DRAW COMPLETE BOX) ISPEXEC SETMSG MSG(ISRZ001) END
6. These statements position the cursor within the box to simplify entering text when the panel is redisplayed.
SET &COL = &COL + 2 SET &ROW = &ROW + 1 ISREDIT CURSOR = (ROW,COL)
The example in Figure 45 shows the cursor placed on line 000009 next to the number 9 before starting the macro.
116
ISRBOX Macro
File Edit Edit_Settings Menu Utilities Compilers Test Help EDIT SBURNF.PRIVATE.DATA(TESTDATA) - 01.00 Columns 00001 00072 Command ===> isrbox Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000100 TEST-1 000200 TEST-2 000300 TEST-3 000400 TEST-4 000500 TEST-5 000600 TEST-6 000700 TEST-7 000800 TEST-8 000900 TEST-9_ 001000 TEST-# 001100 TEST-# 001200 TEST-# 001300 TEST-# 001400 TEST-# 001500 TEST-# ****** **************************** Bottom of Data **************************** F1=Help F8=Down F2=Split F9=Swap F3=Exit F10=Left F5=Rfind F11=Right F6=Rchange F12=Cancel F7=Up
When you press Enter, a box appears beside the cursor, as shown in Figure 46.
File Edit Edit_Settings Menu Utilities Compilers Test Help EDIT SBURNF.PRIVATE.DATA(TESTDATA) - 01.00 Columns 00001 00072 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000100 TEST-1 000200 TEST-2 000300 TEST-3 000400 TEST-4 000500 TEST-5 000600 TEST-6 000700 TEST-7 000800 TEST-8 000900 TEST-9+--------------------+ 001000 TEST-#| _ | 001100 TEST-#| | 001200 TEST-#| | 001300 TEST-#| | 001400 TEST-#+--------------------+ 001500 TEST-# ****** **************************** Bottom of Data **************************** F1=Help F8=Down F2=Split F9=Swap F3=Exit F10=Left F5=Rfind F11=Right F6=Rchange F12=Cancel F7=Up
ISRIMBED Macro
The ISRIMBED macro (Figure 47) builds a list of imbed (.im) statements found in the member that is entered as an operand. The list is created at the end of the member currently being edited. The imbed statements are indented under a MEMBER identifier line. You can start this macro by editing a member, typing ISRIMBED and the name of the member that contains the imbed statements as the operand, and pressing Enter.
117
ISRIMBED Macro
/*********************************************************************/ /* */ /* 5647-A01 (C) COPYRIGHT IBM CORP 1995, 2003 */ /* */ /* ISRIMBED - creates a list of imbed statements. */ /* */ /*********************************************************************/ ISREDIT MACRO (MEMBER) /* Member name passed */ /* as input */ ISREDIT LINE_AFTER .ZL=MEMBER &MEMBER /* Add member ID line */ ISREDIT (LINENBR) = LINENUM .ZL /* Get line number */ ISREDIT COPY AFTER .ZL &MEMBER ISREDIT (NEWLL) = LINENUM .ZL /* Copy member at end /* Get new last line# */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */
IF &LINENBR = &NEWLL THEN /* If no data was EXIT CODE(8) /* copied, then exit ELSE DO ISREDIT LABEL &EVAL(&LINENBR + 1) = .FIRST /* Label first /* line copied ISREDIT RESET EXCLUDED /* Make sure there are /* no previously /* excluded lines ISREDIT EXCLUDE ALL .FIRST .ZL ISREDIT FIND ALL .IM 1 .FIRST .ZL SET FINDRC = &LASTCC ISREDIT DELETE ALL X .FIRST .ZL ISREDIT (NEWLL) = LINENUM .ZL IF &FINDRC = 0 THEN DO WHILE (&LINENBR < &NEWLL) SET LINENBR = &LINENBR + 1 ISREDIT SHIFT &LINENBR ) 8 END END EXIT CODE(1) /* /* /* /* /* /* /* /* /* /* /* /* /* /* Exclude newly copied lines Show lines containing ".im" in column 1 Delete any lines still excluded Update last line number after delete If ".im" was found for all remaining copied lines Shift all .im lines right 8
The following list explains the logical sections of the ISRIMBED macro: 1. Add a line that identifies the member to be searched at the end of ISRIMBED. The .ZL (or .ZLAST) is always associated with the last line in the data.
ISREDIT LINE_AFTER .ZL = MEMBER &MEMBER
2. Retrieve the line number of the identifier line just added into &LINENBR.
ISREDIT (LINENBR) = LINENUM .ZL
3. Now copy, at the end of ISRIMBED, the member name that was passed as an input parameter.
ISREDIT COPY AFTER .ZL &MEMBER
5. Check to see if any lines were added by the copy. Exit from the macro if no lines were added.
118
ISRIMBED Macro
IF &LINENBR = &NEWLL THEN EXIT CODE(8)
6. Set the .FIRST label on the first line copied. This label is available only to this macro; you do not see it.
ISREDIT LABEL &EVAL(&LINENBR + 1) = .FIRST
7. Excluded lines are deleted later. Therefore, make sure that no lines in the data set are excluded.
ISREDIT RESET EXCLUDED
8. Exclude all lines that were just copied: all the lines in the range .FIRST to .ZL.
ISREDIT EXCLUDE ALL .FIRST .ZL
9. The FIND command is used to find all occurrences of .im starting in column 1 of the copied lines. This shows (unexcludes) the lines to keep. If .im was not found on any line, &FINDRC will be 4.
ISREDIT FIND ALL .IM 1 .FIRST .ZL SET FINDRC = &LASTCC
11. Obtain the last line number again, because it will have changed if lines were deleted.
ISREDIT (NEWLL) = LINENUM .ZL
12. If .im lines were found, loop using a column shift to indent them under the member identifier line. Note that &LINENBR is still associated with the identifier line.
IF &FINDRC = 0 THEN DO WHILE (&LINENBR < &NEWLL) SET LINENBR = &LINENBR + 1 ISREDIT SHIFT &LINENBR ) 8 END
119
ISRIMBED Macro
When you run the ISRIMBED macro by typing ISRIMBED LIST on the command line of ISRTDATA, a list of the imbeds in LIST appears at the end of the data. See Figure 49.
ISRMBRS Macro
The ISRMBRS macro (Figure 50 on page 121) uses PDF library access services to determine each member name in the library being edited. This macro invokes the edit service for each member in the library, except the member currently being edited, passing a user-specified edit macro on the edit service invocation. The ISRMBRS macname command, where macname is the name of the macro to be invoked against each member, starts the service. This macro can aid in making repetitive changes to all members of a data set, or in searching all members for a specific string of data.
120
ISRMBRS Macro
/*REXX****************************************************************/ /* ISPF edit macro to process all members of partitioned data set, */ /* running a second, user-specified, ISPF edit macro against each */ /* member. */ /* */ /* To run: */ /* Enter "ISRMBRS macname" on the command line, where macname is */ /* the macro you want run against each member. */ /*********************************************************************/ ISREDIT MACRO (NESTMAC) /*********************************************************************/ /* Get dataid for data set and issue LMOPEN */ /*********************************************************************/ ISREDIT (DATA1) = DATAID ISREDIT (CURMEM) = MEMBER Address ispexec LMOPEN DATAID(data1) OPTION(INPUT) member = lmrc = 0 /*********************************************************************/ /* Loop through all members in the PDS, issuing the EDIT service for */ /* each. The macro specified on the ALLMEMS invocation is passed as */ /* an initial macro on the EDIT service call. */ /*********************************************************************/ Do While lmrc = 0 Address ispexec LMMLIST DATAID(data1) OPTION(LIST), MEMBER(MEMBER) STATS(NO) lmrc = rc If lmrc = 0 & member ^= curmem Then do Say Processing member member Address ispexec EDIT DATAID(data1) MEMBER(member) MACRO(nestmac) end End /*********************************************************************/ /* Free the member list and close the dataid for the PDS. */ /*********************************************************************/ Address ispexec LMMLIST DATAID(data1) OPTION(FREE) Address ispexec LMCLOSE DATAID(data1) Exit 0
To start the ISRMBRS macro, edit a new or existing member and enter ISRMBRS macname, where macname is the name of the macro you wish to invoke against each member of the data set. For example, if the macro is named ISRIMBED, enter: ISRMBRS ISRIMBED The following list explains the logical sections of the ISRMBRS macro: 1. The MACRO command identifies NESTMAC as the variable to contain the name of the macro that is passed on the edit service invocation for each member. If no parameter is passed to ISRMBRS, NESTMAC is blank.
ISREDIT MACRO (NESTMAC)
2. The DATAID assignment statement returns a data ID in the variable DATA1. The data ID identifies the concatenation of data sets currently being edited.
ISREDIT (DATA1) = DATAID
Chapter 8. Sample Edit Macros
121
ISRMBRS Macro
3. The name of the member currently being edited is returned in CURMEM.
ISREDIT (MEMBER) = CURMEM
4. The data set (or sets) identified by the data ID obtained earlier is opened for input to allow the LMMLIST service to be called later. No return code checking is done because it is presumed that if the data set is being edited, it can be successfully processed by LMOPEN.
Address ispexec LMOPEN DATAID(data1) OPTION(INPUT)
5. The variable to hold the name of the next member to be processed, and the return code from the LMMLIST service are initialized.
member = lmrc = 0
6. The exec loops to process all members returned by LMMLIST. Variable LMRC is set to 4 when the end of the member list is reached, stopping the loop.
Do While lmrc = 0
7. Obtain the next member in the list. If this is the first invocation of LMMLIST, the first member in the list is returned. The member name is returned in variable MEMBER, and variable LMRC is set to the return code from LMMLIST.
Address ispexec LMMLIST DATAID(data1) OPTION(LIST), MEMBER(MEMBER) STATS(NO) lmrc = rc
8. If LMMLIST returns a 0, indicating a member name was returned, and if the member returned is not the member currently being edited, the member is processed.
If lmrc = 0 Then do
9. The REXX SAY statement is used to write line-I/O messages. As the macro processes each member, the member name appears on the terminal to keep you informed about what is happening. An alternative to the SAY statement would be to display a panel showing the member name after issuing the ISPEXEC CONTROL DISPLAY LOCK service.
Say Processing member member
10. The EDIT service is invoked on the member returned by LMMLIST. The macro specified on invocation of ISRMBRS is passed as an initial macro on the edit service.
Address ispexec EDIT DATAID(data1) MEMBER(member) MACRO(nestmac)
11. When the LMMLIST service returns a nonzero value, the loop is exited and the cleanup begins. LMMLIST is called to free the member list, and the LMCLOSE service is called to close the data sets associated with the data ID.
Address ispexec LMMLIST DATAID(data1) OPTION(FREE) Address ispexec LMCLOSE DATAID(data1)
ISRCHGS Macro
The ISRCHGS macro (Figure 51 on page 123) identifies the lines most recently changed by showing only those lines and excluding all others. When no level is passed, the latest level is assumed. A label range can also be passed to ISRCHGS to limit the search. This macro relies on the modification level maintained by the editor for members with numbers and ISPF statistics. Operands can also be specified. For example, to show lines with level 8 or greater on a line range:
122
ISRCHGS Macro
Command ===> ISRCHGS 8 .FIRST .LAST
/*********************************************************************/ /* */ /* 5647-A01 (C) COPYRIGHT IBM CORP 1995, 2003 */ /* */ /* ISRCHGS - shows the most recent changes to a data set */ /* */ /*********************************************************************/ ISREDIT MACRO (SEARCH,PARMS) ISREDIT (SAVE) = USER_STATE ISREDIT (NUMBER, NUMTYPE) = NUMBER SET SYSDVAL = &NUMTYPE READDVAL STD COBOL DISPLAY ISREDIT (STATS) = STATS ISREDIT (LEVEL) = LEVEL IF &SEARCH = &STR() | &SUBSTR(1:1,&STR(&SEARCH. )) = &STR(.) THEN DO SET PARMS = &STR(&SEARCH &PARMS) SET SEARCH = &LEVEL END IF &STATS = OFF | &NUMBER = OFF | &STD = NOSTD THEN DO SET ZEDSMSG = &STR(INVALID DATA) SET ZEDLMSG = &STR(BOTH NUMBER AND STATS MODE MUST BE ON) ISPEXEC SETMSG MSG(ISRZ001) EXIT CODE(8) END IF &DATATYPE(&SEARCH) = CHAR THEN DO SET ZEDSMSG = &STR(INVALID ARG) SET ZEDLMSG = &STR(SEARCH STRING MUST BE FIRST) ISPEXEC SETMSG MSG(ISRZ001) EXIT CODE(8) END ISREDIT NUMBER = OFF ISREDIT (RECFM) = RECFM IF &RECFM = F THEN DO ISREDIT (LRECL) = LRECL SET COL1 = &LRECL - 1 SET COL2 = &LRECL END ELSE DO SET COL1 = 7 SET COL2 = 8 END ISREDIT EXCLUDE ALL DO WHILE &SEARCH <= &LEVEL ISREDIT FIND ALL &SEARCH &COL1 &COL2 &PARMS SET SEARCH = &SEARCH + 1 END ISREDIT NUMBER = ON ISREDIT USER_STATE = (SAVE) EXIT CODE(1)
00010003 00020003 00030003 00040003 00050003 00060003 00070003 00080003 00090003 00100003 00110003 00120003 00130003 00140003 00150003 00160003 00170008 00180003 00190003 00200003 00210003 00220003 00230003 00240003 00250003 00260003 00270003 00280003 00290003 00300003 00310003 00320003 00330003 00340003 00350003 00360007 00370003 00380003 00390003 00400003 00410003 00420003 00430003 00440003 00450003 00460003 00470003 00480003 00490003 00500003 00510003 00520005 00530003 00530107 00531007 00550003 00560003
The following list explains the logical sections of the ISRCHGS macro:
Chapter 8. Sample Edit Macros
123
ISRCHGS Macro
1. ISRCHGS allows three optional parameters to be passed: a search level and two labels (a label range). If all three are passed, PARMS contains two labels.
ISREDIT MACRO (SEARCH,PARMS)
2. The following statements save user information, number mode and type, last find string, cursor location, and other profile and status information. Also, stats mode and the current modification level for parameter checking are retrieved, and the three-part number type is divided into three variables.
ISREDIT (SAVE) = USER_STATE ISREDIT (NUMBER, NUMTYPE) = NUMBER SET SYSDVAL = &NUMTYPE READDVAL STD COBOL DISPLAY ISREDIT (STATS) = STATS ISREDIT (LEVEL) = LEVEL
3. ISRCHGS requires that the modification level be entered first if it is specified. This check allows the level to default to the current (highest) modification level. A label range can be specified without a level number; PARMS is reset to capture both labels.
IF &SEARCH = &STR() | &SUBSTR(1:1,&SEARCH) = &STR(;) THEN DO SET PARMS = &STR(&SEARCH &PARMS) SET SEARCH = &LEVEL END
4. Check to see if the member modification level is maintained. If not, issue an error message and exit the macro.
IF &STATS = OFF | &NUMBER = OFF | &STD = NOSTD THEN DO SET ZEDSMSG = &STR(INVALID DATA) SET ZEDLMSG = &STR(BOTH NUMBER AND STATS MODE MUST BE ON) ISPEXEC SETMSG MSG(ISRZ001) EXIT CODE(8) END
5. A CLIST DATATYPE function is used to check if the first parameter is valid (a number). If it is not valid, issue an error message and exit from the macro.
IF &DATATYPE(&SEARCH) = CHAR THEN DO SET ZEDSMSG = &STR(INVALID ARG) SET ZEDLMSG = &STR(SEARCH STRING MUST BE FIRST) ISPEXEC SETMSG MSG(ISRZ001) EXIT CODE(8) END
6. Now that validity checks have been passed you can set number mode off. This allows you to treat the number field, which contains the level number, as data.
ISREDIT NUMBER = OFF
7. Set &COL1 and &COL2 to the columns containing the level numbers.
ISREDIT (RECFM) = RECFM IF &RECFM = F THEN DO ISREDIT (LRECL) = LRECL SET COL1 = &LRECL - 1 SET COL2 = &LRECL END ELSE DO SET COL1 = 7 SET COL2 = 8 END
124
ISRCHGS Macro
9. For each level, find all occurrences of the current modification level. If a label range was specified, it is in the PARMS variable. All lines with matching levels are excluded.
DO WHILE &SEARCH <= &LEVEL ISREDIT FIND ALL &SEARCH &COL1 &COL2 &PARMS SEARCH = &SEARCH + 1 END
In the example in Figure 52 the data contains lines that you have changed.
When you press Enter, the FINDGHGS macro displays the changed lines and excludes the others, as shown in Figure 53 on page 126.
125
ISRMASK Macro
ISRMASK Macro
The ISRMASK macro (Figure 54 on page 127) allows data in the mask line to overlay lines. It can be used to place a comment area over existing lines in a member. Before starting this macro, you must specify two things: a mask line and the range of lines it overlays. See MASKLINESet or Query the Mask Line on page 352 for information on creating mask lines. Specify the range of lines by using either an OO or $$ line command. You can use O, OO, On, or $, $$, $n, where n is the number of lines. An O line command specifies that mask line data overlays only blanks in the line data. A $ line command specifies that nonblank mask line data overlays the line data. Once the mask line and range of lines have been specified, type ISRMASK on the command line and press Enter.
126
ISRMASK Macro
/*********************************************************************/ /* */ /* 5647-A01 (C) COPYRIGHT IBM CORP 1995, 2003 */ /* */ /* ISRMASK - Overlay a line with data from the mask line. */ /* Use either line command 0 or $ to indicate */ /* which line to overlay. 0 causes nondestructive */ /* overlay, and $ causes a destructive overlay. */ /* */ /*********************************************************************/ ISREDIT MACRO NOPROCESS /* Wait to process */ ISREDIT PROCESS RANGE O $ /* "O" and "$" reserved */ IF &LASTCC = 0 THEN /* for macro */ + DO /* If specified, get */ ISREDIT (CMD) = RANGE_CMD /* command entered and */ ISREDIT (FIRST) = LINENUM .ZFRANGE /* line number range */ ISREDIT (LAST) = LINENUM .ZLRANGE DO WHILE &FIRST LE &LAST /* Loop to merge data */ /* based on which line */ /* command was entered.*/ IF &CMD = $ THEN /* If $ overlay data */ + ISREDIT LINE &FIRST = (LINE) + MASKLINE ELSE /* - else */ + ISREDIT LINE &FIRST = MASKLINE + (LINE) /* do not overlay */ SET FIRST = &FIRST + 1 /* Increment line num */ END SET RC = 0 END ELSE /* Set prompt messages */ + DO SET ZEDSMSG = &STR(ENTER "O"/"$" LINE CMD) SET ZEDLMSG = &STR("ISRMASK" REQUIRES AN "O" OR + "$" CMD TO INDICATE LINE(S) MERGED WITH MASKLINE) ISPEXEC SETMSG MSG(ISRZ001) SET RC = 12 /* Set return code to 12 */ END /* to keep command in */ EXIT CODE(&RC) /* command area */
The following list explains the logical sections of the ISRMASK macro: 1. The NOPROCESS keyword on the MACRO command allows the macro to control when user input (changes to data and line commands) is processed.
ISREDIT MACRO NOPROCESS
2. Now process user input and check if certain line commands are entered. The O and $ following the RANGE keyword specify the line commands to be processed by this macro.
ISREDIT PROCESS RANGE O $
3. A zero return code shows that you entered an O or $ in any of its valid forms: OO-OO, On, and so forth.
IF &LASTCC = 0 THEN
5. &LINE1 and &LINE2 contain the first and last line numbers of the lines specified by the user line commands.
ISREDIT (FIRST) = LINENUM .ZFRANGE ISREDIT (LAST) = LINENUM .ZLRANGE DO WHILE &FIRST LE &LAST
Chapter 8. Sample Edit Macros
127
ISRMASK Macro
6. Each line that you specify is merged with data from the mask line. Note the use of the LINE keyphrase on both sides of the assignment. The line command entered controls how the data is merged. An O specifies that the mask line data only overlays where the line contains blanks. A $ specifies that nonblank mask line data overlays line data.
IF &CMD = $ THEN ISREDIT LINE &FIRST = (LINE) + MASKLINE ELSE ISREDIT LINE &FIRST = MASKLINE + (LINE)
7. When no line command is entered, issue a prompt message. Set a return code of 12 to keep ISRMASK displayed on the command line.
SET ZEDSMSG = &STR(ENTER "O"/"$" LINE CMD) SET ZEDLMSG = &STR("ISRMASK" REQUIRES AN "O" OR + "$" CMD TO INDICATE LINE(S) MERGED WITH MASKLINE) ISPEXEC SETMSG MSG(ISRZ001) SET RC = 12
In the example shown in Figure 55, the mask line is specified and the range of lines is set with the destructive $$ line command.
When you press Enter, the macro overlays the mask line onto the specified range of lines, as shown in Figure 56 on page 129.
128
ISRMASK Macro
129
ISRMASK Macro
130
HILITEEnhanced Edit Coloring . . . . . . IMACROSpecify an Initial Macro . . . . . . LEVELSpecify the Modification Level Number LOCATELocate a Line. . . . . . . . . . MODELCopy a Model into the Current Data Set MOVEMove Data . . . . . . . . . . . NONUMBERTurn Off Number Mode . . . . NOTESDisplay Model Notes . . . . . . . NULLSControl Null Spaces . . . . . . . . NUMBERGenerate Sequence Numbers . . . . PACKCompress Data . . . . . . . . . . PASTEMove or Copy Lines from Clipboard . . PRESERVEEnable Saving of Trailing Blanks . . PROFILEControl and Display Your Profile . . . RCHANGERepeat a Change . . . . . . . RECOVERYControl Edit Recovery. . . . . . RENUMRenumber Data Set Lines . . . . . . REPLACEReplace Data . . . . . . . . . RESETReset the Data Display . . . . . . . RFINDRepeat Find . . . . . . . . . . . RMACROSpecify a Recovery Macro . . . . . SAVESave the Current Data . . . . . . . . SETUNDOSet the UNDO Mode . . . . . . SORTSort Data . . . . . . . . . . . . STATSGenerate Library Statistics . . . . . . SUBMITSubmit Data for Batch Processing . . . TABSDefine Tabs . . . . . . . . . . . UNDOReverse Last Edit Interaction . . . . . UNNUMBERRemove Sequence Numbers . . . VERSIONControl the Version Number . . . . VIEWView from within an Edit Session . . . .
236 240 240 242 243 247 250 251 252 253 254 255 256 256 259 260 261 263 267 269 269 270 271 272 274 275 276 278 280 282 283
Chapter 11. Edit Macro Commands and Assignment Statements . . . . . . . . . 285 Edit Macro Command Summary . . . . . . . 285 AUTOLISTSet or Query Autolist Mode . . . . 290 AUTONUMSet or Query Autonum Mode . . . 291 AUTOSAVESet or Query Autosave Mode . . . 292 BLKSIZEQuery the Block Size . . . . . . . 294 BOUNDSSet or Query the Edit Boundaries . . . 294 BROWSEBrowse from within an Edit Session 296 BUILTINProcess a Built-In Command . . . . 297 CANCELCancel Edit Changes . . . . . . . 297 CAPSSet or Query Caps Mode . . . . . . . 298 CHANGEChange a Search String . . . . . . 299 CHANGE_COUNTSQuery Change Counts . . . 302 COMPAREEdit Compare . . . . . . . . . 303 COPYCopy Data . . . . . . . . . . . 306 CREATECreate a Data Set or a Data Set Member 307 CURSORSet or Query the Cursor Position . . . 308 CUTCut and Save Lines . . . . . . . . . 310 DATA_CHANGEDQuery the Data Changed Status . . . . . . . . . . . . . . . . 311 DATA_WIDTHQuery Data Width . . . . . . 312 DATAIDQuery Data ID . . . . . . . . . 313
131
DATASETQuery the Current and Original Data Set Names . . . . . . . . . . . . . . DEFINEDefine a Name . . . . . . . . . DELETEDelete Lines . . . . . . . . . . DISPLAY_COLSQuery Display Columns . . . DISPLAY_LINESQuery Display Lines . . . . DOWNScroll Down . . . . . . . . . . EDITEdit from within an Edit Session . . . . ENDEnd the Edit Session . . . . . . . . EXCLUDEExclude Lines from the Display . . . EXCLUDE_COUNTSQuery Exclude Counts . . FINDFind a Search String . . . . . . . . FIND_COUNTSQuery Find Counts . . . . . FLIPReverse Exclude Status of Lines . . . . . FLOW_COUNTSQuery Flow Counts . . . . . HEXSet or Query Hexadecimal Mode . . . . HIDEHide Excluded Lines Message . . . . . HILITEEnhanced Edit Coloring . . . . . . IMACROSet or Query an Initial Macro . . . . INSERTPrepare Display for Data Insertion . . . LABELSet or Query a Line Label . . . . . . LEFTScroll Left . . . . . . . . . . . . LEVELSet or Query the Modification Level Number . . . . . . . . . . . . . . . LINESet or Query a Line from the Data Set . . LINE_AFTERAdd a Line to the Current Data Set LINE_BEFOREAdd a Line to the Current Data Set . . . . . . . . . . . . . . . . . LINE_STATUSQuery Source and Change Information for a Line in a Data Set . . . . . . LINENUMQuery the Line Number of a Labeled Line . . . . . . . . . . . . . . . . LOCATELocate a Line. . . . . . . . . . LRECLQuery the Logical Record Length . . . MACROIdentify an Edit Macro . . . . . . MACRO_LEVELQuery the Macro Nesting Level MASKLINESet or Query the Mask Line . . . . MEMBERQuery the Current Member Name . . MENDEnd a Macro in the Batch Environment MODELCopy a Model into the Current Data Set MOVE Move a Data Set or a Data Set Member NONUMBERTurn Off Number Mode . . . . NOTESSet or Query Note Mode . . . . . . NULLSSet or Query Nulls Mode . . . . . . NUMBERSet or Query Number Mode . . . . PACKSet or Query Pack Mode . . . . . . . PASTEMove or Copy Lines from Clipboard . . PRESERVEEnable Saving of Trailing Blanks . . PROCESSProcess Line Commands . . . . . PROFILESet or Query the Current Profile . . . RANGE_CMDQuery a Command That You Entered . . . . . . . . . . . . . . . RCHANGERepeat a Change . . . . . . . RECFMQuery the Record Format . . . . . . RECOVERYSet or Query Recovery Mode . . . RENUMRenumber Data Set Lines . . . . . . REPLACEReplace a Data Set or Data Set Member . . . . . . . . . . . . . . . RESETReset the Data Display . . . . . . . RFINDRepeat Find . . . . . . . . . . . RIGHTScroll Right . . . . . . . . . . .
314 315 316 318 319 319 321 321 322 325 325 328 328 329 330 331 332 335 336 337 338 339 340 342 343 345 346 347 349 350 351 352 353 353 353 355 356 357 358 359 362 363 364 365 367 369 369 370 371 373 374 375 376 377
RMACROSet or Query the Recovery Macro . SAVESave the Current Data . . . . . . . SAVE_LENGTHSet or Query Length for Variable-Length Data . . . . . . . . . . SCANSet Command Scan Mode . . . . . SEEKSeek a Data String, Positioning the Cursor SEEK_COUNTSQuery Seek Counts . . . . SESSIONQuery Session Type . . . . . . SETUNDOSet UNDO Mode . . . . . . . SHIFT (Shift Columns Left . . . . . . . SHIFT )Shift Columns Right . . . . . . . SHIFT <Shift Data Left . . . . . . . . SHIFT >Shift Data Right . . . . . . . . SORTSort Data . . . . . . . . . . . STATSSet or Query Stats Mode . . . . . . SUBMITSubmit Data for Batch Processing . . TABSSet or Query Tabs Mode . . . . . . TABSLINESet or Query Tabs Line . . . . . TENTERSet Up Panel for Text Entry . . . . TFLOWText Flow a Paragraph . . . . . . TSPLITText Split a Line . . . . . . . . UNNUMBERRemove Sequence Numbers . . UPScroll Up . . . . . . . . . . . . USER_STATESave or Restore User State . . . VERSIONSet or Query Version Number . . . VIEWView from within an Edit Session . . . VOLUMEQuery Volume Information . . . . XSTATUSSet or Query Exclude Status of a Line
. 378 . 379 . 380 . 381 382 . 384 . 385 . 385 . 387 . 387 . 388 . 389 . 390 . 392 . 393 . 394 . 396 . 397 . 398 . 399 . 400 . 400 . 402 . 403 . 404 . 404 405
132
Example
In such cases, the ISPF editor assumes that you have not typed a number following the line command. If you want to repeat the line three times, you can use any of the following procedures: Leave the cursor on the character that immediately follows the R3:
R31700
Type one or more blanks following the R but before the number, leaving the cursor on the character that immediately follows the 3:
R 3700
Type R3 and press the Erase EOF key to clear the rest of the line command field, or press the Erase EOF key and then type R3
Copyright IBM Corp. 1984, 2006
133
TE, TEn Type one or n text lines ahead of the data. v You can type the following line command on the BOTTOM OF DATA line by typing over the asterisks: B, Bn Move or copy a line or lines one or n times following the data.
134
O OO R RR S TABS TE TF TS UC UCC X XX
169 169 171 171 174 176 177 181 183 185 185 186 186
Syntax
2 ( n
2 (( n
A number that tells the ISPF editor how many positions to shift. If you omit this operand, the default is 2.
Chapter 9. Edit Line Commands
135
Description
To column shift one line toward the left side of your display: 1. Type ( in the line command field of the line to be shifted. Beside the command, type a number other than 2 if you want to shift the line other than 2 columns. 2. Press Enter. To column shift a block of lines toward the left side of your display: 1. Type (( in the line command field of the first line to be shifted. Beside the command, type a number other than 2 if you want to shift the block of lines other than 2 columns. 2. Type (( in the line command field of the last line to be shifted. You can scroll (or use FIND or LOCATE) between typing the first (( and the second ((, if necessary. 3. Press Enter. The lines that contain the two (( commands and all of the lines between them are column shifted to the left. The BOUNDS setting limits column shifting. If you shift columns beyond the current BOUNDS setting, the editor deletes the text beyond the BOUNDS without displaying a warning message.
Examples
To shift a group of lines to the left three column positions, specify the number of columns and the range in the line command field, as shown in Figure 57.
Press Enter and the editor shifts the specified lines three columns to the right. See Figure 58 on page 137.
136
Syntax
2 ) n
2 )) n
A number that tells the ISPF editor how many positions to shift. If you omit this operand, the default is 2.
Description
To column shift one line toward the right side of your display: 1. Type ) in the line command field of the line to be shifted. Beside the command, type a number other than 2 if you want to shift the data other than 2 columns. 2. Press Enter.
137
Examples
To shift a group of lines to the right 3 column positions, specify the number of columns and the range in the line command field, as shown in Figure 59. Figure 60 on page 139 shows that when you press Enter, the editor shifts the
138
Syntax
2 < n
2 << n
A number that tells the ISPF editor how many positions to shift. If you omit this operand, the default is 2.
Description
To data shift one line toward the left side of your display: 1. Type < in the line command field of the line to be shifted. Beside the command, type a number other than 2 if you want to shift the data other than 2 columns. 2. Press Enter.
139
Examples
To use a data shift to delete 5 blanks before a segment of three lines, specify the shift and the range in the line command field, as shown in Figure 61.
Figure 61. Before the < (Data Shift Left) Line Command
When you press Enter, the editor deletes 5 blanks on the specified lines. Notice that the editor does not shift data within the BOUNDS setting, as shown in Figure 62 on page 141.
140
Figure 62. After the < (Data Shift Left) Line Command
Syntax
2 > n
2 >> n
A number that tells the ISPF editor how many positions to shift. If you omit this operand, the default is 2.
Description
To data shift one line toward the right side of your display: 1. Type > in the line command field of the line to be shifted. Beside the command, type a number other than 2 if you want to shift the line other than 2 columns. 2. Press Enter.
141
Examples
To use a data shift to insert 5 blanks before a segment of three lines, specify the shift and the range in the line command field, as shown in Figure 63.
Figure 63. Before the > (Data Shift Right) Line Command
When you press Enter, the editor inserts 5 blanks on the specified lines. See Figure 64 on page 143. Notice that the editor does not shift the data within the BOUNDS setting.
142
Figure 64. After the > (Data Shift Right) Line Command
Syntax
A n
A number that tells the ISPF editor to repeat the associated line command a specified number of times. If you do not type a number, or if the number you type is 1, the editor performs the command only once. The number does not affect associated primary commands.
Description
To specify that data is to be moved, copied, or inserted after a specific line: 1. Type one of the commands that are listed in the following table. Line commands are typed in the line command field. Primary commands are typed on the command line.
Line Commands C M See page... 149 162 Primary Commands COPY MODEL MOVE See page... 207 243 247
143
Examples
Figure 65 shows how you can move data with the M and A line commands. Type M in the line command field of the line you want to move. Type A in the line command field of the line that you want the moved line to follow.
When you press Enter, the line where you typed the M command is moved after the line where you typed the A command. See Figure 66.
144
Syntax
B n
A number that tells the ISPF editor to repeat the associated line command a specified number of times. If you do not type a number, or if the number you type is 1, the command is not repeated. For associated primary commands, this number has no effect.
Description
To specify that data is to be moved, copied, or inserted before a specific line: 1. Type one of the commands that are listed in the following table. Line commands are typed in the line command field. Primary commands are typed on the command line.
Line Commands C See page... 149 Primary Commands COPY See page... 207
Chapter 9. Edit Line Commands
145
2. Type B in the line command field of the line that the moved, copied, or inserted data is to precede. If you are specifying the destination for a line command, a number after the B line command to specifies the number of times that the other line command is performed. However, a number that you type after the B command has no effect on a primary command. 3. Press Enter. 4. Some of the commands in the preceding table can cause another panel to be displayed if more information is needed. If so, fill in the required information and press Enter to move, copy, or insert the data. See the information about the specified command if you need help. If no panel is displayed, the data is moved, copied, or inserted when you press Enter in step 3. You must always specify a destination except when you are using a primary command to move, copy, or insert data into a member or data set that is empty. Two other line commands that are used to specify a destination are the A (after) command and the O (overlay) command. See ASpecify an After Destination on page 143 and OOverlay Lines on page 169 for more information.
Examples
Figure 67 shows how you can copy data with the C and B line commands. Type C in the line command field of the line you want to copy. Type B in the line command field of the line that the copied line precedes.
146
Syntax
BOUNDS BOUND BNDS BND BOU
Description
The BOUNDS line command provides an alternative to setting the boundaries with the BOUNDS primary command or macro command; the effect on the member or data set is the same. However, if you use both the BOUNDS primary command and the BOUNDS line command in the same interaction, the line command overrides the primary command. To display the boundary definition (=BNDS>) line: 1. Type BOUNDS in the line command field of any line that is not flagged.
Chapter 9. Edit Line Commands
147
To remove the boundary definition line from the panel, you can either type D in the line command field that contains the =BNDS> flag or type one of the following on the command line: v RESET (to reset all flagged lines), or v RESET SPECIAL (to reset only the special lines) The column numbers are always data column numbers (see Referring to Column Positions on page 102). Thus, for a variable format data set with number mode on, data column 1 is column 9 in the record. See Edit boundaries on page 23 for more information, including tables that show commands affected by BOUNDS settings and default bounds settings for various types of data sets.
Examples
Figure 69 shows the boundary definition line displayed with the column identification line. Type BOUNDS in the line command field.
148
Figure 70 shows that when you press Enter, the editor inserts the BOUNDS line and sets the left bound at column 43 and the right bound at column 69.
Session A - [24x80]
File Edit Transfer Appearance Communication Assist Window Help
File Edit Edit_Settings Menu EDIT ****** 000100 000200 000300 =COLS> =BNDS 000400 000500 000600 000700 000800 000900 001000 001100 001200 ******
P020136.PRIVATE.PLS(INTO) - 01.00 Columns 00001 00072 ***************************** Top of Data ****************************** /* REXX */ ARG FIRST LAST /* SET ARGUMENTS */ IF FIRST > LAST /* IF FIRST IS GREATER */ ----+----1----+----2----+----3----+----4----+----5----+----6----+----7-< > THEN /* THAN LAST, */ DO /* AND */ IF TEMP = FIRST /* IF TEMP IS EQUAL */ THEN /* TO FIRST, THEN */ FIRST = LAST /* SET FIRST EQUAL */ ELSE /* TO LAST, OTHERWISE */ LAST = TEMP /* SET LAST EQUAL */ END /* TO TEMP */ END /* */ **************************** Bottom of Data **************************** Scroll ===> PAGE F6=Rchange F7=Up F12=Cancel
F3=Exit F10=Left
F5=Rfind F11=Right
09/009
CCopy Lines
The C (copy) line command copies lines from one location to another.
149
CCopy Lines
Syntax
C n
CC
The number of lines to be copied. If you do not type a number, or if the number you type is 1, only the line on which you type C is copied.
Description
To copy one or more lines within the same data set or member: 1. Type C in the line command field of the line to be copied. If you also want to copy one or more lines that immediately follow this line, type a number greater than 1 after the C command. 2. Next, specify the destination of the line to be copied by using either the A (after), B (before), or O (overlay) line command. 3. Press Enter. The line or lines are copied to the new location. To copy a block of lines within the same data set or member: 1. Type CC in the line command field of both the first and last lines to be copied. You can scroll (or use FIND or LOCATE) between typing the first CC and the second CC, if necessary. 2. Use the A (after), B (before), or OO (overlay) command to show where the copied lines are to be placed. Notice that when you use the block form of the C command (CC) to copy and overlay lines, you should also use the block form of the O command (OO). 3. Press Enter. The lines that contain the two CC commands and all of the lines between them are copied to the new location. Note: Only blank characters in the lines specified with O or OO are overlaid with characters in the corresponding columns from the source lines. Characters that are not blank are not overlaid. The overlap affects only those characters within the current column boundaries. To 1. 2. 3. 4. copy lines to another data set or member: Type either CREATE or REPLACE on the command line. Use one of the forms of the C command described previously. Press Enter. On the next panel that PDF displays, type the name of the data set or member that you want to create or replace. 5. Press Enter. The lines are copied to the data set or member that you specified. Note: To copy lines into an existing data set or member without replacing that data set or member, edit the existing data set or member and use the COPY primary or macro command.
150
CCopy Lines
Examples
The example in Figure 71 shows how to copy data by using the C and B line commands. Type C in the line command field of the line you want to copy. Type B in the line command field of the line that you want the copied line to precede.
When you press Enter, the line where you typed the C command is copied preceding the line where you typed the B command, as shown in Figure 72 on page 152. Note: If you press Enter before specifying where you want the data to go, the editor displays a MOVE/COPY pending message at the top of the panel. The line is not copied until you specify a destination.
151
COLSIdentify Columns
COLSIdentify Columns
The COLS line command displays a column identification line.
Syntax
COLS COL
Description
To display the column identification (=COLS>) line: 1. Type COLS in the line command field of any line. 2. Press Enter. The column identification line is inserted in the data set or member after the line in which you entered COLS. The column identification line moves with the rest of the data when you scroll through the data set or member. To display a non-scrolling, non-editable column indicator line, use the COLS primary command. See COLSDisplay Fixed Columns Line on page 203. Note: You can use the COLS line command with the BOUNDS line command to help check and reposition the bounds settings. To remove the column identification line from the panel, you can either type D in the line command field that contains the =COLS> flag, or type one of the following on the Command line: v RESET (to reset all flagged lines), or v RESET SPECIAL (to reset only the special lines)
152
COLSIdentify Columns
Examples
The example in Figure 73 shows the column identification line displayed with the boundary definition line. The COLS command is typed in the line command field.
When you press Enter, the editor inserts the COLS line, as shown in Figure 74.
153
DDelete Lines
DDelete Lines
The D (delete) line command deletes lines from your display.
Syntax
D n
DD
The number of lines to be deleted. If you do not type a number, or if the number you type is 1, only the line on which you type D is deleted.
Description
To delete one or more lines: 1. Type D in the line command field of the line to be deleted. If you also want to delete one or more lines that immediately follow this line, type a number greater than 1 after the D command. 2. Press Enter. The line or lines are deleted. To delete a block of lines: 1. Type DD in the line command field of both the first and last lines to be deleted. You can scroll (or use FIND or LOCATE) between typing the first DD and the second DD, if necessary. 2. Press Enter. The lines that contain the two DD commands and all of the lines between them are deleted.
Examples
To delete two lines, type D2 in the line command field of the first line you want to delete. See Figure 75.
154
DDelete Lines
When you press Enter, the editor deletes the two lines specified. See Figure 76.
155
Syntax
F n
The number of lines to be redisplayed. If you do not type a number, or if the number you type is 1, only one line is redisplayed.
Description
To redisplay the first line or lines of a block of excluded lines: 1. Type F in the line command field next to the dashed line that shows where lines have been excluded. The message in the dashed line tells you how many lines are excluded. If you want to redisplay more than one line, type a number greater than 1 after the F command. 2. Press Enter. The first line or lines are redisplayed.
Examples
The example in Figure 77 shows how to redisplay the excluded lines of a member. To redisplay the first three lines, type F3 in the line command field.
When you press Enter, the editor displays the first three lines, as shown in Figure 78 on page 157. Excluded lines do not need to be displayed again before saving the data. The excluded lines message line is never saved.
156
IInsert Lines
IInsert Lines
The I (insert) line command inserts one or more lines in your data set or member. The inserted lines are blank unless you have defined a mask. See MASKDefine Masks on page 165 for more information about defining a mask.
Syntax
I n
The number of blank lines to insert. If you do not type a number, or if the number you type is 1, only one line is inserted.
Description
To insert one or more lines in a data set or member: 1. Type I in the line command field of the line that the inserted line is to follow. If you want to insert more than one line, type a number greater than 1 after the I command. 2. Press Enter. The line or lines are inserted. If you type any information, even a blank character in the inserted line, the line becomes part of the source data and is assigned a line number the next time you press Enter. However, if you do not type any information, the space for the new line is automatically deleted the next time you press Enter. If you type information on the last, or only, inserted line and the cursor is still in the data portion of that line, the editor automatically inserts another line when you
Chapter 9. Edit Line Commands
157
IInsert Lines
press Enter or a scroll function key, but only if the new inserted line remains on the panel. If the new line is at the bottom of the panel, the editor automatically scrolls down so that the new line is displayed at the bottom of the screen.
Examples
Figure 79 shows how to insert lines in a member. To insert three lines, type I3 in the line command field.
When you press Enter, the editor inserts three lines. See Figure 80 on page 159.
158
Syntax
L n
The number of lines to be redisplayed. If you do not type a number, or if the number you type is 1, only one line is redisplayed.
Description
To redisplay the last line or lines of a block of excluded lines: 1. Type L in the line command field next to the dashed line that shows where lines have been excluded. The message in the dashed line tells you how many lines are excluded. If you want to redisplay more than one line, type a number greater than 1 after the L command. 2. Press Enter. The last line or lines are redisplayed.
Examples
Figure 81 shows how to redisplay the last three excluded lines. To redisplay the last three lines, type L3 in the line command field of the excluded lines.
159
When you press Enter, the editor redisplays the last three lines. See Figure 82. Note: Excluded lines do not need to be displayed again before saving the data. The excluded lines message line is never saved.
160
Syntax
LC n
LCC LCLC
The number of lines to be converted to lowercase. If you do not type a number, or if the number you type is 1, only the line on which you type LC is converted to lowercase.
Description
To convert characters on one or more lines to lowercase: 1. Type LC in the line command field of the source code line that contains the characters you want to convert. If you also want to convert characters on one or more lines that immediately follow this line, type a number greater than 1 after the LC command. 2. press enter. The characters on the source code lines are converted to lowercase. To convert characters in a block of lines to lowercase: 1. Type LCC in the line command field of both the first and last source code lines that contain characters that are to be converted. You can scroll (or use FIND or LOCATE) between typing the first LCC and the second LCC, if necessary. 2. Press Enter. The characters in the source code lines that contain the two LCC commands and in all of the source code lines between them are converted to lowercase. See the UC (uppercase) line command and the CAPS primary and macro commands, which are related, for information about converting characters from uppercase to lowercase and vice versa.
Examples
Figure 83 shows how to use the LC command without any operands. To convert a line, type LC in the line command field of the line you want to convert.
161
When you press Enter, the editor converts the characters in the line to lowercase. See Figure 84.
MMove Lines
The M (move) line command moves lines from one location to another.
162
MMove Lines
Syntax
M n
MM
The number of lines to be moved. If you do not type a number, or if the number you type is 1, only the line on which you type M is moved.
Description
To move one or more lines within the same data set or member: 1. Type M in the line command field of the line to be moved. If you want to move one or more lines that immediately follow this line, type a number greater than 1 after the M command. 2. Next, specify the destination of the line to be moved by using either the A (after), B (before), or O (overlay) line command. See the descriptions of those commands if you need more information about them. 3. Press Enter. The line or lines are moved to the new location. To move a block of lines within the same data set or member: 1. Type MM in the line command field of both the first and last lines to be moved. You can scroll (or use FIND or LOCATE) between typing the first MM and the second MM, if necessary. 2. Use the A (after), B (before), or OO (overlay) command to show where the moved lines are to be placed. Notice that when you use the block form of the M command (MM) to move and overlay lines, you should also use the block form of the O command (OO). 3. Press Enter. The lines that contain the two MM commands and all of the lines between them are moved to the new location. Note: Only blank characters in the lines specified with O or OO are overlaid with characters in the corresponding columns from the source lines. Characters that are not blank are not overlaid. The overlap affects only those characters within the current column boundaries. To 1. 2. 3. 4. move lines to another data set or member: Type either CREATE or REPLACE on the command line. Use one of the forms of the M command described previously. Press Enter. On the next panel, type the name of the data set or member that you want to create or replace. 5. Press Enter. The lines are moved to the data set or member that you specified. Note: To move lines into an existing data set or member without replacing that data set or member, use the MOVE primary or macro command.
Chapter 9. Edit Line Commands
163
MMove Lines
Examples
Figure 85 shows how you can move data by using the M with the A (After) line command. To move a line, type M in the line command field of the line you want to move. Type a A in the line command field of the line you want the moved line to follow.
When you press Enter, the editor moves the line where you typed the M command to a position immediately after the line where you typed the A command, as shown in Figure 86. If you press Enter before specifying a destination, the editor displays a MOVE/COPY pending message at the top of the panel. The line is not moved until you specify a destination.
164
MASKDefine Masks
MASKDefine Masks
The MASK line command displays the =MASK> line. On this line, you can type characters that you want to insert into an unformatted data set or member. These characters, which are called the mask, are inserted whenever you use the I (insert), TE (text entry), or TS (text split) line commands, or when you edit an empty data set.
Syntax
MASK
Description
To display the =MASK> line: 1. Type MASK in the line command field of any line. 2. Press Enter. The =MASK> line is displayed. Initially, the mask contains all blanks. To define a mask: 1. Add characters to or delete characters from the =MASK> line while it is displayed. 2. Press Enter. The mask is now defined. Once a mask is defined, the contents of the =MASK> line are displayed whenever a new line is inserted. This occurs when you use the I (insert), TE (text entry), and TS (text split) line commands, and when you edit an empty data set. You can change the mask definition whenever you need to by repeating the preceding steps.
Chapter 9. Edit Line Commands
165
MASKDefine Masks
To remove the =MASK> line from the panel, do one of the following: v Type D in the line command field that contains the =MASK> flag and press Enter. v Type RESET on the command line and press Enter. v End the edit session by: Pressing F3 (if it is defined as the END command), or Typing END on the command line and pressing Enter The mask line is never saved as part of the data. However, the mask remains in effect, even if it is not displayed, until you change it. The contents of the mask are retained in the current edit profile, and are automatically used the next time you edit the same kind of data. The MASK command is ignored in formatted edit mode. You enter formatted edit mode when you type the name of a previously defined format in the Format Name field on the Edit Entry panel when beginning an edit session. If you have defined a mask before entering formatted edit mode, the mask is not retained in the current edit profile.
Examples
In Figure 87, the mask is displayed and the characters /* and */ are typed on the mask line.
When you insert five lines, the new lines contain the contents of the mask. See Figure 88 on page 167.
166
MDMake Dataline
MDMake Dataline
The MD (make dataline) line command converts one or more ==MSG>, =NOTE=, =COLS>, or ====== (information) lines to data so they can be saved as part of your data set.
Syntax
MD n
MDD MDMD
The number of lines to be converted to data. If you do not type a number, or if the number you type is 1, only the line on which you type MD is converted.
Description
If v v v v you enter the MD line command on: Any line except a ==MSG>, =NOTE=, =COLS>, or ====== line, it is ignored. The TOP OF DATA and BOTTOM OF DATA lines, it is not allowed. An excluded line, any converted lines remain excluded and are converted. A line that contains a label, the label remains after the line is converted.
Chapter 9. Edit Line Commands
167
MDMake Dataline
Note: The MD line command only works on the editable =COLS> lines produced by the COLS line command. It does not work with the non-editable =COLS> indicator line produced by the COLS primary command. For best results, you should set your edit profile to NUMBER OFF and make sure that the record length of your data set or member is at least 80 before entering the MD line command. Otherwise, data on the right may be truncated. To convert one or more lines to data: 1. Type MD in the line command field next to the line that is to be converted. If you also want to convert one or more lines that immediately follow this line, type a number greater than 1 after the MD command. 2. Press Enter. The lines are converted to data. To convert a block of lines to data: 1. Type MDD in the line command field of both the first and last lines to be converted. You can scroll (or use the FIND or LOCATE command) between typing the first MDD and the second MDD, if necessary. 2. Press Enter. The lines that contain the two MDD commands and all eligible lines between them are converted to data.
Examples
Figure 89 shows how you can convert a block of temporary lines to data by using the block form of the MD line command. Type MDD over the =NOTE= line flags in the line command field of the first and last lines of the block of lines that you want to convert to data.
When you press Enter, the lines on which the MDD commands are typed and all of the lines between them are converted to data. See Figure 90 on page 169.
168
OOverlay Lines
OOverlay Lines
The O (overlay) line command specifies the destination of data that is to be copied or moved by the C (copy) or M (move) line commands. The data that is copied or moved overlays blanks in an existing line of data. This allows you to rearrange a single-column list of items into multiple column, or tabular, format.
Syntax
O n
OO
The number of lines to be overlaid. If you do not type a number, or if the number you type is 1, only one line is overlaid.
Description
To overlay one or more lines: 1. Type either M or C in the line command field of the line that is to be moved or copied. 2. Type O in the line command field of the line that the moved or copied line is to overlay. You can type a number after the O line command to specify the number of times that the M or C line command is to be performed.
169
OOverlay Lines
3. Press Enter. The data being moved or copied overlays the specified line or lines. To overlay a block of lines: 1. Type either MM or CC in the line command field of the first and last lines of a block of lines that is to be moved or copied. You can scroll (or use FIND or LOCATE) between typing the first command and the second command, if necessary. 2. Type OO in the line command field of the first and last lines that the block of lines being moved or copied is to overlay. Again, you can scroll (or use FIND or LOCATE) between typing the first OO and the second OO, if necessary. 3. Press Enter. The lines that contain the two CC or MM commands and all of the lines between them overlay the lines that contain the two OO commands and all of the lines between them. Only blank characters in the lines specified with O or OO are overlaid with characters in the corresponding columns from the source lines. Characters that are not blank are not overlaid. The overlap affects only those characters within the current column boundaries. The number of source and receiving lines need not be the same. If there are more receiving lines, the source lines are repeated until the receiving lines are gone. If there are more source lines than receiving lines, the extra source lines are ignored. The overlay operation involves only data lines. Special lines such as MASK, TABS, BNDS, and COLS are ignored as either source or receiving lines. Note: There is no special support for DBCS data handling. You are responsible for DBCS data integrity when overlaying lines. Two other line commands that allow you to specify a destination are the A (after) command and the B (before) command. See ASpecify an After Destination on page 143 and BSpecify a Before Destination on page 145 for more information.
Examples
Figure 91 illustrates the O (overlay) line command. Suppose you were editing a list in a single left-adjusted column and wanted to place portions of the list side-by-side. First, using the ) (column shift right) command, shift a portion of the list the appropriate amount to the right to overlay in a multiple column format. Next, type MM in the line command field to mark the beginning and end of the block of lines you want to move, then type OO in the line command field to mark the destination of the lines you want to move.
170
OOverlay Lines
When you press Enter, the editor overlays the lines you marked to move on the destination block. See Figure 92.
RRepeat Lines
The R (repeat) line command repeats one or more lines in your data set or member immediately after the line on which the R command is entered.
171
RRepeat Lines
Syntax
R n
RR n
The number of lines to be repeated. If you do not type a number, or the number you type is 1, only the line on which you type R is repeated.
Description
To repeat one or more lines: 1. Type R in the line command field of the line that is to be repeated. If you want to repeat the line more than once, type a number that is greater than 1 immediately after the R command. 2. Press Enter. The editor inserts a duplicate copy or copies of the line immediately after the line that contains the R command. To repeat a block of lines: 1. Type RR in the line command field of both the first and last lines to be repeated. You can scroll (or use FIND or LOCATE) between typing the first RR and the second RR, if necessary. 2. Press Enter. The lines that contain the two RR commands and all of the lines between them are repeated immediately after the line that contains the second RR command.
172
RRepeat Lines
Examples
When you press Enter, the editor repeats line 000400 five times. See Figure 94.
173
SShow Lines
SShow Lines
The S (show line) line command causes one or more lines in a block of excluded lines to be redisplayed. The redisplayed lines have the leftmost indentation levels; they contain the fewest leading blanks. See Redisplaying Excluded Lines on page 55 for more information about redisplaying excluding lines.
Syntax
S n
The number of lines to be redisplayed. If there are more than 2 excluded lines, and you do not type a number or if the number you type is 1, only one line is redisplayed.
Note: If you enter an S line command to display all but one line of an excluded block, then that line is also displayed. This could result in more lines being displayed than the number you requested. For example, if five lines are excluded in a block, an S4 command causes all five lines to be displayed.
Description
To redisplay a line or lines of a block of excluded lines: 1. Type S in the line command field next to the dashed line that shows where a line or lines has been excluded. The message in the dashed line tells you how many lines are excluded. If you want to redisplay more than one line, type a number greater than 1 after the S command. If you type S3, for example, the three lines with the leftmost indentation level are displayed again. If more than three lines exist at this indentation level, only the first three are displayed. 2. Press Enter. The line or lines with the fewest leading blanks are redisplayed.
Examples
Figure 95 shows how to redisplay a members excluded lines. To redisplay four lines, type S4 in the line command field.
174
SShow Lines
When you press Enter, the four lines are redisplayed. See Figure 96. Note: Excluded lines do not need to be displayed again before saving the data. The excluded lines message line is never saved.
175
TABSControl Tabs
TABSControl Tabs
The TABS line command: v Displays the =TABS> (tab-definition) line v Defines tab positions for software, hardware, and logical tabs Use PROFILE to check the setting of tabs mode and the logical tab character. See Using Tabs on page 61 if you need more information about using tabs.
Syntax
TABS TAB
Description
When you type TABS in the line command field, =TABS> is displayed along with any previously defined tab positions. To remove the =TABS> line, use the D (delete) line command or the RESET primary command, or end the edit session. The =TABS> line is never saved as part of the data. The tab definitions remain in effect, even if they are not displayed, until you change them. Tab definitions are retained in the current edit profile, and are automatically used the next time you edit the same kind of data.
Examples
This section contains two examples: one using software and hardware tabs, and one using software tab fields.
Now, type COLS in the line command field and press Enter again. A partial =COLS> line with positions 9 through 45 is shown in the following example:
=COLS> -1----+----2----+----3----+----4----+
Next use the TABS line command to define software and hardware tabs. Type TABS in the line command field beneath the =COLS> line and press Enter. When the =TABS> line appears, type hyphens in columns 15, 25, and 35, and asterisks in columns 20, 30, and 40, using the =COLS> line to find these columns:
=COLS> -1----+----2----+----3----+----4----+ =TABS> * * *
With the preceding =TABS> line, you can move the cursor to a software tab position (hyphen) by pressing Enter, even if another character already occupies that position. To move the cursor to a hardware tab position (one space to the right of an asterisk), press either the Tab Forward or Tab Backward key. See Figure 97.
176
TABSControl Tabs
Figure 97. TAB Line Command Example. A =TABS> line with four software tabs and one hardware tab defined.
Notice in the preceding example that the cursor is positioned to the right of data string 789. With the cursor in this position, press Enter. The cursor moves under the 1 in the 123 data string, not to column 10, which is the beginning of the field.
TEText Entry
The TE (text entry) line command provides one very long line wrapped around many lines of the display to allow power typing for text entry. The editor does the formatting for you. The TE line command is different from the I (insert) line command. The I command inserts a specified number of separate, blank lines as well as the mask, if there is one, as you typed it. With the TE command, the input data is formatted, only mask line characters outside the current boundaries are added to the formatted lines.
177
TEText Entry
Syntax
TE n
The number of blank lines to be added. If you do not type a number, the display is filled with blanks from the line following the TE to the bottom of the screen.
Description
Before you enter text entry mode, consider the following: v If you are going to be typing text in paragraph form, make sure caps mode is off. Otherwise, when you press Enter, your text changes to uppercase. v You may want to turn off number mode to prevent sequence numbers from writing over any of your text. v Make sure the bounds setting is where you want it so that the text will flow correctly when you end text entry mode. To enter text entry mode: 1. Type TE in the line command field. If you want to specify several blank lines, type a number greater than 1 immediately after the TE command. If the number that you type is greater than the number of lines remaining on the display, the vertical bar that shows where you will run out of room is not displayed and the keyboard does not lock at the last character position on the display. You can scroll down to bring the additional blank text entry space into view. 2. Press Enter. The editor inserts a single continuous blank area for the specified number of lines or to the bottom of the display. To begin a new paragraph: 1. Use the return (Enter), cursor movement, or Tab keys to advance the cursor enough spaces to leave one blank line on the display. If there are insufficient blank spaces on the display, the keyboard locks when you try to type beyond the last character position. A vertical bar (|) is displayed above the cursor at the locked position. To generate more blank spaces: 1. Press the Reset key to unlock the keyboard. 2. Press Enter. To end text entry mode: 1. Press Enter. The data is flowed together into a paragraph and any embedded blanks are preserved. The left and right sides of the paragraph are determined by the current bounds. See Word Processing on page 58 and Entering Text (Power Typing) on page 60 if you need more information.
178
TEText Entry
Examples
Figure 98 shows how the TE (text entry) command allows you to use power typing and word wrap to input text. The edit profile is set to NUMBER OFF and CAPS OFF. Also, the left bound is set to 1 and the right bound is set to 72. A new data set member called CHAP10 has been started and the TE command is typed in the line command field.
When you press Enter, the editor begins text entry mode. The cursor shows where text input begins and the vertical bar in the lower-right corner of the panel shows how much room you have to work with. See Figure 99.
179
TEText Entry
When you enter text, some of the words are split between lines, with part of the word at the right end of a line and the remainder of the word at the beginning of the next line. See Figure 100.
When you press Enter, the editor exits text entry mode. As shown in Figure 101 on page 181, the text flows between the bounds settings and the line numbers are displayed in the line command field.
180
TFText Flow
TFText Flow
The TF (text flow) line command restructures paragraphs. This is sometimes necessary after deletions, insertions, or splitting.
Syntax
TF n
The column number to which the text should be flowed. The default is the panel width when default boundaries are in effect. If you are using nondefault bounds, the right boundary is used. This is different from the TFLOW macro command, which always defaults to the right boundary. If a number greater than the right boundary is specified, the right boundary is used.
Description
To flow text: 1. Type TF in the line command field of the line at which you want the text to begin flowing. If you want to specify the rightmost column position for the restructured text, type a number greater than 1 immediately after the TF command. 2. Press Enter. The text is flowed from the beginning of that line to the end of the paragraph.
181
TFText Flow
See Word Processing on page 58 and Formatting Paragraphs on page 58 for more information.
Examples
Figure 102 demonstrates text restructuring. The bounds are set at columns 1 and 72. A TF50 command is typed on line 000041.
When you press Enter, the editor takes all text in that paragraph between columns 1 and 72 and reformats it between columns 1 and 50. See Figure 103 on page 183.
182
TSText Split
TSText Split
The TS (text split) line command moves part or all of a line of text to the following line. This makes it easier for you to add new material to existing text.
Syntax
TS n
The number of blank lines to be inserted between the split lines. If you do not type a number, or if the number that you type is 1, the editor inserts only one blank line.
Description
To split a line: 1. Type TS in the line command field of the line you would like to split. If you want to insert more than one blank line between the split lines, type a number greater than 1 immediately after the TS command. 2. Move the cursor to the desired split point. 3. Press Enter. To rejoin lines, use the TF (text flow) line command. See TFText Flow on page 181 for more information. For more information about splitting lines and other word processing commands, see Word Processing on page 58 and Splitting Lines on page 60.
Chapter 9. Edit Line Commands
183
TSText Split
Examples
Figure 104 shows how to split text and to insert blank lines. To split the text and insert three lines, type TS3 in the line command field of the line you want to split and place the cursor where you want the line split.
When you press Enter, the line is split at the cursor position and the editor inserts the number of blank lines specified, as shown in Figure 105.
184
Syntax
UC n
UCC UCUC
The number of lines to be converted to uppercase. If you do not type a number, or if the number you type is 1, only the line on which you type UC is converted to uppercase.
Description
To convert characters on one or more lines to uppercase: 1. Type UC in the line command field of the source code line that contains the characters that you want to convert. To convert characters on lines following this one, type a number greater than 1 after the UC command. 2. Press Enter. The characters on the source code line or lines are converted to uppercase. To convert characters in a block of lines to uppercase: 1. Type UCC in the line command field of both the first and last source code lines that contain characters that are to be converted. You can scroll (or use FIND or LOCATE) between typing the first UCC and the second UCC, if necessary. 2. Press Enter. The characters in the source code lines that contain the two UCC commands and in all of the source code lines between them are converted to uppercase. See the LCConvert Characters to Lowercase line command and the CAPS primary command (page 199) and macro command (page 298) for information about converting characters from uppercase to lowercase and vice versa.
Examples
Figure 106 shows how to convert lines of text to uppercase. To convert lines of text to uppercase, place the UC command and the number of lines you want to convert in the line command field where you want the conversion to start.
185
When you press Enter, the editor converts the lines specified to uppercase. See Figure 107.
XExclude Lines
The X (exclude) line command replaces one or more lines on the panel with a dotted line. The dotted line contains a message that specifies how many lines have been excluded.
186
XExclude Lines
The excluded lines are not erased. They are simply hidden from view and can still be affected by edit line, primary, and macro commands.
Syntax
X n
XX
The number of lines to be excluded. If you do not type a number, or if the number that you type is 1, PDF excludes only the line on which you type the X command.
Description
To exclude one or more lines: 1. Type X in the line command field of the line that you want to exclude. If you want to exclude one or more lines that immediately follow this line, type a number greater than 1 immediately after the X command. 2. Press Enter. The lines are excluded from the panel. To exclude a block of lines: 1. Type XX in the line command field of both the first and last lines that you want to exclude. You can scroll (or use FIND or LOCATE) between typing the first XX and the second XX, if necessary. 2. Press Enter. The lines that contain the two XX commands and all of the lines between them are excluded. See Excluding Lines on page 55 for more information on using this command.
Examples
Figure 108 shows how lines are excluded from a member. To exclude six lines, type X6 in the line command field.
187
XExclude Lines
When you press Enter, the editor excludes the specified lines. See Figure 109.
To redisplay excluded lines, use the F (show first line), L (show last line), or S (show lines) line command.
188
Example
189
HILITE
236
IMACRO LEVEL LOCATE MODEL MOVE NONUMBER NOTES NULLS NUMBER PACK PASTE PRESERVE
240 240 242 243 247 250 251 252 253 254 255 256
190
RMACRO SAVE SETUNDO SORT STATS SUBMIT TABS UNDO UNNUMBER VERSION VIEW
269 270 271 272 274 275 276 278 280 282 283
Syntax
ON AUTOLIST OFF ON Generates a source listing in the ISPF list data set for eventual printing when you end an edit session in which you changed and saved data. No source listing is generated.
OFF
Description
Autolist mode is saved in the edit profile. To check the current setting of autolist mode:
Chapter 10. Edit Primary Commands
191
AUTOLIST
1. On the command line, type:
PROFILE 3
2. Press Enter. The third line of the edit profile shows the autolist mode setting. To turn on autolist mode: 1. On the command line, type:
AUTOLIST ON
2. Press Enter. To turn off autolist mode: 1. On the command line, type:
AUTOLIST OFF
2. Press Enter.
Examples
This example shows how to use the AUTOLIST command to save a copy of a source code listing in the ISPF list data set and to print the list data set. 1. As you edit a data set, you decide to store a listing of the source code in the ISPF list data set so that you can print it later. Enter the PROFILE 3 command to display the first 3 lines of the edit profile. This shows you whether autolist mode is on or off.
PROFILE 3
2. You can see from the edit profile that autolist mode is off:
=PROF> ....PLI (VARIABLE - 72)....RECOVERY ON....NUMBER OFF.................... =PROF> ....CAPS OFF....HEX OFF....NULLS OFF....TABS OFF........................ =PROF> ....AUTOSAVE ON....AUTONUM OFF....AUTOLIST OFF....STATS ON..............
4. After editing the data set, save your changes by entering the END command. The changes are saved because, as you can see in the preceding partial edit profile, autosave mode is on.
END
ISPF creates a list data set with the contents of the data set member that you were editing. The name of the list data set is:
prefix.user-id.SPFn.LIST
Note: See z/OS ISPF Users Guide Vol I for information about list data sets. 5. Before leaving ISPF, use the jump function to go to option 0.2 and check the log/list defaults:
=0.2
The Log and List Defaults panel shows the current default settings for the handling of log and list data sets. 6. Because you want to print the list data set, make sure that the PD option is entered in the Process Option field under the List Data Set Default Options heading:
192
AUTOLIST
Process option ===> PD
Note: Also, make sure that the appropriate JCL information is entered at the bottom of the Log and List Defaults panel so that the print job is submitted. 7. You can now end the session, knowing that the list data set will be printed:
=X
8. When the session ends, TSO displays a message that says the print job has been submitted.
Syntax
ON AUTONUM OFF ON OFF Turns on automatic renumbering. When number mode is also on, the data is automatically renumbered when it is saved. Turns off automatic renumbering. Data is not renumbered.
Description
When number mode is on (see (xref refid=number), the first line of a data set or member is normally line number 000100, the second number is 000200, and so forth. However, as lines are inserted and deleted, the increment between line numbers can change. For example, you might think that when a line is inserted between 000100 and 000200, line 000200 would be given the number 000300 and the new line would become 000200. Instead, the existing lines retain their numbers and the new line is given line number 000110. Therefore, if the original line number increments are important to you, the AUTONUM command renumbers your lines automatically so that the original increments are maintained. Autonum mode is saved in the edit profile. To check the current settings of number mode and autonum mode: 1. On the command line, type:
PROFILE 3
2. Press Enter. The first line of the edit profile shows the number mode setting and the third line shows the autonum mode setting. To turn on autonum mode: 1. On the command line, type:
AUTONUM ON
2. Press Enter.
193
AUTONUM
To turn off autonum mode: 1. On the command line, type:
AUTONUM OFF
2. Press Enter.
Examples
This example shows a practical application of AUTONUM command usage. You have been editing a data set with number mode on. Note: If you are editing a data set or member with number mode off and then decide to turn number mode on, make sure that columns 1 through 6 of your data set are blank. Otherwise, the sequence numbers created by the NUMBER command can overlay any of your data in columns 1 through 6. Use either the COLUMN SHIFT or DATA SHIFT line command to indent the data. You now want to end the edit session. However, since you had to insert and delete many lines, your line numbering is no longer uniform. Therefore, you decide to use autonum mode so that the next time you edit this data set the line numbers will be correct. 1. First, check the edit profile to see whether autonum mode is already on by entering the PROFILE 3 command to display the first 3 lines of the edit profile.
PROFILE 3
2. You can see from the edit profile that autonum mode is off:
=PROF> ....PLI (VARIABLE - 72)....RECOVERY ON....NUMBER OFF.................... =PROF> ....CAPS OFF....HEX OFF....NULLS OFF....TABS OFF........................ =PROF> ....AUTOSAVE ON....AUTONUM OFF....AUTOLIST OFF....STATS ON..............
4. After editing the data set, save your changes by entering the END command. The changes will be saved because, as you can see in the preceding partial edit profile, autosave mode is on.
END
ISPF saves the data set that you were editing, along with any changes. The next time you edit the data set, the line numbers will have the proper increments.
Syntax
194
AUTOSAVE
ON AUTOSAVE PROMPT PROMPT OFF NOPROMPT ON OFF PROMPT Turns autosave mode off with the PROMPT operand. You are notified that changes have been made and that either the SAVE command (followed by END) or CANCEL must be used. When you use AUTOSAVE PROMPT by itself, it implies the OFF command. OFF NOPROMPT Turns autosave mode off with the NOPROMPT operand. You are not notified and the data is not saved when you issue an END command. END becomes an equivalent to CANCEL. Use the NOPROMPT operand with caution. Turns autosave mode on. When you enter END, any changed data is saved.
Description
Data is considered changed if you have operated on it in any way that could cause a change. Shifting a blank line or changing a word to the same word does not actually alter the data, but the editor considers this data changed. When you enter SAVE, the editor resets the change status. Autosave mode, along with the PROMPT operand, is saved in the edit profile. To check the current setting of autosave mode: 1. On the command line, type:
PROFILE 3
2. Press Enter. The third line of the edit profile shows the autosave mode setting. To turn on autosave mode: 1. On the command line, type:
AUTOSAVE
Note: This is the equivalent of entering AUTOSAVE ON. 2. Press Enter. The next time you enter END, any changes that you made to the data set or member that you were editing are saved. To turn off autosave mode: 1. On the command line, type:
AUTOSAVE OFF
Note: This is the equivalent of entering AUTOSAVE OFF PROMPT. 2. Press Enter. The next time you enter END when a data set or member has been changed, the editor prompts you to specify whether you want changes to the data set or member saved (SAVE) or not saved (CANCEL). However, if no changes have been made to the data set or member, the edit session ends without a prompt.
195
AUTOSAVE
To turn off autosave mode and specify that you do not want to be prompted when data has changed: 1. On the command line, type:
AUTOSAVE OFF NOPROMPT
2. Press Enter. The next time you enter END when a data set or member has been changed, the edit session ends without saving your changes, just as if you had entered CANCEL. You are not prompted to save the changes. For more information on saving data, see the CANCEL and END primary commands, and the DATA_CHANGED, CANCEL, and END macro commands.
Examples
This example shows a practical application of AUTOSAVE usage. 1. You have been editing a data set member and now want to end the edit session. Enter END:
END
2. The member that you were editing remains with the following message in the upper-right corner:
DATA CHANGED-SAVE/CANCEL
This message implies that autosave mode in the edit profile is set to AUTOSAVE OFF PROMPT. You are prompted to enter either SAVE to save your changes, or CANCEL to end the edit session without saving your changes. You also have the option to change autosave mode in the edit profile to AUTOSAVE ON. By doing so, the next time you enter END, your changes will be saved and the edit session will end. 3. You decide to turn on autosave mode:
AUTOSAVE ON
4. Then you enter END again to save your changes and end the edit session.
END
Syntax
BOUNDS BOUND BNDS BND BOU left_col right_col * left_col * right_col *
The left boundary column to be set. The right boundary column to be set. The current value of the boundary.
To reset the boundaries to the default columns: 1. On the command line, type:
BOUNDS
196
BOUNDS
2. Press Enter. The boundaries are reset to the default columns. See Edit boundaries on page 23 for more information, including tables that show commands affected by bounds settings and default bounds settings for various types of data sets. The column numbers are always data column numbers (see Referring to Column Positions on page 102). Thus, for a variable format data set with number mode on, data column 1 is column 9 in the record. You cannot specify the same column for both boundaries.
Description
The BOUNDS primary command provides an alternative to setting the boundaries with the BOUNDS line command or macro command; the effect on the member or data set is the same. However, if you use both the BOUNDS primary command and the BOUNDS line command in the same interaction, the line command overrides the primary command.
Examples
To set the left boundary to 1 and the right boundary to 72, type:
BOUNDS 1 72
To set the left boundary to 10 and leave the right as is, type:
BOUNDS 10 *
Syntax
BROWSE member member A member of the ISPF library or other partitioned data set you are currently editing. You may enter a member pattern to generate a member list.
Description
To browse a data set or member during your current edit session: 1. On the command line, type:
BROWSE member
Here, member represents the name of a member of the partitioned data set you are editing. The member operand is optional. 2. Press Enter. If you specified a member name, the current library concatenation sequence finds the member. The member displays for browsing. If you do not specify a member name, the Browse Command Entry panel, which is similar to the regular Browse Entry panel, appears. You can enter the name of any sequential or partitioned data set to which you have access. When you press Enter, the data set or member displays for browsing. The editor suspends your initial edit session until the browse session is complete.
Chapter 10. Edit Primary Commands
197
BROWSE
3. To exit from the browse session, enter the END command. The current session resumes.
Examples
To browse member YYY of the current library concatenation: 1. On the command line, type:
BROWSE YYY
2. Press Enter.
Syntax
BUILTIN cmdname cmdname The built-in command to be processed.
Description
To process a built-in primary command instead of a command with the same name that has been defined as an alias: 1. On the command line, type:
BUILTIN cmdname
where cmdname is the name of a primary command. 2. Press Enter. The edit primary command is processed.
Examples
This example shows a practical application of BUILTIN command usage. 1. You have a macro named MACEND that you have created. You want to run your MACEND macro instead of ISPFs built-in END command. Enter the following command:
DEFINE END ALIAS MACEND
Note: If the END command is issued in your MACEND macro without being preceded by the BUILTIN macro command, the MACEND macro would be run again, resulting in a loop. 2. Enter the following to run your MACEND macro:
END
3. To end the edit session without redefining END, use BUILTIN, as follows:
BUILTIN END
This command issues ISPFs built-in END command instead of your MACEND macro.
198
CANCEL
Syntax
CANCEL CAN
Description
CANCEL is especially useful if you have changed the wrong data, or if the changes themselves are incorrect. To cancel changes to a data set: 1. On the command line, type:
CANCEL
2. Press Enter. The edit session ends without saving your changes. Note: If you issue SAVE and later issue CANCEL, the changes you made before issuing SAVE are not canceled. See the DATA_CHANGED, AUTOSAVE, and END commands for more information about saving data. CANCEL does not cause automatic recording in the ISPF list data set, regardless of the setting of the autolist mode.
Examples
After editing the data, you decide that you want the data set the way it was before editing. Enter the following command:
CANCEL
The edit session ends with the data set in its original state.
Syntax
ON CAPS OFF ON OFF Turns caps mode on. Turns caps mode off.
Description
The editor sets the caps mode according to the data in the file retrieved for editing. If caps mode has been on and the data contains lowercase letters, the mode
Chapter 10. Edit Primary Commands
199
CAPS
switches and the editor displays a message indicating the change. Likewise, if caps mode is off and the editor contains all uppercase letters, the mode switches and the editor displays a message. Caps mode is saved in the edit profile. To override the automatic setting of caps mode, you can include the CAPS command in an initial macro. Caps mode is usually on during program development work. When caps mode is on, any alphabetic data that you type, plus any other alphabetic data that already exists on that line, is converted to uppercase when you press Enter or a function key. To set caps mode on: 1. On the command line, type:
CAPS
2. Press Enter. Caps mode is set to on in the edit profile. Caps mode is usually off when you edit text documentation. When caps mode is set to off, any alphabetic data that you type remains just as you typed it. If you typed it in uppercase, it stays in uppercase; if you typed it in lowercase, it stays in lowercase. Alphabetic data already typed on a line is not affected. To set caps mode off: 1. On the command line, type:
CAPS OFF
2. Press Enter. Caps mode is set to off in the edit profile. The CAPS command does not apply to DBCS fields in formatted data or to DBCS fields in mixed fields. If you specify CAPS, the DBCS fields remain unchanged. See the LC (lowercase) and UC (uppercase) line commands and the CAPS macro command for more information about changing case.
Examples
This example shows a practical application of CAPS command usage. 1. You are editing a data set that contains all uppercase letters, with caps mode off. The data you are typing contains both uppercase and lowercase letters, but you want all of the letters to be uppercase. On the command line, type:
CAPS
2. 3. 4. 5.
Press Enter. Move the cursor back to the line on which you were typing. Finish typing the line or type over one or more of the existing letters. Press Enter. All of the letters on the line are converted to uppercase.
Syntax
200
CHANGE
.ZFIRST .ZLAST CHANGE CHA CHG C string1 string2 labela labelb ALL FIRST LAST PREV NEXT
CHARS PREFIX SUFFIX WORD string1 string2 labela, labelb X NX start_col left_col right_col
The search string you want to change. See Finding, Seeking, Changing, and Excluding Data on page 45. The string you want to replace string1. See Finding, Seeking, Changing, and Excluding Data on page 45. Labels identifying the start and end of the group of lines the CHANGE command is to search. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
NEXT ALL FIRST LAST PREV CHARS PREFIX SUFFIX WORD X NX start_col
Starts at the first position after the current cursor location and searches ahead to find the next occurrence of string1. Starts at the top of the data and searches ahead to find all occurrences of string1. Starts at the top of the data and searches ahead to find the first occurrence of string1. Starts at the bottom of the data and searches backward to find the last occurrence of string1. Starts at the current cursor location and searches backward to find the previous occurrence of string1. Locates string1 anywhere the characters match. Locates string1 at the beginning of a word. Locates string1 at the end of a word. Locates string1 when it is delimited on both sides by blanks or other non-alphanumeric characters. Scans only lines that are excluded from the display. Scans only lines that are not excluded from the display. The first column to be included in the range of columns to be searched. When you specify only one column, the editor finds the string only if the string starts in the specified column. The first column to be included in the range of columns to be searched. The last column to be included in the range of columns to be searched.
left_col right_col
201
CHANGE
Notes: 1. For more information about restricting the search to only a portion of each line, see Limiting the Search to Specified Columns on page 51. 2. The CHANGE command allows you to control the starting point and the direction of the search by positioning the cursor and using either the NEXT or PREV operand. For more information, see Starting Point and Direction of the Search on page 49.
Description
You can use the CHANGE command with the FIND and EXCLUDE commands to find a search string, change it, and then exclude the line that contains the string from the panel. To change the next occurrence of ME to YOU without specifying any other qualifications: 1. On the command line, type:
CHANGE ME YOU
2. Press Enter. This command changes only the next occurrence of the letters ME to YOU. Since no other qualifications were specified, the letters ME can be: v Uppercase or a mixture of uppercase and lowercase v At the beginning of a word (prefix), the end of a word (suffix), or the entire word (word) v In an excluded line or a non-excluded line v Anywhere within the current boundaries To change the next occurrence of ME to YOU, but only if the letters are uppercase: 1. On the command line, type:
CHANGE CME YOU
2. Press Enter. This type of change is called a character string change (note the C that precedes the search string) because it changes the next occurrence of the letters ME to YOU only if the letters are found in uppercase. However, since no other qualifications were specified, the change occurs no matter where the letters are found, as outlined in the preceding list. For more information, including other types of search strings, see Finding, Seeking, Changing, and Excluding Data on page 45.
Examples
The following example changes the first plus (+) in the data set to a minus (-). However, the plus must occur on or between lines labeled .E and .S and it must be the first character of a word:
CHANGE + - .E .S FIRST PREFIX
The following example changes the last plus in the data set to a minus. However, the plus must occur on or between lines labeled .E and .S; it must be the last character of a word; and it must be found on an excluded line:
CHANGE + - .E .S LAST SUFFIX X
The following example changes the plus that immediately precedes the cursor position to a minus. However, the cursor must not be positioned ahead of the lines
202
CHANGE
labeled .E and .S. Also, the plus must occur on or between the labeled lines; it must be a standalone character (not part of any other word); it must be on a non-excluded line; and it must exist within columns 1 and 5:
CHANGE + - .E .S PREV WORD NX 1 5
Syntax
ON COLS OFF ON OFF Display columns line. Remove columns line from the display.
Description
The COLS command displays a columns indicator line at the top of the data area in Edit and View mode. This works in the same manner as the columns line under Browse. The columns line differs from that displayed by the COLS line command in that the line command field is protected. This means that it cannot be copied, moved, or deleted by overtyping with line commands. The line does not scroll with the data, and therefore the number of data lines displayed is reduced by one. Entering COLS with no parameter toggles the display to the opposite. For example, if the columns line is currently displayed, entering COLS removes it.
Examples
To display the columns indicator line, enter the following command:
COLS ON
Figure 110 on page 204 shows an example of an edit screen displaying the columns indicator line.
203
COMPARE
File Edit Edit_Settings Menu Utilities Compilers Test Help EDIT LEEBURR.TEST($$ZZZZ) - 01.10 Columns 00001 00072 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7-****** ***************************** Top of Data ****************************** 000001 //LEEBURRC JOB CLASS=A,MSGCLASS=X 000002 //STEPPLX EXEC PGM=AKEEPLX,REGION=2048K,PARM=SOURCE(SEG) 000003 //SYSPRINT DD SYSOUT=A 000004 //SYSUT1 DD UNIT=SYSDA,SPACE=(TRK,(30,10)) 000005 //SYSUT2 DD UNIT=SYSDA,DSN=&&ASM,DISP=(NEW,PASS), 000006 // SPACE=(TRK,(30,10)) 000007 //SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(30,10)) 000008 //SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(30,10)) 000009 //SYSLIB DD DISP=SHR,DSN=PDFTOS2C.LEEBURR.SOURCE 000010 // DD DISP=SHR,DSN=PDFTOS2C.APARTEST.SOURCE . . . Command ===> ________________________________________________ Scroll ===> CSR F1=Help F2=Split F3=Exit F5=Rfind F6=Rchange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
COMPAREEdit Compare
The COMPARE command compares the file you are editing with an external sequential data set or member of a partitioned data set. Lines that exist only in the file being edited are marked, and lines that exist only in the file being compared are inserted as information lines in the file being edited. The command operates as a primary command or an edit macro command. You can use the Delete and Make Data line commands to merge changes between files that are being compared. The COMPARE function supports all line lengths, but some SuperC options are ignored for line lengths greater than 256 characters long. When you are editing a cataloged data set, explicit data set names refer to cataloged data sets. However, if you are editing an uncataloged data set and specify only a member name, COMPARE searches for the member in the current uncataloged data set. For example, if you are editing an uncataloged data set called userid.TEMP, then the command
COMPARE TEMP
first looks for member TEMP in the current, uncataloged data set, then looks for a cataloged data set named TEMP (TSO prefix rules apply). If it finds data set TEMP, and the data set being edited is a PDS member, then the same named member is searched for in data set TEMP. Use of COMPARE when editing concatenations that contain uncataloged data sets is not supported and can lead to unpredictable results. If you have made changes to the data before issuing the COMPARE command, the COMPARE command uses the current contents of the edit session during the comparison. Because COMPARE does not require the data to be saved on disk, you can use the COMPARE command from EDIF, VIIF, or EDIREC sessions. However, COMPARE NEXT and COMPARE SESSION are not supported in EDIF, VIIF, or EDIREC sessions.
204
COMPARE
Syntax
COMPARE dsname NEXT SESSION * EXCLUDE SAVE SYSIN
no operand
The Edit Compare Settings panel is displayed. This panel enables you to customize the comparison by selecting the relevant SuperC options to use. The comparison is always a LINE compare with the options UPDLDEL, NOLISTL, LINECMP, and CKPACKL specified. The SEQ, NOSEQ, or COBOL keywords are automatically specified depending on the NUMBER state in the edit profile. Mixed data can be enabled, and is always assumed to be specified when you are in an edit session with MIXED specified in the profile. Each field in the Edit Compare Settings panel has field level help. Note: When dont process (DP) options are used, the resulting display shows DP lines in the current file as unlabeled and does not show DP lines from the comparison file. This can be misleading. Because comparisons which ignore parts of the file might show data in one file and not in the other, use caution when using DP options. When you use options that ignore programming language comments, the dont process reformatted lines option is recommended.
dsname
The name of a member or data set to which the current file is compared. This variable can be specified as a fully qualified data set name (in quotation marks), a partially qualified data set name, or a member name. If you specify only a member name, it can be preceded by a left parenthesis symbol. The right parenthesis is allowed but not required. The current edit session must be of a member of a partitioned data set. The current edit concatenation is searched for the member to compare. If you specify only a data set name and the current file is a member of a PDS, then the specified data set is searched for a member of the same name as the member being edited.
NEXT
Specifies to do a comparison between the currently edited member and the next member of the same name found at a higher level of the hierarchy (or next level of the edit concatenation) than the current member. For example, if the current member is found in the third level of the concatenation, and a like-named member exists at the fourth level, then the third and fourth level members are compared. After data is saved in the lowest level, compares are done from that level upward. If you specify dsname, the NEXT keyword cannot be used. Specifies that you want to compare the changes you have made during the edit session with the copy of the data saved on disk. Use COMPARE SESSION (or COMPARE *) to see the changes you have made to the edit data since the beginning of the edit session or since the last SAVE command.
SESSION
205
COMPARE
* EXCLUDE Same as SESSION. Specifies that all matching lines in the compared data sets are excluded from the display except for a specified number of lines above and below the differences. The differences themselves are also shown in the display. The specified number of lines that are shown is set on the Edit Compare Settings panel. If you do not specify a new number for this edit session, then whatever was the last number set is still valid. To change this number, issue the COMPARE command with no operand and change the EXCLUDE field on the Edit Compare Settings panel. Valid numbers are 0 through 12, inclusive. You can also use the COMPARE EXCLUDE command at any time to exclude all lines in a file except lines with line labels and information lines, and the lines above and below those lines. When you specify EXCLUDE without a data set name or NEXT, no comparison is done. Instead the labels and information lines that already exist in the file are used to exclude functions. SAVE Specifies that SuperC (which performs the actual compare function) create a listing. The listing is saved in a data set named prefix.ISPFEDIT.COMPARE.LIST. The save function is intended for debugging purposes, but it also provides a way to create a SuperC listing. The listing produced is a Change listing (option CHNGL). No notification is given regarding successful creation of the listing, and errors allocating the listing do not cause the comparison to end. Note: Because of the way the SuperC comparison is done, the file currently being edited is shown in the SuperC listing as the old file, and the file to which the current file is being compared is listed as the new file. Therefore, insertions refer to lines that are not in the current file, and deletions refer to lines that are only in the current file. SYSIN Specifies not to free the ddname SYSIN before calling SuperC to compare files. This enables you to pass SuperC Process Statements to alter the comparison. No validation is done on the type of SYSIN allocation or the contents of the data set.
Examples
To display the Edit Compare Settings panel: 1. On the command line, type:
COMPARE
2. Press Enter.
206
COMPARE
File Edit Edit_Settings Menu Utilities Compilers Test Help Edit Compare Settings SuperC Options: Display options: Enter "/" to select option Lines displayed Case Insensitive Compare with EXCLUDE . . . 5 (0 - 12) Ignore Reformat Differences Label Prefix . . . O (A - Y) Do not Process Blank Lines Do not Process PL/I Comments Use a label prefix of O to enable Do not Process Pascal Comments special coloring when edit Do not Process ADA Comments highlighting is enabled. Do not Process Assembler Comments Do not Process Fortran Comments Do not Process COBOL Comments Data Contains DBCS Characters Enter END to save changes. Enter CANCEL to cancel changes. Command ===> F1=Help F2=Split F3=Exit F7=Backward F8=Forward F9=Swap F12=Cancel
To compare the data to a member in the current data set or concatenation: 1. On the command line, type:
COMPARE (member
2. Press Enter.
COPYCopy Data
The COPY primary command copies a sequential data set or a member of a partitioned data set into the data being edited.
Syntax
COPY member (member) dsname dsname(member) AFTER BEFORE label
start_line end_line member A member of the ISPF library or partitioned data set that you are editing. If a name of eight or fewer characters is specified and it could be a member name or a data set name, COPY searches for a member name first. If no member is found, then the name is used as a data set name. A partially qualified or fully qualified data set name. If the data set is partitioned you can include a member name in parentheses or select a member from a member list. The data is copied after the line with the specified label. The data is copied before the line with the specified label. The number of the first line of the member or data set to be
Chapter 10. Edit Primary Commands
dsname
207
COPY
included in the range of lines to be copied. Must be greater than or equal to 1, and less than or equal to the number of lines in the member or data set. To specify standard, ISPF, or COBOL line numbers, omit the member name or data set name to use the Extended Edit Copy panel. end_line The number of the last line to be included in the range of lines to be copied. Must be greater than or equal to start_line and less than or equal to the number of lines in the member or data set.
The label can be either a label that you define or one of the PDF editor-defined labels, such as .ZF and .ZL. If you have not defined a label and the ISPF editor-defined labels are not appropriate for your purpose, use the A (after) or B (before) line command to specify where the data is to be copied. If the data set or member that you are editing is empty, you do not need to specify a destination for the data being copied. Note: If the member name or data set name is less than 8 characters and the data set you are editing is partitioned a like-named member is copied. If a like-named member does not exist, the name is considered to be a partially qualified data set name.
Description
COPY adds a copy of data that already exists to the data set or member that you are editing. Use MOVE if you want to move data from one data set or member to another, rather than just copy it. To copy data into an empty data set or member: 1. On the command line, type:
COPY member
or:
COPY dsname
The member or data set name operand is optional. If you do not specify the name of a member or of a data set to be copied, the Edit Copy panel appears. Enter the data set or member name on this panel. Also, if you are copying a member of a partitioned data set, you can specify the numbers of the first and last lines to be copied, along with the kind of line numbers (standard, ISPFSTD, COBOL, or relative) on the Edit Copy panel. This allows you to copy only part of the data set or member. Note: When you select ISPFSTD line numbers and the STATS mode is ON, the editor uses the first 6 digits and ignores the 2-digit modification number. When the STATS mode is OFF, the editor uses all 8 digits. 2. Press Enter. The data is copied. To copy data into a data set or member that is not empty: 1. On the command line, type:
COPY member AFTER | BEFORE label start_line end_line start_line end_line
or:
COPY dsname AFTER | BEFORE label
208
COPY
The member or dsname operand is optional. You should omit the member name only if you do not know the member name, or if you are going to copy a sequential data set or a member of a different partitioned data set. The AFTER label and BEFORE label operands are also optional. However, if the data set or member that is to receive the copied data is not empty, you must specify a destination for the copied data. Therefore, if you do not want to use a label, you can substitute either the A (after) or B (before) line command as the destination of the copied data. However, a number indicating that the A or B command should be repeated cannot follow the line command. See the descriptions of these commands for information about them. If the data set or member is not empty and you do not specify a destination, a MOVE/COPY Pending message appears in the upper-right corner of the panel and the data is not copied. When you type a destination and press Enter, the data is copied. 2. press enter. If you entered a member name or data set name, the member or data set is copied. Otherwise, the edit copy panel appears. If a range of line numbers is specified, only those lines are copied. See the previous example for more information. See Copying and Moving Data on page 42 if you need more information.
Examples
The following steps show how you can copy data when you omit the member name and the ISPF editor panels appear. 1. Type COPY on the command line and specify the destination of the operation. The panel in Figure 112 shows you that the data is to be copied after line 000700, as specified by the A (after) line command.
File Edit Edit_Settings Menu Utilities Compilers Test Help EDIT P020136.PRIVATE.PLS(INTO) - 01.00 Columns 00001 00072 Command ===> copy Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000100 000200 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 000300 000400 THIS IS THE MEMBER INTO WHICH THE LINES ARE TO BE COPIED. 000500 000600 +---------------------+ a 0700 | | 000800 | | 000900 | | 001000 | | 001100 +---------------------+ 001200 001300 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 001400 ****** **************************** Bottom of Data ****************************
F1=Help F8=Down
F2=Split F9=Swap
F3=Exit F10=Left
F5=Rfind F11=Right
F6=Rchange F12=Cancel
F7=Up
2. When you press Enter, the Edit Copy panel appears. Specify the data you want copied.
209
COPY
The example in Figure 113 copies the data set member named COPYFROM. Since you are using the Edit Copy panel, you can also specify the first and last lines you want copied.
Menu RefList Utilities Help Edit/View - Copy Command ===> _________________________________________________________________ More: Project . . . PROJ1 Group . . . . USERID . . . ________ . . . ________ . . . ________ Type . . . . CLIST Member . . . (Blank or pattern for member selection list) From Other Partitioned or Sequential Data Set: Data Set Name . . _________________________________________________________ Volume Serial . . ______ (If not cataloged) Data Set Password . . (If password protected)
Line Numbers (Blank for entire member or seq. data set) First line . . . . ________ Last line . . . . . ________ Number type . . . . ________ (Standard, ISPFstd, COBOL, or Relative) Press Enter key to copy, enter End command to cancel copy. F1=Help F2=Split F3=Exit F7=Backward F8=Forward F10=Actions F12=Cancel
F9=Swap
3. Figure 114 shows the contents of the COPYFROM member, which is copied into the original data set.
EDIT ****** 000100 000200 000300 000400 ****** . . . P020136.PRIVATE.PLS(COPYFROM) - 01.00 Columns 00001 00072 ***************************** Top of Data ****************************** @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ These are the lines that are to be copied. These are the lines that are to be copied. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ **************************** Bottom of Data ****************************
4. When you press Enter, the editor copies the data and displays a short message in the upper right side of the panel. Figure 115 shows the result of the copy operation.
210
CREATE
File Edit Edit_Settings Menu Utilities Compilers Test Help EDIT P020136.PRIVATE.PLS(INTO) - 01.00 Member COPYFROM copied Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000100 000200 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 000300 000400 THIS IS THE MEMBER INTO WHICH THE LINES ARE TO BE COPIED. 000500 000600 +---------------------+ 000700 | | 000710 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 000720 These are the lines that are to be copied. 000730 These are the lines that are to be copied. 000740 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 000800 | | 000900 | | 001000 | | 001100 +---------------------+ 001200 001300 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ F1=Help F2=Split F3=Exit F5=Rfind F6=Rchange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
CREATECreate Data
The CREATE primary command creates a member of a partitioned data set, or a sequential data set, from the data you are editing.
Syntax
CREATE CRE member (member) dsname(member) dsname (1) labela labelb
Notes: 1 If you dont specify the group of lines using labels, you must specify the group by using C or M line commands. The name of the new member added to the partitioned data set currently being edited. If you are using a concatenated sequence of libraries, the member is always written to the first library in the sequence. Labels identifying the start and end of the group of lines which are added to the new member. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56. dsname(member) The name of a different partitioned data set and new member name to be added to the partitioned data set. The data set name can be fully qualified or partially qualified. dsname The name of a different sequential data set to be added. The data set name can be fully qualified or partially qualified.
Chapter 10. Edit Primary Commands
member
labela, labelb
211
CREATE
Description
CREATE adds a new member to a partitioned data set only if a member of the same name does not already exist. Use REPLACE if the member already exists. To create a member of a partitioned data set or a sequential data set: 1. On the command line, type one of the following:
CREATE CREATE CREATE CREATE member labela labelb (member) labela labelb dsname(member) labela labelb dsname labela labelb
The member operand is optional unless you specify a data set name. It represents the name of the member you want to create. The labela and labelb operands specify the first and last lines in a group of lines used to create the new member or sequential data set. If you omit the labela and labelb operands, you must specify the lines by using either the C (copy) or M (move) line command. See the descriptions of these commands if you need more information about them. If you omit the labela and labelb operands and do not enter one of the preceding line commands, a CREATE Pending message is displayed in the upper-right corner of the panel. 2. Press Enter. If you did not specify the name of the member or the name of another partitioned data set along with the member name to be created, the Edit Create panel appears (see Figure 117 on page 213). Enter the member name on this panel and press Enter again. If you used either a pair of labels or a C line command, the data is copied from the member that you are editing into the member that you are creating. If you used the M line command, however, the data is removed from the member that you are editing and placed in the member that you are creating. If the data set specified does not exist, ISPF prompts you to see if the data set should be created. You can create the data set using the characteristics of the source data set as a model, or specify the characteristics for the new data set. You can suppress this function through the ISPF configuration table, causing any CREATE request for a nonexistent data set to fail. See Creating and Replacing Data on page 41 if you need more information about the CREATE command.
Examples
The following steps show how you can create a new member when you omit the member name. 1. Type CREATE on the command line and specify which lines you want to copy or move into the new data set or member. The example in Figure 116 uses the MM (block move) line command to move a block of lines from the data.
212
CREATE
2. When you press Enter, the Edit Create panel (Figure 117) appears. Type the name of a new member and press Enter. If you type the name of a member that already exists, an error message appears and the CREATE fails. The name of the member created for this example is NEWMEM.
Menu RefList Utilities Help -----------------------------------------------------------------------------Edit - Create More: + "Current" Data Set: USERID.PRIVATE.CLIST(SCREEN) To ISPF Library: Project . . . Group . . . . Type . . . . Member . . . USERID PRIVATE CLIST NEWMEM__
To Other Partitioned Data Set Member: Data Set Name . . _________________________________________________________ Volume Serial . . ______ (If not cataloged) Data Set Password . . (If password protected)
Enter "/" to select option _ Specify pack option for "CREATE" Data Set Command ===> _________________________________________________________________ F1=Help F2=Split F3=Exit F7=Backward F8=Forward F9=Swap F10=Actions F12=Cancel
3. Figure 118 shows the lines remaining in the original member after the specified lines were moved to the new member.
213
CREATE
4. Figure 119 shows the contents of the new member. The data is renumbered only if both number mode and autonum mode are on. A source listing of the data is also recorded in the ISPF list data set for eventual printing if autolist mode is on. In this example, the lines have retained their original line numbers.
214
CUT
Syntax
CUT .ZFIRST .ZLAST (1) labela labelb DISPLAY DEFAULT clipboard_name X NX APPEND REPLACE
Notes: 1 You can also specify the group of lines using C or M line commands. Labels identifying the start and end of the group of lines the CUT command is to copy or move to the clipboard. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56. clipboard_name The name of the clipboard to use. If you omit this parameter, the ISPF default clipboard (named DEFAULT) is used. You can define up to ten additional clipboards. The size of the clipboards and number of clipboards might be limited by installation defaults. X NX REPLACE Cut only lines that are excluded from the display. Cut only lines that are not excluded from the display. Replace existing data in the clipboard. You can select REPLACE as the default by entering the EDITSET command on the editor command line. The default action depends on the setting specified in the panel displayed by the EDITSET. You should always specify REPLACE (or APPEND) in a macro because the user can change the default behavior. APPEND Add the data to the clipboard. You can select APPEND as the default by entering the EDITSET command on the editor command line. The default action depends on the setting specified in the panel displayed by the EDITSET. You should always specify APPEND (or REPLACE) in a macro because the user can change the default behavior. Show a list of existing clipboards. From this list you can browse, edit, clear, or rename the clipboards.
labela, labelb
DISPLAY
Description
CUT saves copies of lines from an edit session to a clipboard for later retrieval by the PASTE command. The lines are moved or copied from the session to the named clipboard. Lines are specified by either the C (Copy) or M (Move) line commands, CC or MM block line commands, or label names. If the C or CC line commands or labels are used to identify the lines, the lines are copied to the
215
CUT
clipboard. If the M or MM line commands are used to identify the lines, the lines are copied to the clipboard and deleted from the edit session (in effect, moving them). All lines in the edit session are copied to the clipboard if you do not specify the lines using a label range on the CUT command, or through the C or M commands. If you specify a clipboard name, lines are copied to that clipboard. If the specified clipboard does not yet exist, it is created. ISPF provides a default clipboard named DEFAULT. You can use up to 10 other clipboards that you define. The defined clipboards exist as long as you are logged on to TSO and are deleted when you log off. To browse, edit, clear, or rename any of the clipboards, use the DISPLAY keyword of the CUT command:
CUT DISPLAY
Examples
| | | | | This command saves to the default clipboard all the lines in the current file from the current cursor position to the last line. These lines are appended to any lines that are already in the clipboard:
CUT .ZCSR .ZLAST APPEND
To save all the lines in the current file to a clipboard named USERC1, replacing any lines already in the clipboard:
CUT .ZFIRST .ZLAST USERC1 REPLACE
| | |
This example assumes that you have APPEND set as the default behavior in the EDITSET command panel. Because all lines are copied by default, in this case you could omit the labels .ZFIRST and .ZLAST.
DEFINEDefine a Name
The DEFINE primary command is used to: v Identify a macro that replaces a built-in command of the same name v Identify programs that are edit macros v Assign an alias to a macro or built-in command v Make a macro or built-in command inoperable v Reset an inoperable macro or built-in command v Disable a macro or built-in command DEFINE is often used with the BUILTIN command.
Syntax
CMD DEFINE DEF name MACRO PGM ALIAS name_2 NOP RESET DISABLED The name for the command.
name
216
DEFINE
MACRO CMD Identifies the name you are defining as a command language (CLIST or REXX exec) macro, which is called in the same way as using the SELECT service CMD keyword with a percent symbol (%) preceding the command. That means that you can specify only CLISTs or REXX EXECs. MACRO PGM Identifies the name that you are defining as a program (load module) macro. ALIAS name_2 Identifies the name you are defining as an alias of another name, with the same characteristics. If name_2 is already an alias, the editor replaces it with the command for which it is an alias. Therefore, it is not possible to have an alias of an alias. NOP Makes the name that you are defining and all of its aliases inoperable until you reset them with RESET. Therefore, when the name or an alias of the name is called, nothing is processed. NOP is similar to DISABLED, except that disabled names cannot be reset by the RESET operand. Resets the most recent definition of the name that you are defining to the status in effect before that definition. For example, RESET makes inoperable names operable again. Disables the name you are defining and all of its aliases until you completely exit the editor and return to the ISPF Primary Option Menu. Therefore, when the name or an alias of the name is entered, nothing is processed. A disabled command or macro cannot be restored by the RESET operand. To disable RESET, use delimiters around RESET to distinguish it from the keyword.
RESET
DISABLED
Description
The effects of a DEFINE command remain until you either issue DEFINE RESET or exit from the editor. You enter the editor when you select option 2, and you do not exit the editor until you return to the ISPF Primary Option Menu. Therefore, if you edit several members of a partitioned data set, one DEFINE at the beginning affects them all. To temporarily override the DEFINE command, use the BUILTIN command.
stacks three definitions of A. Only the last one is effective. Here, A would be defined as SAVE. The following operation:
DEFINE A RESET
removes one command from the stack, making the previous command effective. In the preceding example, A would now be defined as COPY.
Chapter 10. Edit Primary Commands
217
Examples
To define the name IJKDOIT as a CLIST or REXX macro, enter:
DEFINE IJKDOIT MACRO
DELETEDelete Lines
The DELETE primary command deletes lines from the data you are editing. Note: As a precaution against error, there is no DELETE ALL command. To delete all lines, see Description.
Syntax
DELETE DEL ALL labela labelb ALL labela labelb X NX
ALL
Specifies that all selected lines are deleted. The DELETE command, unlike FIND, CHANGE, and EXCLUDE, does not accept NEXT, FIRST, PREV, or LAST. ALL is required to emphasize that NEXT is not the default. Restricts the lines deleted to those that are excluded. Restricts the lines deleted to those that are not excluded. Labels identifying the start and end of the group of lines which are deleted, including the lines with the labels. To delete one line, enter the same label twice. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
X NX labela, labelb
Description
To delete all lines, do one of the following: v To delete all lines by using the editor-defined labels:
DELETE ALL .ZFIRST .ZLAST
v To delete all lines by first resetting any excluded lines to make them not excluded, and then deleting all lines that are not excluded:
218
DELETE
RESET; DELETE ALL NX
Examples
In the examples that follow, .labela and .labelb represent the two labels that show the range of lines to be deleted. v To delete all excluded lines:
DELETE ALL X
You can more easily determine which lines to delete in a large data set by excluding lines that meet some criterion, or by leaving all lines that meet the criterion non-excluded. Then, with DELETE you can delete many lines. For example, to delete all blank lines in a data set, type the following commands on the command line and press Enter after each one: 1. First, reset all excluded lines:
RESET X
Another way to do the same thing is this: 1. First, exclude all lines:
EXCLUDE ALL
3. Finally, delete the remaining excluded lines, which contain only blanks:
DEL ALL X
Syntax
EDIT member member A member of the ISPF library or other partitioned data set you are currently editing. You may enter a member pattern to generate a member list.
219
EDIT
Description
Editing one data set or member while you are already editing another is called recursive editing. To edit another data set or member during your current edit session: 1. On the command line, type:
EDIT member
Here, member represents the name of a member of the partitioned data set you are editing. The member operand is optional. 2. Press Enter. If you specified a member name, the current library concatenation sequence finds the member. The member is displayed for editing. If you do not specify a member name, the Edit Command Entry panel, which is identical to the regular Edit Entry panel, appears. You can enter the name of any sequential or partitioned data set to which you have access. When you press Enter, the data set or member is displayed for editing. The editor suspends your initial edit session until the second-level edit session is complete. Editing sessions can be nested until you run out of storage. 3. To exit from a nested edit session, enter an END or CANCEL command. The current edit session resumes.
Examples
The following steps show the use of the EDIT primary command: 1. Assume that you are editing a member named PGM8 and you need to edit a member in another data set. So, you enter the EDIT command on the command line, omitting the member operand, as shown in Figure 120.
220
EDIT
2. When you press Enter, the Edit Command Entry panel (Figure 121) appears. On this panel, you enter the name of the partitioned data set and member that you want to edit:
3. When you press Enter again, the member is displayed for editing, as shown in Figure 122:
221
EDITSET
Syntax
EDITSET EDSET
Description
The EDITSET primary command enables you to modify the Editor settings.
The fields on the panel are as follows: User session initial macro You can specify a macro to be run before you begin editing your sequential data set or any member of a partitioned data set. This initial macro allows you to set up a particular editing environment for the Edit session you are beginning. This initial macro runs in addition to any IMACRO value in your profile. Maximum initial storage allowed for Edit and View The maximum amount of storage that edit and view use when initially loading the data into the edit or view session. This number is in kilobytes and is rounded to the nearest 128 KB value. If you set a limit on the initial
222
EDITSET
amount of storage allowed, and a session requires more than that amount, the data is shown in BROWSE mode instead of edit or view. A value of zero indicates that the edit session should not impose any limits on initial storage used. If this value is zero and there is not enough storage to load the data, a program error can result. Target line for Find/Change/Exclude string This indicates the line of the edit data display to which the target line of a FIND, CHANGE, or EXCLUDE command should be positioned. The value can be from 1 to 99, the default is 2. If the value specified is greater than the last line of the display, the target line is positioned to the last line of the display. Always position Find/Change/Exclude string to target line This determines whether the editor always positions the target line of a FIND, CHANGE, or EXCLUDE command to the target line specified in the Target line for found/changed/excluded string field, or only position the string if it is not currently on the display. The default is to only position the line if it is not on the current display. Remove action bars in ISPF edit and view panels If this field is selected, the action bars in the edit or view panels are not shown. This field affects only those panels that are included in ISPF, and has no effect on customized edit panels or edit panels provided with products other than ISPF. Force ISRE776 if RCHANGE passed arguments If this field is selected then EDIT will ensure that when RCHANGE is issued from a PF key, it does not try to process input from the command line. In this case RCHANGE will treat anything that you type on the command line as an invalid parameter and will return an error message ISRE776. For more information, see Edit commands and PF key processing on page 14. CUT default Append If data exists on the clipboard, append the new data being cut to the end of the existing data. Replace If data exists on the clipboard, replace it with the new data being cut. PASTE default Delete Remove the data from the clipboard after it has been pasted. Keep Do not remove the data from the clipboard after it has been pasted. This allows for data to be pasted multiple times.
Confirm Cancel/Move/Replace When you select this field with a /, a confirmation panel displays when you request one of these actions, and the execution of that action would result in data changes being lost or existing data being overwritten. v For MOVE, the confirm panel is displayed if the data to be moved exists. Otherwise, an error message is displayed. v For REPLACE, the confirm panel is displayed if the data to be replaced exists. Otherwise, the REPLACE command functions like the edit CREATE command, and no confirmation panel is displayed.
Chapter 10. Edit Primary Commands
223
EDITSET
v For CANCEL, the confirmation panel is displayed if any data changes have been made, whether through primary commands, line commands, or typing. Note: Any commands or data changes pending at the time the CANCEL command is issued are ignored. Data changes are pending if changes have been made to the displayed edit data, but no interaction with the host (ENTER, PF key, or command other than CANCEL) has occurred. If no other changes have been made during the edit session up to that point, the confirmation panel is not displayed. Apply Setting Immediately Controls whether a change in the setting applies to the current edit session (immediately) or on the next edit session. Preserve VB record length You can select this option to cause the editor to store the original length of each record in variable-length data sets and when a record is saved, the original record length is used as the minimum length for the record. Apply Setting Immediately Controls whether a change in the setting applies to the current edit session (immediately) or on the next edit session.
Examples
The following steps show the use of the EDITSET primary command: 1. Assume that you are editing a member named PGM8 and you want to change the setting for Confirming a Cancel, Move, or Replace action. So, you enter the EDITSET command on the command line as shown in Figure 124.
2. When you press Enter, the Edit and View Settings panel (Figure 123) appears.
224
EDITSET
3. If necessary, scroll down to display the Confirm Cancel/Move/Replace field. Enter or remove the slash mark in the Confirm Cancel/Move/Replace field to make the setting as you want it to be.
Syntax
END
Description
To end an edit session by using END, do one of the following: v Enter END on the command line, or v Press a function key to which END is assigned. The default setting is F3 If v v v no aliases have been defined for END, the editors response to END depends on: Whether changes were made to the data during your current edit session If changes were made, whether SAVE was entered after the last change The setting of number mode, autonum mode, stats mode, autolist mode, and autosave mode in the edit profile v Whether you were editing a member that was an alias of another member
Examples
To end the current edit session: 1. On the command line, type:
END
2. Press Enter.
Syntax
.ZFIRST .ZLAST EXCLUDE EXCLUDED EXC EX X string labela labelb ALL FIRST LAST PREV PREFIX SUFFIX WORD NEXT CHARS
225
EXCLUDE
The search string you want to exclude. See Finding, Seeking, Changing, and Excluding Data on page 45. Labels identifying the start and end of the group of lines which the EXCLUDE command is to search. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
NEXT ALL FIRST LAST PREV CHARS PREFIX SUFFIX WORD start_col
Starts at the first position after the current cursor location and searches ahead to find the next occurrence of string. Starts at the top of the data and searches ahead to find all occurrences of string. Starts at the top of the data and searches ahead to find the first occurrence of string. Starts at the bottom of the data and searches backward to find the last occurrence of string. Starts at the current cursor location and searches backward to find the previous occurrence of string. Locates string anywhere the characters match. Locates string at the beginning of a word. Locates string at the end of a word. String is delimited on both sides by blanks or other non-alphanumeric characters. The first column to be included in the range of columns to be searched. When you specify only one column, the editor finds the string only if the string starts in the specified column. Number of the first column the EXCLUDE command is to search. Number of the last column the EXCLUDE command is to search.
left_col right_col
Notes: 1. For more information about restricting the search to only a portion of each line, see Limiting the Search to Specified Columns on page 51. 2. The EXCLUDE command allows you to control the starting point and the direction of the search by positioning the cursor and using either the NEXT or PREV operand. For more information, see Starting Point and Direction of the Search on page 49.
Description
You can use the EXCLUDE command with the FIND and CHANGE commands to find a search string, change it, and exclude the line that contains the string from the panel. To exclude the next non-excluded line that contains the letters ELSE without specifying any other qualifications: 1. On the command line, type:
226
EXCLUDE
EXCLUDE ELSE
2. Press Enter. Since no other qualifications were specified, the letters ELSE can be: v Uppercase or a mixture of uppercase and lowercase v At the beginning of a word (prefix), the end of a word (suffix), or the entire word (word) v Anywhere within the current boundaries To exclude the next line that contains the letters ELSE, but only if the letters are uppercase: 1. On the command line, type:
EXCLUDE CELSE
2. Press Enter. This type of exclusion is called a character string exclusion (note the C that precedes the search string) because it excludes the next line that contains the letters ELSE only if the letters are found in uppercase. However, since no other qualifications were specified, the exclusion occurs no matter where the letters are found on a non-excluded line, as outlined in the previous list. For more information, including other types of search strings, see Finding, Seeking, Changing, and Excluding Data on page 45.
Examples
The following example excludes the first non-excluded line in the data set that contains the letters ELSE. However, the letters must occur on or between lines labeled .E and .S and they must be the first four letters of a word:
EXCLUDE ELSE .E .S FIRST PREFIX
The following example excludes the last non-excluded line in the data set that contains the letters ELSE. However, the letters must occur on or between lines labeled .E and .S and they must be the last four letters of a word.
EXCLUDE ELSE .E .S LAST SUFFIX
The following example excludes the first non-excluded line that immediately precedes the cursor position and that contains the letters ELSE. However, the cursor must not be positioned ahead of the lines labeled .E and .S. Also, the letters must occur on or between lines labeled .E and .S; they must be standalone characters (not part of any other word); and they must exist within columns 1 and 5:
EXCLUDE ELSE .E .S PREV WORD 1 5
Syntax
.ZFIRST .ZLAST FIND F string labela labelb ALL FIRST LAST PREV PREFIX SUFFIX WORD NEXT CHARS
227
FIND
X NX
The search string you want to find. See Finding, Seeking, Changing, and Excluding Data on page 45. Labels identifying the start and end of the group of lines which FIND is to search. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
NEXT ALL FIRST LAST PREV CHARS PREFIX SUFFIX WORD X NX start_col
Starts at the first position after the current cursor location and searches ahead to find the next occurrence of string. Starts at the top of the data and searches ahead to find all occurrences of string. Starts at the top of the data and searches ahead to find the first occurrence of string. Starts at the bottom of the data and searches backward to find the last occurrence of string. Starts at the current cursor location and searches backward to find the previous occurrence of string. Locates string anywhere the characters match. Locates string at the beginning of a word. Locates string at the end of a word. String is delimited on both sides by blanks or other non-alphanumeric characters. Scans only lines that are excluded from the display. Scans only lines that are not excluded from the display. The first column to be included in the range of columns to be searched. When you specify only one column, the editor finds the string only if the string starts in the specified column. Number of the first column the FIND command is to search. Number of the last column the FIND command is to search.
left_col right_col
Notes: 1. For more information about restricting the search to only a portion of each line, see Limiting the Search to Specified Columns on page 51. 2. The FIND command allows you to control the starting point and the direction of the search by positioning the cursor and using either the NEXT or PREV operand. For more information, see Starting Point and Direction of the Search on page 49.
Description
You can use the FIND command with the EXCLUDE and CHANGE commands to find a search string, change it, and exclude the line that contains the string from the panel.
228
FIND
To find the next occurrence of the letters ELSE without specifying any other qualifications: 1. On the command line, type:
FIND ELSE
2. Press Enter. Since no other qualifications were specified, the letters ELSE can be: v Uppercase or a mixture of uppercase and lowercase v At the beginning of a word (prefix), the end of a word (suffix), or the entire word (word) v In either an excluded or a non-excluded line v Anywhere within the current boundaries To find the next occurrence of the letters ELSE, but only if the letters are uppercase: 1. On the command line, type:
FIND CELSE
2. Press Enter. This type of search is called a character string search (note the C that precedes the search string) because it finds the next occurrence of the letters ELSE only if the letters are in uppercase. However, since no other qualifications were specified, the letters can be found anywhere in the data set or member, as outlined in the preceding list. For more information, including other types of search strings, see Finding, Seeking, Changing, and Excluding Data on page 45.
Examples
The following example finds the first occurrence in the data set of the letters ELSE. However, the letters must occur on or between lines labeled .E and .S and they must be the first four letters of a word:
FIND ELSE .E .S FIRST PREFIX
The following example finds the last occurrence in the data set of the letters ELSE. However, the letters must occur on or between lines labeled .E and .S; they must be the last four letters of a word; and they must be found in an excluded line.
FIND ELSE .E .S LAST SUFFIX X
The following example finds the first occurrence of the letters ELSE that immediately precedes the cursor position. However, the cursor must not be positioned ahead of the lines labeled .E and .S. The letters must occur on or between lines labeled .E and .S; they must be standalone characters (not part of any other word); they must be found in a non-excluded line; and they must exist within columns 1 and 5:
FIND ELSE .E .S PREV WORD NX 1 5
Syntax
229
FLIP
.ZFIRST .ZLAST FLIP labela labelb labela, labelb Labels identifying the start and end of the group of lines for which FLIP is to reverse the exclude status. If labelb is not supplied, then the single line identified by labela is flipped. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
Description
The FLIP primary command reverses the exclude status of a range of lines you specify with labels. It can also reverse the exclude status of all the lines in a file. FLIP excludes all lines that are currently visible, and makes all excluded lines visible. For example, if you have used the X ALL;FIND ALL xyz command to find lines containing a string (xyz), you can use FLIP to see the lines which do not contain the string. The range is optional. If no range is specified, the exclude status is reversed for all of the lines in the file. To reverse the exclude status of all the lines in a file: 1. Enter the following on the command line:
FLIP
2. Press Enter. All the excluded lines in the file are displayed, and all the previously displayed lines are excluded. To reverse the exclude status of a range of lines: 1. Enter the following on the command line:
FLIP .A .B
Actual values are substituted for .a and .b and can be defined by an edit macro or by the user. 2. Press Enter. All the lines with the specified range that were previously excluded are displayed, and all the lines within the specified range that were displayed are excluded.
Examples
In the example shown in Figure 125, the edit session contains 10 lines:
230
FLIP
After excluding lines 4 through 7, the data set looks like Figure 126:
After executing FLIP, all previously excluded lines are shown. All previously visible lines are excluded, as shown in Figure 127.
231
HEX
Syntax
VERT HEX ON DATA VERT DATA OFF ON VERT ON DATA OFF Displays the hexadecimal representation of the data vertically (two rows per byte) under each character. Displays the hexadecimal representation of the data as a string of hexadecimal characters (two per byte) under the characters. Does not display hexadecimal representation of the data.
Description
The HEX command determines whether the editor displays hexadecimal representation in a vertical or data string format. See Figure 129 on page 234 and Figure 130 on page 234 for examples of these two formats. When the editor is operating in hexadecimal mode, three lines are displayed for each source line. The first line shows the data in standard character form, while the next two lines show the same data in hexadecimal representation. This applies to every line except profile lines (=PROF>), excluded line messages (- - - ), message lines (==MSG>), and informational lines (======).
| | |
232
HEX
Besides normal editing on the first of the three lines, you can change any characters by typing over the hexadecimal representations. You can also use the FIND, CHANGE, and EXCLUDE commands to find, change, or exclude invalid characters or any specific hexadecimal character, regardless of the setting of hexadecimal mode. See the discussion of picture strings and hexadecimal strings under Finding, Seeking, Changing, and Excluding Data on page 45.
Examples
Suppose you are editing the data set member shown in Figure 128:
Pressing Enter causes the hexadecimal value for each character on the panel, including blanks, to be displayed in vertical format, as shown in Figure 129 on page 234.
233
HEX
You can enter the HEX DATA command to change the display to data format, as shown in Figure 130.
234
HIDE
Syntax
HIDE EXCLUDE EXCLUDED EXC EX X Removes each n Line(s) not Displayed message from the display and underscores the line number field of the preceding line.
Description
The HIDE command removes the n Line(s) not Displayed messages from the display where lines have been excluded by the EXCLUDE command. Instead the line number field of the preceding line is underscored (where the terminal supports the underscore attribute) to indicate that part of the data is not being displayed. The RESET HIDE command redisplays the excluded lines messages.
Examples
In Figure 131, the edit session shows that three lines are excluded after line 000020 and one line is excluded after line 000060:
EDIT ****** 000010 000020 - - 000060 - - 000080 000090 000100 ****** SBURNF.PRIVATE.DATA(HIDEXMP) - 01.01 Columns 00001 00072 ***************************** Top of Data ****************************** example text line number 00010 example text line number 00020 - - - - - - - - - - - - - - - - 3 Line(s) not Displayed example text line number 00060 - - - - - - - - - - - - - - - - 1 Line(s) not Displayed example text line number 00080 example text line number 00090 example text line number 00100 **************************** Bottom of Data ****************************
Figure 132 shows the edit session after the HIDE X command is entered. Note that the line number fields for lines 000020 and 000060 are underscored.
235
HILITE
EDIT SBURNF.PRIVATE.DATA(HIDEXMP) - 01.01 Columns 00001 00072 ****** ***************************** Top of Data ****************************** 000010 example text line number 00010 000020 example text line number 00020 000060 example text line number 00060 000080 example text line number 00080 000090 example text line number 00090 000100 example text line number 00100 ****** **************************** Bottom of Data ****************************
Command ===>
Syntax
HILITE OFF ON NOLOGIC LOGIC IFLOGIC DOLOGIC AUTO DEFAULT OTHER ASM BOOK C COBOL DTL HTML IDL JCL PANEL PASCAL PLI REXX SKEL SUPERC XML
236
HILITE
|
MARGINS left_col * PAREN FIND right_col * CURSOR SEARCH DISABLED
RESET
ON OFF LOGIC
Sets program coloring ON and turns LOGIC coloring off. Sets coloring OFF, with the exception of cursor, find, and parenthesis highlighting. LOGIC highlighting matches logical language-specific keywords in the same color. If an unmatched closing keyword is found, such as END for PL/I or :eul. for BookMaster, it is highlighted in reverse video pink only if HILITE LOGIC is active. When logic is being highlighted, only comments are highlighted along with it. Logic highlighting is available only for PL/I, PL/X, REXX, OTHER, C, SKELS, Pascal, and BookMaster. HILITE LOGIC turns on both IFLOGIC and DOLOGIC. Note: LOGIC highlighting can be turned off by issuing HILITE ON, HILITE NOLOGIC, or HILITE RESET commands. Changing the HILITE language does not change the LOGIC setting.
IFLOGIC
Turns on IF/ELSE logic matching. IFLOGIC matches IF and ELSE statements. When IFLOGIC is enabled, unmatched ELSE keywords are highlighted in reverse video pink. Turns on DO/END logic matching. DOLOGIC matches logical blocks such as DO/END in PL/I or :ol/:eol in BookMaster. For the C language, DOLOGIC matches curly braces ({ and }). C trigraphs for curly braces are not recognized and are not supported by DOLOGIC highlighting. When DOLOGIC is enabled, unmatched logical block terminators (such as END keywords in PL/I, :e tags in BookMaster or right braces ( } ) in C) are highlighted in reverse video pink. Same as ON. Allows ISPF to determine the language. Highlights the data in a single color. Highlight the data as a pseudo-PL/I language. Limited CLIST support is also provided by OTHER. Highlights the data as Assembler. Highlights the data as BookMaster. Highlights the data as C. Highlights the data as COBOL Highlights the data as Dialog Tag Language. Highlights the data as HTML. Highlights the data as IDL. Highlights the data as MVS Job Control Language.
Chapter 10. Edit Primary Commands
DOLOGIC
NOLOGIC AUTO DEFAULT OTHER ASM BOOK C COBOL DTL HTML IDL JCL
237
HILITE
PANEL PASCAL PLI REXX SKEL SUPERC XML | | | | | | | | | | | | | | | | | | | | | | | | | RESET PAREN Highlights the data as ISPF Panel Language. Highlights the data as Pascal. Highlights the data as PL/I. Highlights the data as REXX. Highlights the data as ISPF Skeleton Language. Highlights the data as a SuperC Listing. Highlights the data as XML.
MARGINS [left-margin | * [right-margin | * ] ] Specifies either or both of the left-margin or right-margin parameters for languages C, PL/I, and PL/X. The MARGINS keyword can be included on the same command that includes one of these languages. It cannot be specified when the language AUTO is specified, even if the language would subsequently be determined to be C, PL/I, or PL/X. left-margin The left hand margin for processing the language source. The value must be within the range as defined by the language. The maximum value is 254 for C, 100 for PL/I, and 65 for PL/X. If left-margin exceeds the last input column or if an asterisk (*) is specified, the default left margin is obtained from the ISPF configuration table keyword for this language (HILITE_MARGIN_C, HILITE_MARGIN_PLI, or HILITE_MARGIN_PLX). right-margin The right hand margin for processing the language source. The value must be within the range as defined by the language. The maximum value is 255 for C, 200 for PL/I, and 80 for PL/X. If right-margin exceeds the last input column or if an asterisk (*) is specified, the default right margin is obtained from the ISPF configuration table keyword for this language (HILITE_MARGIN_C, HILITE_MARGIN_PLI, or HILITE_MARGIN_PLX). Resets defaults (AUTO, ON, Find and Cursor on). Toggles parenthesis matching. When parenthesis matching is active, only comments are specially colored. All other code appears in the default color. Note that extra parenthesis highlighting is always active when highlighting is active. The HILITE FIND command toggles the highlighting color of any string that would be found by an RFIND. The user can select the highlight color. The default is reverse video white. Only non-picture strings are supported, and the only additional qualifiers recognized are hex strings (X...), character strings (C...), text strings (T...), WORD, PREFIX and SUFFIX, and boundaries specified in the FIND command. Hex strings may be highlighted, but non-displayable characters are not highlighted. Labels are ignored when FIND strings are highlighted. Because FIND highlighting is not quite as robust as the FIND command itself, the editor may highlight more occurrences of the FIND string than FIND would actually locate. The FIND operand
FIND
238
HILITE
toggles the display of search strings. If HILITE FIND is issued when FIND highlighting is in effect, FIND highlighting is disabled. Similarly, if FIND highlighting is disabled, the HILITE FIND command enables it. Note: RESET has been enhanced, through the addition of a FIND operand, to temporarily disable the highlighting of FIND strings until the next FIND, RFIND, CHANGE, or RCHANGE command is issued. RESET with the FIND operand (or no operands at all), temporarily disables the highlighting of FIND strings. CURSOR The CURSOR operand toggles the highlighting of the phrase that contains the cursor in a user selectable color. The default is white. Cursor highlighting in Edit is performed in a manner similar to the way it is done in Browse. The entire phrase from the previous blank to the next blank is highlighted. The CURSOR operand toggles cursor highlighting. If HILITE CURSOR is issued when CURSOR highlighting is in effect, CURSOR highlighting is disabled. Similarly, if CURSOR highlighting is disabled, the HILITE CURSOR command enables it. SEARCH HILITE SEARCH finds the first unmatched END, ELSE, }, or ) above the last displayed line on the screen. If a mismatched item is found, the file is scrolled so that the mismatch is at the top of the screen. The search for mismatches only occurs for lines above the last displayed line, so you may need to scroll to the bottom of the file before issuing the HI SEARCH command. Search is not available when the DEFAULT language operand is used. Search for language keywords is only supported for languages which supported by the logic option. DISABLED Turns off all HILITE features and removes all action bars. This benefits performance at the expense of function. Since DISABLED status is not stored in the edit profile, you need to reenter this operand each time you enter the editor. When DISABLED is in effect, keylists are unavailable for that edit session.
Description
The HILITE primary command can be used to highlight, in user-specified colors, many language-specific constructs, program logic features, the phrase containing the cursor, and any strings that match the previous FIND operation or those that would be found by an RFIND or RCHANGE request. In addition, when HILITE is entered with no operands, a dialog appears that allows you to set default colors for the data area in non-program files, for any characters typed since the previous Enter or PF key entry, and for strings located by FIND. Both HI and HILIGHT are valid synonyms for HILITE. Note: Highlighting is not available for edit sessions that involve the following: v Data sets with record lengths greater than 255 v Mixed mode edit sessions (normally used when editing DBCS data) v Formatted data
239
IMACRO
Syntax
IMACRO name NONE The name of the initial macro to be run when you are editing the data set type that matches the current edit profile. This macro is run before any data appears. For more information about displaying and defining a profile, see Displaying or defining an edit profile on page 17. NONE Indicates that no macro is to be run at the beginning of each edit session. The edit profile shows a value of NONE when no initial macro has been specified.
name
Examples
To save STARTUP as the initial macro, type:
IMACRO STARTUP
Syntax
LEVEL num num The modification level. It can be any number from 0 to 99.
Description
To specify the modification level number: 1. On the command line, type:
LEVEL num
240
LEVEL
Examples
In Figure 133, the version and modification level numbers on line 1 show that this is Version 1, Modification 3 (01.03). Type LEVEL 0 on the command line to reset the modification level number to 00.
After you press Enter, the editor resets the modification level, as shown in Figure 134.
241
LOCATE
LOCATELocate a Line
The LOCATE primary command allows you to scroll up or down to a specified line. The line then appears as the first line on the panel. There are two forms of LOCATE: specific and generic.
Syntax
Specific Locate Syntax LOCATE label linenum
The specific form of the LOCATE command positions a particular line at the top of the panel. You must specify either a line number or a label. label linenum A previously assigned label. An edit line number. If that line number exists, it appears at the top. If the line number does not exist, the line with the next lower number appears at the top of the data area. The linenum operand is a numeric value of up to 8 digits. You do not need to type leading zeros. If the operand contains 6 or fewer digits, it refers to the number in the line command field to the left of each line. If linenum contains 7 or 8 digits, it refers to the sequence numbers in the data records. For NUMBER ON STD, the editor refers to the modification flag. For NUMBER OFF, it refers to the ordinal line number (first=1, fifth=5, and so on). For NUMBER ON COBOL, it refers to the number in the line command field, which is the data sequence number. See Sequence number format and modification level on page 27 for more information. Generic Locate Syntax NEXT LOCATE FIRST LAST PREV CHANGE COMMAND ERROR EXCLUDED LABEL SPECIAL INFOLINE MSGLINE NOTELINE .ZFIRST .ZLAST labela labelb
The generic LOCATE command positions the panel to the first, last, next, or previous occurrence of a particular kind of line. FIRST LAST NEXT Searches from the first line, proceeding forward. Searches from the last line, proceeding backward. Searches from the first line of the page displayed, proceeding forward.
242
LOCATE
PREV CHANGE COMMAND ERROR EXCLUDED LABEL SPECIAL Searches from the first line of the page displayed, proceeding backward. Searches for a line with a change flag (==CHG>). Searches for a line with a pending line command. Searches for a line with an error flag (==ERR>). Searches for an excluded line. Searches for a line with a label. Searches for a special non-data (temporary) line: v Bounds line flagged as =BNDS> v Column identification lines flagged as =COLS> v Information lines flagged as ====== v Mask lines flagged as =MASK> v Message lines flagged as ==MSG> v Note lines flagged as =NOTE= v Profile lines flagged as =PROF> v Tabs line flagged as =TABS> Searches for information lines flagged with ====== Searches for message lines flagged with ==MSG> Searches for note lines flagged with =NOTE= Labels identifying the start and end of the group of lines to be searched. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
Examples
To find the next special line, type:
LOCATE SPE
To find the next excluded line between .START and .END, type:
LOC X .START .END
243
MODEL
The class name form of the MODEL primary command changes the model class that the editor uses to determine which model you want. For more information on edit models, see Chapter 4, Using Edit Models.
Syntax
Model name syntax MODEL model_name AFTER BEFORE qualifier label
NOTES NONOTES
If you omit the model name or a required qualifier, or if there is a validation error, the editor displays a series of selection panels from which you can select the desired information. model_name The name of the model to be copied, such as VGET for the VGET service model. This operand can also be one of the options listed on a model selection panel, such as V1 for the VGET service model. See z/OS ISPF Planning and Customizing for a list of models and model names. qualifier The name of a model on a secondary model selection panel, such as TBCREATE for the TBCREATE service model. This operand can also be one of the options listed on a model selection panel, such as G1 for the TBCREATE service model. For example, a model selection panel allows you to enter T1 to choose table models. Another model selection panel then appears for choosing table models, such as G1 for the TBCREATE service model. Therefore, your MODEL primary command could use either TABLES or T1 as the model-name operand and either TBCREATE or G1 at the qualifier operand. The simplest way would be to use TBCREATE or G1 as the model-name operand and omit the qualifier operand. See z/OS ISPF Planning and Customizing for a list of models and model names. AFTER label Identifies the line after which the model is to be copied. If you have not defined a label, use the A or B line command to specify the destination. The only time this operand or the BEFORE label operand is not required is when the data set or member is empty. BEFORE label Identifies the line before which the model is to be copied. If you have not defined a label, use the A or B line command to specify the destination. The only time this operand or the AFTER label operand is not required is when the data set or member is empty.
244
MODEL
NOTES Overrides the current edit profile setting for note mode, to include any notes that are part of the model. NONOTES Overrides the current edit profile setting for note mode, to exclude any notes that are part of the model. Class name syntax MODEL CLASS class_name
If you omit class_name, or if there is a validation error, the editor displays a series of selection panels from which you can select the desired information. CLASS When entered without the optional class_name operand, the editor displays the Model Classes panel, from which you can select a model class. When entered with the class_name operand, the macro specifies that the current model class is to be replaced by class_name. In both cases, the new class name is used for all models from that point on, until you change the model class again or end the edit session. class_name Specifies a new class for the current edit session. It must be a name on the Model Classes panel or an allowable abbreviation. The model class coincides with the type of model, such as REXX, COBOL, or FORTRAN.
Examples
You are editing a new member named NEWMEM and have not decided which service to use first. Figure 135 shows the display screen for NEWMEM. Type MODEL on the command line without any operands. Here, the model name form of the MODEL command is used and the A (after) line command is used instead of the AFTER operand.
245
MODEL
The data set type is EXEC, so the editor displays the REXX Models panel (Figure 136) when you press Enter. To begin with the VGET service, you type V1 on the Option line and press Enter.
REXX Models Display D1 DISPLAY D2 TBDISPL D3 SETMSG D4 PQUERY D5 ADDPOP D6 REMPOP File F1 F2 F3 F4 Tailoring FTOPEN FTINCL FTCLOSE FTERASE Miscellaneous M1 SELECT M2 CONTROL M3 BROWSE M4 EDIT M5 LOG M6 GETMSG M7 EDREC M8 LIBDEF M9 LIST M10 VIEW Variables V1 VGET V2 VPUT V3 VERASE L1 L2 L3 L4 L5 L6 L7 L8 L9 L10 L11 L12 L13 L14 L15 Library Access LMCLOSE L16 LMERASE L17 LMFREE L18 LMGET L19 LMINIT L20 LMMADD L21 LMMDEL L22 LMMFIND L23 LMMLIST L24 LMMREN L25 LMMREP L26 LMOPEN L27 LMPROM L28 LMPUT L29 LMQUERY L30 LMRENAME LMHIER LMACT LMDEACT LMREVIEW LMMDISP LMMOVE LMCOPY LMCOMP LMMSTATS LMPRINT LMDINIT LMDLIST LMDFREE LMDDISP
Tables T1 TABLES
Enter END command to cancel MODEL command. Option ===> __________________________________________________________________ F1=Help F2=Split F3=Exit F9=Swap F12=Cancel
The editor inserts the VGET service model into the NEWMEM member, as shown in Figure 137. Because the edit profile is set to NOTE ON, the models notes are also included.
246
MOVE
MOVEMove Data
The MOVE primary command moves a sequential data set or a member of a partitioned data set into the data being edited.
Syntax
MOVE member (member) dsname Notes: 1 If you dont specify the position using a label, you must specify the position by using an A or B line command. A member of the ISPF library or partitioned data set you are editing. A partially qualified or fully qualified data set name. If the data set is partitioned you can include a member name in parentheses or select a member from a member list. The data is moved after the line with the specified label. The data is moved before the line with the specified label. (1) AFTER BEFORE label
member dsname
The label can be either a label you define or one of the editor-defined labels, such as .ZF and .ZL. If you have not defined a label and the editor-defined labels are not appropriate for your purpose, use the A (after) or B (before) line command to specify the datas destination.
247
MOVE
If the data set or member that you are editing is empty, you do not need to specify a destination for the data being moved. Note: If the member name or data set name is less than 8 characters and the data set you are editing is partitioned a like-named member is copied. If a like-named member does not exist, the name is considered to be a partially qualified data set name.
Description
MOVE adds data that already exists to the data set or member that you are editing. Use MOVE if you want to move data rather than copy it from one data set or member to another. The member or sequential data set is deleted after the move. For a concatenated sequence of ISPF libraries, the deletion occurs only if the member was in the first library. To move data into an empty data set or member: 1. On the command line, type:
MOVE member
or:
MOVE dsname
The member and dsname operands are optional. If you do not specify the name of a member or a data set to be moved, the Edit Move panel appears. Enter the data set or member name on this panel. 2. Press Enter. The data is moved. To move data into a data set or member that is not empty: 1. On the command line, type:
MOVE member AFTER | BEFORE label
or:
MOVE dsname AFTER | BEFORE label
The member operand is optional. The AFTER label and BEFORE label operands are optional, also. However, if the data set or member that is to receive the moved data is not empty, you must specify a destination for the moved data. Therefore, if you do not use a label, substitute either the A (after) or B (before) line command as the destination of the moved data. However, a number indicating that the A or B command should be repeated cannot follow the line command. If the data set or member is not empty and you do not specify a destination, a MOVE/COPY Pending message is displayed in the upper-right corner of the panel and the data is not moved. When you type a destination and press Enter, the data is moved. 2. Press Enter. If you entered a member name or a data set name, the member or data set is moved. Otherwise, the Edit Move panel appears. See the previous example for more information. See Copying and Moving Data on page 42 if you need more information.
Examples
The following steps show how you can move data when you omit the member name and the editor panels appear.
248
MOVE
1. Type MOVE on the command line and specify the destination of the operation. In Figure 138, the data is to be moved after line 000700, as specified by the A (after) line command.
2. When you press Enter, the Edit Move panel appears. Specify the data you want moved. This example (Figure 139) moves the data set member named MOVEFROM.
Menu RefList Utilities Help -----------------------------------------------------------------------------Edit/View Move "Current" Data Set: ________________________________________________________ From ISPF Library: Project . . . PROJ1 Group . . . . PRIVATE . . . ________ . . . ________ . . . ________ Type . . . . DATA Member . . . MOVEFROM (Blank or pattern for member selection list) From Other Partitioned or Sequential Data Set: Data Set Name . . _________________________________________________________ Volume Serial . . ______ (If not cataloged) Data Set Password . . (If password protected)
Press ENTER key to move. (Member or sequential data set may be deleted) Enter END command to cancel move. Command ===> _________________________________________________________________ F1=Help F2=Split F3=Exit F7=Backward F8=Forward F9=Swap F10=Actions F12=Cancel
249
MOVE
3. Figure 140 shows the contents of the MOVEFROM member which is moved into the original data set. This panel is shown only for this example, so you can see the data that is being moved. It is not displayed during a move sequence.
EDIT ****** 000100 000200 000300 000400 ****** . . . P020136.PRIVATE.PLS(MOVEFROM) - 01.00 Columns 00001 00072 ***************************** Top of Data ****************************** @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ These are the lines that are to be moved. These are the lines that are to be moved. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ **************************** Bottom of Data ****************************
4. When you press Enter, the editor moves the data and displays a short message in the upper right corner of the panel. Figure 141 shows the result of using MOVE.
Syntax
NONUMBER NONUMBR NONUMB NONUM
250
NONUMBER
Description
You can also use NUMBER OFF to turn off number mode. When number mode is off, NONUMBER prevents any verification of valid line numbers, generation of sequence numbers, and the renumbering of lines that normally occurs when autonum mode is on.
Examples
To turn number mode off by using NONUMBER, enter the following command:
NONUMBER
Syntax
ON NOTES NOTE ON OFF Displays explanatory notes when a model is copied into the data being edited or when notes are added to the edit session by an edit macro. Does not display explanatory notes.
OFF
Description
Note mode is saved in the edit profile. To check the setting of note mode: 1. On the command line, type:
PROFILE 4
2. Press Enter. The note mode setting appears as either NOTE ON or NOTE OFF on the fourth line of the edit profile. You can set the note mode with a primary command and then use the NOTES or NONOTES operand on the MODEL command to override the default mode for a particular model. See MODELCopy a Model into the Current Data Set on page 243 for information about copying dialog development models.
Examples
To set note mode on: 1. On the command line, type:
NOTES ON
2. Press Enter. The next time you insert a model, the explanatory notes appear along with the model. To set note mode off: 1. On the command line, type:
NOTES OFF
Chapter 10. Edit Primary Commands
251
NOTES
2. Press Enter. The next time you insert a model, the explanatory notes are not displayed along with the model.
Syntax
ON STD NULLS NULL NUL ALL ON STD ALL OFF Specifies that in fields containing any blank trailing space, the space is written as one blank followed by nulls. If the field is entirely empty, it is written as all blanks. Specifies that all trailing blanks and all-blank fields are written as nulls. Specifies that trailing blanks in each data field are written as blanks.
ON STD
ON ALL OFF
Description
Blank characters (X40) and null characters (X00) both appear as blanks. When you use the I (insert) line command, the data entry area appears as blanks for NULLS ON STD and as nulls for NULLS ON ALL. Trailing nulls simplify use of the Ins (insert) key on the IBM 3270 keyboard. You can use this key to insert characters on a line if the line contains trailing nulls. Besides using the NULLS command, you can create nulls at the end of a line by using the Erase EOF or Del (delete) key. Null characters are never stored in the data; they are always converted to blanks. Note: When you swap screens in split screen mode, the nulls are replaced by spaces until you press an interrupt key, such as Enter, or a function key.
Examples
To set nulls mode on with all trailing blanks and all-blank fields written as nulls, enter the following command:
NULLS ON ALL
To set nulls mode on with blank trailing space written as one blank followed by nulls and empty fields written as all blanks, enter the following command:
NULLS ON STD
To set nulls mode off and thus have trailing blanks in each data field, enter the following command:
NULLS OFF
252
NUMBER
Syntax
(1) ON NUMBER NUMB NUM STD COBOL STD COBOL NOSTD NOCOBOL NOSTD NOCOBOL OFF Notes: 1 ON STD is the default for non-COBOL data set types. COBOL is the default for COBOL data set types. Automatically verifies that all lines have valid numbers in ascending sequence and renumbers any lines that are either unnumbered or out of sequence. You can also use RENUM to turn number mode on and renumber lines. The editor interprets the STD, COBOL, and DISPLAY operands only when number mode is turned on. OFF Turns number mode off. You can also use NONUMBER to turn number mode off. If you alter or delete sequence numbers and enter NONUMBER on the Command line at the same time, the editor issues the message Some input data ignored and discards the data typed over the sequence numbers. The editor converts the original sequence numbers to data. Numbers the data in the standard sequence field. Numbers the data in the COBOL field. Numbers the data in both fields. If both STD and COBOL numbers are generated, the STD number is determined and then used as the COBOL number. This can result in COBOL numbers that are out of sequence if the COBOL and STD fields were not synchronized. Use RENUM to force synchronization. NOSTD NOCOBOL Turns standard number mode off. Turns COBOL number mode off. DISPLAY
NOSTD NOCOBOL Turns both the standard number mode and COBOL number mode off. DISPLAY Causes the width of the data window to include the sequence number fields. Otherwise, the width of the window does not include the sequence number fields. When you display a data set with a logical record length of 80 and STD numbering, the
Chapter 10. Edit Primary Commands
253
NUMBER
sequence numbers are not shown unless you are using a 3278 Model 5 terminal, which displays 132 characters. Automatic left or right scrolling is performed, if required, so that the left most column of the data window is the first column displayed.
Description
Attention: If number mode is off, make sure the first 6 columns of your data set are blank before turning COBOL number mode on. Otherwise, the data in these columns is replaced by sequence numbers. If that happens and if edit recovery or SETUNDO is on, you can use the UNDO command to recover the data. You can also use CANCEL at any time to end the edit session without saving the data. When number mode is on, NUMBER verifies that all lines have valid numbers in ascending sequence. It renumbers any lines that are either unnumbered or out of sequence, but it does not otherwise change existing numbers. In number mode, the editor automatically generates sequence numbers in the data for new lines created when data is copied or inserted. The editor also automatically renumbers the data when it is saved if autonum mode is in effect. If the number overlays the shift-in (SI) or shift-out (SO) characters, the double-byte characters appear incorrectly and results are unpredictable.
Examples
To number data in the standard sequence field, enter the following:
NUMBER ON STD
To number data in both the standard and COBOL fields and include sequence numbers in the display, enter the following command:
NUMBER ON STD COBOL DISPLAY
PACKCompress Data
The PACK primary command sets pack mode, which controls whether the data is to be stored in packed format. The PACK command saves the pack mode setting in the edit profile. See Packing data on page 16 for more information about packing data.
Syntax
ON PACK OFF ON OFF Saves data in packed format. Saves data in unpacked (standard) format.
Examples
To set pack mode on, enter the following command:
PACK ON
254
PACK
PACK OFF
Syntax
DEFAULT PASTE clipboard_name AFTER BEFORE label KEEP DELETE
clipboard_name The name of the clipboard to use. If you omit this parameter, the ISPF default clipboard (named DEFAULT) is used. You can define up to ten additional clipboards. The size of the clipboards and number of clipboards might be limited by installation defaults. AFTER label BEFORE label KEEP The data is copied after the line with the specified label. The data is coped before the line with the specified label. The copied lines are not removed from the clipboard.
DELETE
Notes: 1. You should always specify KEEP or DELETE in an edit macro because the default behavior may have been changed by the user. 2. You can specify the default behavior (KEEP or DELETE) using the EDITSET primary command.
Description
PASTE copies or moves lines from a specified clipboard to the current edit session. If lines in the clipboard are longer than the lines in the edit session, they are truncated. Only the data portion of the line is saved in the clipboard. Line numbers are not saved. If the data was CUT from a data set that had sequence numbers and is PASTEd into an edit session without sequence numbers, or if it was CUT from a data set without sequence numbers and PASTEd into a session with sequence numbers, some shifting of data is likely to occur.
Examples
To paste data from the default clipboard to the line after the last line in the edit session:
PASTE AFTER .ZLAST
To paste data from the default clipboard to the line after the first line in the edit session, without clearing the contents of the clipboard:
PASTE AFTER .ZFIRST KEEP
255
PRESERVE
Syntax
ON PRESERVE OFF ON OFF The editor preserves the record length of the record when the data is saved. Turns truncation on. ISPF removes trailing blanks when saving variable-length files.
Regardless of the PRESERVE setting, if a line has a length of zero, ISPF saves 1 blank.
Description
PRESERVE ON causes the editor to save trailing blanks for variable length files. The number of blanks saved for a particular record is determined by one of the following: v the original length of the record when it was read in to the editor v the number of blanks required to pad the record length specified by the SAVE_LENGTH edit macro command v the length of the record that was saved on disk during a previous SAVE request in the same edit session PRESERVE OFF causes the editor to truncate trailing blanks. If a line is empty ISPF saves 1 blank. Use of the PRESERVE command does not prevent the editor from working on data past the specified record length. The length set and returned by the PRESERVE command is only used when the data is written and does not affect the operation of other edit functions.
Examples
To enable the editor to remove trailing blanks when data is saved, enter the following:
PRESERVE OFF
256
PROFILE
v The reset form specifies that the site-wide configuration for new edit profiles is to be used.
Syntax
Profile Control current_edit_profile PROFILE name name number 5
The profile name. It can consist of up to 8 alphanumeric characters, the first of which must be alphabetic. The edit profile table is searched for an existing entry with the same name. That profile is then read and used. If one is not found, a new entry is created in the profile table. If you omit this operand, the current edit profile is used.
number The number of lines, from 0 through 9, of profile data to be displayed. When you type 0 as the number, no profile data is displayed. When no operands are entered, the first five lines, which contain the =PROF> flags, are always displayed. However, the =MASK> and =TABS> lines are not displayed if they contain all blanks; if the =MASK> or =TABS> lines do contain data they are displayed, followed by the =COLS> line. For more information about displaying and defining a profile, see Displaying or defining an edit profile on page 17. Profile Lock syntax PROFILE LOCK UNLOCK
LOCK Specifies that the current values in the profile are saved in the edit profile table and are not modified until the profile is unlocked. The current copy of the profile can be changed, either because of commands you enter that modify profile values (BOUNDS and NUMBER, for example) or because of differences in the data from the current profile settings. However, unless you unlock the edit profile, the saved values replace the changes when you end the edit session. CAPS, NUMBER, STATS, and PACK mode are automatically changed to fit the data. These changes occur when the data is first read or when data is copied into the data set. Message lines (==MSG>) are inserted in the data set to show you which changes occurred. Note: To force CAPS, NUMBER, STATS, or PACK mode to a particular setting, use an initial macro. Be aware, however, that if you set number mode on, data may be overlaid. UNLOCK Specifies that the editor saves changes to profile values. See Locking an edit profile on page 19 for more information about locking and unlocking the profile.
257
PROFILE
Profile Reset syntax PROFILE RESET RESET Specifies that the ZDEFAULT profile is to be removed and the site-wide configuration for new edit profiles is to be used.
Description
To display the current edit profile: 1. On the command line, type:
PROFILE number
2. Press Enter. The current edit profile appears. To switch edit profiles or define a new edit profile without displaying the new profile: 1. On the command line, type:
PROFILE name 0
where name is the name of the edit profile to which you want to switch. This also specifies that no lines are to be displayed. If you want to display the new profile, you can omit the number or enter a number from 1 to 9. 2. Press Enter. The profile specified by the name operand becomes the active edit profile, but is not displayed if you entered 0. If the profile does not exist, an entry is created for it in the edit profile table, using the values of the current edit profile. To lock the current edit profile: 1. On the command line, type:
PROFILE LOCK
2. Press Enter. The values in the current edit profile are saved in the edit profile table. From this point on, any changes you make to the current edit profile affect only the current edit session. Values that were saved when the current profile was locked are used the next time you begin an edit session with this profile. To unlock an edit profile: 1. On the command line, type:
PROFILE UNLOCK
2. Press Enter. From this point on, any changes that you make to the current edit profile replace any values that may have been saved for this profile in the edit profile table. Also, these changes are saved when you end the current edit session.
Examples
Figure 142 shows a typical edit profile for a REXX data set. The display results from entering PROFILE with no operands. The =TABS> and =MASK> lines appear because they contained data. If they had been empty, they would not have appeared.
258
PROFILE
The sample profile contains the following information: v The first profile line (=PROF>) shows the profile name (EXEC), the data set record format and length (FIXED - 80), and the settings for edit recovery mode (RECOVERY ON) and number mode (NUMBER ON STD). v The second profile line shows the settings for caps mode (CAPS ON), hexadecimal mode (HEX OFF), nulls mode (NULLS OFF), tabs mode (TABS OFF), and UNDO mode (SETUNDO STG). v The third profile line shows the settings for the auto modes: autosave (AUTOSAVE ON), autonum (AUTONUM OFF), and autolist (AUTOLIST OFF). It also shows the setting for stats mode (STATS ON). v The fourth profile line shows the lock status of the EXEC profile (PROFILE UNLOCK), the name, if any, of the initial macro called at the beginning of the edit session (IMACRO NONE), and the settings for pack mode (PACK OFF) and note mode (NOTE ON). v The fifth profile line shows the current hilite status (HILITE OFF). v The last four lines of the edit profile show the tabs settings (=TABS>), edit mask (=MASK>), bounds settings (=BNDS>), and the column position line (=COLS>).
RCHANGERepeat a Change
RCHANGE repeats the change requested by the most recent CHANGE command.
Syntax
RCHANGE
Description
You can use this command to repeatedly change other occurrences of the search string. After a string NOT FOUND message appears, the next RCHANGE issued starts
Chapter 10. Edit Primary Commands
259
RCHANGE
at the first line of the current range for a forward search (FIRST or NEXT specified) or the last line of the current range for a backward search (LAST or PREV specified). Note: RCHANGE is normally assigned to a program function key, although you can issue it directly from the command line.
Syntax
ON RECOVERY RECOVER RECOVRY RECVRY RECOV RECVR ON OFF WARN SUSP OFF WARN NOWARN
The system creates and updates a recovery data set for each change. The system does not create and update a recovery data set. This operand no longer has a practical function due to a software change. However, the primary command continues to accept the operand for compatibility reasons. This operand no longer has a practical function due to a software change. However, the primary command continues to accept the operand for compatibility reasons. This operand functions the same as the ON operand.
NOWARN
SUSP
Note: When SETUNDO is enabled during installation, both the RECOVERY primary command and edit macro command continue to accept the NOWARN and WARN keywords for compatibility reasons, but the value is ignored. NOWARN will always be in effect.
Description
You cannot edit data recursively while you are in recovery. Attention: If the data set to be recovered was edited by another user before edit recovery, the changes made by the other user will be lost if you save the recovered data. See Undoing Edit Interactions on page 64 for more information. To turn on edit recovery mode: 1. On the command line, type:
RECOVERY ON
260
RECOVERY
RECOVERY can be abbreviated REC. This command can also ensure that your edit session is not lost due to a system failure. 2. Press Enter. The editor begins recording an audit trail of your interactions. After a system failure, the editor uses that record to reestablish the edit session at the time of failure. Note: For edit recovery to work properly, the data set to be recovered, the edit recovery data set, and the edit recovery table all must exist, be cataloged, and be intact. For example, with RECOVERY on, uncataloging a data set and then trying to recover it fails. To turn off edit recovery mode: 1. On the command line, type:
RECOVERY OFF
2. Press Enter. The editor stops recording your interactions. Edit recovery is not available following a system failure. When an edit session is recovered, the data is scrolled all the way to the left when the recovery edit session begins. See Edit recovery on page 39 for more information about edit recovery.
Syntax
(1) ON RENUM REN Notes: 1 ON STD is the default for non-COBOL data set types. COBOL is the default for COBOL data set types. Automatically verifies that all lines have valid numbers in ascending sequence and renumbers any lines that are either unnumbered or out of sequence. It also turns number mode on and renumbers lines. The STD, COBOL, and DISPLAY operands are interpreted only when number mode is turned on. STD COBOL Numbers the data in the standard sequence field. This is the default for all non-COBOL data set types. Numbers the data in the COBOL field. This is the default for all COBOL data set types. STD COBOL STD COBOL DISPLAY
261
RENUM
Attention: If number mode is off, make sure the first 6 columns of your data set are blank before using either the NUMBER ON COBOL or NUMBER ON STD COBOL command. Otherwise, the data in these columns is replaced by the COBOL sequence numbers. If that happens and if edit recovery or SETUNDO is on, you can use the UNDO command to recover the data. Or, you can use CANCEL at any time to end the edit session without saving the data. STD COBOL Numbers the data in both fields. If both STD and COBOL numbers are generated, the STD number is determined and then used as the COBOL number. This can result in COBOL numbers that are out of sequence if the COBOL and STD fields are not synchronized. Use RENUM to synchronize them. DISPLAY Causes the width of the data window to include the sequence number fields. Otherwise the width of the window does not include the sequence number fields. When you display a data set with a logical record length of 80 and STD numbering, the sequence numbers are not shown unless you are using a 3278 Model 5 terminal, which displays 132 characters. The editor automatically scrolls left or right, if required, so that the left most column of the data window is the first column to appear.
Description
To renumber all lines using the standard sequence fields only:
RENUM STD
To renumber all lines using both the standard and COBOL sequence fields:
RENUM STD COBOL
To renumber all lines using both the standard and COBOL sequence fields and specifying that the data window is to include the sequence number fields:
RENUM STD COBOL DISPLAY
To renumber all lines by using the standard sequence fields only and specifying that the data window is to include the sequence number fields:
RENUM DISPLAY
Here, the DISPLAY operand is the only operand needed because STD is the default.
Examples
In Figure 143, the line numbers are not incremented uniformly. Type RENUM on the command line. Figure 144 shows how the lines are renumbered after you press Enter.
262
RENUM
REPLACEReplace Data
The REPLACE primary command replaces a sequential data set or a member of a partitioned data set with data you are editing. If the member you want to replace does not exist, the editor creates it.
263
REPLACE
Syntax
REPLACE REPL REP member (member) dsname(member) dsname (1) labela labelb
Notes: 1 If you dont specify the group of lines using labels, you must specify the group by using C or M line commands. The name of the member to be replaced in the partitioned data set currently being edited. If a name of eight characters or fewer is specified and it could be a member name or a data set name, REPLACE searches for a member name first. If no member is found, then the name is used as a data set name. If the member does not exist, the editor creates it. If you are using a concatenated sequence of libraries, the editor writes the member to the first library in the sequence. This operand is optional. To replace a sequential data set or a member of a different partitioned data set, enter REPLACE without a member operand. The editor displays the Edit Replace panel, from which you can enter the data set name. dsname dsname(member) A partially qualified or fully qualified partitioned data set and member you want to replace. labela, labelb Labels identifying the start and end of the group of lines to replace the member or data set. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56. A partially qualified or fully qualified sequential data set you want to replace.
member
Description
To replace a member of a partitioned data set or to replace a sequential data set: 1. On the command line, type:
REPLACE REPLACE REPLACE REPLACE member labela labelb (member) labela labelb dsname labela labelb dsname(member) range
The member operand is optional unless you specify the name of a partitioned data set. It represents the name of the member that you want to replace. If you specify a data set name only, it must be a sequential data set. The labela and labelb operands are optional, also. They represent a pair of labels that show the first and last lines in a group of lines used to replace the member. If you omit the labela and labelb operands, you must specify the lines by using either the C (copy) or M (move) line command. See the descriptions of these commands if you need more information about them.
264
REPLACE
If you omit the labela and labelb operands, and do not enter one of the preceding line commands, a REPLACE Pending message is displayed in the upper-right corner of the panel. 2. Press Enter. If you did not specify a member name or a data set name, the Edit Replace panel is displayed. Enter the member name on this panel and press Enter again. If you used either a pair of labels or a C line command, the data is copied from the member that you are editing into the member that you are replacing. If you used the M line command, however, the data is removed from the member that you are editing and placed in the member that you are replacing. If the data set specified does not exist, ISPF prompts you to see if the data set should be created. You can create the data set using the characteristics of the source data set as a model, or specify the characteristics for the new data set. You can suppress this function through the ISPF configuration table, causing any CREATE request for a nonexistent data set to fail. See Creating and Replacing Data on page 41 for more information about the REPLACE command.
Examples
The following steps show how you can replace a member when you omit the member name. These same steps apply when you create data. 1. Type REPLACE and specify which lines you want to copy or move into the data set or member. The example in Figure 145 uses the MM (block move) line command to move a block of lines from the data.
2. When you press Enter, the Edit Replace panel (Figure 146) appears. Type the name of the member to be replaced and press Enter. A member is created when you type the name of a member that does not already exist. The name of the member replaced in this example is REPMEM.
265
REPLACE
Menu RefList Utilities Help -----------------------------------------------------------------------------Edit/View Replace More: To ISPF Library: Project . . . V$ICB Group . . . . PRIVATE Type . . . . CLIST Member . . .
To Other Sequential Data Set or Partitioned Data Set Member: Data Set Name . . ________________________________________________________ Volume Serial . . _______ (If not cataloged) Data Set Password . . Enter "/" to select option _ Pack "Replace" Data Set Press ENTER key to replace. Enter END command to cancel replace. Command ===> _________________________________________________________________ F1=Help F2=Split F3=Exit F7=Backward F8=Forward F9=Swap F10=Actions F12=Cancel (If password protected)
3. Figure 147 shows the lines remaining in the data being edited after the specified lines were moved.
Figure 147. Member After the Other Member Has Been Replaced
266
RESET
Syntax
.ZFIRST .ZLAST RESET RES CHANGE COMMAND ERROR EXCLUDED FIND HIDE LABEL SPECIAL labela labelb
You can type the operands in any order. If you do not specify any operands, RESET processes all operands except LABEL. CHANGE COMMAND ERROR EXCLUDED Removes ==CHG> flags from the line command field. Removes any pending line commands from the line command field. Removes ==ERR> flags from the line command field. Redisplays any excluded line.
267
RESET
FIND Turns off highlighting of FIND strings until the next FIND, RFIND, CHANGE, or RCHANGE command. SEEK and EXCLUDE do not return the highlighting of FIND strings in this manner. The resetting of FIND highlighting does not honor the range specified on the RESET command. HIDE LABEL SPECIAL Redisplays all n Line(s) not Displayed messages for excluded lines that were hidden through the HIDE command. Removes labels from the line command field. Deletes any temporary line from the panel: v Bounds line flagged as =BNDS> v Column identification lines flagged with =COLS> v Information lines flagged with ====== v Mask lines flagged as =MASK> v Message lines flagged as ==MSG> v Note lines flagged with =NOTE= v Profile lines flagged as =PROF> v Tabs line flagged as =TABS> Labels identifying the start and end of the group of lines to be reset. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
labela, labelb
Description
RESET scans every line of data. If you want to delete a small number of special lines, you can get faster response time if you use the D (delete) line command.
Examples
To reset all lines except those that contain labels:
RESET
268
RESET
To reset all lines between and including the .START and .STOP labels, except those that contain labels:
RESET .START .STOP
RFINDRepeat Find
RFIND locates the search string defined by the most recent SEEK, FIND, or CHANGE command, or excludes a line containing the search string defined by the previous EXCLUDE command. RFIND can be used repeatedly to find other occurrences of the search string. After a string NOT FOUND message is displayed, the next RFIND issued starts at the first line of the current range for a forward search (FIRST or NEXT specified), or the last line of the current range for a backward search (LAST or PREV specified).
Syntax
RFIND
Note: RFIND is normally assigned to a program function key, although you can issue it directly from the command line.
Syntax
RMACRO name !name NONE The name of the recovery macro to be run. The name can be preceded by an exclamation point (!) to show that it is a program macro. The name to prevent a recovery macro from being run.
name
NONE
Description
To specify the name of a recovery macro: 1. On the command line, type:
RMACRO name
where name is the name of the recovery macro that you want to run. 2. Press Enter. See Recovery Macros on page 106 for more information.
Examples
To define RESTART as the recovery macro, type:
RMACRO RESTART
269
RMACRO
To reset the profile with no recovery macro, type:
RMACRO NONE
Syntax
SAVE
Description
SAVE writes the data to the same data set from which it was retrieved unless you specified a concatenated sequence of partitioned data sets on the Edit Entry panel. In that case, the data is saved in the first library in the concatenation sequence, regardless of from which library it came. For a sequential data set, the complete data set is rewritten. For a partitioned data set, the member is rewritten with the same member name. If stats mode is on, the library statistics for the member are automatically updated. If both number mode and autonum mode are on, the data is automatically renumbered before it is saved. If SAVE cannot successfully rewrite the data because of I/O errors or insufficient space, the system displays a message in the upper-right corner of the panel, accompanied by an audible alarm, if installed. You can then try to save the data in another data set by taking the following steps: 1. Enter CREATE or REPLACE with no operand on the command line. Use CREATE only if the destination is a member of a partitioned data set, such as an ISPF library member. 2. Type CC on the first and last data lines to specify that all lines are to be copied. Then press Enter. 3. Fill in the data set and member name of the alternate library on the Edit Create or Edit Replace panel, and press Enter. When a space ABEND such as D37 occurs, ISPF deallocates the data set so that you can swap to another screen or user ID and reallocate the data set. This does not occur for data sets that were edited using the DDNAME parameter of the EDIT service. See Creating and Replacing Data on page 41 for more information.
Examples
To save the data in the data set or member that you are editing: 1. On the command line, type:
SAVE
2. Press Enter.
270
SETUNDO
Syntax
STORAGE SETUNDO SETU RECOVER ON OFF Enables the saving of edit changes in storage. If the setting is changed, and the profile lines are displayed, the profile lines show the value (SETUNDO STG) after the change. Valid abbreviations for STORAGE are STO, STG, STOR and STORE. Enables the saving of edit changes through the recovery file only. If recovery is off, it is turned on by this command. If the setting is changed and the profile lines are displayed, the profile lines show the value (SETUNDO REC) after the change. A valid abbreviation for RECOVER is REC. The same as STORAGE. Disables the saving of edit changes in storage. If SETUNDO OFF is specified and recovery is on, then a state of SETUNDO RECOVER is set and UNDO is available from the recovery file. All transactions on the storage UNDO chain are removed, and no changes before SETUNDO OFF can be undone (unless RECOVERY ON is specified). If the setting is changed and the profile lines are displayed, the profile lines show the value (SETUNDO OFF or SETUNDO REC) after the change.
STORAGE
RECOVER
ON OFF
Description
SETUNDO allows you to specify how changes you make during your edit session are to be recorded and used by the UNDO command. UNDO can be run when either SETUNDO or RECOVERY is on. Changes can be recorded in storage, in the recovery file, or in both places. Saving the changes in storage only is the fastest method. To enable recording in storage: 1. On the command line, type either of the following: v SETUNDO STORAGE or v SETUNDO 2. Press Enter. The value of ON is accepted to compliment the OFF state.
Chapter 10. Edit Primary Commands
271
SETUNDO
To use the recovery file: 1. On the command line, type:
SETUNDO RECOVER
2. Press Enter. If RECOVERY is off, it is turned on by this command. To turn off recording and disable the UNDO command, enter:
SETUNDO OFF
Note: If recovery is on, setting SETUNDO OFF is the same as specifying SETUNDO REC, and the recovery file is used for UNDO.
Examples
The edit profile shown in Figure 149 shows SETUNDO set to STORAGE and RECOVERY OFF.
SORTSort Data
The SORT primary command puts data in a specified order.
Syntax
.ZFIRST .ZLAST SORT labela labelb X NX sort_field
272
SORT
sort_field: A start_col D labela, labelb end_col Labels identifying the start and end of the group of lines to be sorted. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56. X NX sort_field Sorts only lines that are excluded. Sorts only lines that are not excluded. Specifies the field to be used in sorting data. You can specify up to five sort fields using the following operands: A D start_col Defines the starting column of the field that is to be compared. It must be within the current boundaries. end_col Defines the ending column of the field that is to be compared. It must be within the current boundaries. If it is not supplied, then the ending column is the current right boundary. For more information on boundaries, see Edit boundaries on page 23. If you specify several fields, you must specify both the starting and ending columns of each field. The fields cannot overlap. If you supply the sort order for one field, you must supply it for all fields. Specifies ascending order. It can either precede or follow the column specification. Specifies descending order. It can either precede or follow the column specification.
Description
SORT operates in two different modes, based on the hexadecimal mode status. If hexadecimal mode is on, the data is ordered according to its hexadecimal representation. If hexadecimal mode is off, data is sorted in the collating sequence defined for the national language being used.
273
SORT
first, second and third lines of the sorted file, the changed line flags would now exist on the first, second and third lines of the sorted data set. It is important to properly set the boundaries before issuing SORT. SORT is a powerful tool for editing data that may be formatted in multiple columns. You can set the boundaries, for example, to the first half of a record and sort one column of data. Then you can set the boundaries to the last half of the record and sort a second column of data.
Examples
The following form of the SORT command sorts in ascending order. The start-column is the left boundary and the end-column is the right boundary:
SORT
The following form of the SORT command sorts in descending order. The start-column is the left boundary and the end-column is the right boundary:
SORT D
The following form of the SORT command sorts in ascending order. The start-column is column 5 and the end-column is the right boundary:
SORT 5
The following form of the SORT command sorts in descending order. The start-column is column 5 and the end-column is the right boundary:
SORT 5 D
274
STATS
Syntax
ON STATS OFF ON OFF Creates or updates library statistics when the data is saved. Does not create or update library statistics.
Examples
To set stats mode on:
STATS ON
Syntax
.ZFIRST .ZLAST SUBMIT SUB labela labelb X NX
labela, labelb
Labels identifying the start and end of the group of lines to be submitted. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
X NX
Submits only lines that are excluded from the display. Submits only lines that are not excluded from the display.
Description
The editor does not supply a job statement when you enter the SUBMIT command. You can supply job statements as part of the data being submitted. When you supply a job statement, only the job name is logged to the ISPF log data set to ensure the protection of sensitive data. ISPF uses the TSO SUBMIT command to submit the job.
Examples
To submit lines between labels .START and .END as a batch job:
SUBMIT .START .END
275
SUBMIT
To submit all of the data as a batch job:
SUBMIT
TABSDefine Tabs
The TABS primary command: v Turns tabs mode on and off v Defines the logical tab character v Controls the insertion of attribute bytes at hardware tab positions defined with TABS Use PROFILE to check the setting of tabs mode and the logical tab character. See Using Tabs on page 61 if you need more information about using tabs.
Syntax
ON TABS TAB OFF ON Turns tabs mode on, which means that logical tabs can be used to break up strings of data. This is the default operand. If no other operands are included, all hardware tab positions (asterisks) that contain a blank or null character are activated because STD is also a default operand. The TABS ON STD message is displayed in the profile. Turns tabs mode off, which means that logical tabs cannot be used. Attribute bytes are deleted from all hardware tab positions, causing the Tab Forward and Tab Backward keys to ignore hardware tabs defined on the =TABS> line. Blanked-out characters that occupy these positions reappear. The TABS OFF message is displayed in the profile. Activates all hardware tab positions (asterisks) that contain a blank or null character. The editor inserts attribute bytes, which cannot be typed over, at these positions. STD is the default operand. You can use the Tab Forward and Tab Backward keys to move the cursor one space to the right of the attribute bytes. The TABS ON STD message is displayed in the profile. Causes an attribute byte to be inserted at all hardware tab positions. Characters occupying these positions are blanked out and the attribute bytes cannot be typed over. The Tab Forward and Tab Backward keys can be used to move the cursor one space to the right of these attribute bytes. The TABS ON ALL message is displayed in the profile. Defines a single character that is not a number, letter, or command STD ALL tab_character
OFF
STD
ALL
tab_character
276
TABS
delimiter as the logical tab character. This character is used with hardware tab definitions. The TABS ON tab_character message is displayed in the profile. You can enclose the character in quotes ( or "), although this is not necessary unless a quote or a comma (,) is used as the tab character. The tab_character operand causes the data string that follows the logical tab character to align itself one space to the right of the first available hardware tab position when you press Enter. No attribute bytes are inserted. If no hardware tabs are defined, the editor aligns the data vertically. If software tabs are defined, the first data string is aligned under the first software tab position and the remaining data strings are aligned at the left boundary. If neither software nor hardware tabs are defined, the editor aligns all the data strings at the left boundary. With the tab_character operand, the Tab Forward and Tab Backward keys ignore hardware tab positions because no attribute bytes are inserted. You can type the operands in any order, but keep the following rules in mind: v The tab_character and ALL operands cannot be used together, because the tab_character operand does not allow ISPF to insert attribute bytes at tab positions, while the ALL operand does. v The TABS primary command has no effect on software tabs. Whenever software tabs are defined, you can always use the Enter key to move the cursor to a software tab position in the data, even if tabs mode is off. Attribute bytes are not inserted at software tab positions.
Examples
Define the number sign (#) as a logical tab character by typing the following and pressing Enter:
TAB #
Now, enter the COLS line command by typing COLS in the line command field and pressing Enter. A partial =COLS> line with positions 9 through 45 is shown in the following example. To use the logical tab character you have defined (#), you also need at least one hardware tab. For this example, we will assume that three hardware tabs have already been defined in columns 20, 30, and 40:
=COLS> -1----+----2----+----3----+----4----+ =TABS> * * *
the data $4237 is repositioned after the first tab column, defined by an * in the =TABS line, when you press Enter. The $ 596 is repositioned after the next tab column and so forth, as follows:
=COLS> -1----+----2----+----3----+----4----+ =TABS> * * * $4237 $ 596 $ 81
Chapter 10. Edit Primary Commands
277
UNDO
Syntax
UNDO
Description
Each time you enter UNDO, it reverses edit interactions, one at a time, in the order in which they have been entered. To use UNDO, you must have either RECOVERY on or SETUNDO on. You can undo only those changes made after RECOVERY or SETUNDO was turned on. SETUNDO and RECOVERY can be specified in your edit profile. You can also use the edit macro command ISREDIT SETUNDO to turn UNDO processing on and off. See SETUNDOSet UNDO Mode on page 385 for more information. RECOVERY is now optional and is not required to run UNDO. Performance improves if the editor is run with SETUNDO STORAGE and RECOVERY OFF. In this mode, non-data changes, such as setting line labels, adding note lines, and inserting blank lines, can be undone by UNDO even if no data changes have been made. With RECOVERY ON, only changes made after (and including) the first change to edit data can be undone. Note: Changes made by initial edit macros cannot be undone. See Understanding Differences in SETUNDO Processing on page 66 for more information on the differences between SETUNDO RECOVER and SETUNDO STORAGE processing. Each time you press Enter, an interaction occurs between you and ISPF. If you combine line and primary commands in one entry, ISPF considers this one interaction. Therefore, UNDO would cause all of the commands to be reversed. ISPF also considers running edit macros that contain a combination of macro commands and assignment statements, while entering a combination of edit line and primary commands at the same time, as one interaction. Profile changes, such as HEX ON, LEVEL, and CAPS, cannot be undone separately. Profile changes are associated with the data change that came before them, and can be undone only when preceded by a data change. The data change and the profile change are undone at the same time. For example, if you make a change to the data, change the version number, set caps off, turn hex on, and then enter UNDO, the version number, caps setting, and hex mode all revert to the way they existed before the data change. The data change is also undone. Note: UNDO is not accepted if any line commands or data changes are also specified since it would be unclear what is to be undone. To undo the last changes:
278
UNDO
1. Type on the command line:
UNDO
2. Press Enter. Note: UNDO is reset by SAVE. Once you save your data for the current edit session, you can no longer recover any interactions made before the data was saved. Failures in recovery processing due to I/O errors no longer terminate the UNDO function if SETUNDO STORAGE is active. When UNDO is processed, the editor scrolls the data all the way to the left. See Undoing Edit Interactions on page 64 for more information.
Examples
You are editing the member shown in Figure 150 and decide to delete all of the lines. You have type the block form of the D (DELETE) command in the line command field.
Figure 151 shows the member after the lines have been deleted. However, you have changed your mind and want to put the lines back again. Therefore, type UNDO on the command line.
279
UNDO
Figure 152 shows the member after UNDO has been entered and the deleted lines have been restored.
280
UNNUMBER
Syntax
UNNUMBER UNNUMB UNNUM UNN
Description
UNNUMBER is valid only when number mode is also on. The standard sequence field, the COBOL sequence field, or both, are blanked out. If you alter or delete sequence numbers and enter UNNUMBER on the command line at the same time, the editor issues the message Some input data ignored and discards the data you typed over the sequence numbers. To set all sequence fields to blanks, turn number mode off, and position the panel so that column 1 is the first column to appear:
UNNUMBER
Examples
You are editing the member in Figure 153 and you want to turn off the sequence numbers. Enter UNNUMBER on the command line.
Figure 154 shows the member after the sequence numbers have been turned off.
281
VERSION
Syntax
VERSION VERS VER num num
Description
To change the version number of the member that you are editing: 1. On the command line, type:
VERSION num
where num is the new version number. 2. Press Enter. See Version and modification level numbers on page 27, for more information about version numbers.
Examples
Version and modification level numbers are shown on the first line of an edit data display in the format VV.MM, where VV is the version number and MM is the modification level number.
282
VERSION
You are editing the member shown in Figure 155 and you want to change the version number from 01 to 02. Enter VERSION on the command line.
Figure 156 shows the member with the changed version number.
283
VIEW
Syntax
VIEW member member A member of the ISPF library or other partitioned data set you are currently editing. You may enter a member pattern to generate a member list.
Description
To view a data set or member during your current edit session: 1. On the command line, type:
VIEW member
Here, member represents the name of the partitioned data set you are editing. The member operand is optional. 2. Press Enter. If you specified a member name, the current library concatenation sequence finds the member. The member is displayed for viewing. If you do not specify a member name, the View Command Entry panel, which is similar to the regular View Entry panel, appears. You can enter the name of any sequential or partitioned data set to which you have access. When you press Enter, the data set or member is displayed for viewing. The editor suspends your initial edit session until the view session is complete. Viewing sessions can be nested until you run out of storage. 3. To exit from the view session, enter the END command. The current edit session resumes.
Examples
To view member YYY of the current library concatenation: 1. On the command line, type:
VIEW YYY
2. Press enter.
284
Return Codes A description of codes returned by the macro command. For all commands, a return code of 20 or higher implies a severe error. See Return Codes from User-Written Edit Macros on page 106 and Return Codes from PDF Edit Macro Commands on page 107 for more information. Examples Sample usage of the macro command.
285
286
HILITE
332
IMACRO INSERT LABEL LEFT LEVEL LINE LINE_AFTER LINE_BEFORE LINE_STATUS LINENUM LOCATE LRECL MACRO
335 336 337 338 339 340 342 343 345 346 347 349 350
287
RIGHT RMACRO
377 378
288
SEEK
382
SEEK_COUNTS SEEK_COUNTS SESSION SHIFT SHIFT SHIFT SHIFT SORT STATS SUBMIT TABS TABSLINE TENTER TFLOW TSPLIT UNNUMBER UP USER_STATE VERSION VIEW VOLUME XSTATUS
384 384 385 387 387 388 389 390 392 393 394 396 397 398 399 400 400 402 403 404 404 405
289
AUTOLIST
Syntax
Macro command syntax ON ISREDIT AUTOLIST OFF ON Specifies that when you end an edit session and save changed data, the editor generates a source listing in the ISPF list data set for eventual printing. Does not generate a source listing.
OFF
ON ISREDIT AUTOLIST = OFF varname ON OFF The name of a variable that contains the setting of autolist mode, either ON or OFF. Same as macro command syntax. Same as macro command syntax.
Return codes
0 20 Normal completion Severe error
Examples
To turn autolist mode on:
ISREDIT AUTOLIST ON
or
ISREDIT AUTOLIST = ON
or
290
AUTOLIST
ISREDIT AUTOLIST = OFF
Syntax
Macro command syntax ON ISREDIT AUTONUM OFF ON OFF Turns on automatic renumbering. When number mode is also on, the data is automatically renumbered when it is saved. Turns off automatic renumbering. Data is not renumbered.
ON ISREDIT AUTONUM = OFF varname ON OFF The name of a variable containing the setting of autonum mode, either ON or OFF. Same as macro command syntax. Same as macro command syntax.
Description
When number mode is on, the first line of a data set or member is normally line number 000100, the second number is 000200, and so on. However, as lines are inserted and deleted, the increments between line numbers can change. For example, you might think that when a line is inserted between 000100 and 000200, line 000200 would be given the number 000300 and the new line would become 000200. Instead, the existing lines retain their numbers and the new line is given line number 000110. Therefore, if the original line number increments are important to you, AUTONUM renumbers your lines automatically so that the original increments are maintained. Autonum mode is saved in the edit profile.
Return codes
0 Normal completion
Chapter 11. Edit Macro Commands and Assignment Statements
291
AUTONUM
20 Severe error
Examples
To turn autonum mode on:
ISREDIT AUTONUM ON
or
ISREDIT AUTONUM = ON
or
ISREDIT AUTONUM = OFF
Syntax
Macro command syntax ON ISREDIT AUTOSAVE PROMPT PROMPT OFF NOPROMPT ON OFF PROMPT Turns autosave mode off with the PROMPT operand. You are notified that changes have been made and to use either SAVE (followed by END) or CANCEL. If you specify only the PROMPT keyword, OFF is implied. OFF NOPROMPT Turns autosave mode off with the NOPROMPT operand. You are not notified and the data is not saved when you issue an END command. END becomes an equivalent to CANCEL. Use the NOPROMPT operand with caution. Assignment statement syntax ISREDIT (var1,var2) = AUTOLIST Turns autosave mode on. When you enter END, any changed data is saved.
292
AUTOSAVE
ON ISREDIT AUTOSAVE = PROMPT PROMPT OFF NOPROMPT var1 var2 ON OFF PROMPT Same as macro command syntax. OFF NOPROMPT Same as macro command syntax. The name of a variable to contain the setting of autosave mode, either ON or OFF. The name of a variable to contain the prompt value, PROMPT or NOPROMPT. Same as macro command syntax.
Description
Data is considered changed if you have operated on it in any way that could cause a change. Shifting a blank line or changing a name to the same name does not actually alter the data, but the editor considers this data changed. When you enter SAVE, the editor resets the change status. Autosave mode, along with the PROMPT operand, is saved in the edit profile. See the DATA_CHANGED, CANCEL, and END macro commands, and the CANCEL and END primary commands for more information on saving data.
Return codes
0 4 20 Normal completion OFF NOPROMPT specified Severe error
Examples
To turn autosave mode on:
ISREDIT AUTOSAVE ON
or
ISREDIT AUTOSAVE = ON
To turn autosave mode off and have the editor prompt you to use the SAVE or CANCEL command:
ISREDIT AUTOSAVE OFF
or
ISREDIT AUTOSAVE = OFF
To turn autosave mode off and not have the editor prompt you to use SAVE or CANCEL:
ISREDIT AUTOSAVE OFF NOPROMPT
293
AUTOSAVE
or
ISREDIT AUTOSAVE = OFF NOPROMPT
Syntax
Assignment statement syntax ISREDIT (varname) varname = BLKSIZE
The name of a variable to contain the block size of the data being edited. The block size is a 6-digit value that is left-padded with zeros.
Return codes
0 12 20 Normal completion Syntax Error Severe error
Examples
To find the block size and continue processing if the block size is greater than 800:
ISREDIT (BSIZE) = BLKSIZE IF &BSIZE > 000800 THEN ...
Syntax
Macro command syntax ISREDIT BOUNDS BOUND BNDS BND BOU
left_col *
right_col *
left_col right_col
The left boundary column to be set. The right boundary column to be set.
294
BOUNDS
ISREDIT BOUNDS = left_col * var1 right_col *
A variable containing the left boundary. If the variable is VDEFINEd in character format, it should be defined with a length of 5. The returned value is left padded with zeros. For compatibility with earlier releases of ISPF, a length of 3 or 4 is allowed if no data loss will result. var2 A variable containing the right boundary. If the variable is VDEFINEd in character format, it should be defined with a length of 5. The returned value is left padded with zeros. For compatibility with earlier releases of ISPF, a length of 3 or 4 is allowed if no data loss will result. left_col Same as macro command syntax. right_col Same as macro command syntax.
Description
The BOUNDS macro command provides an alternative to setting the boundaries with the BOUNDS line command or primary command; the effect on the member or data set is the same. The column numbers are always data column numbers (see Referring to Column Positions on page 102). Thus, for a variable format data set with number mode on, data column 1 is column 9 in the record. See Edit boundaries on page 23 for more information, including tables that show commands affected by bounds settings and default bounds settings for various types of data sets.
Return codes
0 4 12 20 Normal completion Right boundary greater than default, default right boundary used Invalid boundaries specified Severe error
Examples
To set the boundaries to their default values, type:
ISREDIT BOUNDS
To set one boundary while leaving the other value unchanged, type an asterisk (*) for the boundary to be unchanged. For example, to set the left boundary from the variable &LEFT, and leave the right boundary unchanged, type:
ISREDIT BOUNDS &LEFT *
295
BOUNDS
To evaluate numbers for bounds when NUMBER COBOL is on, or NUMBER is on for a variable blocked data set:
/* REXX - Set physical bounds in a macro. Input is 2 column */ /* numbers and result is bounds set on that physical column */ /* regardless of number setting. Bounds will not be set */ /* within line number areas. This sample has minimal */ /* error checking. */ Address isredit MACRO (LEFT,RIGHT) /* Take left and right bounds*/ (NUMBER,COBOL) = NUMBER /* Get number status */ Parse Var cobol . cobol . /* Get just left status */ (RECFM) = RECFM /* Get record format */ (DW) = DATA_WIDTH /* Get data width */ If left= Then left = 1 /* Assume col 1 for left */ If right= Then right = dw /* Assume datawidth for right*/ shift = 0 /* Assume no left seq numbers*/ If cobol=COBOL Then /* If numbered as cobol */ shift = 6 /* Account for sequence num*/ Else If number=ON & recfm=V Then /* If numbered variable block*/ shift = 8 /* Account for sequence num*/ right = max(1,right - shift) /* Adjust right column */ right = min(right,dw) /* Adjust right column */ left = max(1,left - shift) /* Adjust left column */ left = min(left ,dw) /* Adjust left column */ BOUNDS min(left,right) max(left,right) /* Issue bounds command PROFILE */
Syntax
Macro command syntax ISREDIT BROWSE member member A member of the library or other partitioned data set you are currently editing. You may enter a member pattern to generate a member list.
Description
Your initial edit session is suspended until the browse session is complete. To exit from the browse session, END or CANCEL must be processed by a macro or entered by you. The current edit session resumes. For more information on using the BROWSE service, refer to the z/OS ISPF Services Guide.
Return codes
0 12 20 Normal completion Your error (invalid member name, recovery pending) Severe error
296
BROWSE
Examples
To browse the member OLDMEM in your current ISPF library:
ISREDIT BROWSE OLDMEM
Syntax
Macro command syntax ISREDIT BUILTIN cmdname cmdname The built-in command to be processed.
Description
If you create a macro named MACEND and enter a DEFINE END ALIAS MACEND command, your MACEND macro runs when you enter END. Within the MACEND macro you can perform logic and use a built-in END command to actually end the edit session. Note that if END is issued in your MACEND macro without being preceded by BUILTIN, the MACEND macro would run again, resulting in an infinite loop.
Return codes
n 20 Return code from the built-in command Severe error
Examples
To process the built-in END command:
ISREDIT BUILTIN END
Syntax
Macro command syntax ISREDIT CANCEL
297
CANCEL
Description
CANCEL is especially useful if you have changed the wrong data, or if the changes themselves are incorrect. See the DATA_CHANGED, AUTOSAVE, and END commands for more information about saving data. Notes: 1. If you issue SAVE and later issue CANCEL, the changes you made before issuing SAVE are not canceled. 2. When CANCEL is entered in the macro field in the edit prompt panel (ISRUEDIT), the macro name is not saved in the profile for use in future sessions. This is to avoid having the editor appear to do nothing when it is invoked from the data set list. CANCEL does not cause automatic recording in the ISPF list data set, regardless of the setting of the autolist mode.
Return codes
0 20 Normal completion Severe error
Examples
To cancel the current edit session:
ISREDIT CANCEL
Syntax
Macro command syntax ON ISREDIT CAPS OFF ON OFF Turns caps mode on. Turns caps mode off.
298
CAPS
varname ON OFF The name of a variable containing the setting of caps mode, either ON or OFF. Same as macro command syntax. Same as macro command syntax.
Description
When the editor retrieves data, it sets the caps mode on if the data contains all uppercase letters, or off if the data contains lowercase letters. The editor displays a message when the caps mode changes. Caps mode is saved in the edit profile. To override the automatic setting of caps mode, you can include the CAPS command in an initial macro. Caps mode is normally on for program development work. When caps mode is set to on, any alphabetic data that you type, plus any other alphabetic data that already exists on that line, is converted to uppercase when you press Enter or a function key. Caps mode is normally off when you edit text documentation. When caps mode is set to off, any alphabetic data that you type remains just as you typed it. If you typed it in uppercase, it stays in uppercase; if you typed it in lowercase, it stays in lowercase. Also, alphabetic data that is already typed on that line is not affected. CAPS does not apply to DBCS fields in formatted data or to DBCS fields in mixed fields. If you specify CAPS, the DBCS fields remain unchanged. See the LC (lowercase) and UC (uppercase) line commands and the CAPS primary command for more information about changing cases.
Return codes
0 20 Normal completion Severe error
Examples
To save the value of caps mode in variable &CAPMODE:
ISREDIT (CAPMODE) = CAPS
Syntax
Macro command syntax
299
CHANGE
.ZFIRST .ZLAST ISREDIT CHANGE string1 string2 labela labelb ALL FIRST LAST PREV NEXT
The search string you want to change. See Finding, Seeking, Changing, and Excluding Data on page 45. Note: For edit macros written in CLIST, strings that contain an open comment delimiter (/*) must be placed within the &STR() delimiters such as &STR(/*XXX). The maximum allowable length of the string is 256 bytes. If you are specifying a hex string, the maximum is 128 hexadecimal characters.
string2
The string you want to replace string1. The maximum allowable length of the string is 256 bytes. If you are specifying a hex string, the maximum is 128 hexadecimal characters. See Finding, Seeking, Changing, and Excluding Data on page 45. Labels identifying the start and end of the group of lines CHANGE searches. If the cursor is currently placed above the start label and the PREV occurrence of a string is requested, or the cursor is currently placed below the end label and the NEXT occurrence of a string is requested, the process returns a return code of 4 and the string is not found, even if it exists within the label range. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
labela, labelb
Starts at the first position after the current cursor location and searches ahead to find the next occurrence of string1. Starts at the top of the data and searches ahead to find all occurrences of string1. Starts at the top of the data and searches ahead to find the first occurrence of string1. Starts at the bottom of the data and searches backward to find the last occurrence of string1. Starts at the current cursor location and searches backward to find the previous occurrence of string1. Locates string1 anywhere the characters match. Locates string1 at the beginning of a word. Locates string1 at the end of a word.
300
CHANGE
WORD X NX start_col Locates string1 when it is delimited on both sides by blanks or other non-alphanumeric characters. Scans only lines that are excluded from the display. Scans only lines that are not excluded from the display. The first column to be included in the range of columns to be searched. When you specify only one column, the editor finds the string only if the string starts in the specified column. The first column to be included in the range of columns CHANGE is to search. The last column to be included in the range of columns CHANGE is to search.
left_col right_col
Note: For more information about restricting the search to only a portion of each line, see Limiting the Search to Specified Columns on page 51.
Description
CHANGE is often used with FIND, EXCLUDE, and SEEK, and the CHANGE_COUNTS assignment statement. To change the next occurrence of ME to YOU without specifying any other qualifications, include the following command in an edit macro:
ISREDIT CHANGE ME YOU
This command changes only the next occurrence of the letters ME to YOU. Since no other qualifications were specified, the letters ME can be: v Uppercase or a mixture of uppercase and lowercase v At the beginning of a word (prefix), the end of a word (suffix), or the entire word (word) v In an excluded line or a non-excluded line v Anywhere within the current boundaries To change the next occurrence of ME to YOU, but only if the letters are uppercase, include the following command in an edit macro:
ISREDIT CHANGE CME YOU
This type of change is called a character string change (note the C that precedes the search string) because it changes the next occurrence of the letters ME to YOU only if the letters are found in uppercase. However, since no other qualifications were specified, the change occurs no matter where the letters are found, as outlined in the preceding list. When you would like to issue CHANGE, but you are unsure of the exclude status of a line, you can use the XSTATUS assignment statement with SEEK. First, find the particular line with SEEK. Then, determine the exclude status with the XSTATUS assignment statement. Use CHANGE to change the string; and finally, reset the exclude status with another XSTATUS assignment statement. For example:
ISREDIT SEEK ABC DO WHILE &LASTCC=0 ISREDIT (X) = XSTATUS .ZCSR
301
CHANGE
ISREDIT CHANGE ABC DEF .ZCSR .ZCSR ISREDIT XSTATUS .ZCSR = &X ISREDIT SEEK ABC END
For more information, including other types of search strings, see Finding, Seeking, Changing, and Excluding Data on page 45.
Return codes
0 4 8 12 20 Normal completion String not found Change error. string2 is longer than string1 and substitution was not performed on at least one change. Inconsistent parameters. The string to be found does not fit between the specified columns. Severe error
Examples
Before changing the current member name, put it into a variable name such as MEMNAME. To add an identifier to that name, if it is in columns 1 to 10 and lies within the first line and the line labeled .XLAB:
ISREDIT (MEMNAME) = MEMBER ISREDIT CHANGE WORD &MEMNAME "MEMBER:&MEMNAME" 1 10 .ZFIRST .XLAB
Syntax
Assignment statement syntax ISREDIT (var1,var2) var1 var2 = CHANGE_COUNTS
The name of a variable to contain the number of strings changed. It must be an 8-character value that is left-padded with zeros. The name of a variable to contain the number of strings that could not be changed. It also must be an 8-character value that is left-padded with zeros.
Return codes
0 20 Normal completion Severe error
Examples
To put the number of changes resulting from the most recent CHANGE command into the variable &CHGED:
ISREDIT (CHGED) = CHANGE_COUNTS
302
CHANGE_COUNTS
ISREDIT (,ERRS) = CHANGE_COUNTS
To put the number of changes and change errors into variables &CHG and &ERR:
ISREDIT (CHG,ERR) = CHANGE_COUNTS
COMPAREEdit Compare
The COMPARE command compares the file you are editing with an external sequential data set or member of a partitioned data set. Lines that exist only in the file being edited are marked, and lines that exist only in the file being compared are inserted as information lines in the file being edited. The command operates as a primary command or an edit macro. You can use the Delete and Make Data line commands to merge changes between files that are being compared. The COMPARE function supports all line lengths, but some SuperC options are ignored for line lengths greater than 256 characters long. When you are editing a cataloged data set, explicit data set names refer to cataloged data sets. However, if you are editing an uncataloged data set, explicit member names refer to cataloged data sets, but if you specify only a member name, COMPARE searches for the member in the current uncataloged data set. For example, if you are editing an uncataloged data set called userid.TEMP, the command
COMPARE TEMP
first looks for member TEMP in the current, uncataloged data set, then looks for a cataloged data set named TEMP (TSO prefix rules apply). If it finds data set TEMP, and the data set being edited is a PDS member, then the same named member is searched for in data set TEMP. Use of COMPARE when editing concatenations that contain uncataloged data sets is not supported and can lead to unpredictable results. If you have made changes to the data before issuing the COMPARE command, the COMPARE command uses the current contents of the edit session during the comparison. Because COMPARE does not require the data to be saved on disk, you can use the COMPARE command from EDIF, VIIF, or EDIREC sessions. However, COMPARE NEXT and COMPARE SESSION are not supported in EDIF, VIIF, or EDIREC sessions.
Syntax
Macro command syntax ISREDIT COMPARE dsname NEXT SESSION *
EXCLUDE dsname
SAVE
SYSIN
303
COMPARE
compared. This variable can be specified as a fully qualified data set name (in quotation marks), a partially qualified data set name, or a member name. If you specify only a member name, it can be preceded by a left parenthesis symbol. The right parenthesis is allowed but not required. The current edit session must be of a member of a partitioned data set. The current edit concatenation is searched for the member to compare. If you specify only a data set name and the current file is a member of a PDS, then the specified data set is searched for a member of the same name as the member being edited. NEXT Specifies to do a comparison between the currently edited member and the next member of the same name found at a higher level of the hierarchy (or next level of the edit concatenation) than the current member. For example, if the current member is found in the third level of the concatenation, and a like-named member exists at the fourth level, then the third and fourth level members are compared. After data is saved in the lowest level, compares are done from that level upward. Specifies that you want to compare the changes you have made during the edit session with the copy of the data saved on disk. Use COMPARE SESSION or COMPARE * to see the changes you have made to the edit data since the beginning of the edit session or since the last SAVE command. Same as SESSION. Specifies that all matching lines in the compared data sets are excluded from the display except for a specified number of lines above and below the differences. The differences themselves are also shown in the display. The specified number of lines that are shown is set on the Edit Compare Settings panel. If you do not specify a new number for this edit session, then whatever was the last number set is still valid. To change this number, issue the COMPARE command with no operand and change the EXCLUDE field on the Edit Compare Settings panel. Valid numbers are 0 through 12, inclusive. You cannot display the Edit Compare Settings panel from a macro. You can also use the COMPARE EXCLUDE command at any time to exclude all lines in a file except lines with line labels and information lines, and the lines above and below those lines. When you specify EXCLUDE without a data set name or NEXT, no comparison is done. Instead the labels and information lines that already exist in the file are used to exclude functions. See Examples on page 305 for a macro that uses this technique. SAVE Specifies that SuperC (which performs the actual compare function) create a listing. The listing is saved in a data set named prefix.ISPFEDIT.COMPARE.LIST. The save function is intended for debugging purposes, but it also provides a way to create a SuperC listing. The listing produced is a Change listing (option CHNGL). No notification is given regarding successful creation of the listing, and errors allocating the listing do not cause the comparison to end.
SESSION
* EXCLUDE
304
COMPARE
Note: Because of the way the SuperC comparison is done, the file currently being edited is shown in the SuperC listing as the old file, and the file to which the current file is being compared is listed as the new file. Therefore, insertions refer to lines that are not in the current file, and deletions refer to lines that are only in the current file. SYSIN Specifies not to free the ddname SYSIN before calling SuperC to compare files. This enables you to pass SuperC Process Statements to alter the comparison. No validation is done on the type of SYSIN allocation or the contents of the data set.
Return codes
0 8 12 20 Normal completion Member or data set not found, or an error opening the member or data set occurred. No parameters specified, or another parameter error such as not valid NEXT or member specification. Severe error. SuperC, allocation, or delta file error occurred.
Examples
To compare the current file to another file called X.Y.Z and to save the SuperC output file in ISPFEDIT.COMPARE.LIST:
ISREDIT COMPARE X.Y.Z SAVE
To compare the current file to a member in the same partitioned data set, and exclude everything but the context in which changes exist:
ISREDIT COMPARE (memname) EXCLUDE
To find all of the occurrences of a string in a file and exclude lines to show the context in which the strings were found, you can use the following macro:
/* REXX - Edit macro to find a string, show only lines with the /* string and a few lines above and below found strings. /* This uses the COMPARE EXCLUDE command to perform the /* line exclude function. /* -------------------------------------------------------------Address isredit /* MACRO (PARM) /* Accept input string If parm ^= Then /* Do nothing if no parameters Do /* RESET LABEL /* Remove all existing labels F FIRST parm /* Find first string occurrence Do While(rc=0) /* For each occurrence LABEL .ZCSR = label() 0/* Assign a label to line RFIND /* Find next occurrence End /* COMPARE X /* Exclude everything except /* Labels and above/below lines RESET LABEL /* Remove all labels (XSTAT) = XSTATUS .ZFIRST /* Save exclude status of line 1 LOCATE .ZFIRST /* Move display to line 1 XSTATUS .ZFIRST = xstat /* Restore line 1 exclude status End /* Exit 0 /* Always return a zero /* -------------------------------------------------------------label:Procedure Expose labelnum /* Routine to generate a unique If datatype(labelnum,N)=0 Then /* Edit line label */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */
305
COMPARE
labelnum=0 /* */ Else /* */ labelnum=labelnum+1 /* */ Return .translate(right(labelnum,4,0),ABCDEFGHIJ,0123456789)
COPYCopy Data
The COPY macro command copies any member of the ISPF library or partitioned data set you are editing into the member you are editing.
Syntax
Macro command syntax ISREDIT COPY member (member) dsname dsname(member) AFTER BEFORE label
start_line end_line member dsname A member of the ISPF library or partitioned data set that you are editing. Either member or data set name are required parameters. A partially or fully qualified data set name. If the data set is partitioned, you must include a member name in parentheses. If a name of eight or fewer characters is specified and it could be a member name or a data set name, COPY searches for a member name first. If no member is found, then the name is used as a data set. Either data set name or member are required parameters. The destination of the data that is being copied. AFTER copies the data after label or linenum. The destination of the data that is being copied. BEFORE copies the data before label or linenum. Label identifying the line where the data is to be copied. It can be either a label that you define or one of the editor-defined labels, such as .ZF or .ZL. Label identifying the line where the data is to be copied. The number of the first line of the member to be copied. Must be greater than or equal to 1, and less than or equal to the number of lines in the member. The number of the last line of the member to be copied. Must be greater than or equal to linenum1 and less than or equal to the number of lines in the member. If not specified, the last line of the member is used.
linenum linenum1
linenum2
Note: If the member name or data set name is less than 8 characters and the data set you are editing is partitioned a like-named member is copied. If a like-named member does not exist the name is considered to be a partially qualified data set name.
306
COPY
Return codes
0 8 12 16 20 Normal completion End of data reached before last record read Invalid label or linenum; member not found or BLDL error End of data reached before first record of specified range was reached Syntax error (invalid name, incomplete range), or I/O error.
Examples
To copy all of the member MEM1 at the end of the data:
ISREDIT COPY MEM1 AFTER .ZLAST
To copy all of data set MOVECOPY.DATA before the first line of data:
ISREDIT COPY MOVECOPY.DATA BEFORE .ZFIRST
To copy the first three lines of the member MEM1 before the first line of data:
ISREDIT COPY MEM1 BEFORE .ZF 1 3
Syntax
Macro command syntax ISREDIT CREATE member (member) dsname(member) dsname labela labelb
member
The name of the new member added to the partitioned data set currently being edited. If you are using a concatenated sequence of libraries, the member is always written to the first library in the sequence. The name of a different partitioned data set and new member to be added to the partitioned data set. The data set name can be fully or partially qualified.
dataset(member)
Labels identifying the start and end of the group of lines used to create the new member. Relative line number identifying the start of a group of lines used to create the new member. Relative line number identifying the end of a group of lines used to create the new member.
Description
CREATE adds a member to a partitioned data set only if a member with the same name does not already exist. Use REPLACE if the member already exists.
307
CREATE
Return codes
0 8 12 20 Normal completion Member already exists, member not created Invalid label or relative line number. The referenced line does not exist in the file. Syntax error (invalid name or incomplete label or relative line number range), or I/O error.
Examples
To create a new 10-line member from the first 10 lines of the member being edited:
ISREDIT CREATE MEM1 1 10
Syntax
Assignment statement syntax ISREDIT (var1,var2) var1 = CURSOR
The name of a variable containing the line number. The line number is a 6-digit value that is left-padded with zeros. It is the ordinal number (not the sequence number) of the line. If the variable is VDEFINEd in character format, it should be defined with a length of 8. The returned value is left-padded with zeros. For compatibility with previous releases of ISPF, a length of 6 or 7 is allowed in cases where no data loss will occur. The name of a variable containing the data column number. The data column number is a 3-digit number that is left-padded with zeros. If the variable is VDEFINEd in character format, it should be defined with a length of 5. The returned value is left padded with zeros. For compatibility with previous releases of ISPF, a length of 3 or 4 is allowed in cases where no data loss will occur. The columns are numbered starting with 1 at the first data column. If the cursor is in the command line, the cursor value is column 0 of the first data line on the panel; the value is column 0 if the cursor is in the line command field. When you retrieve the cursor position in an empty member, the line number and column number are both set to 0.
var2
linenum
The relative line number of the line on which the cursor is to be located. Make sure when you set the cursor to a line number that the line number exists. The label of the line on which the cursor is to be located. Note: If you try to use a label that has not been assigned, you receive a return code of 20. To avoid this, use the LINENUM assignment statement.
ISREDIT X = LINENUM .LABEL
label
308
CURSOR
When using the LINENUM statement, a return code of 8 is issued if the label does not exist. col The data column number where the cursor is to be located. If the column number is beyond the end of the data area when setting the cursor, the cursor is positioned to the next line, which is equivalent to the first position of the line command field.
Description
The position of the cursor shows the starting or ending location for the SEEK, FIND, CHANGE, and EXCLUDE commands. It is also used as the text split point for TSPLIT. See Referring to Column Positions on page 102 for more information on how the column number is determined. When you run a macro, the cursor value is the cursor position on the panel at run time. Note: To position the cursor on the command line, issue a return code of 1 from the macro. For example, in CLIST code EXIT CODE(1) as the last statement in your EDIT MACRO to position the cursor on the command line. The following statements can change the cursor position:
CHANGE CURSOR EXCLUDE FIND SEEK TSPLIT USER_STATE
Table 7 shows the line and column numbers returned, depending on the location of the cursor.
Table 7. Cursor Position If the CURSOR location is: The LINE number is: Command line Line number field Left sequence number (the sequence number is on the left of the data when number mode is on) Right sequence number Left or right of the bounds Data within the bounds Insert blank space First display line Line by the cursor Line by the cursor The COLUMN number is: 0 0 0
Line by the cursor Line by the cursor Line by the cursor Line above the cursor. If the cursor is at the top of the panel, then the line number returned is the line below the cursor and the column number is column 0. Line below the non-data line.
Column by the cursor Column by the cursor Column by the cursor Column by the cursor
Non-data line and its line command field (above the last data line) Non-data line (below the last data line)
309
CURSOR
Return codes
0 4 12 20 Normal completion Column number beyond data, line number incremented Invalid line number Severe error
Examples
To put the line number of the current cursor position into variable &LINE:
ISREDIT (LINE) = CURSOR
To set the cursor position to the line with the label .LAB, without changing the column position:
ISREDIT CURSOR = .LAB
Syntax
Macro command syntax
ISREDIT CUT .ZFIRST .ZLAST labela labelb DISPLAY DEFAULT clipboard_name X NX APPEND REPLACE
linenum1
Relative line number identifying the start of a group of lines in the current member that are to be added to, or replace, data in the clipboard. Relative line number identifying the end of a group of lines in the current member that are to be added to, or replace, data in the clipboard. Labels identifying the start and end of the group of lines in the current member that are to be added to, or replace, data in the clipboard. The name of the clipboard to use. If you omit this parameter, the ISPF default clipboard (named DEFAULT) is used. You can define up to ten additional clipboards. The size of the clipboards and number of clipboards might be limited by installation defaults.
linenum2
labela, labelb
clipboardname
310
CUT
X|NX Specify X to cut only lines that are excluded from the display. Specify NX to cut only lines that are not excluded from the display. The default is to cut all lines in the range (both excluded and nonexcluded lines) to the clipboard.
REPLACE|APPEND Specify REPLACE to replace existing data in the clipboard. If you do not specify REPLACE, the lines in the current CUT are added to the end of the existing data within the clipboard. If you specify APPEND, you add the data to the clipboard. This is the default.
Description
CUT saves copies of lines from an edit session to a clipboard for later retrieval by the PASTE command. The lines are copied from the session to the named clipboard. Lines are specified by label names on the CUT command. The edit macro CUT command always copies lines to the clipboard and does not delete them from the edit session. If you specify a clipboard name, lines are copied to that clipboard. If the specified clipboard does not yet exist, it is created. ISPF provides a default clipboard named DEFAULT. You can use up to 10 other clipboards that you define. The defined clipboards exist as long as you are logged on to TSO and are deleted when you log off. You can view the contents of clipboards and rename existing clipboards using the DISPLAY keyword of the CUT command.
Return codes
0 12 20 Normal completion Parameter error. Insufficient storage, or no more clipboards available. Severe error
Examples
To save all the lines in the current file to the default clipboard, appending them to lines already in the clipboard:
ISREDIT CUT .ZFIRST .ZLAST
To save all the lines in the current file to a clipboard named USERC1, replacing any lines already in the clipboard:
ISREDIT CUT .ZFIRST .ZLAST USERC1 REPLACE
Syntax
Assignment statement syntax ISREDIT (varname) varname = DATA_CHANGED
311
DATA_CHANGED
YES or NO. The data-changed status is initially set to NO at the beginning of an edit session, and is reset to NO whenever a save is done. If you change data on your screen, but issue the END command, the data-changed status is still NO. When data is changed, or if a command is issued which might have changed the data, the changed status is set to YES.
Description
This command returns information about whether the data might have changed. However, it does not specify whether data is saved when the END command is issued. Data can be saved without being changed if there is a change to the version, number, stats, or pack mode. When DATA_CHANGED returns a value of NO, an 8 character variable called ZEDSAVE is set to indicate whether the data is saved. ZEDSAVE will contain either SAVE or NOSAVE. See AUTOSAVE, CANCEL, SAVE and END for more information about saving data.
Return codes
0 20 Normal completion Severe error
Examples
To determine whether data has been changed and, if it has, to issue the built-in SAVE command:
ISREDIT (CHGST) = DATA_CHANGED IF &CHGST = YES THEN ISREDIT BUILTIN SAVE
Syntax
Assignment statement syntax ISREDIT (varname) varname = DATA_WIDTH
The name of a variable to contain the logical data width. The logical data width is a 3-digit value that is left-padded with zeros. If the variable is VDEFINEd in character format, it should be defined with a length of 5. The returned value is left padded with zeros. For compatibility with previous releases of ISPF, a length of 3 or 4 is allowed in cases where no data loss occurs.
Description
The logical data width is the maximum space, in bytes, that is available for data only. It does not include any COBOL or sequence number fields or, for variable-length records, the 4-byte record descriptor word (RDW). The value returned by the DATA_WIDTH assignment statement depends on the record format (fixed or variable) and the setting of number mode, as shown in Table 8. See NUMBERGenerate Sequence Numbers on page 253 if you need more information about number mode.
312
DATA_WIDTH
Table 8. Data Width Return Value Number mode setting OFF ON STD ON COB ON STD COB Logical data width for fixed-length records LRECL LRECL - 8 LRECL - 6 LRECL - 14 Logical data width for variable-length records LRECL - 4 LRECL - 12 N/A 1 N/A 1
Use the LRECL assignment statement to get the maximum space, in bytes, that is available for data, COBOL number fields, and sequence number fields.
Return codes
0 12 20 Normal completion Invalid command format Severe error
Examples
To put the data width in variable &MAXCOL and override the boundary setting for SEEK:
ISREDIT (MAXCOL) = DATA_WIDTH ISREDIT SEEK 1 &MAXCOL &ARGSTR
DATAIDQuery Data ID
The DATAID assignment statement retrieves the data ID for the data set currently being edited and places it in a variable.
Syntax
Assignment statement syntax ISREDIT (varname) varname = DATAID
The name of a variable containing the data ID of the data set currently allocated for editing.
Description
The data ID is created by the LMINIT service to identify a data set. If you begin an edit session with a data ID, the data ID is returned when you issue this command. If you begin an edit session without a data ID, then an LMINIT service obtains a data ID and returns it. On return from a top-level macro, the editor releases any data ID it has obtained. For further information about the use of library access services, refer to the z/OS ISPF Services Guide.
Return codes
0 The data ID returned was passed to the editor
Chapter 11. Edit Macro Commands and Assignment Statements
313
DATAID
4 8 20 Data ID was generated by and is freed by the editor A previously generated data ID was returned Severe error
Examples
To store the data ID in variable &DID, and then find the member MEM1 of that data set by using the LMMFIND library access service:
ISREDIT (DID) = DATAID ISPEXEC LMMFIND DATAID(DID) MEMBER(MEM1) IF &LASTCC = 0 THEN ...
Syntax
Assignment statement syntax ISREDIT (var1,var2,var3) var1 = DATASET
The name of a variable to contain the name of the data set currently being edited. The data set name is fully qualified without quotation marks (). The name of a variable to contain the name of the data set where the data currently being edited originated from. The data set name is fully qualified without quotation marks (). If the data currently being edited is new, a blank is returned in this variable. If the original data is deleted, the name of the data set where the data currently being edited originated from is still returned in this variable. The library concatenation number of the original data set. If the data currently being edited is new, zeros are returned.
var2
var3
Return codes
0 20 Normal completion Severe error
Examples
To place the name of the data set you are editing and the library concatenation number in the variables &CURDSN and &LIBNUM:
ISREDIT (CURDSN, ,LIBNUM) = DATASET
314
DEFINE
DEFINEDefine a Name
The DEFINE macro command is used to: v Identify a macro that replaces a built-in command of the same name v Identify programs that are edit macros v Assign an alias to a macro or built-in command v Make a macro or built-in command inoperable v Reset an inoperable macro or built-in command v Disable a macro or built-in command DEFINE is often used with the BUILTIN command.
Syntax
Macro command syntax CMD ISREDIT DEFINE name MACRO PGM ALIAS name_2 NOP RESET DISABLED name MACRO CMD Identifies the name that you are defining as a command language (CLIST or REXX exec) macro, which is called in the same way as using the SELECT service CMD keyword with a percent symbol (%) preceding the command. That means that you can specify only CLISTs or REXX EXECs. MACRO PGM Identifies the name that you are defining as a program (load module) macro, which is called by the SELECT PGM service. ALIAS name2 Identifies the name that you are defining as an alias of another name, with the same characteristics. If name2 is already an alias, the editor replaces it with the command it names. Therefore, it is not possible to have an alias of an alias. Makes the name you are defining and all of its aliases inoperable until you reset them with the RESET operand. Therefore, when the name or an alias of the name is called, nothing is processed. NOP is similar to DISABLED, except that disabled names cannot be reset by the RESET operand. Resets the most recent definition of the name that you are defining to the status in effect before that definition. For example, RESET makes inoperable names operable again. Makes the name that you are defining and all of its aliases disabled until you end the edit session. Therefore, when the name or an alias of the name is called, nothing is processed. A disabled command or macro cannot be restored by RESET. The name with which you process the command.
NOP
RESET
DISABLED
315
DEFINE
Description
The effects of the DEFINE macro command apply only to the edit session of the member or sequential data set being edited when the macro is run. This effect is different from the DEFINE primary command. To temporarily override DEFINE, use BUILTIN. Note: To define RESET as disabled, enclose it in quotes (RESET). If you do not use quotes, the editor interprets RESET as a keyword.
Return codes
0 8 12 20 Normal completion RESET was attempted for a name not currently defined, or DEFINE name ALIAS name2 requested and name2 is an NOP DEFINE was attempted for a name not currently defined Severe error (unknown command)
Examples
To define the name IJKDOIT as a CLIST or REXX macro:
ISREDIT DEFINE IJKDOIT MACRO
To create and update library statistics when data is saved, first set the stats mode on. Then make it impossible to turn off by defining it as disabled. Note that none of the commands that are defined as disabled can be called while you are editing a member.
ISREDIT MACRO ISREDIT STATS ON ISREDIT DEFINE STATS DISABLED
DELETEDelete Lines
The DELETE macro command deletes lines from the data you are editing.
316
DELETE
Syntax
Macro command syntax ISREDIT DELETE ALL X NX
ALL
linenum1 labela labelb ALL Specifies that all selected lines are deleted. The DELETE command, unlike FIND, CHANGE, and EXCLUDE, does not use NEXT, FIRST, PREV, or LAST. ALL is required to emphasize that NEXT is not the default. Restricts the lines deleted to those that are excluded. Restricts the lines deleted to those that are not excluded. Labels identifying the start and end of the group of lines to be deleted. To delete one line, enter one label. Relative line number identifying a line, or the start of a group of lines, to be deleted. Relative line number identifying the end of a group of lines to be deleted.
Description
DELETE can specify a single line or a range of lines. It can limit the lines to be deleted to all excluded or non-excluded lines in the data, or to all excluded or non-excluded lines within a line pointer range.
Return codes
0 4 8 12 20 Normal (lines deleted successfully) No lines deleted No standard records exist Invalid line number Severe error
Examples
To delete all non-excluded lines:
ISREDIT DELETE ALL NX
317
DELETE
To delete the last line of data in the current data set:
ISREDIT DELETE .ZLAST
Syntax
Assignment statement syntax ISREDIT (var1,var2) var1 = DISPLAY_COLS
The name of a variable containing the column number of the first data column visible to you. The column number is a 3-digit value that is left-padded with zeros. If the variable is VDEFINEd in character format, it should be defined with a length of 5. The returned value is left padded with zeros. For compatibility with previous releases of ISPF, a length of 3 or 4 is allowed in cases where no data loss will occur. The name of a variable containing the column number of the last data column visible to you. The column number is a 3-digit value that is left-padded with zeros. If the variable is VDEFINEd in character format, it should be defined with a length of 5. The returned value is left padded with zeros. For compatibility with previous releases of ISPF, a length of 3 or 4 is allowed in cases where no data loss will occur.
var2
Description
Columns that contain sequence numbers are not considered data columns. Do not use this assignment statement in initial macros because the columns displayed are not known until the data first appears. See Referring to Column Positions on page 102 for more information.
Return codes
0 12 20 Normal completion Invalid command format Severe error
Examples
To put the leftmost and rightmost column values displayed to you in variables &LEFT and &RIGHT:
ISREDIT (LEFT,RIGHT) = DISPLAY_COLS
318
DISPLAY_LINES
Syntax
Assignment statement syntax ISREDIT (var1,var2) var1 = DISPLAY_LINES
The name of a variable containing the relative line number of either the first visible data line or block of excluded lines if the macro ended at this point. The relative line number is a 6-digit value that is left-padded with zeros. If the variable is VDEFINEd in character format, it should be defined with a length of 8. The returned value is left-padded with zeros. For compatibility with previous releases of ISPF, a length of 6 or 7 is allowed in cases where no data loss will occur. The name of a variable containing the relative line number of either the last visible data line or block of excluded lines. The relative line number is a 6-digit value that is left-padded with zeros. If the variable is VDEFINEd in character format, it should be defined with a length of 8. The returned value is left-padded with zeros. For compatibility with previous releases of ISPF, a length of 6 or 7 is allowed in cases where no data loss will occur.
var2
Return codes
0 4 8 12 20 Normal completion No visible data lines No existing data lines Invalid command format Severe error
Examples
To place the top and bottom line numbers in variables &TOP and &BOT:
ISREDIT (TOP,BOT) = DISPLAY_LINES
DOWNScroll Down
The DOWN macro command scrolls data down from the current panel position.
Syntax
Macro command syntax ISREDIT DOWN amt amt The number of lines (0-9999) to scroll, or one of the following operands: MAX Scrolls to the end of data in the specified direction. HALF Displays the next sequential half panel of data.
Chapter 11. Edit Macro Commands and Assignment Statements
319
DOWN
PAGE Displays the next sequential full panel of data. CURSOR Scrolls until the line on which the cursor is located becomes the first data line on the panel. DATA Scrolls until the last data line on the current panel of data becomes the first data line on the next panel of data.
Description
To scroll down using the panel position when the macro was first issued, use USER_STATE assignment statements to save and then restore the panel position operands. When you issue DOWN, the non-data lines on the panel affect the number of lines scrolled. However, if you define a macro named DOWN, it only overrides the DOWN command when used from another macro. DOWN does not change the cursor position and cannot be used in an initial macro. The actual number of lines appearing on the panel is determined by: v The number of lines excluded from the display v The terminal display size and split-panel line v The number of special temporary lines appearing, such as the ==ERR>, ==CHG>, =COLS>, ======, =PROF>, ==MSG>, =NOTE=, =BNDS>, =TABS> or =MASK> lines The first line appearing is determined in one of two ways: (1) a LOCATE command can set the line first on the panel, and (2) the first line to appear depends on whether the cursor was set explicitly by a CURSOR assignment statement or implicitly by a SEEK, FIND, CHANGE, or TSPLIT command. Since the cursor must be on the panel, the line that is the first line on the panel may be different from the line that was first when you called the macro.
Return codes
0 2 4 8 12 20 Normal completion No more data DOWN No visible lines No data to display Amount not specified Severe error
Examples
To scroll down to the end of the data set:
ISREDIT DOWN MAX
To make the line where the cursor is placed the first one on the display:
ISREDIT DOWN CURSOR
320
EDIT
Syntax
Macro command syntax ISREDIT EDIT member member A member of the library or other partitioned data set you are currently editing. You may enter a member pattern to generate a member list.
Description
Editing one data set or member while you are already editing another is called recursive editing. Your initial edit session is suspended until the second-level edit session is complete. Editing sessions can be nested until you run out of storage. To exit from a nested edit session, END or CANCEL must be processed by a macro or entered by you. The current edit session resumes. The EDIT service call, ISPEXEC EDIT, is an alternate method of recursively starting the editor. It offers the option of editing another data set and specifying an initial macro. For more information on using the EDIT service for recursive editing, refer to the z/OS ISPF Services Guide.
Return codes
0 4 12 14 20 28 Normal completion, data was saved Normal completion, data was not saved Your error (invalid member name, recovery pending) Member in use Severe error No ISREDIT MACRO statement preceded this call, or BROWSE was substituted because of the size of the member being edited.
Examples
To recursively edit the member OLDMEM in your current ISPF library:
ISREDIT EDIT OLDMEM
Syntax
Macro command syntax
321
END
ISREDIT END
Description
If an edit macro contains an ISREDIT END statement, there can be no other ISREDIT or ISPEXEC statements following it. If one of these kinds of statements does follow an ISREDIT END, the edit macro ends with an error when that statement occurs. However, any other CLIST, REXX exec, or program statements can follow an ISREDIT END statement and process normally. If no aliases have been defined for END, the response of the editor to the END command depends on: v Whether changes were made to the data during your current edit session v If changes were made, whether a SAVE command was entered after the last change v The setting of number mode, autonum mode, stats mode, autolist mode, and autosave mode in the edit profile v Whether you were editing a member that was an alias of another member Note: When END is entered in the macro field in the edit prompt panel (ISRUEDIT), the macro name is not saved in the profile for use in future sessions. This is to avoid having the editor appear to do nothing when it is invoked from the data set list. See Ending an edit session on page 12 for more information.
Return codes
0 4 12 20 Normal completion New member saved END not done, AUTOSAVE OFF PROMPT set, or Data not saved (insufficient space) Severe error
Examples
To end the current edit session:
ISREDIT END
Syntax
.ZFIRST .ZLAST ISREDIT EXCLUDE string labela labelb ALL FIRST LAST PREV NEXT
322
EXCLUDE
CHARS PREFIX SUFFIX WORD string start_col left_col right_col
The search string you want to exclude. See Finding, Seeking, Changing, and Excluding Data on page 45. Note: For edit macros written in CLIST, strings that contain an open comment delimiter (/*) must be placed within the &STR() delimiters such as &STR(/*XXX). The maximum allowable length of the string is 256 bytes. If you are specifying a hex string, the maximum is 128 hexadecimal characters.
labela, labelb
Labels identifying the start and end of the group of lines within which the EXCLUDE command is to search. If the cursor is currently placed above the start label and the PREV occurrence of a string is requested, or the cursor is currently placed below the end label and the NEXT occurrence of a string is requested, the process returns a return code of 4 and the string is not found, even if it exists within the label range. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
NEXT ALL FIRST LAST PREV CHARS PREFIX SUFFIX WORD start_col
Starts at the first position after the current cursor location and searches ahead to find the next occurrence of string. Starts at the top of the data and searches ahead to find all occurrences of string. Starts at the top of the data and searches ahead to find the first occurrence of string. Starts at the bottom of the data and searches backward to find the last occurrence of string. Starts at the current cursor location and searches backward to find the previous occurrence of string. Locates string anywhere the characters match. Locates string at the beginning of a word. Locates string at the end of a word. Locates string when it is delimited on both sides by blanks or other non-alphanumeric characters. The first column to be included in the range of columns to be searched. When you specify only one column, the editor finds the string only if the string starts in the specified column. The first column to be included in the range of columns to be searched. The last column to be included in the range of columns to be searched.
left_col right_col
323
EXCLUDE
Note: For more information about restricting the search to only a portion of each line, see Limiting the Search to Specified Columns on page 51.
Description
You can use the EXCLUDE command with the FIND and CHANGE commands to find a search string, change it, and then exclude the line that contains the string from the panel. To exclude the next non-excluded line that contains the letters ELSE without specifying any other qualifications, include the following command in an edit macro:
ISREDIT EXCLUDE ELSE
Since no other qualifications were specified, the letters ELSE can be: v Uppercase or a mixture of uppercase and lowercase v At the beginning of a word (prefix), the end of a word (suffix), or the entire word (word) v Anywhere within the current boundaries To exclude the next line that contains the letters ELSE, but only if the letters are uppercase, include the following command in an edit macro:
ISREDIT EXCLUDE CELSE
This type of exclusion is called a character string exclusion (note the C that precedes the search string) because it excludes the next line that contains the letters ELSE only if the letters are found in uppercase. However, since no other qualifications were specified, the exclusion occurs no matter where the letters are found on a non-excluded line, as outlined in the previous list. For more information, including other types of search strings, see Finding, Seeking, Changing, and Excluding Data on page 45.
Return codes
0 4 8 12 20 Normal completion String not found Lines not excluded Inconsistent parameters Severe error
Examples
This example excludes the first non-excluded line in the data set that contains the letters ELSE. However, the letters must occur on or between lines labeled .E and .S and they must be the first four letters of a word:
ISREDIT EXCLUDE ELSE .E .S FIRST PREFIX
This example excludes the last non-excluded line in the data set that contains the letters ELSE. However, the letters must occur on or between lines labeled .E and .S and they must be the last four letters of a word.
ISREDIT EXCLUDE ELSE .E .S LAST SUFFIX
This example excludes the first non-excluded line that immediately precedes the cursor position and that contains the letters ELSE. However, the cursor must not be
324
EXCLUDE
positioned ahead of the lines labeled .E and .S. Also, the letters must occur on or between the labeled lines; they must be standalone characters (not part of any other word); and they must exist within columns 1 and 5:
ISREDIT EXCLUDE ELSE .E .S PREV WORD 1 5
Syntax
Assignment statement syntax ISREDIT (var1,var2) var1 var2 = EXCLUDE_COUNTS
The name of a variable to contain the number of strings found. The number of strings is an 8-digit value that is left-padded with zeros. The name of a variable to contain the number of lines excluded. The number of lines excluded is an 8-digit value that is left-padded with zeros.
Return codes
0 12 20 Normal completion Invalid command format Severe error
Examples
To determine the number of lines that contain the word BOX:
ISREDIT EXCLUDE ALL BOX ISREDIT (,BOXLINES) = EXCLUDE_COUNTS
Syntax
Macro command syntax .ZFIRST .ZLAST ISREDIT FIND F string labela labelb ALL FIRST LAST PREV NEXT
325
FIND
string The search string you want to find. See Finding, Seeking, Changing, and Excluding Data on page 45. Note: For edit macros written in CLIST, strings that contain an open comment delimiter (/*) must be placed within the &STR() delimiters such as &STR(/*XXX). The maximum allowable length of the string is 256 bytes. If you are specifying a hex string, the maximum is 128 hexadecimal characters. labela, labelb Labels identifying the start and end of the group of lines within which the FIND command is to search. If the cursor is currently placed above the start label and the PREV occurrence of a string is requested, or the cursor is currently placed below the end label and the NEXT occurrence of a string is requested, the process returns a return code of 4 and the string is not found, even if it exists within the label range. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56. NEXT ALL FIRST LAST PREV CHARS PREFIX SUFFIX WORD X NX start_col Starts at the first position after the current cursor location and searches ahead to find the next occurrence of string. Starts at the top of the data and searches ahead to find all occurrences of string. Starts at the top of the data and searches ahead to find the first occurrence of string. Starts at the bottom of the data and searches backward to find the last occurrence of string. Starts at the current cursor location and searches backward to find the previous occurrence of string. Locates string anywhere the characters match. Locates string at the beginning of a word. Locates string at the end of a word. Locates string when it is delimited on both sides by blanks or other non-alphanumeric characters. Scans only lines that are excluded from the display. Scans only lines that are not excluded from the display. The first column to be included in the range of columns to be searched. When you specify only one column, the editor finds the string only if the string starts in the specified column. The first column to be included in the range of columns to be searched. The last column to be included in the range of columns to be searched.
left_col right_col
Note: For more information about restricting the search to only a portion of each line, see Limiting the Search to Specified Columns on page 51.
326
FIND
Description
Use the SEEK macro command instead of FIND if you want to locate a string without changing the exclude status of the line that contains the string. You can use FIND with the EXCLUDE and CHANGE commands to find a search string, change it, and then exclude the line that contains the string from the panel. To find the next occurrence of the letters ELSE without specifying any other qualifications, include the following line in an edit macro:
ISREDIT FIND ELSE
Since no other qualifications were specified, the letters ELSE can be: v Uppercase or a mixture of uppercase and lowercase v At the beginning of a word (prefix), the end of a word (suffix), or the entire word (word) v In either an excluded or a non-excluded line v Anywhere within the current boundaries To find the next occurrence of the letters ELSE, but only if the letters are uppercase:
ISREDIT FIND CELSE
This type of search is called a character string search (note the C that precedes the search string) because it finds the next occurrence of the letters ELSE only if the letters are in uppercase. However, since no other qualifications were specified, the letters can be found anywhere in the data set or member, as outlined in the preceding list. For more information, including other types of search strings, see Finding, Seeking, Changing, and Excluding Data on page 45.
Return codes
0 4 12 20 Normal completion String not found Syntax error Severe error
Examples
The following example finds the first occurrence in the data set of the letters ELSE. However, the letters must occur on or between lines labeled .E and .S and they must be the first four letters of a word:
ISREDIT FIND ELSE .E .S FIRST PREFIX
The following example finds the last occurrence in the data set of the letters ELSE. However, the letters must occur on or between lines labeled .E and .S; they must be the last four letters of a word; and they must be found in an excluded line.
ISREDIT FIND ELSE .E .S LAST SUFFIX X
The following example finds the first occurrence of the letters ELSE that immediately precedes the cursor position. However, the cursor must not be positioned ahead of the lines labeled .E and .S. Also, the letters must occur on or between lines labeled .E and .S; they must be standalone characters (not part of any other word); they must be found in a non-excluded line; and they must exist within columns 1 and 5:
Chapter 11. Edit Macro Commands and Assignment Statements
327
FIND
ISREDIT FIND ELSE .E .S PREV WORD NX 1 5
Syntax
Assignment statement syntax ISREDIT (var1,var2) var1 var2 = FIND_COUNTS
The name of a variable to contain the number of strings found. The number of strings is an 8-digit value that is left-padded with zeros. The name of a variable to contain the number of lines on which strings were found. The number of lines on which strings were found is an 8-digit value that is left-padded with zeros.
Return codes
0 12 20 Normal completion Invalid command format Severe error
Examples
To find all occurrences of && in the line labeled .A and loop through and process them:
ISREDIT FIND .A .A && ALL ISREDIT (FINDS) = FIND_COUNTS DO WHILE &FINDS > 0 ... END
Syntax
Assignment statement syntax ISREDIT FLIP label-range labela, labelb Labels identifying the start and end of the group of lines within which the FLIP command is to reverse the exclude status. If one label is specified, only that labeled line is reversed. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
328
FLIP
Return codes
0 20 Successful completion. The excluded status of the requested lines was reversed. Severe error
Examples
The following are examples of statements using the FLIP commands from an Edit macro. The actual values for .a and .b can be defined by edit macro or by the user.
ISREDIT ISREDIT ISREDIT ISREDIT ISREDIT FLIP FLIP FLIP FLIP FLIP /* Flip all lines */ .ZL .ZF /* Flip all lines */ .ZF /* Flip first line in file */ .a .b /* Flip lines between and including .a and .b */ .a /* Flip line labeled .a */
Syntax
Assignment statement syntax ISREDIT (var1,var2) var1 = FLOW_COUNTS
The name of a variable to contain the number of original lines that participated in the text flow operation. The number of original lines is an 8-digit value that is left-padded with zeros. The name of a variable to contain the number of lines that were generated by the text flow operation. The number of lines is an 8-digit value that is left-padded with zeros. If the value in var1 is larger than the value in var2, the difference is the number of lines that were deleted from the current data because of the text flow operation. If the value in var1 is less than the value in var2, the difference is the number of lines that were added to the current data because of the text flow operation.
var2
Return codes
0 20 Normal completion Severe error
Examples
To retrieve the value of the rightmost column displayed, allow a margin of 8 for the text flow, and then take action if lines were added because of the text flow operation:
ISREDIT (,MAXCOL) = DISPLAY_COLS ISREDIT TFLOW .ZCSR &EVAL(MAXCOL - 8) ISREDIT (INLINE,OUTLIN) = FLOW_COUNTS IF &OUTLIN > &INLINE THEN DO ...
329
HEX
Syntax
Macro command syntax VERT ISREDIT HEX ON DATA VERT DATA OFF ON DATA ON VERT OFF Displays the hexadecimal representation of the data as a string of hexadecimal characters (two per byte) under the characters. Displays the hexadecimal representation of the data vertically (two rows per byte) under each character. Does not display hexadecimal representation of the data.
VERT ISREDIT HEX = ON DATA VERT DATA OFF var1 var2 ON DATA ON VERT OFF The name of a variable to contain ON or OFF. The name of a variable to contain DATA, VERT, or blanks. Same as macro command syntax. Same as macro command syntax. Same as macro command syntax.
Description
The HEX macro command and assignment statement determines whether the editor displays hexadecimal representation in a vertical or data string format. When the editor is operating in hexadecimal mode, three lines are displayed for each source line. The first line shows the data in standard character form, while the next two lines show the same data in hexadecimal representation.
330
HEX
Besides normal editing on the first of the three lines, you can change any characters by typing over the hexadecimal representations. You can also use the FIND, CHANGE, and EXCLUDE commands to find, change, or exclude invalid characters or any specific hexadecimal character, regardless of the setting of hexadecimal mode. See the discussion of picture strings and hexadecimal strings under Finding, Seeking, Changing, and Excluding Data on page 45.
Return codes
0 20 Normal completion Severe error
Examples
To put the value of hexadecimal mode (on or off) in variable &HEXMODE and to process if hexadecimal mode is on:
ISREDIT (HEXMODE) = HEX IF &HEXMODE = ON THEN ...
Syntax
Macro command syntax ISREDIT HIDE EXCLUDE EXCLUDED EXC EX X
Removes each n Line(s) not Displayed message from the display and underscores the line number field of the preceding line.
Return codes
0 20 Successful completion. Any n Line(s) not Displayed messages were removed from the display. Severe error
Examples
The following statements show how to use the HIDE command from an Edit macro to hide excluded lines, then the RESET HIDE command to display the excluded lines again.
ISREDIT HIDE X ISREDIT RESET HIDE /* Hide excluded lines /* Redisplay excluded lines */ */
331
HILITE
Syntax
Macro command syntax
ISREDIT HILITE OFF ON NOLOGIC LOGIC IFLOGIC DOLOGIC AUTO DEFAULT OTHER ASM BOOK C COBOL DTL HTML IDL JCL PANEL PASCAL PLI REXX SKEL SUPERC XML
|
MARGINS left_col * PAREN FIND right_col * CURSOR SEARCH DISABLED
RESET
ON OFF LOGIC
Sets program coloring ON and turns LOGIC coloring off. Sets coloring OFF, with the exception of cursor highlighting. LOGIC highlighting matches logical language-specific keywords in the same color. If an unmatched closing keyword is found, such as END for PL/I or :eul. for BookMaster, it is highlighted in reverse video pink only if HILITE LOGIC is active. When logic is being highlighted, only comments are highlighted along with it. Logic highlighting is available only for PL/I, PL/X, REXX, OTHER, C, SKELS, Pascal, and BookMaster. HILITE LOGIC turns on both IFLOGIC and DOLOGIC.
332
HILITE
Note: LOGIC highlighting can be turned off by issuing HILITE ON, HILITE NOLOGIC, or HILITE RESET commands. Changing the HILITE language does not change the LOGIC setting. IFLOGIC Turns on IF/ELSE logic matching. IFLOGIC matches IF and ELSE statements. When IFLOGIC is enabled, unmatched ELSE keywords are highlighted in reverse video pink. Turns on DO/END logic matching. DOLOGIC matches logical blocks such as DO/END in PL/I or :ol/:eol in BookMaster. For the C language, DOLOGIC matches curly braces ({ and }). C trigraphs for curly braces are not recognized and are not supported by DOLOGIC highlighting. When DOLOGIC is enabled, unmatched logical block terminators (such as END keywords in PL/I, :e tags in BookMaster or right braces ( } ) in C) are highlighted in reverse video pink. Same as ON. Allows ISPF to determine the language. Highlights the data in a single color. Highlight the data as a pseudo-PL/I language. Highlights the data as Assembler. Highlights the data as BookMaster. Highlights the data as C. Highlights the data as COBOL. Highlights the data as Dialog Tag Language. Highlights the data as HTML. Highlights the data as IDL. Highlights the data as MVS Job Control Language. Highlights the data as ISPF Panel Language. Highlights the data as Pascal. Highlights the data as PL/I. Highlights the data as REXX. Highlights the data as ISPF Skeleton Language. Highlights the data as a SuperC Listing. Highlights the data as XML.
DOLOGIC
NOLOGIC AUTO DEFAULT OTHER ASM BOOK C COBOL DTL HTML IDL JCL PANEL PASCAL PLI REXX SKEL SUPERC XML | | | | | | | | | |
MARGINS [left-margin | * [right-margin | * ] ] Specifies either or both of the left-margin or right-margin parameters for languages C, PL/I, and PL/X. The MARGINS keyword can be included on the same command that includes one of these languages. It cannot be specified when the language AUTO is specified, even if the language would subsequently be determined to be C, PL/I, or PL/X. left-margin The left hand margin for processing the language source. The value must be within the range as defined by the
Chapter 11. Edit Macro Commands and Assignment Statements
333
HILITE
| | | | | | | | | | | | | | | RESET PAREN language. The maximum value is 254 for C, 100 for PL/I, and 65 for PL/X. If left-margin exceeds the last input column or if an asterisk (*) is specified, the default left margin is obtained from the ISPF configuration table keyword for this language (HILITE_MARGIN_C, HILITE_MARGIN_PLI, or HILITE_MARGIN_PLX). right-margin The right hand margin for processing the language source. The value must be within the range as defined by the language. The maximum value is 255 for C, 200 for PL/I, and 80 for PL/X. If right-margin exceeds the last input column or if an asterisk (*) is specified, the default right margin is obtained from the ISPF configuration table keyword for this language (HILITE_MARGIN_C, HILITE_MARGIN_PLI, or HILITE_MARGIN_PLX). Resets defaults (AUTO, ON, Find and Cursor on). Toggles parenthesis matching. When parenthesis matching is active, only comments and quoted strings are specially colored. All other code appears in the default color. Note that extra parenthesis highlighting is always active when highlighting is active. Parentheses within quoted strings and comments are not checked or highlighted by the parenthesis matching function. FIND The HILITE FIND command toggles the highlighting color of any string that would be found by an RFIND. The user can select the highlight color. The default is reverse video white. Only non-picture strings are supported, and the only additional qualifiers recognized are hex strings (X...), character strings (C...), text strings (T...), WORD, PREFIX and SUFFIX, and boundaries specified in the FIND command. Hex strings may be highlighted. but non-displayable characters are not highlighted. Default bounds and labels are ignored when FIND strings are highlighted. Because FIND highlighting is not quite as robust at the FIND command itself, the editor may highlight more occurrences of the FIND string than FIND would actually locate. RESET has been enhanced, through the addition of a FIND operand, to temporarily disable the highlighting of FIND strings until the next FIND, RFIND, CHANGE, or RCHANGE command is issued. RESET with the FIND operand (or no operands at all), temporarily disables the highlighting of FIND strings. CURSOR The CURSOR operand toggles the highlighting of the phrase that contains the cursor in a user-selectable color. The default is white. Cursor highlighting in Edit is performed in a manner similar to the way it is done in Browse. The entire phrase from the previous blank to the next blank is highlighted. SEARCH HILITE SEARCH finds the first unmatched END, ELSE, }, or ) above the last displayed line on the panel. If a mismatched item is found, the file is scrolled so that the mismatch is at the top of the panel. The search for mismatches only occurs for lines above the last displayed line, so you may need to scroll to the bottom of the file before issuing the HI SEARCH command.
334
HILITE
Search is not available for the when the DEFAULT language operand is used. DISABLED Turns off all HILITE features and removes all action bars. This benefits performance at the expense of function. Since DISABLED status is not stored in the edit profile, you need to reenter this operand each time you enter the editor. If ISREDIT HILITE DISABLED is issued by a macro, any attempts to restore highlighting within the same macro invocation are ignored.
Description
The HILITE macro command can be used to highlight, in user-specified colors, many language-specific constructs, program logic features, the phrase containing the cursor, and any strings that match the previous FIND operation or those that would be found by an RFIND or RCHANGE request. In addition, when HILITE is entered with no operands, a dialog appears that allows you to set default colors for the data area in non-program files, for any characters typed since the previous Enter or function key entry, and for strings located by the FIND command. Both HI and HILIGHT are valid synonyms for HILITE. Note: Highlighting is not available for edit sessions that involve the following: v Data sets with record lengths greater than 255 v Mixed mode edit sessions (normally used when editing DBCS data) v Formatted data If a macro issues HILITE in any of these situations, a return code of 12 is set.
Return codes
0 8 12 Normal completion. Logic or search not supported in the current environment. Invalid language. Hilite dialog is invalid from an edit macro or Hilite not available because of the installation defaults or because the edit panel in use is not enabled for enhanced color. Severe error. Possibly extra parameters.
20
335
IMACRO
Syntax
Macro command syntax ISREDIT IMACRO name NONE
name
Identifies the initial macro to be run when editing the data set type that matches this profile. This macro is run before any data is displayed. Shows that no macro is to be run at the beginning of each edit session. The editor returns a value of NONE when no initial macro has been specified.
NONE
name
The name of a variable to contain the name of the initial macro. Same as macro command syntax.
Return codes
0 4 12 20 Normal completion IMACRO set not accepted; profile is locked Invalid name specified Severe error
Examples
To set the initial macro name to ISCRIPT:
ISREDIT IMACRO ISCRIPT
Syntax
Macro command syntax ISREDIT INSERT label linenum
numlines
336
INSERT
label linenum numlines A label that shows which line you want the inserted line or lines to follow. A relative line number that shows which line you want the inserted line or lines to follow. The number of lines to appear for data input; these lines are not saved until they contain data. If you do not type a number or if the number you type is 1, only one data input line appears.
Description
Use the INSERT macro command for data input. Inserted lines are initialized with data from the mask line. However, they are not data lines and cannot be referred to by any macro. Inserted lines are deleted if they do not contain data. You must specify that the line referenced on INSERT should be displayed; otherwise, you will not see the inserted line. Use LOCATE to position a line at the top of the display. Do not use this command for adding lines with specific data; instead, use the LINE_BEFORE and LINE_AFTER assignment statements.
Return codes
0 12 20 Normal completion Invalid line number Severe error
Examples
To open a 5-line area for data input after the line with the label .POINT, locate .POINT to position it to the top of the display. Then issue INSERT:
ISREDIT LOCATE .POINT ISREDIT INSERT .POINT 5
Syntax
Assignment statement syntax ISREDIT (var1,var2) = LABEL label linenum
ISREDIT LABEL
labelname linenum
label level
The name of a variable to contain the name of the label. The name of a variable to contain the nesting level of the label. It must be a 3-character value that is left-padded with zeros. A label identifying the line for which a label must be set or retrieved.
Chapter 11. Edit Macro Commands and Assignment Statements
337
LABEL
See the LOCATE and RESET command descriptions, which use labels to specify line ranges. linenum A relative line number identifying the line for which a label must be set or retrieved. Use the LINENUM assignment statement to obtain the current relative line number of a line with a label. labelname The name of the label. For more information about using labels, see Labels and Line Ranges on page 56. The LINENUM assignment statement can be used to determine whether a label exists. For more information, refer to the description of the LINENUM assignment statement later in this chapter. level The highest nesting level at which this label is visible to you or to a macro. Level 0 is the highest level. Labels at this level are visible to you and to all levels of nested macros. Level 1 is not visible to you, but it is visible to all macros, and so on. The level can never exceed the current nesting level. The maximum nesting level is 255. The level number defaults to the current nesting level.
Description
A range of labels is particularly useful for commands that operate on a range of lines, such as those in the following list:
CHANGE CREATE DELETE EXCLUDE FIND FLIP LOCATE REPLACE RESET SEEK SORT SUBMIT
Return codes
0 4 8 12 20 Normal completion Label name not returned, specified line has no label Label set, but an existing label at the same level was deleted Line number specified is beyond the end of data Severe error
Examples
To get the line of data at the cursor, look for the next occurrence of the string in the variable &ARG, and then label the line if it is found and currently unlabeled:
ISREDIT (NAME) = LINE .ZCSR ISREDIT FIND &ARG IF &LASTCC = 0 THEN ISREDIT (LBL,NEST) = LABEL .ZCSR IF &LBL=&STR() THEN ISREDIT LABEL .ZCSR = .POINT 0
LEFTScroll Left
The LEFT macro command scrolls data to the left of the current panel position.
338
LEFT
Syntax
Macro command syntax ISREDIT LEFT amt amt The scroll amount, the number of columns (0-9999) to scroll, or one of the following operands: MAX Displays the first page of data to the left.
HALF Displays the next half-panel of data to the left. PAGE Displays the next full panel of data to the left. CURSOR Scrolls until the column on which the cursor is located becomes the first data column on the panel. DATA Scrolls until the first column on the current panel of data becomes the last column on the next panel.
Description
The editor stops scrolling when it reaches the current BOUNDS setting. For example, if the left bound is position 9 and positions 21 to 92 are displayed, issuing ISREDIT LEFT 20 leaves positions 9 to 80 displayed, not 1 to 72. To scroll to the left using the panel position when the macro was issued, use USER_STATE assignment statements to save and then restore the panel position operands. If you define a macro named LEFT, it overrides the LEFT command when used from another macro. LEFT does not change the cursor position and cannot be used in an initial macro. For further information, see the BOUNDS and DISPLAY_COLUMNS descriptions.
Return codes
0 4 8 12 20 Normal completion No visible lines No data to display Amount not specified Severe error
Examples
To scroll the display to the left by the number of columns specified in variable &COL:
ISREDIT LEFT &COL
339
LEVEL
See Version and modification level numbers on page 27 for more information about level numbers.
Syntax
Macro command syntax ISREDIT LEVEL num num The modification level. It can be any number from 0 to 99.
num
The name of a variable to contain the modification level. The modification level is a 2-digit value that is left-padded with zeros. Same as above.
Return codes
0 4 12 20 Normal completion Statistics mode is off; the command is ignored Invalid value specified Severe error
Examples
To reset the modification level to 1:
ISREDIT LEVEL = 1
Syntax
Assignment statement syntax ISREDIT (varname) = LINE linenum label
ISREDIT LINE
linenum label
data
340
LINE
varname linenum label data Specifies the name of a variable to hold the contents of the specified data line. A relative line number identifying the data line. A label identifying the data line. Specifies that the following forms can be used: v Simple string v Delimited string v Variable v Template (< col,string >) v Merge format (string1 + string2, operand + string2, string1 + operand) v Operand: LINE Data from this line is used. LINE linenum Data from the line with the given relative line number. LINE label Data from the line with the given label. MASKLINE Data from the mask line. TABSLINE Data from the tabs line.
Description
The logical data width of the line determines how many characters are retrieved or set. See the description of the DATA_WIDTH command for information on determining the current logical data width. You must specify the line pointer to set or retrieve a line. To set data on a line, you can use a variety of data formats: (variable), templates, or merging a line with other data. The data on the line is completely overlaid with the data specified on this command.
Return codes
0 4 8 12 16 20 Normal completion Data truncated (line shorter than data supplied) Variable not found Invalid line number Variable data truncated Severe error
Examples
To replace the data on line 7 with data from a variable named NEWDAT:
ISREDIT LINE 7 = (NEWDAT)
because the variable is not rescanned by either the language processor or ISPF. To set comment delimiters in columns 40 and 70, blanking the rest of the line:
Chapter 11. Edit Macro Commands and Assignment Statements
341
LINE
ISREDIT LINE 1 = < 40 &STR(/*) 70 &STR(*/) >
Syntax
Assignment statement syntax DATALINE ISREDIT LINE_AFTER linenum label = INFOLINE MSGLINE NOTELINE data
linenum
A relative line number identifying the data line after which the new line is to be inserted. A line pointer of 0 causes the new line to be inserted at the beginning of the current data set. A label identifying the data line after which the new line is to be inserted. The line inserted is a data line. The line inserted is a temporary, non-data line. The line command field shows ====== in high intensity and the data on the line is in high intensity, also. The line can be scrolled left and right and can be as long as the current record length. An information line is protected. Once it has been added to the data, it cannot be referenced. The line inserted is a temporary, non-data line. The line command field contains ==MSG> in high intensity and the data on the line is also in high intensity. A message line has a data length of 72 characters, regardless of the data width. Once it has been added to the data, it cannot be referenced. The line inserted is a temporary, non-data line. The line command field shows =NOTE= in high intensity and the data on the line is in low intensity. A note line has a data length of 72 characters, regardless of the data width. It cannot be referenced after it is added to the data. Specifies that the following data formats can be used: v Simple string v Delimited string v Variable v Template (< col,string >)
MSGLINE
NOTELINE
data
342
LINE_AFTER
v Merge format (string1 + string2, operand + string2, string1 + operand) v Operand: LINE Data from the line preceding this line. LINE linenum Data from the line with the given relative line number. LINE label Data from the line with the given label. MASKLINE Data from the mask line. TABSLINE Data from the tabs line.
Description
This statement is used for adding lines with specific data. Use the INSERT command for data input.
Return codes
0 4 12 20 Normal completion Data truncated Invalid line number Severe error
Examples
To add data after line 4 with data from a variable named NEWDAT:
ISREDIT LINE_AFTER 4 = (NEWDAT)
Note: This syntax is preferred to ISREDIT LINE_AFTER 4 = &NEWDAT because the variable is not rescanned by either the language processor or ISPF. To put a new line that contains the string:
This is the new top line of the data
To put the contents of the line labeled .START on a new line following the line labeled .END:
ISREDIT LINE_AFTER .END = LINE .START
To put the contents of the mask line modified by the variable &DATA after the line whose number is in variable &N:
ISREDIT LINE_AFTER &N = MASKLINE + &DATA
343
LINE_BEFORE
Syntax
Assignment statement syntax DATALINE ISREDIT LINE_BEFORE linenum label = INFOLINE MSGLINE NOTELINE data
A relative line number identifying the data line before which the new line is to be inserted. A line pointer of 0 is invalid. A label identifying the data line before which the new line is to be inserted. The line inserted is a data line. The line inserted is a temporary, non-data line. The line command field shows ====== in high intensity. The data on the line is shown in high intensity also. The line can be scrolled left and right and can be as long as the current record length. An information line is protected. Once it has been added to the data, it cannot be referenced. The line inserted is a temporary, non-data line. The line command field contains ==MSG> in high intensity. The data on the line is shown in high intensity also. A message line has a data length of 72 characters, regardless of the data width. Once it has been added to the data, it cannot be referenced. The line inserted is a temporary, non-data line. The line command field shows =NOTE= in high intensity. The data on the line is shown in low intensity. A note line has a data length of 72 characters, regardless of the data width. It cannot be referenced once it has been added to the data. Specifies that the following data formats can be used: v Simple string v Delimited string v Variable v Template (< col,string >) v Merge format (string1 + string2, operand + string2, string1 + operand) v Operand (those allowed follow): LINE Data from the line following this line. LINE linenum Data from the line with the given relative line number. LINE label Data from the line with the given label. MASKLINE Data from the mask line. TABSLINE Data from the tabs line.
MSGLINE
NOTELINE
data
344
LINE_BEFORE
Description
The LINE_BEFORE statement is used for adding lines with specific data. Use INSERT for data input.
Return codes
0 4 12 20 Normal completion Data truncated Invalid line number Severe error
Examples
To add data before line 4 with data from a variable named NEWDAT:
ISREDIT LINE_BEFORE 4 = (NEWDAT)
Note: This syntax is preferred to ISREDIT LINE_BEFORE 4 = &NEWDAT because the variable is not rescanned by either the language processor or ISPF. To put the contents of the line labeled .START on a new line preceding the line labeled .END:
ISREDIT LINE_BEFORE .END = LINE .START
To put the contents of the mask line modified by the variable &DATA before the line whose number is in variable &N:
ISREDIT LINE_BEFORE &N = MASKLINE + &DATA
Syntax
Assignment statement syntax ISREDIT (varname) = LINE_STATUS linenum label
varname
The name of a variable to contain the status string for the specified line. This is a 32-character variable containing character 1s and 0s indicating the following: Characters 1-7 are source information.
Character 1 Character 2 Character 3 Character 4 Character 5 Line is an original record (it existed when the edit session started) Line was created by the Move line command Line was created by the Copy or Repeat line command Line was created by the MOVE primary or macro command Line was created by the COPY primary or macro command
345
LINE_STATUS
Character 6 Character 7 Line was created by the TE line command Line was created by the Insert line command
Characters 15-32 are reserved for future use. linenum label A relative line number identifying the data line. A label identifying the data line.
Return codes
0 12 20 Normal completion Line number not valid Severe error
Examples
To determine if line number one of your data has changed and to display a message informing you of its status:
ISREDIT (LINESTAT) = LINE_STATUS 1 If linestat(1) = 1 Then Say Line is an ORIGINAL record Else Say Line was created during this edit session If linestat(8) = 1 Then Say Line has been changed Else Say Line has not been changed
Syntax
Assignment statement syntax ISREDIT (varname) varname = LINENUM label
The name of a variable to contain the line number of the line with the specified label. The line number is a 6-digit value that is
346
LINENUM
left-padded with zeros. If the variable is VDEFINEd in character format, it should be defined with a length of 8. The returned value is left-padded with zeros. For compatibility with previous releases of ISPF, a length of 6 or 7 is allowed in cases where no data loss will occur. label The name of the label for the line whose line number is needed.
Return codes
0 4 8 12 20 Normal completion Line 0 specified Label specified, but not found (variable set to 0) Invalid line number Severe error
Description
Once the line number is retrieved and placed in a variable, it can be used in arithmetic operations. Note that line numbers are relative to the position of the line: first=1, second=2, and so on. Therefore, the value returned by the LINENUM assignment statement is not always be correct if lines are added or deleted before the line number is obtained.
Examples
To determine the number of lines in the data set and set variable &VAR to the last line number:
ISREDIT (VAR) = LINENUM .ZLAST
That number is 0 if there are no lines. To set variable &NUM to the line number containing the label .MYLAB:
ISREDIT (NUM) = LINENUM .MYLAB
LOCATELocate a Line
The LOCATE macro command scrolls up or down to a specified line. The line is then displayed as the first line on the panel. There are two forms of LOCATE, specific and generic. The specific form of LOCATE positions a particular line at the top of the panel. You must specify either a line number or a label. The generic LOCATE command positions the panel to the first, last, next, or previous occurrence of a particular kind of line.
Syntax
Specific Locate macro command syntax ISREDIT LOCATE label linenum
linenum
347
LOCATE
label A label identifying the data line. It must be a label that you have previously defined or an editor-defined label, such as .ZFIRST or .ZLAST.
Generic Locate macro command syntax NEXT ISREDIT LOCATE FIRST LAST PREV CHANGE COMMAND ERROR EXCLUDED LABEL SPECIAL INFOLINE MSGLINE NOTELINE .ZFIRST .ZLAST labela labelb
FIRST LAST NEXT PREV CHANGE COMMAND ERROR EXCLUDED LABEL SPECIAL
Searches from the first line, proceeding forward. Searches from the last line, proceeding backward. Searches from the first line of the page displayed, proceeding forward. Searches from the first line of the page displayed, proceeding backward. Searches for a line with a change flag (==CHG>). Searches for a line with a pending line command. Searches for a line with an error flag (==ERR>). Searches for an excluded line. Searches for a line with a label. Searches for any special non-data (temporary) line: v Bounds line flagged as =BNDS> v Column identification lines flagged as =COLS> v Information lines flagged as ====== v Mask lines flagged as =MASK> v Message lines flagged as ==MSG> v Note lines flagged as =NOTE= v Profile lines flagged as =PROF> v Tabs line flagged as =TABS> Searches for information lines flagged with ====== Searches for message lines flagged with ==MSG> Searches for note lines flagged with =NOTE= Labels identifying the start and end of the group of lines in which to search. Note: If you try to locate a line using a label that has not been assigned, you will receive a return code of 20. To avoid this, use the LINENUM assignment statement. When using the LINENUM statement, a return code of 8 is issued if the label does not exist.
ISREDIT X = LINENUM .LABEL
348
LOCATE
linenum1 linenum2 Relative line number identifying the start of a group of lines in which to search. Relative line number identifying the end of a group of lines in which to search.
Return codes
0 4 8 20 Normal completion Line not located Empty member or data set Severe error
Examples
To locate the next occurrence of a line with a label:
ISREDIT LOCATE NEXT LABEL
Syntax
Assignment statement syntax ISREDIT (varname) varname = LRECL
The name of a variable to contain the logical record length of the data being edited. The logical record length is a 3-digit value that is left-padded with zeros. If the variable is VDEFINEd in character format, it should be defined with a length of 5. The returned value is left padded with zeros. For compatibility with previous releases of ISPF/PDF, a length of 3 or 4 is allowed in cases where no data loss occurs.
Description
The value returned by the LRECL assignment statement includes the sequence number field and, for fixed-length records, the COBOL number field, if these number fields are used. For variable-length records, the value returned by LRECL does not include the 4-byte record descriptor word (RDW).
349
LRECL
Use the DATA_WIDTH assignment statement to get the maximum space, in bytes, available for data.
Return codes
0 12 20 Normal completion Invalid command format Severe error
Examples
To check the logical record length of the data and process the data if the logical record length (LRECL) is 80:
ISREDIT (RECLEN) = LRECL IF &RECLEN = 80 THEN ...
Syntax
Macro Command syntax PROCESS ISREDIT MACRO NOPROCESS , ( variable variable )
The names of the variables that contain parameters, if a macro allows parameters to be specified. Parameters are parsed and placed into the named variables in the order in which they are typed. The last variable contains any remaining parameters. Variables that do not receive a parameter are set to a null string. A parameter is a simple or quoted string, separated by blanks or commas. Quotes can be single () or double ("), but must be matched at the beginning and end of the string. Immediately processes all changes and line commands typed at the keyboard.
PROCESS
NOPROCESS Processes changes and line commands typed at the keyboard when the macro completes processing or a PROCESS statement is found. NOPROCESS must be used if the macro is to use line commands as input to its processing. See PROCESSProcess Line Commands on page 365 for more information.
Description
The MACRO macro command is required in all macros. It must be the first command in a CLIST or REXX macro that is not a CLIST or REXX statement. Similarly, it also must be the first edit command in a program macro.
350
MACRO
Return codes
0 8 12 20 Normal completion No parameters are permitted for this processing Syntax Error Severe error
Examples
To begin a macro, first accepting a member name and optionally a line number range to be placed in the variable &PARM:
ISREDIT MACRO (PARM) ISREDIT COPY AFTER .ZCSR &PARM
To begin a macro, checking parameters before processing panel information, testing for missing input, excess input, and nonnumeric input:
ISREDIT MACRO NOPROCESS (COL,X) IF &STR(&COL) = &STR() THEN ISREDIT (,COL) = DISPLAY_COLS ELSE IF &DATATYPE(&COL) = CHAR THEN GOTO MSG IF &STR(&X) = &STR() THEN GOTO MSG ISREDIT PROCESS
Syntax
Assignment statement syntax ISREDIT (varname) varname = MACRO_LEVEL
The name of a variable to contain the macro nesting level. The nesting level is a 3-digit value that is left-padded with zeros.
Description
The nesting level can be any number between 1 (a macro that you start) and 255. MACRO_LEVEL is used to adjust processing based on whether the macro is started by you or called by another macro. It is required if labels are to be set for the starter of this macro. See LABELSet or Query a Line Label on page 337 for more information.
Return codes
0 12 20 Normal completion Invalid command format Severe error
Examples
To set the label for the caller of the macro at 1 less than the current level:
ISREDIT (NESTLEV) = MACRO_LEVEL ISREDIT LABEL .ZCSR = .XSTR &EVAL(&NESTLEV -1)
Chapter 11. Edit Macro Commands and Assignment Statements
351
MASKLINE
Syntax
Assignment statement syntax ISREDIT (varname) = MASKLINE
data
The name of a variable containing maskline contents. Specifies that the following forms can be used: v Simple string v Delimited string v Variable v Template (< col,string >) v Merge format (string1 + string2, operand + string2, string1 + operand) v Operand: LINE linenum Data from the line with the given relative line number. LINE label Data from the line with the given label. MASKLINE Data from the mask line. TABSLINE Data from the tabs line.
Description
The MASKLINE assignment statement places the mask line contents in a variable or sets the mask line from a variable. The mask line can contain any characters and serves to initialize inserted lines to the value of the mask line. See the description of templates in Overlays and Templates on page 94 for more information on the setting of a mask line. Be careful not to destroy a DBCS string in the mask line. If shift-out (SO) or shift-in (SI) characters in a mask line are overlaid through the MASKLINE statement, the result is unpredictable.
Return codes
0 4 16 20 Normal completion Data truncated Variable data truncated Severe error
Examples
To set the mask line to place comment delimiters starting at lines 40 and 70:
ISREDIT MASKLINE = <40 &STR(/*) 70 &STR(/*)>
352
MASKLINE
To set the mask line to blanks:
ISREDIT MASKLINE = " "
Syntax
Assignment statement syntax ISREDIT (varname) varname = MEMBER
The name of a variable to contain the name of the library member currently being edited.
Return codes
0 12 20 Normal completion Invalid command format Severe error
Examples
To determine if you are editing a library member with a prefix of MIN:
ISREDIT (MEMNAME) = MEMBER IF &SUBSTR(1:3,&MEMNAME ) = MIN THEN ...
Syntax
Macro command syntax ISREDIT MEND
Return codes
0 Normal completion
353
MODEL
The class name form of the MODEL macro command changes the model class that the editor uses to determine the model you want. For more information on edit models, see Chapter 4, Using Edit Models.
Syntax
Macro Command Model Name syntax ISREDIT MODEL model_name
qualifier
The name of the model to be copied, such as VGET for the VGET service model. This operand can also be one of the options listed on a model selection panel, such as V1 for the VGET service model. However, to use these options with the MODEL macro command, you must already know what they are or else display a model selection panel by using the MODEL primary command. The MODEL macro command does not display model selection panels. See z/OS ISPF Planning and Customizing for a list of models and model names. The name of a model on a secondary model selection panel, such as TBCREATE for the TBCREATE service model. This operand can also be one of the options listed on a model selection panel, such as G1 for the TBCREATE service model. For example, a model selection panel allows you to enter T1 to choose table models. It then displays another model selection panel for choosing table models, such as G1 for the TBCREATE service model. Therefore, your MODEL macro command could use either TABLES or T1 as the model-name operand and either TBCREATE or G1 as the qualifier operand. The simplest way would be to use TBCREATE or G1 as the model-name operand and omit the qualifier operand. To use options with the MODEL macro command, you must already know what they are or else display a model selection panel by using the MODEL primary command. The MODEL macro command does not display model selection panels. See z/OS ISPF Planning and Customizing for a list of models and model names.
qualifier
Specifies that the model is to be copied after the line specified by linenum or label. Specifies that the model is to be copied before the line specified by linenum or label. A relative line number identifying where the model should be copied. A label identifying where the model should be copied.
354
MODEL
NOTES NONOTES Explanatory notes appear when a model is copied. No explanatory notes appear.
Macro Command Class Name syntax ISREDIT MODEL CLASS class_name CLASS Specifies that the current model class is to be replaced by class-name. The new class name is used for all models from that point on, until you change the model class again or end the edit session. Specifies the model class for the current edit session. It must be a name on the Model Classes panel or an allowable abbreviation. The model class coincides with the type of model, such as REXX, COBOL, or FORTRAN.
class_name
Return codes
0 4 12 20 Normal completion Data truncated (the model exceeded the right-hand margin of the data being edited) Invalid line number (linenum) or label (label) Severe error
Examples
To copy the VGET model at the end of the current data:
ISREDIT MODEL VGET AFTER .ZL
Syntax
Macro command syntax ISREDIT MOVE member (member) dsname AFTER BEFORE linenum label
A member of the ISPF library or partitioned data set you are editing. A partially or fully qualified data set name. If the data set is partitioned you must include a member name in parentheses. Specifies that the member is to be moved after the target specified by linenum or label. Specifies that the member is to be moved before the target specified by the label. A relative line number identifying the target of the move.
Chapter 11. Edit Macro Commands and Assignment Statements
355
MOVE
label A label identifying the target of the move. Iit can be either a label that you define, or one of the editor-defined labels, such as .ZF and .ZL.
Note: If member or dsname is less than 8 characters and the data set you are editing is partitioned, a like-named member is copied. If a like-named member does not exist, the name is considered to be a partially qualified data set name.
Description
The member or data set is deleted after the move. For a concatenated sequence of ISPF libraries, the deletion occurs only if the member was in the first library of the concatenation sequence. See Copying and Moving Data on page 42 if you need more information.
Return codes
0 8 12 16 20 Normal completion End of data before last record read or the specified data set is in use Invalid line pointer (linenum or label); member not found or BLDL error End of data before first record read Syntax error (invalid name, incomplete range), or I/O error
Examples
To move the contents of member ABC after the first line in the current data:
ISREDIT MOVE ABC AFTER .ZF
To move all of data set MOVECOPY.DATA before the line where the cursor is currently positioned:
ISREDIT MOVE MOVECOPY.DATA BEFORE .ZCSR
Syntax
Macro command syntax ISREDIT NONUMBER
Description
You can also use the NUMBER OFF macro command to turn off number mode. When number mode is off, NONUMBER prevents any verification of valid line numbers, generation of sequence numbers, and the renumbering of lines that normally occurs when autonum mode is on.
356
NONUMBER
Return codes
0 20 Normal completion Severe error
Examples
To turn number mode off by using the NONUMBER command:
ISREDIT NONUMBER
Syntax
Macro command syntax ON ISREDIT NOTES NOTE OFF
ON OFF
Displays explanatory notes when a model is copied into the data being edited. Does not display explanatory notes.
ON ISREDIT NOTES = OFF varname ON OFF The name of a variable to contain the value of note mode, either ON or OFF. Same as macro command syntax. Same as macro command syntax.
Return codes
0 20 Normal completion Severe error
357
NOTES
Examples
To set note mode off:
ISREDIT NOTES = OFF
Syntax
Macro command syntax ON STD ISREDIT NULLS ALL ON STD ALL OFF ON STD Specifies that in fields that contain any blank trailing space, the space is to be written as one blank followed by nulls. If the field is entirely empty, it is written as all blanks. Specifies that all trailing blanks and all-blank fields are written as nulls. Specifies that trailing blanks in each data field are written as blanks.
ON ALL OFF
ON STD ISREDIT NULLS = ALL ON STD ALL OFF var1 var2 ON STD The name of a variable to contain either ON or OFF. The name of a variable to contain ALL, STD, or blanks. Same as macro command syntax.
358
NULLS
ON ALL OFF Same as macro command syntax. Same as macro command syntax.
Description
The term data field normally refers to the 72 characters of data on each line. Using hardware tabs, however, you can split each line into multiple fields. See TABSDefine Tabs on page 276 for more details. Blank characters (X40) and null characters (X00) both appear as blanks. When you use the I (insert) line command, the data entry area appears as blanks for NULLS ON STD and as nulls for NULLS ON ALL. Trailing nulls simplify use of the Ins (insert) key on the IBM 3270 keyboard. You can use this key to insert characters on a line if the line contains trailing nulls. Besides using NULLS, you can create nulls at the end of a line by using the Erase EOF or Del (delete) key. Null characters are never stored in the data; they are always converted to blanks.
Return codes
0 20 Normal completion Severe error
Examples
To set nulls mode on with blank trailing space written as one blank followed by nulls and empty fields written as all blanks:
ISREDIT NULLS = ON STD
To set nulls mode off and thus have trailing blanks in each data field:
ISREDIT NULLS = OFF
Syntax
Macro command syntax (1) ON ISREDIT NUMBER STD COBOL NOSTD NOCOBOL NOSTD NOCOBOL OFF DISPLAY STD COBOL
359
NUMBER
Notes: 1 ON STD is the default for non-COBOL data set types. COBOL is the default for COBOL data set types. Automatically verifies that all lines have valid numbers in ascending sequence and renumbers any lines that are either unnumbered or out of sequence. You can also use the RENUM command to turn number mode on and renumber lines. The editor interprets the STD, COBOL, and DISPLAY operands only when number mode is turned on. OFF STD COBOL Turns number mode off. You can also use the NONUMBER command to turn number mode off. Numbers the data in the standard sequence field. Numbers the data in the COBOL field. Note: The NUMBER ON COBOL mode is not supported for formatted data sets. Attention: If number mode is off, make sure the first 6 columns of your data set are blank before using either the NUMBER ON COBOL or NUMBER ON STD COBOL command. Otherwise, the data in these columns is replaced by the COBOL sequence numbers. If that happens and if edit recovery or SETUNDO is on, you can use the UNDO command to recover the data. You can also use CANCEL at any time to end the edit session without saving the data. STD COBOL Numbers the data in both fields. If both STD and COBOL numbers are generated, the STD number is determined and then used as the COBOL number. The COBOL numbers can be out of sequence if the COBOL and STD fields were not synchronized. Use RENUM to force synchronization. NOSTD NOCOBOL Turns standard number mode off. Turns COBOL number mode off.
NOSTD NOCOBOL Turns both the standard number mode and COBOL number mode off. DISPLAY Causes the width of the data window to include the sequence number fields. Otherwise, the width of the window does not include the sequence number fields. When you display a data set with a logical record length of 80 and STD numbering, the sequence numbers are not shown unless you are using a 3278 Model 5 terminal, which displays 132 characters. Automatic left or right scrolling is performed, if required, so that the leftmost column of the data window is the first column displayed.
360
NUMBER
ON ISREDIT NUMBER = COBOL STD COBOL NOSTD NOCOBOL NOSTD NOCOBOL OFF var1 var2 The name of a variable to contain either ON or OFF. The name of a variable to contain one of the eight combinations in the following list:
NOSTD STD NOSTD STD NOSTD STD NOSTD STD NOCOBOL NOCOBOL COBOL COBOL NOCOBOL NOCOBOL COBOL COBOL DISPLAY DISPLAY DISPLAY DISPLAY NODISPL NODISPL NODISPL NODISPL
STD DISPLAY
The value STD, COBOL, or DISPLAY can be placed in var2, even when var1 is set to off. This allows the macro to save and restore number mode. It also allows the macro to set number mode off, while specifying defaults to be used when number mode is changed to on. ON OFF STD COBOL NOSTD NOCOBOL Same as for macro command syntax. Same as for macro command syntax. Same as for macro command syntax. Same as for macro command syntax. Turns standard number mode off. Turns COBOL number mode off.
NOSTD NOCOBOL Turns both the standard number mode and COBOL number mode off. STD COBOL DISPLAY Same as for macro command syntax. Same as for macro command syntax.
Description
When number mode is on, NUMBER verifies that all lines have valid numbers in ascending sequence. It renumbers any lines that are either unnumbered or out of sequence, but it does not otherwise change existing numbers. In number mode, the editor automatically generates sequence numbers in the data for new lines that are created when data is copied or inserted. The editor also automatically renumbers the data when it is saved if autonum mode is in effect.
361
NUMBER
If the number overlays the shift-in (SI) or shift-out (SO) characters, the double-byte characters are displayed incorrectly and results are unpredictable.
Return codes
0 20 Normal completion Severe error
Examples
To save the current value of number mode, set number mode off for processing, and then restore the value of number mode:
ISREDIT (STAT,VALUE) = NUMBER ISREDIT NUMBER OFF ... ISREDIT NUMBER = (STAT VALUE)
Syntax
Macro command syntax ON ISREDIT PACK OFF ON OFF Saves data in packed format. Saves data in unpacked (standard) format.
If you change pack mode, data is written when an END command is issued. Assignment statement syntax ISREDIT (varname) = PACK
ON ISREDIT PACK = OFF varname ON OFF The name of a variable to contain the setting of pack mode, either ON or OFF. Same as macro command syntax. Same as macro command syntax.
362
PACK
Return codes
0 20 Normal completion Severe error
Examples
To set pack mode off:
ISREDIT PACK OFF
Syntax
Macro command syntax DEFAULT ISREDIT PASTE clipboard_name DELETE KEEP clipboardname The name of the clipboard to use. If you omit this parameter, the ISPF default clipboard (named DEFAULT) is used. You can define up to ten additional clipboards. The size of the clipboards and number of clipboards might be limited by installation defaults. The destination of the data that is being transferred from the clipboard. BEFORE copies the data before the specified label linenum or label. The destination of the data that is being transferred from the clipboard. AFTER copies the data after the specified label linenum or label. A relative line number identifying the line after, or before, which the lines from the clipboard are copied or moved. A label identifying the line after, or before, which the lines from the clipboard are copied or moved. Records are copied and not removed from the clipboard. Records are moved and deleted from the clipboard. AFTER BEFORE linenum label
BEFORE
AFTER
Description
PASTE copies or moves lines from a specified clipboard to the current edit session. If lines in the clipboard are longer than the lines in the edit session, they are truncated. The portion of the line that is saved in the clipboard is only the data portion of the line. Line numbers are not saved. If the data was CUT from a data set that had sequence numbers and is PASTEd into an edit session without sequence numbers,
363
PASTE
or if it was CUT from a data set without sequence numbers and PASTEd into a session with sequence numbers, some shifting of data is likely to occur.
Return codes
0 12 20 Normal completion Parameter error. Clipboard is empty or does not exist. Severe error
Examples
To paste data from the default clipboard to the line after the last line in the edit session:
ISREDIT PASTE AFTER .ZLAST DELETE
To paste data from the default clipboard to the line after the first line in the edit session, without clearing the contents of the clipboard:
ISREDIT PASTE AFTER .ZFIRST KEEP
Syntax
Macro command syntax ON ISREDIT PRESERVE OFF ON OFF The editor saves all trailing blanks in the record. Turns truncation on. ISPF removes trailing blanks when saving variable-length files. If a line is empty ISPF saves 1 blank.
ON ISREDIT PRESERVE = OFF varname ON OFF The name of a variable to contain the setting of PRESERVE mode, either ON or OFF. Same as macro command syntax. Same as macro command syntax.
364
PRESERVE
Description
PRESERVE ON causes the editor to save trailing blanks for variable length files. The number of blanks saved for a particular record is determined by one of the following: v the original record length of the record when it was read in to the editor v the number of blanks required to pad the record length specified by the SAVE_LENGTH edit macro command v the length of the record that was saved on disk during a previous SAVE request in the same edit session PRESERVE OFF causes the editor to truncate trailing blanks. If a line is empty ISPF saves 1 blank. Use of the PRESERVE command does not prevent the editor from working on data past the specified record length. The length set and returned by the PRESERVE command is only used when the data is written and does not affect the operation of other edit functions.
Return codes
0 6 16 20 Normal completion Record format is not variable. Error setting variable. Severe error
Examples
To save the value of the PRESERVE mode in variable &TRMODE:
ISREDIT (TRMODE) = PRESERVE
To enable the editor to remove trailing blanks when the data is saved:
ISREDIT PRESERVE OFF
Syntax
Macro command syntax ISREDIT PROCESS DEST RANGE cmd1 cmd2 DEST Specifies that the macro can capture an A (after) or a B (before) line command that you enter. The .ZDEST label is set to the line preceding the insertion point. If A or B is not entered, .ZDEST points to the last line in the data. Must be followed by the names of one or two line commands, either of which you can enter. Use the RANGE_CMD assignment statement to return the value of the line command entered. This
RANGE
365
PROCESS
allows the macro to define and then capture a line command that you enter. It can also modify its processing based on which of the two commands was entered. cmd1 and cmd2 Specifies one or two line command names, which can be 1 to 6 characters; however, if the name is 6 characters long it cannot be used as a block format command (to specify multiple lines) by doubling the last character. The name can contain any alphabetic or special character except blank, hyphen (-), or apostrophe (). It cannot contain any numeric characters. The .ZFRANGE label is set to the first line identified by the line command that you have entered, and .ZLRANGE is set to the last line. They can refer to the same line. If the expected RANGE line command was not entered, .ZFRANGE points to the first line in the data and .ZLRANGE points to the last line in the data.
Description
If a line is retrieved before the PROCESS macro command is called, changes made to this line will not be seen. The DEST and RANGE operands allow the macro to identify the line commands that you can enter as additional input to the macro. This command cannot be specified without first coding the MACRO command with a NOPROCESS operand. For more information about using the PROCESS command, see Using the PROCESS Command and Operand on page 104.
Return codes
0 4 8 12 16 20 Normal completion. A RANGE was expected by the macro, but one was not specified; default values set. A DEST (destination) was expected by the macro, but one was not specified; default values set. Both a RANGE and a DEST (destination) were expected by the macro, but were not specified; default values set. You entered incomplete or conflicting line commands. Severe error
Note: ISPF does not consider a return code of 12 from the PROCESS edit macro command an error and does not terminate a macro that receives a return code of 12 from the PROCESS edit macro.
Examples
To set up the macro to process the line commands * and # (defined by the macro writer):
ISREDIT MACRO NOPROCESS ISPEXEC CONTROL ERRORS RETURN ISREDIT PROCESS RANGE * # IF &LASTCC >= 16 THEN EXIT CODE(&LASTCC) ISREDIT (CMD) = RANGE_CMD
366
PROCESS
ISREDIT (FIRST) = LINENUM .ZFRANGE ISREDIT (LAST) = LINENUM .ZLRANGE IF &STR(&CMD) = &STR(*) THEN ...
To place data depending on the location of the A (after) or B (before) line command:
ISREDIT MACRO NOPROCESS ISREDIT PROCESS DEST ISREDIT LINE_AFTER .ZDEST = "&DATA"
To allow processing of the A and B destination line commands and the specification of a range by using the * line command (defined by the macro writer):
ISREDIT MACRO NOPROCESS ISREDIT PROCESS DEST RANGE *
Syntax
Macro Command Profile Control syntax current_edit_profile ISREDIT PROFILE name name number 5
The profile name. It can consist of up to 8 alphanumeric characters, the first of which must be alphabetic. The edit profile table is searched for an existing entry with the same name. That profile is then read and used. If one is not found, a new entry is created in the profile table. If you omit this operand, the current edit profile is used.
number
The number of lines, from 0 through 8, of profile data to be displayed. When you type 0 as the number, no profile data is displayed. When you omit the number operand, the profile modes appear; the =MASK> and =TABS> lines are displayed if they contain data, followed by the =COLS> line. The =BNDS> line does not appear if it contains the default boundary positions. It does appear when the bounds are set to something other than the default, and no number parameter is entered into the PROFILE command.
For more information about displaying and defining a profile, see Displaying or defining an edit profile on page 17.
Chapter 11. Edit Macro Commands and Assignment Statements
367
PROFILE
Macro Command Profile Lock Syntax ISREDIT PROFILE LOCK UNLOCK
LOCK
Specifies that the current values in the profile are saved in the edit profile table and are not modified until the profile is unlocked. The current copy of the profile can be changed, either because of commands you enter that modify profile values (BOUNDS and NUMBER, for example) or because of differences in the data from the current profile settings. However, unless you unlock the edit profile, the saved values replace the changes when you end the edit session. Caps, number, stats, and pack mode are automatically changed to fit the data. These changes occur when the data is first read or when data is copied into the data set. Message lines (==MSG>) are inserted in the data set to show you which changes occurred. Note: To force caps, number, stats, or pack mode to a particular setting, use an initial macro. Be aware, however, that if you set number mode on, data may be overlaid.
UNLOCK
See Locking an edit profile on page 19 for more information about locking and unlocking the profile. Macro Command Profile Reset syntax ISREDIT PROFILE RESET RESET Specifies that the ZEDFAULT profile is to be removed and the site-wide configuration for new edit profiles is to be used.
See Locking an edit profile on page 19 for more information about locking and unlocking the profile. Assignment statement syntax ISREDIT (var1,var2) var1 var2 = PROFILE
The name of a variable to contain the name of the current edit profile. The name of a variable to contain the profile status, LOCK or UNLOCK.
Description
Profile names cannot be set by an assignment statement. Instead, use PROFILE to change a profile name, thereby changing the current edit profile and the edit profile values.
Return codes
0 Normal completion
368
PROFILE
20 Severe error
Examples
To check the lock status of the profile and perform processing if the profile is locked:
ISREDIT (,STATUS) = PROFILE IF &STATUS = LOCK THEN ...
Syntax
Assignment statement syntax ISREDIT (varname) varname = RANGE_CMD
The name of a variable to contain the line command that you entered.
Description
The macro must first issue a PROCESS command to identify all line commands to be processed by this macro. A particular line command within a range can be found by using the RANGE_CMD. For instance, if the following PROCESS command is issued by a macro:
PROCESS RANGE Q $
The RANGE_CMD statement returns either a Q or a $. If a range such as Q5 is entered, only Q is returned.
Return codes
0 4 8 20 Normal completion Line command not set Line command setting not acceptable Severe error
Examples
To determine which line command (* or #) you entered and to process the line command (defined by the macro writer):
ISREDIT MACRO NOPROCESS ISREDIT PROCESS RANGE * # ISREDIT (CMD) = RANGE_CMD IF &STR(&CMD) = &STR(*) THEN ... ELSE IF &STR(&CMD) = &STR(#) THEN ...
RCHANGERepeat a Change
The RCHANGE command repeats the change requested by the most recent CHANGE command.
Chapter 11. Edit Macro Commands and Assignment Statements
369
RCHANGE
Syntax
Macro command syntax ISREDIT RCHANGE
Description
You can use this command to repeatedly change other occurrences of the search string. After a string NOT FOUND message appears, the next RCHANGE issued starts at the first line of the current range for a forward search (FIRST or NEXT specified) or the last line of the current range for a backward search (LAST or PREV specified).
Return codes
0 4 8 12 20 Normal completion String not found Change error (string2 longer than string1 and substitution was not performed on at least one change) Syntax error Severe error
Examples
To perform a single-line change and then repeat the change from the top if the string was not found:
ISREDIT CHANGE C. the C. IF &LASTCC = 4 THEN ISREDIT RCHANGE The 1 8
Syntax
Assignment statement syntax ISREDIT (var1,var2) var1 = RECFM
The name of a variable to contain the type of record format of the data being edited, either F or V: F V Fixed-length records. Variable-length records.
var2
The name of a variable to contain the remaining record format information of the data being edited, in the combination of M, A, S, BM, BA, BS, BSM, or BSA: B S Blocked records. Standard or spanned records.
370
RECFM
M A Machine print control character records. ASA print control character records.
Return codes
0 20 Normal completion Severe error
Examples
To place the type of record format in variable RECFM1 and then use either the logical data width (for a fixed data set) or the right display column (for a variable data set):
ISREDIT (RECFM1) = RECFM IF &RECFM1 = F THEN ISREDIT (WIDTH) = DATA_WIDTH ELSE ISREDIT (,WIDTH) = DISPLAY_COLS
To place the type of record format information in variable RECFM1, and the remaining record format information in variable RECFM2:
ISREDIT (RECFM1,RECFM2) = RECFM
Syntax
Macro command syntax ON ISREDIT RECOVERY SUSP OFF WARN NOWARN ON OFF WARN The system creates and updates a recovery data set for each change thereafter. The system does not create and update a recovery set. This operand no longer has a practical function, due to a software change. However, the primary command continues to accept the operand for compatibility reasons. This operand no longer has a practical function, due to a software change. However, the primary command continues to accept the operand for compatibility reasons.
Chapter 11. Edit Macro Commands and Assignment Statements
NOWARN
371
RECOVERY
SUSP This operand, when specified with the ON operand has no function. It allows existing macros which save and restore the recovery state to continue working. When SUSP is specified by itself, it functions like the ON operand.
See Edit recovery on page 39 for more information about edit recovery. Assignment statement syntax ISREDIT (var1,var2) = RECOVERY
Macro command syntax ON ISREDIT RECOVERY = SUSP OFF WARN NOWARN var1 var2 The name of a variable to contain the setting of recovery mode, either ON or OFF. The name of a variable that contains the warning setting, either WARN, NOWARN (when RECOVERY is OFF), or blank or SUSP (when RECOVERY is ON). The system creates and updates a recovery data set for each change thereafter. The system does not create and update a recovery set. This operand no longer has a practical function, due to a software change. However, the primary command continues to accept the operand for compatibility reasons. This operand no longer has a practical function, due to a software change. However, the primary command continues to accept the operand for compatibility reasons. This value indicates that recovery is ON, but that it is suspended due to a previous error.
ON OFF WARN
NOWARN
SUSP
Return codes
0 20 Normal completion Severe error
Examples
To save the value of recovery mode in variable &RECOV:
ISREDIT (RECOV) = RECOVERY
372
RENUM
Syntax
Macro command syntax (1) ON ISREDIT RENUM STD COBOL Notes: 1 ON STD is the default for non-COBOL data set types. COBOL is the default for COBOL data set types. Automatically verifies that all lines have valid numbers in ascending sequence and renumbers any lines that are either unnumbered or out of sequence. It also turns number mode on and renumbers lines. The STD, COBOL, and DISPLAY operands are interpreted only when number mode is turned on. STD COBOL STD COBOL Numbers the data in the standard sequence field. Numbers the data in the COBOL field. Numbers the data in both fields. If both STD and COBOL numbers are being generated, the STD number is determined and then used as the COBOL number. This can result in COBOL numbers that are out of sequence if the COBOL and STD fields were not synchronized. Use RENUM to force synchronization. DISPLAY Causes the width of the data window to include the sequence number fields. Otherwise, the width of the window does not include the sequence number fields. When you display a data set with a logical record length of 80 and STD numbering, the sequence numbers are not shown unless you are using a 3278 Model 5 terminal, which displays 132 characters. The editor automatically scrolls left or right, if required, so that the leftmost column of the data window is the first column displayed. DISPLAY STD COBOL
Return codes
0 20 Normal completion Severe error
Examples
To renumber all data lines with standard numbering:
ISREDIT RENUM
373
RENUM
To renumber all data lines with standard and COBOL numbering:
ISREDIT RENUM STD COBOL
To renumber all data lines with COBOL numbering, bringing the sequence numbers within the data window:
ISREDIT RENUM COBOL DISPLAY
Syntax
Macro command syntax ISREDIT REPLACE member (member) dsname(member) dsname
labela labelb
member
The name of the member to be replaced in the partitioned data set currently being edited. If a name of eight or fewer characters is specified and it could be a member name or a data set name, REPLACE searches for a member name first. If no member name is found, then the name is used as a data set. If the member does not exist, the editor creates it. If you are using a concatenated sequence of libraries, the member is always written to the first library in the sequence. The name of a sequential data set that is to be replaced. The data set name can be fully or partially qualified. The name of a different partitioned data set and member name to be replaced in the partitioned data set. The data set name can be fully or partially qualified.
dsname dsname(member)
Relative line number identifying the start of a group of lines in the current member that replace data in the other member. Relative line number identifying the end of a group of lines in the current member that replace data in the other member. Labels identifying the start and end of the group of lines in the current member that replace data in the other member. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
Return codes
0 8 Normal completion Member in use
374
REPLACE
12 20 Invalid line pointer Syntax error (invalid name, incomplete line pointer value), or I/O error
Examples
To replace member MEM1 with the first 10 lines of the current data:
ISREDIT REPLACE MEM1 1 10
Syntax
Macro command syntax .ZFIRST .ZLAST ISREDIT RESET CHANGE COMMAND ERROR EXCLUDED FIND HIDE LABEL SPECIAL labela labelb linenum1 linenum2
You can type the operands in any order. If you do not specify any operands, RESET processes all operands except LABEL. CHANGE COMMAND ERROR EXCLUDED FIND Removes ==CHG> flags from the line command field. Removes any pending line commands from the line command field. Removes ==ERR> flags from the line command field. Redisplays any excluded line. Turns off highlighting of FIND strings until the next FIND, RFIND, CHANGE, or RCHANGE command. However, SEEK and EXCLUDE do not return the highlighting of FIND strings in this manner. RESET with no operands has the same effect on highlighted FIND strings as RESET FIND. HIDE LABEL SPECIAL Redisplays all n Line(s) not Displayed messages for excluded lines that were hidden through the HIDE command. Removes labels from the line command field. Deletes any temporary line from the panel: v Bounds line flagged as =BNDS>
Chapter 11. Edit Macro Commands and Assignment Statements
375
RESET
v v v v v v v linenum1 linenum2 labela, labelb Column identification lines flagged with =COLS> Information lines flagged with ====== Mask lines flagged as =MASK> Message lines flagged as ==MSG> Note lines flagged with =NOTE= Profile lines flagged as =PROF> Tabs line flagged as =TABS>
Relative line number identifying the start of a group of lines to be reset. Relative line number identifying the end of a group of lines to be reset. Labels identifying the start and end of the group of lines to be reset. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
Description
RESET scans every line of data for conditions to be reset. If you want to delete a small number of special lines, you can get faster response time if you use the D (delete) line command.
Return codes
0 20 Normal completion Severe error
Examples
To remove all change flags from the current data:
ISREDIT RESET CHANGE
To redisplay all excluded lines between the .START and .STOP labels:
ISREDIT RESET EXCLUDED .START .STOP
To remove all labels from the current data between and including the .START and .STOP labels:
ISREDIT RESET LABEL .START .STOP
To remove all special lines from the current data between lines 100 and 200:
ISREDIT RESET SPECIAL 100 200
RFINDRepeat Find
The RFIND macro command locates the search string defined by the most recent SEEK, FIND, or CHANGE command, or excludes a line containing the search string defined by the previous EXCLUDE command.
376
RFIND
The RFIND command can be used repeatedly to find other occurrences of the search string. After a string NOT FOUND message appears, the next RFIND issued starts at the first line of the current range for a forward search (FIRST or NEXT specified), or the last line of the current range for a backward search (LAST or PREV specified).
Syntax
Macro command syntax ISREDIT RFIND
Return codes
0 4 12 20 Normal completion String not found Syntax error Severe error (string not defined)
Examples
To find a character string, process it, and then repeat the operation for the rest of the data:
ISREDIT FIND FIRST C. the SET RETCODE = &LASTCC; DO WHILE &RETCODE = 0 ... ISREDIT RFIND SET RETCODE = &LASTCC; END
RIGHTScroll Right
The RIGHT macro command scrolls data to the right of the current panel position.
Syntax
Macro command syntax ISREDIT RIGHT amount amount The scroll amount. The number of columns (0-9999) to scroll, or: MAX Displays the last panel of data to the right.
HALF Displays the next half-panel of data to the right. PAGE Displays the next full panel of data to the right. CURSOR Scrolls until the column on which the cursor is located becomes the first data column on the panel. DATA Scrolls until the last column on the current panel of data becomes the first column on the next panel of data.
377
RIGHT
Description
The editor stops scrolling when it reaches the current BOUNDS setting. For example, if the right bound is position 100, and positions 9 to 80 are displayed, issuing ISREDIT RIGHT 100 leaves positions 29 to 100 being displayed, not positions 109 to 180. To scroll to the right using the panel position when the macro was issued, use USER_STATE assignment statements to save and then restore the panel position operands. If you define a macro named RIGHT, it overrides RIGHT when used from another macro, but has no effect for you. RIGHT does not change the cursor position and cannot be used in an initial macro. See BOUNDSSet or Query the Edit Boundaries on page 294 and DISPLAY_COLSQuery Display Columns on page 318 for further information.
Return codes
0 4 8 12 20 Normal completion No visible lines No data to display Amount not specified Severe error
Examples
To scroll the display to the right by the number of columns specified in variable &RCOL:
ISREDIT RIGHT &RCOL
Syntax
Macro command syntax ISREDIT RMACRO name !name NONE
name
The name of the recovery macro to be run. The name can be preceded by an exclamation point (!) to show that it is a program macro. The name to prevent a recovery macro from being run; conversely, a value of NONE is returned when no recovery macro has been specified.
NONE
378
RMACRO
Assignment statement syntax ISREDIT (varname) = RMACRO
ISREDIT RMACRO
name NONE
The name of a variable to contain the name of the recovery macro. Same as macro command syntax. Same as macro command syntax.
Return codes
0 12 20 Normal completion Invalid name specified Severe error
Examples
To set the RMACRO name from the variable &RMAC:
ISREDIT RMACRO = &RMAC
Syntax
Macro command syntax ISREDIT SAVE
Description
The SAVE command writes the data to the same data set from which it was retrieved unless you specified a concatenated sequence of partitioned data sets on the Edit - Entry panel. In that case, the data is saved in the first library in the concatenation sequence, regardless of which library it came from. For a sequential data set, the complete data set is rewritten. For a partitioned data set, the member is rewritten with the same member name. If stats mode is on, the library statistics for the member are automatically updated. If both number mode and autonum mode are on, the data is automatically renumbered before it is saved.
Return codes
0 4 12 20 Normal completion New member saved Data not saved; not enough PDS space or directory space Severe error
379
SAVE
Examples
To check autosave mode and, if it is set to OFF, ensure that changes are saved:
ISREDIT (VAR) = AUTOSAVE IF &VAR = OFF THEN ISREDIT SAVE
Syntax
Assignment statement syntax ISREDIT (varname) = SAVE_LENGTH label linenum
ISREDIT SAVE_LENGTH
linenum label
value
Description
You can use the SAVE_LENGTH macro command to set or query the minimum length that is used to store an individual record in a variable-length data set. When setting a length, the length is automatically adjusted to include the nonblank portion of the line. When retrieving the length, the number returned reflects the line length that would be used if the line were saved immediately. This is the greater of the following two values: v the length of the nonblank portion of the line and the length set by a previous SAVE_LENGTH request v the length of the nonblank portion of the line and the original line length. You can use the SAVE_LENGTH command in edit macros to define line commands to prompt the user for final record lengths or to check the record length. You might also use it to substitute a visible character for trailing blanks to make editing easier. Use of the SAVE_LENGTH command does not prevent the editor from working on data past the specified record length. The length set and returned by the SAVE_LENGTH command is only used when the data is written and does not affect the operation of any other edit functions.
Return codes
0 4 Normal completion Value supplied on set call was out of range. If the supplied length was too
380
SAVE_LENGTH
great, it is adjusted to equal the maximum record length. Otherwise, the length was adjusted to the length of the nonblank data portion of the record. Record format is not variable. Any value on an assignment request is ignored. Error setting variable. Severe error
6 16 20
Examples
To save the number of characters that are saved for the last line in the file when PRESERVE OFF is active:
ISREDIT (NCHARS) = SAVE_LENGTH .ZLAST
To set the minimum line length for the last line in the file and to set PRESERVE ON active:
ISREDIT SAVE_LENGTH .ZLAST = 74
Another edit macro sample using the SAVE_LENGTH command can be found in the ISRSETLN member of the ISPF EXEC library.
Syntax
Macro command syntax ON ISREDIT SCAN OFF ON OFF Specifies that the editor automatically replaces variables in command lines. Specifies that the editor does not automatically replace variables.
Scan mode is initialized to ON when a macro is started. Assignment statement syntax ISREDIT (varname) = SCAN
ON ISREDIT SCAN = OFF varname The name of a variable to contain the setting of scan mode, either ON or OFF.
Chapter 11. Edit Macro Commands and Assignment Statements
381
SCAN
ON OFF Same as macro command syntax. Same as macro command syntax.
Return codes
0 20 Normal completion Severe error
Examples
To set a line whose number is in variable &LNUM to:
&SYSDATE is a CLIST built-in function
set scan mode off and issue the LINE command with &&SYSDATE as the CLIST function name. The CLIST processor strips off the first &, but, because scan mode is off, the editor does not remove the second &:;
ISREDIT SCAN OFF ISREDIT LINE &LNUM = "&&SYSDATE is a CLIST built-in function" ISREDIT SCAN ON
Because the ISPEXEC call interface for REXX EXECs allows you to specify parameters as symbolic variables, a single scan always takes place before the syntax check of a statement. Therefore, the rule of using two ampersands (&) before variable names to avoid substitution of variable names also applies to REXX EXECs.
Syntax
Macro command syntax .ZFIRST .ZLAST ISREDIT SEEK string labela labelb ALL FIRST LAST PREV PREFIX SUFFIX WORD NEXT CHARS
X NX
string
The search string you want to find. The maximum allowable length of the string is 256 bytes. If you are specifying a hex string, the maximum is 128 hexadecimal characters. See Finding, Seeking, Changing, and Excluding Data on page 45. Labels identifying the start and end of the group of lines SEEK is to search. If the cursor is currently placed above the start label and the PREV occurrence of a string is requested, or the cursor is currently placed
labela, labelb
382
SEEK
below the end label and the NEXT occurrence of a string is requested, the process returns a return code of 4 and the string is not found, even if it exists within the label range. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56. NEXT ALL FIRST LAST PREV CHARS PREFIX SUFFIX WORD X NX left_col right_col Starts at the first position after the current cursor location and searches ahead to find the next occurrence of string. Starts at the top of the data and searches ahead to find all occurrences of string. Starts at the top of the data and searches ahead to find the first occurrence of string. Starts at the bottom of the data and searches backward to find the last occurrence of string. Starts at the current cursor location and searches backward to find the previous occurrence of string. Locates string anywhere the characters match. Locates string at the beginning of a word. Locates string at the end of a word. Locates string when it is delimited on both sides by blanks or other non-alphanumeric characters. Scans only lines that are excluded from the display. Scans only lines that are not excluded from the display. The first column to be included in the range of columns SEEK is to search. The last column to be included in the range of columns SEEK is to search.
Description
Use the FIND macro command instead of SEEK if you want to locate a string and change the exclude status of the line that contains that string at the same time. You can use SEEK to find a search string, change it with CHANGE, and then exclude it from the display with EXCLUDE. To find the next occurrence of the letters ELSE without specifying any other qualifications, include the following line in an edit macro:
ISREDIT SEEK ELSE
Since no other qualifications were specified, the letters ELSE can be: v Uppercase or a mixture of uppercase and lowercase v At the beginning of a word (prefix), the end of a word (suffix), or the entire word (word) v In either an excluded or a non-excluded line v Anywhere within the current boundaries To find the next occurrence of the letters ELSE, but only if the letters are uppercase:
ISREDIT SEEK CELSE
Chapter 11. Edit Macro Commands and Assignment Statements
383
SEEK
This type of search is called a character string search (note the C that precedes the search string) because it finds the next occurrence of the letters ELSE only if the letters are in uppercase. However, since no other qualifications were specified, the letters can be found anywhere in the data set or member, as outlined in the preceding list. For more information, including other types of search strings, see Finding, Seeking, Changing, and Excluding Data on page 45.
Return codes
0 4 12 20 Normal completion String not found Syntax error Severe error
Examples
The following example finds the last occurrence in the data set of the letters ELSE. However, the letters must occur on or between lines labeled .E and .S; they must be the last four letters of a word; and they must be found in an excluded line.
ISREDIT SEEK ELSE .E .S LAST SUFFIX X
The following example finds the first occurrence of the letters ELSE that immediately precedes the cursor position. However, the cursor must not be positioned ahead of the lines that are labeled .E and .S. Also, the letters must occur on or between lines labeled .E and .S; they must be stand-alone characters (not part of any other word); they must be found in a non-excluded line; and they must exist within columns 1 and 5:
ISREDIT SEEK ELSE .E .S PREV WORD NX 1 5
Syntax
Assignment statement syntax ISREDIT (var1,var2) var1 var2 = SEEK_COUNTS
The name of a variable to contain the number of strings found. It must be an 8-character value that is left-padded with zeros. The name of a variable to contain the number of lines on which strings were found. It must be an 8-character value that is left-padded with zeros.
Return codes
0 20 Normal completion Severe error
Examples
To seek all lines with a blank in column 1 and store the number of such lines in variable &BLNKS:
384
SEEK_COUNTS
ISREDIT SEEK ALL " " 1 ISREDIT (BLNKS) = SEEK_COUNTS
Syntax
Assignment statement syntax ISREDIT (var1,var2) var1 var2 = SESSION
This variable contains either EDIF, EDIT, VIEW, or VIIF to identify the type of session. This variable contains SCLM if the SCLM edit environment is active, or four asterisks (****) if not. Until SCLM edit is initialized and is active, edit commands such as SAVE will not update SCLM correctly. Note: SCLM edit is not available during execution of the site-wide initial edit macro.
Return codes
0 20 Normal completion Severe error
Syntax
Macro command syntax STORAGE ISREDIT SETUNDO RECOVER ON OFF STORAGE RECOVER ON OFF Enables edit changes to be saved in storage. Enables edit changes to be saved through the recovery file only. If edit recovery is off, SETUNDO RECOVER turns recovery on. The same as STORAGE. Disables the saving of edit changes in storage. If edit recovery is available, the undo command uses the edit recovery file.
385
SETUNDO
Assignment statement syntax ISREDIT (varname) = SETUNDO
STORAGE ISREDIT SETUNDO = RECOVER ON OFF varname STORAGE RECOVER ON OFF The name of a variable containing the setting of the UNDO mode, either OFF or RECOVER or STORAGE. Enables edit changes to be saved in storage. Enables edit changes to be saved through the recovery file only. If edit recovery is off, SETUNDO RECOVER turns recovery on. Enables edit changes to be saved in storage. Disables the saving of edit changes in storage. If edit recovery is available, the undo command uses the edit recovery file.
Description
The SETUNDO macro command enables undo processing. It does not perform the undo function itself. Valid operands are STORAGE, RECOVER, ON, or OFF. If SETUNDO is set on by a macro and was not on already, the UNDO function is enabled for all interactions started from the point SETUNDO was turned on. Notes: 1. Changes are saved on the undo chain after: v SETUNDO STORAGE is specified in a macro, and it was previously OFF or REC, or v SETUNDO REC is specified in a macro, and it was previously OFF It is possible to undo back to a particular point in a macro. This is helpful in debugging edit macros. 2. If SETUNDO is disabled through the configuration table, the SETUNDO macro command is accepted and returns a zero return code. It does not turn recovery on. 3. The SETUNDO command is ignored if UNDO from storage is not enabled by the installer or person who maintains the ISPF product. For information on enabling UNDO from storage, see z/OS ISPF Planning and Customizing.
Return codes
0 20 Successful completion. SETUNDO was turned on or off, or status remains unchanged because UNDO was already on or off. Severe error. Probably a parameter error (something other than STG, REC, or OFF was specified).
386
SETUNDO
Examples
To disable the saving of edit changes in storage:
ISREDIT SETUNDO OFF
Syntax
Macro command syntax 2 ISREDIT SHIFT ( linenum label n
linenum label n
A relative line number identifying the line on which characters are to be moved to the left. A label identifying the line on which characters are to be moved to the left. Specifies the number of columns to shift.
Description
The SHIFT ( command is limited to shifting columns of data on a single line. If you want to shift columns of data on several lines, each line of data columns must be moved individually.
Return codes
0 12 20 Normal completion Invalid line number Severe error
Examples
To shift columns of data 10 columns to the left on the line that contains the cursor:
ISREDIT SHIFT ( .ZCSR 10
To shift columns of data 2 columns to the left on the line with the label .LAB:
ISREDIT SHIFT ( .LAB
387
SHIFT )
Syntax
Macro command syntax 2 ISREDIT SHIFT ) linenum label n
linenum label n
A relative line number identifying the line on which characters are to be moved to the right. A label identifying the line on which characters are to be moved to the right. Specifies the number of columns to shift.
Description
The SHIFT ) command is limited to shifting columns of data on a single line. If you want to shift columns of data on several lines, each line of data columns must be moved individually.
Return codes
0 12 20 Normal completion Invalid line number Severe error
Examples
To shift columns of data 4 columns to the right on the line that contains the cursor:
ISREDIT SHIFT ) .ZCSR 4
To shift columns of data 2 columns to the right on the line with the label .LAB:
ISREDIT SHIFT ) .LAB
Syntax
Macro command syntax 2 ISREDIT SHIFT < linenum label n
linenum label n
A relative line number identifying the line on which the body of a program statement is to be moved to the left. A label identifying the line on which the body of a program statement is to be moved to the left. Specifies the number of columns to shift.
388
SHIFT <
Description
The SHIFT < command is limited to shifting data on a single line. To shift data on several lines, you must shift data on each line individually.
Return codes
0 12 20 Normal completion Invalid line number Severe error
Examples
To shift data 4 columns to the left on the line that contains the cursor:
ISREDIT SHIFT < .ZCSR 4
To shift data 2 columns to the left on the line with the label .LAB:
ISREDIT SHIFT < .LAB
Syntax
Macro command syntax 2 ISREDIT SHIFT > linenum label n
linenum label n
A relative line number identifying the line on which the body of a program statement is to be moved to the right. A label identifying the line on which the body of a program statement is to be moved to the right. Specifies the number of columns to shift.
Description
The SHIFT > command is limited to shifting data on a single line. To shift data on several lines, you must shift data on each line individually.
Return codes
0 12 20 Normal completion Invalid line number Severe error
Examples
To shift data 4 columns to the right on the line that contains the cursor:
ISREDIT SHIFT > .ZCSR 4
To shift data 2 columns to the right on the line with the label .LAB:
Chapter 11. Edit Macro Commands and Assignment Statements
389
SHIFT >
ISREDIT SHIFT > .LAB
SORTSort Data
The SORT macro command puts data in a specified order.
Syntax
Macro command syntax .ZFIRST .ZLAST ISREDIT SORT labela labelb X NX
sort_field
sort_field: A start_col D labela, labelb end_col Labels identifying the start and end of the group of lines for the sort operation. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56. X NX sort_field Specifies that only excluded lines are to be sorted. Specifies that only non-excluded lines are to be sorted. Specifies the field to be used in sorting data. You can specify up to five sort fields using the following operands: A D start_col Specifies ascending order. It can either precede or follow the column specification. Specifies descending order. It can either precede or follow the column specification. Defines the starting column of the field that is to be compared. It must be within the current boundaries. Defines the ending column of the field that is to be compared. It must be within the current boundaries.
end_col
If you specify several fields, you must specify both the starting and ending columns of each field. The fields cannot overlap. If you specify A or D for one field, you must specify it for all fields.
390
SORT
Description
The SORT command operates in two different modes, based on the hexadecimal mode status. If hexadecimal mode is on, the data is ordered according to its hexadecimal representation. If hexadecimal mode is off, data is sorted in the collating sequence defined for the national language being used.
Return codes
0 4 8 Normal completion Lines were already in sort order No records to sort
Chapter 11. Edit Macro Commands and Assignment Statements
391
SORT
16 20 Not enough storage to perform sort Severe error
Examples
To sort the data in descending order, using the sort key in columns 15 through 20:
ISREDIT SORT D 15 20
Syntax
Macro command syntax ON ISREDIT STATS OFF ON OFF Creates or updates library statistics when the data is saved. Does not create or update library statistics.
ON ISREDIT STATS = OFF varname ON OFF The name of a variable to contain the setting of stats mode, either ON or OFF. Same as macro command syntax. Same as macro command syntax.
Return codes
0 20 Normal completion Severe error
392
STATS
Examples
To put the value of stats mode in variable &LIBSTAT:
ISREDIT (LIBSTAT) = STATS
Syntax
Macro command syntax .ZFIRST .ZLAST ISREDIT SUBMIT labela labelb X NX
labela, labelb
Labels identifying the start and end of the group of lines to be submitted. For more information about using labels to identify a group of lines, see Labels and Line Ranges on page 56.
X NX
Submits only lines that are excluded from the display. Submits only lines that are not excluded from the display.
Description
The editor does not supply a job statement when you enter the SUBMIT command. You can supply job statements as part of the data being submitted. When you supply a job statement, only the job name is logged to the ISPF log data set to ensure the protection of sensitive data. PDF uses TSO SUBMIT to submit the job.
Return codes
0 20 Normal completion Severe error (submit failed)
Examples
To submit the first 20 lines of the data as a batch job:
ISREDIT SUBMIT 1 20
393
SUBMIT
To submit all of the data as a batch job:
ISREDIT SUBMIT
Syntax
Macro command syntax ON ISREDIT TABS ALL tab_character OFF ON OFF Turns tabs mode on, which means that logical tabs can be used to break up strings of data. Turns tabs mode off, which means that logical tabs cannot be used. Attribute bytes are deleted from all hardware tab positions, causing the Tab Forward and Tab Backward keys to ignore hardware tabs defined on the =TABS> line. Blanked-out characters occupying these positions reappear. The TABS OFF message appears in the profile display. Activates all hardware tab positions (asterisks) that contain a blank or null character. The editor inserts attribute bytes, which cannot be typed over, at these positions. You can use the Tab Forward and Tab Backward keys to move the cursor one space to the right of the attribute bytes. The TABS ON STD message appears in the profile display. Causes an attribute byte to be inserted at all hardware tab positions. Characters occupying these positions are blanked out and the attribute bytes cannot be typed over. The Tab Forward and Tab Backward keys can be used to move the cursor one space to the right of these attribute bytes. The TABS ON ALL message appears in the profile display. Defines a single character that is not a number, letter, or command STD
STD
ALL
tab_character
394
TABS
delimiter as the logical tab character. This character is used with hardware tab definitions. The TABS ON tab character message appears in the profile display. You can enclose the character in quotes ( or "), although this is not necessary unless you want to use one of the following as the tab character:
= " < , ( +
The ampersand (&), left bracket ([), and right bracket (]) should not be used as tab characters at all. The tab_character operand causes the data string that follows the logical tab character to align itself one space to the right of the first available hardware tab position when you press Enter. No attribute bytes are inserted. If no hardware tabs are defined, the editor aligns the data vertically. If software tabs are defined, the first data string is aligned under the first software tab position and the remaining data strings are aligned at the left boundary. If neither software nor hardware tabs are defined, the editor aligns all the data strings at the left boundary. With the tab_character operand, the Tab Forward and Tab Backward keys ignore hardware tab positions when the tab_character operand is used because no attribute bytes are inserted. Assignment statement syntax ISREDIT (var1,var2) = TABS
ON ISREDIT TABS =
OFF var1 var2 ON OFF STD ALL tab_character The name of a variable to contain the setting of tabs mode, either ON or OFF. The name of a variable to contain the tab character and either ALL or STD. This variable may be blank. Same as macro command syntax. Same as macro command syntax. Same as macro command syntax. Same as macro command syntax. Same as macro command syntax.
Return codes
0 20 Normal completion Severe error
Chapter 11. Edit Macro Commands and Assignment Statements
395
TABS
Examples
To set the tab character to \ and set the tabs mode ON:
ISREDIT TABS ON \
Syntax
Assignment statement syntax ISREDIT (varname) = TABSLINE
data
Specifies the name of a variable to hold the contents of the current tabs line. Specifies the data used to set the tabs line. The only valid tab characters for this data are blanks, asterisks (*), hyphens (-), and underscores (_). The following forms can be used: v Simple string v Delimited string v Variable v Template (< col,string >) v Merge format (string1 + string2, operand + string2, string1 + operand) v Operand: LINE linenum Data from the line with the given relative line number. LINE label Data from the line with the given label. MASKLINE Data from the mask line. TABSLINE Data from the tabs line.
Return codes
0 4 8 20 Normal completion Data truncated Invalid data detected and ignored Severe error (invalid input)
Examples
To store the value of the tabs line in variable &OLDTABS:
ISREDIT (OLDTABS) = TABSLINE
396
TABSLINE
To set the tabs line to "*___*
ISREDIT TABSLINE = "*___* *"
*":
Syntax
Macro command syntax ISREDIT TENTER linenum label
numlines
A relative line number identifying the line. A label identifying the line. Specifies the number of lines displayed for text entry; these lines are not saved unless they contain data. If you do not type a number, the remainder of the panel appears for text entry.
Description
It is important to make sure that the line referenced by the line pointer on TENTER appears; otherwise, the text area will not be visible to you. Use LOCATE to find and display the line for you. Before you enter text entry mode, consider the following: v If you are going to be typing text in paragraph form, such as for a memo or letter, make sure caps mode is off. Otherwise, when you press Enter, your text will change to uppercase. v You may want to turn off number mode to prevent sequence numbers from writing over any of your text. v Make sure the bounds setting is where you want it so that the text flows correctly when you end text entry mode. v Once you enter text entry mode, no macros can be run.
397
TENTER
To enter text entry mode: 1. Include the following command in an edit macro:
ISREDIT TENTER linenum numlines
or
ISREDIT TENTER label numlines
If numlines is greater than the number of rows remaining on the panel, the vertical bar that indicates where you will run out of room does not appear and the keyboard does not lock at the last character position on the panel. When you run the edit macro (see step 2), you can scroll down to bring the additional blank text entry space into view. 2. Run the edit macro. The editor inserts a single continuous blank area for the specified number of rows or to the bottom of the panel. To begin a new paragraph: 1. Use the return (Enter), cursor movement, or Tab keys to advance the cursor enough spaces to leave one blank row on the panel. If there are insufficient blank spaces on the panel, the keyboard locks when you try to type beyond the last character position. A vertical bar (|) appears above the cursor at the locked position. To generate more blank spaces: 1. Press the Reset key to unlock the keyboard. 2. Press Enter. To end text entry mode: 1. Press Enter. The data is flowed together into a paragraph and any embedded blanks are preserved. The left and right sides of the paragraph are determined by the current bounds. See Word Processing on page 58 and Entering Text (Power Typing) on page 60 for more information.
Return codes
0 12 20 Normal completion Invalid line number Severe error
Examples
To find the last line in the data and set up the display for text entry following the last line:
ISREDIT LOCATE .ZL ISREDIT TENTER .ZL
398
TFLOW
Syntax
Macro command syntax ISREDIT TFLOW linenum label
col
A relative line number identifying the line. A label identifying the line. Specifies the column to which the text should be flowed. If the column number is omitted, it defaults to the right boundary. This is different from the TF (text flow) line command, which defaults to the panel width when default boundaries are in effect. If a number greater than the right boundary is specified, the right boundary is used.
Return codes
0 12 20 Normal completion Invalid line number Severe error
Examples
To limit the flow of text, starting at label .PP, to the displayed columns:
ISREDIT (,RCOL) = DISPLAY_COLS ISREDIT TFLOW .PP &RCOL
Syntax
Macro command syntax ISREDIT TSPLIT linenum label linenum label col col
A relative line number identifying the line where the split is to occur. A label identifying the line where the split is to occur. Specifies the column at which the text is to be split.
If you omit both operands, the split point is assumed to be the current cursor position.
Description
The TSPLIT macro command is affected by the current setting of the boundaries. For instance, data beyond the right boundary is not moved to the line added by
399
TSPLIT
TSPLIT. Data between the split column and the right boundary is moved to a new line. The cursor position is set to the split point. To rejoin lines, use the TFLOW macro command. See TFLOWText Flow a Paragraph on page 398 for more information. For more information about splitting lines and other word processing commands, see Word Processing on page 58 and Splitting Lines on page 60.
Return codes
0 12 20 Normal completion Invalid line number Severe error
Examples
To split the line labeled .TOP at column 15:
ISREDIT (LINENBR) = LINENUM .TOP ISREDIT TSPLIT &LINENBR 15
Syntax
Macro command syntax ISREDIT UNNUMBER
Description
The UNNUMBER command is valid only when number mode is also on. The standard sequence field, the COBOL sequence field, or both, are blanked out.
Return codes
0 12 20 Normal completion Number mode not on Severe error
Examples
To set all sequence fields to blanks, turn number mode off, and position the panel so that column 1 is the first column displayed:
ISREDIT UNNUMBER
UPScroll Up
The UP macro command scrolls data up from the current panel position.
400
UP
Syntax
Macro command syntax ISREDIT UP amt amt The scroll amount, the number of lines (0-9999) to scroll, or one of the following operands: MAX Displays the first panel of data.
HALF Displays the previous half-panel of data. PAGE Displays the previous full panel of data. CURSOR Scrolls until the line on which the cursor is located becomes the last data line on the panel. DATA Scrolls until the first data line on the current panel becomes the last data line on the next panel.
Description
To scroll up using the panel position when the macro was issued, use USER_STATE assignment statements to save and then restore the panel position operands. When you issue the UP command, the non-data lines on the panel affect the number of lines scrolled. However, if you define a macro named UP, it only overrides UP when used from another macro. UP does not change the cursor position and cannot be used in an initial macro. The actual number of lines to appear on the panel is determined by: v The number of lines excluded from the panel v The terminal display size and split panel line v The number of special temporary lines displayed, such as the ==ERR>, ==CHG>, =PROF>, =MASK>, =BNDS>, =TABS>, ==MSG>, =NOTE=, =COLS>, and ====== lines. The first line displayed is determined in one of two ways: (1) a LOCATE command can actually set the line to be first on the panel, or (2) the first line to be displayed depends on whether the cursor was explicitly set by a CURSOR assignment statement or implicitly set by a SEEK, FIND, CHANGE, or TSPLIT command. Since the cursor must be on the panel, the line that is first on the panel may be different from the line that was first when you started the macro.
Return codes
0 2 4 8 12 20 Normal completion No more data UP No visible lines No data to display Amount not specified Severe error
Examples
To scroll up to the top of the data set:
ISREDIT UP MAX
Chapter 11. Edit Macro Commands and Assignment Statements
401
UP
To display the previous half panel of data:
ISREDIT UP HALF
To make the line where the cursor is placed the last one on the display:
ISREDIT UP CURSOR
Syntax
Assignment statement syntax ISREDIT (varname) = USER_STATE
(varname)
The name of a variable to contain your status information. Note: The information in the variable is saved in an internal format that is subject to change. Dependence on the format can lead to macro errors.
Description
USER_STATE can be used at the beginning of a macro to save conditions, and at the end of a macro to restore the conditions that may have changed during processing. Many of the values saved by USER_STATE can be saved and restored individually. The USER_STATE assignment statement is a simple way of saving many values with a single statement. The following edit modes and values are saved and restored by USER_STATE:
AUTOLIST AUTONUM AUTOSAVE BOUNDS CAPS CURSOR HEX IMACRO MASKLINE MODEL CLASS NOTES NULLS NUMBER PACK PROFILE RECOVERY STATS TABS TABSLINE
Return codes
0 20 Normal completion Severe error
402
USER_STATE
Examples
To save the user state in variable &STATUS:
ISREDIT (STATUS) = USER_STATE
Syntax
Macro command syntax ISREDIT VERSION num num The version number. It can be any number from 1 to 99.
num
The name of a variable to contain the version number. The version number is a 2-digit value that is left-padded with zeros. Same as macro command syntax.
Return codes
0 4 12 20 Normal completion Stats mode is off, the command is ignored Invalid value specified (the version must be 1 to 99) Severe error
Examples
To save the version number in variable &VERS:
ISREDIT (VERS) = VERSION
403
VIEW
Syntax
Macro command syntax ISREDIT VIEW member member A member of the library or other partitioned data set you are currently editing. You may enter a member pattern to generate a member list.
Description
Your initial edit session is suspended until the view session is complete. Editing sessions can be nested until you run out of storage. To exit from the view session, END or CANCEL must be processed by a macro or entered by you. The current edit session resumes. The VIEW service call, ISPEXEC VIEW, is an alternate method of starting view. It offers the option of viewing another data set and specifying an initial macro. For more information on using the VIEW service, refer to the z/OS ISPF Services Guide.
Return codes
0 12 20 Normal completion Your error (invalid member name, recovery pending) Severe error
Examples
To view the member OLDMEM in your current ISPF library:
ISREDIT VIEW OLDMEM
Syntax
Assignment statement syntax ISREDIT (var1,var2,var3) var1 = VOLUME
The name of a variable to contain the serial number of the volume on which the data set resides. For a multivolume data set, this will be the serial number of the first volume. The volume serial number is a six character value.
404
VOLUME
var2 var3 The name of a variable to contain the number of volumes the data set occupies. The number of volumes is a two-character value. The name of a variable to contain the serial number of the volume of the original data set.
Return codes
0 4 Normal completion The data set is a multivolume data set and the shared pool variable ZEDMVOL is set to contain all the volume serial numbers of the data set. ZEDMVOL has the length of the number of volumes times six. Severe error
20
Examples
To retrieve just the volume serial number of the data set:
ISREDIT (VOL) = VOLUME
To retrieve both the volume serial number and the number of volumes the data set occupies:
ISREDIT (VOL,NUMVOL) = VOLUME
Syntax
Assignment statement syntax ISREDIT (varname) = XSTATUS linenum label
ISREDIT XSTATUS
linenum label
X NX
The name of a variable to contain the exclude status, either X or NX. A relative line number identifying the line. A label identifying the line. Specifies that the specified line is to be excluded. Specifies that the specified line is to be shown (non-excluded).
Description
Exclude status determines whether the line is excluded.
405
XSTATUS
If you want to exclude several lines at one time, the EXCLUDE command should be used. Similarly, to show several lines at one time, use the FIND command.
Return codes
0 8 Normal completion An attempt to set a line status to NX could not be performed. The line has a pending line command on it. For example, if an excluded line contains an M line command in the line command field, then the MOVE/COPY IS PENDING message is displayed and the lines cannot be shown. The reset command can be used to remove your line commands from the line command field. Line number is not an existing line. Severe error
12 20
Examples
Use XSTATUS together with SEEK and CHANGE to preserve the exclude status of a line. For example, to store the exclude status of the line whose number is in variable &N in variable &LINEX:
ISREDIT (LINEX) = XSTATUS &N
To exclude line 1:
ISREDIT XSTATUS 1 = X
To locate a string and change it, saving and then restoring the exclude status:
ISREDIT SEEK &DATA IF &LASTCC = 0 THEN DO ISREDIT (XLINE) = XSTATUS .ZCSR ISREDIT CHANGE &DATA &NEWDATA .aZCSR .ZCSR ISREDIT XSTATUS .ZCSR = (XLINE) END
406
Part 4. Appendixes
407
408
Full primary command BOUNDS BOUNDS BOUNDS BOUNDS CHANGE CANCEL CHANGE CHANGE COLS COLS CREATE
409
410
Parameters
Table 11 shows the allowable abbreviations for parameters.
Table 11. Allowable abbreviations for parameters Abbreviation AFT BEF Full parameter name AFTER BEFORE
411
Scroll amounts
Table 13 shows the allowable aliases and abbreviations for scroll amounts.
Table 13. Aliases and abbreviations for scroll amounts Alias or abbreviation C CSR D H M P Full scroll operand CUR CUR DATA HALF MAX PAGE
412
413
414
Appendix C. Accessibility
Accessibility features help a user who has a physical disability, such as restricted mobility or limited vision, to use software products successfully. The major accessibility features in z/OS enable users to: v Use assistive technologies such as screen readers and screen magnifier software v Operate specific or equivalent features using only the keyboard v Customize display attributes such as color, contrast, and font size
z/OS information
z/OS information is accessible using screen readers with the BookServer/Library Server versions of z/OS books in the Internet library at:
www.ibm.com/servers/eserver/zseries/zos/bkserv/
415
416
Notices
This information was developed for products and services offered in the USA. IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the users responsibility to evaluate and verify the operation of any non-IBM product, program, or service. IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to: IBM Director of Licensing IBM Corporation North Castle Drive Armonk, NY 10504-1785 USA For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property Department in your country or send inquiries, in writing, to: IBM World Trade Asia Corporation Licensing 2-31 Roppongi 3-chome, Minato-ku Tokyo 106, Japan The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice. Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk. IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you.
Copyright IBM Corp. 1984, 2006
417
Licensees of this program who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact: IBM Corporation Mail Station P300 2455 South Road Poughkeepsie, NY 12601-5400 USA Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee. The licensed program described in this information and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement, IBM International Program License Agreement, or any equivalent agreement between us. If you are viewing this information softcopy, the photographs and color illustrations may not appear. This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental. COPYRIGHT LICENSE: This information contains sample application programs in source language, which illustrates programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. You may copy, modify, and distribute these sample programs in any form without payment to IBM for the purposes of developing, using, marketing, or distributing application programs conforming to IBMs application programming interfaces.
418
Trademarks
The following terms are trademarks of International Business Machines Corporation in the United States, other countries, or both:
AD/Cycle APL2 BookManager BookMaster C++/MVS COBOL/370 Common User Access CUA DB2 DFSMSdfp DFSMSrmm DFSORT FFST GDDM IBM Language Environment MVS MVS/XA OS/390 RACF SAA Systems Application Architecture Tivoli VTAM z/OS
Microsoft, Windows, and Windows NT are trademarks of Microsoft Corporation in the United States, other countries, or both. UNIX is a registered trademark of The Open Group in the United States and other countries. Linux is a trademark of Linus Torvalds in the United States, other countries, or both. Other company, product, and service names may be trademarks or service marks of others.
Notices
419
420
B
B (before), line command 42, 145 batch processing, submitting data for 275, 393 batch processing, using edit macros in 99 batch, ending a macro 353 beginning an edit session 4 BLKSIZE, assignment statement 294 block size, retrieving 294 boundaries controlling 196, 294 default 24 definition line 24 setting 147 BOUNDS assignment statement 294, 295 line command 147 macro command 294, 295 primary command 196 BROWSE macro command 296 primary command 197 built-in command disabling 216, 315 processing 198 built-in labels 57 BUILTIN macro command 297 primary command 198
Numerics
3850 virtual volumes, accessing 7
A
A (after), line command 143 A operand, REXX TRACE statement 111 abbreviations for commands and other values 409 accessibility 415 ACCOUNT command 8 action bar xviii action bars xvi Actions (F10 key) xvi ACTIONS command xvi activities nesting xviii add a data set member 374 add data 263 adding a line 157, 342 edit macro command 84 models 70 alias name, defining with edit macro 103 alias, assigning 216, 315 application-wide macros 26 assignment statement AUTOLIST 290 AUTONUM 291 AUTOSAVE 292 BLKSIZE 294 BOUNDS 294 CAPS 298 CHANGE COUNT 302 CURSOR 308 DATA_CHANGED 311 DATA_WIDTH 312 DATAID 313 DATASET 314 description 92 DISPLAY_COLS 318 DISPLAY_LINES 319 Copyright IBM Corp. 1984, 2006
C
C (copy), line command description 149 used with CREATE command 212 used with REPLACE command 264 CANCEL macro command 297, 298 primary command 199 canceling edit changes 199, 297 CAPS assignment statement 298, 299 DBCS data 200 macro command 298, 299 primary command 19, 199, 203 caps mode defined 19 overview 20 querying the value 298 setting the value 199, 298 CHANGE macro command column-dependent data, defined 48 DBCS data 48 description 299, 301 EBCDIC data 48 RCHANGE command 259, 369 saving and restoring values 402
421
CHANGE (continued) primary command column-dependent data, defined 48 DBCS data 48 description 45, 200, 202 EBCDIC data 48 qualifying search strings 50 specifying search strings 45 repeating 52 change a data string 200, 299 change count, retrieving 302 CHANGE_COUNTS, assignment statement 302 changed lines 22 changing data 45 changing models 74 character string changing 200 finding 227, 325 how to use 46 specifying 46 characters converting 199, 298 converting to lowercase 161 converting to uppercase 185 displaying hexadecimal 232, 330 CLIST CONTROL statements 111 CLIST edit macro statements 77, 83 CLIST WRITE statements 110 COBOL sequence field, defined 28 COLS 203 primary command 203 COLS, line command 152 column identification line, displaying 152 column limitations 51 column positions, referring to 102 column shifting DBCS data 43 destructive 43 line command 43 columns identifying 152 line command 152 query display 318 shift left 387 shift right 387 command line 14, 189 command names, overriding 103 command procedure statements 84 command scan mode, setting the value 381 command, PROFILE RESET 22 command, querying 369 commands nesting xviii commands, reversing last edit 278 Common User Access (CUA) guidelines xv compare command 204, 303 compare command examples 206 compare command return codes 305 compare command syntax 205, 303 Compare, edit command 204, 303 compress data 254, 362
CONLIST operand, CLIST CONTROL statement 111 control and display your profile 256, 367 control edit recovery 260, 371 control null spaces 252, 358 control version number 282, 403 CONTROL, ISPEXEC statement 108 controlling the edit boundaries 196, 294 controlling the edit environment 17 controlling the search for a data string 49 convert characters to lowercase 161 converting characters 199, 298 converting note lines to data 167 COPY macro command 306 primary command description 207, 208 how to use 42 copy a model into the current data set 243, 353 copying data into the current data set 42 lines of data 149 macro command 306 primary command 207 using edit macro 95 CREATE macro command 307 primary command description 211, 212 how to use 41 creating a data set member 211, 307 data 41 new data 9 CUA (Common User Access) guidelines xv current member name, querying 353 cursor position querying the value 308 setting the value 308 cursor values, saving and restoring 402 CURSOR, assignment statement 308, 309 positioning cursor on command line 309 Cut and Save Lines 215, 310 Cut Macro command 310 Cut Primary command 215
D
D (delete) line command 154 data adding 263 canceling changes 199, 297 changing 45, 200, 299 column-dependent, defined 48 compressing 254, 362 controlling the string search 49 converting data 185 copying 42, 207, 306 copying lines 149 creating 41 creating new 9
data (continued) DBCS considerations 48 deleting 218, 316 description 202 EBCDIC considerations 48 editing existing 9 excluding 45, 225, 322 finding 45, 227, 325 inserting 336 managing 41 moving 42 packing 16 replacing 41, 263 retrieving the changed status 311 retrieving the ID 313 retrieving the width 312 saving automatically 194, 292 saving the current 270, 379 seek a data string 382 shift left 388 shift right 389 shifting 42, 44 sorting 272, 390 split a line 399 submitting for batch processing 275, 393 test flow a paragraph 398 data field, defined 359 data in controlled libraries, editing 16 data lines, referring to 102 data modes 20 data set adding a member 374 copying a model into 243, 353 creating a member 211, 307 creating a new 9 editing a member 219, 321 editing existing 9 generating statistics 274, 392 moving a member 247, 355 password specification 8 renumbering lines automatically 261, 373 replacing a member 374 retrieving the current name 314 security 8 DATA_CHANGED, assignment statement 311 DATA_WIDTH, assignment statement 312 data-changed status, retrieving 311 DATAID, assignment statement 313 DATASET, assignment statement 314 DBCS data CHANGE command 48 column shifting 43 display boundary 4 hardware tabs 63, 64 SORT command 274, 391 TE (text entry) line command 61 TF (text flow) 59 TS (text split) line command 60 debugging edit macros 109 debugging edit macros with ISREMSPY 113 DEFINE edit macro command 86, 103
422
DEFINE (continued) macro command 315 primary command 216 define tabs mode 276, 394 defining a name 216, 315 an alias for a command 103 an edit profile 17 defining macros implicit 104 overriding command names 103 resetting definitions 103 scope of definitions 103 using an alias 103 DELETE macro command 316 primary command 218 deleting edit macro labels 101 labels 56 lines 154, 218 models 74 delimited string 46 destination, specifying 105 destructive shift, defined 43 dialog development models 67 dialog service errors, debugging 109 dialog service requests 85 dialog variable name, defined 93 direction of the search 49 disability 415 disabling a command 103 disabling a macro or built-in command 216, 315 display and control your profile 256, 367 display boundary, DBCS data 4 display columns 318 display model notes 251, 357 Display the Edit Settings Panel, EDITSET 222 DISPLAY_COLS, assignment statement 318 DISPLAY_LINES, assignment statement 319 displaying an edit profile 17 displaying hexadecimal characters 232, 330 distributed editing 4 DOWN, macro command 319 duplicating lines 171 dynamic status area xviii
E
EBCDIC data 48 edit beginning a session 4 canceling changes 199, 297 column shifting 43 command reference section 189 command summary 13 considerations 16 controlling the boundaries 196, 294 controlling the environment 17 controlling the recovery 260, 371 copying data 42
edit (continued) creating data 41 data display panel 9 displaying processed commands 14 editing data in controlled libraries 16 ending a session 12 entry panel 9 excluding lines 55 introduction to 3, 12 line commands 13 macro command 15, 321 managing data 41 models 67 modes 19 moving data 42 number mode 28 option 2 4 primary command description 219, 220 example 220 syntax 219 primary commands, description 14 profiles 17 recursive 219, 321 replacing data 41 rules for entering line commands 133 selecting the editor 4 sequence number display 28 sequence number format 27 sequence numbers 27 shifting columns 43 shifting data 42, 44 splitting text 58 text entry 58 text flow 58 undisplayable characters 11 undoing edit interactions 64 word processing 58 Edit - Entry panel 9 edit a member 219, 321 Edit and View Settings Panel 222 edit assignment statements elements keyphrase 93 overlays 94 value 92 how to use 94 manipulating data 95 Edit command errors, debugging 109 edit commands and PF key processing 14 edit compare command 204, 303 Edit data display panel 9 edit macro alias name 103 assignment statements 84, 92 CLIST macro, differences from program macros 86 column positions, referring to 102 command procedure statements 84 command summary 15 commands 84 creating 83 data lines, referring to 102 defining 103 definition of 3 description 77
edit macro (continued) dialog service requests 85 identifying 350 implicit definition using an exclamation point 104 initial macro 25 introduction to 77 ISRBOX macro 115 ISRCHGS macro 122 ISRIMBED macro 117 ISRMASK macro 126 ISRMBRS macro 120 labels description 100 editor-assigned 100 passing 102 referring to 101 using 100 levels 99 line command functions, how to perform 96 messages 99 naming 91 NOPROCESS operand 104 parameters 97 PROCESS command and operand 104 program macro description 85 differences from CLIST macros 86 differences from REXX macros 86 parameter passing 86 running 90 writing 87 recovery macro 106 reference section 285 replacing built-in edit commands 103 resetting a command to previous status 103 return codes 106 REXX macro, differences from program macros 86 samples 115 testing CLIST CONTROL statements 111 CLIST WRITE statements 110 description 109 experimenting with edit macro commands 112 return codes 108 REXX SAY statements 110 REXX TRACE statements 111 TSO commands 85 using 77 variable substitution 92 variables 91 edit macros, debugging with ISREMSPY 113 Edit mode defaults 21 edit processing of PF keys 14 edit profile autolist mode 191 autonum mode 193, 291 autosave mode 194, 292 boundary settings 147 caps mode 199 control and display 256, 367 Index
423
edit profile (continued) defaults 21, 22 defining 17 definition of 17 displaying 17 initial macro 240, 335 lock 256, 367 modifying 19 naming 17 note mode 251 nulls mode 252 profile name 17 recovery macro 269 saving and restoring 402 specifying 7 tabs mode 276 types 17 Edit Profile Initialization, Site-wide 21 edit profile name, definition 17 edit profiles, locking 19 edit recovery Edit Recovery panel 39 turning off 40 turning on 39 edit session, ending 225, 321 edit, distributed 4 editing existing data 9 editor-assigned labels 57 editor, ISPF 3 EDITSET 222 EDSET 222 eliminating labels 56 END macro command 321 primary command 225 end a macro 353 END command 194 end the edit session 225, 321 ending an edit session 12 enter text 177 error codes for severe errors 107 error lines 22 EXCLUDE macro command 322 primary command description 45, 225, 226 qualifying search strings 50 specifying search strings 45 repeating 52 exclude counts, querying the value 325 EXCLUDE_COUNTS, assignment statement 325 excluded line limitations 51 excluded lines hiding 234, 331 line status, set or query 405 redisplaying 55 excluding a line 55, 186, 322 excluding data 45 explicit shifts, defined 42 extent of a search 49
FIND macro command description 325, 327 RFIND command 269, 376 saving and restoring values 402 when to use instead of SEEK 383 primary command description 45, 227, 228 qualifying search strings 50 specifying search strings 45 repeating 52 find counts, querying the value 328 FIND_COUNTS, assignment statement 328 finding a data string 227 finding a search string 325 finding data 45 finding models 73 flagged lines changed lines 22 error lines 22 special lines 23 FLIP assignment statement 328 definition 56 macro command 328 primary command 229 flow counts, querying the value 329 FLOW_COUNTS, assignment statement 329 Format Name field 8 formatted edit mode, defined 166 formatting input 352 function keys xx
HILITE (continued) primary command description 239 how to use 236 HILITE function description
29
I
I (insert) line command 157 I operand, REXX TRACE statement 111 identify an edit macro 350 identify columns 152 IMACRO assignment statement 335 macro command 335 primary command 20, 240 implicit macro definition 104 implicit shifts, defined 42 initial macro, specifying 240, 335 initial macros DEFINE commands used in 103 specifying in the EDIT service call 25 specifying on the Edit - Entry panel 25 starting 25 Initialization, Site-wide Edit Profile 21 INSERT, macro command 336 inserting data 336 lines 157 interactive column numbers 102 introduction to edit macros 77 ISPEXEC 85 ISPF user interface xv ISPF list data set 191, 290 ISPF Workstation Tool Integration dialog 4 ISPF, definition 3 ISRBLOCK, sample macro 73, 413 ISRBOX, sample macro 115, 413 ISRCHGS, sample macro 122, 413 ISRCOUNT, sample macro 81, 413 ISRDASH, sample macro 78, 413 ISREDIT service 86 ISREDIT statements 84, 96 ISREMSPY 113 ISREMSPY, sample macro 413 ISRIMBED, sample macro 117, 413 ISRMASK, sample macro 126, 413 ISRMBRS, sample macro 120, 413 ISRONLY, sample macro 413 ISRSETLN, edit macro sample 381 ISRSLCOB, sample macro 90, 413 ISRSLPLI, sample macro 89, 413 ISRSLREX, sample macro 88, 413 ISRTDATA, sample macro 79, 413 ISRTDWRI, sample macro 110, 413 ISRTRYIT, sample macro 112, 413
G
generate sequence numbers 253, 359 generating data set statistics 274, 392 guidelines for using the editor 16
H
Hardware Tab field, defined 63 hardware tabs DBCS data 64 defining 63 description 61 fields, how to use 63 HEX assignment statement 330 macro command 330 primary command 20, 232 hexadecimal characters displaying 232, 330 format 20 mode 232, 330 string 46 HIDE 234 assignment statement 234 macro command 234, 331 primary command 234 HILITE macro command description 331, 335 how to use 332
J
jump function xviii
F
F (show first line), line command F10 key (Actions) xvi 155
424
K
keeping an edit command on the command line 14 keyboard 415 keyphrase, defined 93 kinds of search strings 46
L
L (show last line), line command 159 L operand, REXX TRACE statement 111 LABEL assignment statement description 337, 338 overview 100 querying the value 337 setting the value 337 labeled line, querying 346 labels defined 56 deleting 56 editor-assigned 57 eliminating 56 in macro commands 56 specifying a range 57 labels in edit macros deleting 101 description 100 editor-assigned 100 how to use 100 levels 99 nested macros 101 passing 102 referring to 101 languages for edit macros 77, 83 LC (lowercase), line command 161 left scroll 338 shift columns 387 shift data 388 LEFT macro command 338 LEVEL assignment statement 339 macro command 339 primary command 240 level number, specifying 240, 339 limiting the SORT command 274, 391 LINE adding 343 assignment statement 340 querying the number 340 querying the value 340 setting the value 340 line command field 13, 133 resetting 45 line command functions in edit macros 96 line commands ( (column shift left) 135 ) (column shift right) 137 > (data shift right) 141 < (data shift left) 139 A (after) 143 B (before) 145, 146 BOUNDS 147
line commands (continued) C (copy) 149 COLS 152 D (delete) 154 description 133 F (show first line) 155 I (insert) 157 L (show last line) 159 LC (lowercase) 161 M (move) 162 MASK 165 MD (make dataline) 167 O (overlay) 169 R (repeat) 171 rules for entering 133 S (show line) 55, 174 summary 134 TABS 176 TE (text entry) 58, 60, 177 TF (text flow) 58, 181 TS (text split) 58, 183 UC (uppercase) 185 usage 13 X (exclude) 51, 55, 186 line label querying the value 337 setting the value 337 line number, ordinal 242 line pointer COPY macro command 306 CREATE macro command 307 CURSOR assignment statement 308 DELETE macro command 317 incomplete 308 INSERT macro command 337 invalid 307, 356 LABEL assignment statement 337, 338 LINE assignment statement 341 LINE_AFTERassignment statement 342 LINE_BEFORE assignment statement 344 LOCATE macro command 347 MASKLINE assignment statement 352 MODEL macro command 354 MOVE macro command 355 referring to labels 102 SHIFT ( macro command 387 SHIFT ) macro command 388 SHIFT > macro command 389 TABSLINE assignment statement 396 TENTER macro command 397 TFLOW macro command 399 TSPLIT macro command 399 XSTATUS assignment statement 405 line pointer range CREATE macro command 307, 310, 317, 348, 349, 374, 376 DELETE macro command 317, 348 LOCATE macro command 348 SUBMIT macro command 393 line range 57 LINE_AFTER, assignment statement 342 LINE_BEFORE, assignment statement 343
LINE_STATUS 345 LINENUM, assignment statement 346 lines adding 157 copying 149 deleting 154, 316 exclude status 405 excluded limitations 51 excluding 55, 225, 322 inserting 157 locating 242, 347 moving 162 numbering automatically 193 overlaying 169 query display 319 renumbering automatically 261, 373 repeating 171 show 174 show the first 155 showing the last 159 specifying ranges 56 splitting 60, 399 literal character string, defined 92 LOCATE macro command generic syntax 348 specific syntax 347 primary command generic syntax 242 specific syntax 242 locate lines 242, 347 lock your profile 256, 367 locking an edit profile 19 logical record length, querying 349 logical tabs, description 61 LookAt message retrieval tool x lptr COPY macro command 306 CURSOR assignment statement 308 DELETE macro command 317 incomplete 308 INSERT macro command 337 invalid 307, 356 LABEL assignment statement 337, 338 LINE assignment statement 341 LINE_AFTER assignment statement 342 LINE_BEFORE assignment statement 344 LOCATE macro command 347 MASKLINE assignment statement 352 MODEL macro command 354 MOVE macro command 355 referring to labels 102 SHIFT ( macro command 387 SHIFT ) macro command 388 SHIFT > macro command 389 TABSLINE assignment statement 396 TENTER macro command 397 TFLOW macro command 399 TSPLIT macro command 399 XSTATUS assignment statement 405 lptr-range CREATE macro command 307, 310, 317, 348, 349, 374, 376 Index
425
lptr-range (continued) DELETE macro command 317, 348 LOCATE macro command 348 LRECL, assignment statement 349
M
M (move), line command description 162 used with CREATE command 212 used with REPLACE command 264 macro ending in batch 353 specifying a recovery 269, 378 specifying an initial 240, 335 Macro Command Profile Reset Syntax 368 macro commands abbreviations 409 assignment statements 92 AUTOLIST 290 AUTONUM 291 AUTOSAVE 292 BOUNDS 294 BROWSE 296 BUILTIN 297 CANCEL 297 CAPS 298 CHANGE 299 COPY 306 CREATE 307 CUT 310 DEFINE 315 DELETE 316 disabling 216, 315 DOWN 319 EDIT 321 END 321 EXCLUDE 322 FIND 325 FLIP 328 HEX 330 HIDE 234 HILITE 332 identifying 216, 315 IMACRO 335 INSERT 336 introduction to 77 labels 56 LEFT 338 LEVEL 339 LOCATE 347 MACRO 350 MEND 353 MODEL 353 MOVE 355 NONUMBER 356 NOTES 357 NULLS 358 NUMBER 359 PACK 362 PASTE 363 PROCESS 365 PROFILE 367 RCHANGE 259, 369 RECOVERY 371 reference section 285
macro commands (continued) RENUM 373 REPLACE 374 RESET 375 RFIND 269, 376 RIGHT 377 RMACRO 106, 378 SAVE 379 SCAN 381 SEEK 45, 382 SETUNDO 385 SHIFT ( 387 SHIFT ) 387 SHIFT > 389 SHIFT < 388 SORT 390 STATS 392 SUBMIT 393 summary 285 TABS 394 TENTER 58, 397 TFLOW 58, 398 TSPLIT 58, 399 UNNUMBER 400 UP 400 usage 15 VERSION 403 VIEW 404 macro definitions, resetting 103 macro nesting level querying 351 retrieving 99 MACRO_LEVEL, assignment statement 101, 351 MACRO, macro command 350 macros, sample 413 managing data 41 mask line, set or query 352 mask, defined 165 MASK, line command 165 MASKLINE, assignment statement description 352 overlays 94 using 94 MD (make dataline), line command 167 member name, querying 353 MEMBER, assignment statement 353 member, editing 219, 321 MEND, macro command 353 Menu pull-down xix message retrieval tool, LookAt x messages, displayed from edit macros 80, 99 mixed data, used with data strings 85 Mixed Mode field 8 model adding 70 changing 70, 74 class, defined 67 copying into the current data set 243, 353 deleting 70, 74 edit, defined 67 finding 70, 73 hierarchy 67 kinds 67 locating 73
model (continued) logical name 67 macro command 353 name, defined 68 primary command 243 qualifier, defined 68 using 69 model notes, displaying 251, 357 model selection panels 69 modes, edit 19, 20 modification flag 242 modification level number, specifying 240, 339 modification level, description 27 modifying an edit profile 19 MOUNT authority 8 MOVE macro command 355 primary command 42, 247 move a data set member 247, 355 moving a line of data in an edit macro 96 moving data into the current data set 42 moving lines 162 multiple parameters in an edit macro 98
N
name, defining 216, 315 naming edit macros 91 nested commands xviii nested macros, starting 99 nesting level, querying 351 NOCONLIST operand, CLIST CONTROL statement 111 NOLIST operand, CLIST CONTROL statement 111 non-destructive shifting, defined 44 NONUMBER macro command 356 primary command 250 NOPROCESS 104 normal, defined for stats mode 26 NOSYMLIST operand, CLIST CONTROL statement 111 note lines, converting to data 167 note mode description of 20 querying the value 357 setting the value 251, 357 NOTES assignment statement 357 macro command 357 primary command 20, 251 notes, displaying model 251, 357 Notices 417 null spaces, controlling 252, 358 NULLS assignment statement 358 macro command 358 primary command 20, 252 nulls mode description of 20 querying the value 358 setting the value 252, 358 NUMBER assignment statement 359
426
NUMBER (continued) macro command 359 primary command description 20, 253 DISPLAY operand 28 number mode defined 20 description 20, 253 initializing 28 setting, edit 27 turning off 250, 356 used with RENUM command 261, 373 number, specifying the modification level 240, 339 numbering lines automatically 193, 291 numbers controlling version 282, 403 generating sequence 253, 359 modification level 27 remove sequence 280, 400 sequence 27 turning off number mode 250, 356
O
O (overlay), line command 169 O operand, REXX TRACE statement 111 option number xviii optional items, in syntax diagrams ix Options pull-down menu xvii ordinal line number 242 overlaying lines 169 overlays, guidelines on how to perform 94 overriding, built-in edit commands 103
P
PACK assignment statement 362 macro command 362 primary command 20, 254 pack mode 20, 254 packing data, edit 16 panel excluding lines 186 process the 365 resetting the 375 set up for text entry 397 panel data, resetting 267 panel values, saving and restoring 402 panels Edit data display 9 Edit Entry 6, 221 edit profile display 18, 258 Edit Recovery 39 model selection 69 parameters in an edit macro 97 passing labels 102 passing parameters to an edit macro description 97 multiple 98 processing an Edit command 86 program macros 86 password protection 8
Paste Lines 255, 363 Paste Macro command 363 Paste Primary command 255 PDF, defined 3 PF key processing in edit 14 PF keys, scroll commands 12 picture string 46, 47 Point-and-shoot text fields xx power typing, defined 60 prepare display for data insertion 336 Preserve command 256 PRESERVE command 13 PRESERVE macro 364 primary commands abbreviations 409 AUTOLIST 19, 191 AUTONUM 19, 193 AUTOSAVE 19, 194 BOUNDS 196 BROWSE 197 BUILTIN 198 CANCEL 199 CAPS 19, 199 CHANGE 45, 200 COPY 42, 207 CREATE 41, 211 DEFINE 216 DELETE 218 displaying after processing 14 EDIT 219 END 225 EXCLUDE 45, 225 FIND 45, 227 FLIP 56, 229 HEX 20, 232 HIDE 234 HILITE 236 IMACRO 20, 240 LEVEL 240 LOCATE 242 MODEL 243 MOVE 42, 247 NONUMBER 250 NOTES 20, 251 NULLS 20, 252 NUMBER 20, 253 PACK 20, 254 PROFILE 19, 256 RECOVERY 20, 260 reference section 189 RENUM 261 REPLACE 41, 263 RESET 56, 267 RMACRO 269 SAVE 270 SETUNDO 20, 271 SORT 272 STATS 20, 274 SUBMIT 275 summary 189 TABS 20, 276 UNDO 278 UNNUMBER 280 usage 14 VERSION 282 VIEW 283
Primary Commands CUT 215 PASTE 255 PROCESS command and operand 104 PROCESS, macro command description 366 used with RANGE_CMD assignment statement 369 processing built-in commands 198, 297 PROFILE assignment statement 367 macro command description 367 profile control syntax 367 profile lock syntax 367 primary command description 19, 258 display or define a profile 17 profile control syntax 257 profile lock syntax 257 profile defaults 21, 22 PROFILE RESET command 22 Profile Reset Syntax 258 Profile Reset Syntax, Macro Command 368 profile, edit autolist mode 191, 353 autonum mode 193, 291 autosave mode 194, 292 boundaries 196 boundary settings 147 caps mode 199 control and display 256, 367 defining 17 description 17 displaying 17 initial macro 240, 335 lock 256, 367 locking 19 modifying 19 note mode 251 nullsmode 252 recovery macro 269 saving and restoring 402 tabs mode 276 types 17 program function keys xx program macros differences from CLISTs 86 differences from REXX EXECs 86 how to write 87 implicit definition 104 passing parameters 86 running 90 pull-down menus xvii
Q
qualifying the search string query a line 340 autolist mode 290 autonum mode 291 autosave mode 292 block size 294 caps mode 298 change count 302 50
Index
427
query (continued) command entered 369 current member name 353 cursor position 308 data ID 313 data set name 314 data width 312 data-changed status 311 display columns 318 display lines 319 edit boundaries 294 edit profile 367 exclude counts 325 exclude status for a line 405 find counts 328 flow counts 329 hexadecimal mode 330 initial macro 335 line label 337 line number 346 logical record length 349 macro nesting level 351 mask line 352 modification level number 339 note mode 357 nulls mode 358 number mode 359 pack mode 362 record format 370 recovery mode 371 seek counts 384 tabs line 396 tabs mode 394 version number 403 Query Source and Change Information for a Line in a Data Set, LINE_STATUS 345 Query Volume Information 404
R
R (repeat) line command 171 R operand, REXX TRACE statement 111 range specifying 105 using labels to specify 57 RANGE_CMD, assignment statement description 105, 369 used with the PROCESS command 369 RC variable 107 RCHANGE, macro command description 259, 369, 370 used to repeat CHANGE command 52 RECFM, assignment statement 370 record format, query 370 recovery controlling edit 260, 371 edit 39 macro 106, 269, 378 mode 20, 260, 371 RECOVERY assignment statement 371 macro command 371 primary command 20, 260 recursive editing, defined 220, 321
redisplaying excluded lines 55 referring to column positions 102 referring to data lines 102 reformatting a paragraph 181 relative line number of cursor, setting or retrieving 308 relative line numbers 102 remove sequence numbers 280, 400 removing lines 218, 316 RENUM macro command 373 primary command 261 RENUMBER primary command, DISPLAY operand 28 renumbering lines automatically 261, 373 repeating a change 259, 369 repeating a search RCHANGE command, Edit 52 RFIND command, Edit 52 repeating lines 171 REPLACE macro command 374 primary command description 263, 264 how to use 41 replace a data set member 374 replacing data 41, 263 lines 96 required items, in syntax diagrams ix RESET macro command 375 primary command 267 RESET command, PROFILE 22 reset the data display 375 reset the data panel 267 resetting macro definitions 103 resetting the line command field 45 retrieving the change count 302 retrieving the data ID 313 retrieving the data set name 314 retrieving the data width 312 retrieving the data-changed status 311 return codes &LASTCC variable 107 0 to 20 106 above 20 107 ISPF editor 107 RC variable 107 reverse last data change 278 REXX edit macro statements 77, 83 REXX SAY statements, using to debug edit macros 110 REXX TRACE statements, using to debug edit macros 111 RFIND command description 269, 376 used to repeat FIND and EXCLUDE commands 52 RIGHT See also shift columns and shift data macro command 377 scroll 377 RMACRO assignment statement description 378
RMACRO (continued) assignment statement (continued) overview 106 macro command 378 primary command description 269 overview 106
S
S (show line), line command description 174 redisplaying excluded lines 55 S operand, REXX TRACE statement 111 sample edit macros 115 SAVE macro command 379 primary command 270 save data automatically 194, 292 save the current data 270, 379 SAVE_LENGTH command 380 saving and restoring CHANGE macro command values 402 cursor and panel values 402 edit profile 402 FIND macro command values 402 SCAN assignment statement 381 macro command 381 SCAN assignment statement 92 scope of macro definitions 103 scroll down 319 left 338 right 377 up 400 using PF keys 12 search controlling 49 DBCS search string, delimiting 45 extent 49 qualifying 50 starting point and direction 49 search strings character 46 delimited 46 finding 325 hexadecimal 46 picture 46 simple 46 security, data set 8 seek a data string 382 seek counts, query 384 SEEK_COUNTS, assignment statement 384 SEEK, macro command description 45, 382, 383 when to use instead of FIND 327 selection fields xxi sequence numbers display 28 format 27 generating 253, 359 initializing 28 setting, edit 27
428
set a line 340 autolist mode 290 autonum mode 291 autosave mode 292 caps mode 298 command scan mode 381 cursor position 308 edit boundaries 196, 294 edit profile 367 exclude status for a line 405 hexadecimal mode 232, 330 initial macro 335 line label 337 mask 165 mask line 352 modification level number 339 note mode 251, 357 nulls mode 252, 358 number mode 359 pack mode 362 recovery mode 371 tabs line 396 tabs mode 276, 394 version number 403 set UNDO command 271 setting the edit boundaries 196, 294 SETUNDO macro command 385 primary command 65, 271 SHIFT (, macro command 387 SHIFT ), macro command 387 SHIFT >, macro command 389 SHIFT <, macro command 388 shift columns left 387 right 387 shift data left 388 right 389 shifting data edit columns 43 explicit 42 implicit 42 non-destructive 44 shortcut keys 415 show lines 174 show the first line 155 show the last line 159 SI characters, delimiting a search 45 simple editing 12 simple string 46 Site-wide Edit Profile Initialization 21 site-wide macro 16 SO characters, delimiting a search 45 software tab field, defined 177 software tabs defining 62 description 61 fields, how to use 177 SORT macro command DBCS data 391 description 390, 391 limiting 391 without operands 391
SORT (continued) primary command DBCS data 274 description 272, 273 limiting 274 without operands 273 sorting data 272, 390 source listing, create 191, 290 spaces, controlling null 252, 358 special lines 23 specify a recovery macro 106, 269, 378 specifying an initial macro 15, 25, 240, 335 the level number 240, 339 split screen, searching within 51 splitting a line of text 183 splitting lines 60 splitting text 58 standard sequence field, defined 27 starting point of a search 49 statistics creation and maintenance of 26 generating for a data set 274, 392 STATS assignment statement 392 macro command 392 primary command 20, 274 stats mode 20, 26 strings, kinds of search character 46 delimited 46 hexadecimal 46 picture 46 simple 46 SUBMIT macro command 393 primary command 275 submit data for batch processing 275, 393 suspending an activity xviii SYMLIST operand, CLIST CONTROL statement 111 syntax diagrams, how to read ix Syntax, Macro Command Profile Reset 368 Syntax, Profile Reset 258
TE (text entry), line command DBCS data, using a DBCS terminal 61 description 60, 177, 178 example 179 syntax 178 template (overlay) definition 94 how to design 94 TENTER, macro command 397 text entry in word processing 58 line command 177 setting up the panel 397 text flow 58 text flowing a paragraph 181, 398 text split a line 399 TF (text flow), line command DBCS data, using a DBCS terminal 59 description 58, 181 TFLOW, macro command 398 TS (text split), line command DBCS data 60 description 183 TSO commands in edit macros 85 TSPLIT, macro command 399 turn off number mode 250, 356
U
UC (uppercase), line command 185 undisplayable characters 11 UNDO primary command 278 SETUNDO requirement 385 with SETUNDO macro 271 undoing edit interactions description 278 how to use 64 UNDO primary command 278 UNDOSIZE 65 UNNUMBER macro command 400 primary command 280 UP, macro command 400 uppercase, converting data to 185 USER_STATE, assignment statement 402 using the ISPF editor 3 Utilities pull-down menu xx
T
TABS assignment statement 394 controlling and querying 62, 394 line command defining hardware tabs 63 defining software tabs 62 description 176 limiting hardware tab columns 63 using software tab fields 177 macro command 394 primary command 20, 276 tabs line querying the value 396 setting the value 396 tabs mode description 20, 62 setting the value 276, 394 TABSLINE, assignment statement 396
V
value portion of an edit macro statement 92 variable substitution, controlling 92 variables in edit macros 91 variables, in syntax diagrams x verifying parameters 104 VERSION assignment statement 403 macro command 403 primary command 282 version number controlling 282, 403 description 27 Index
429
VIEW macro command 404 primary command 283 VOLUME assignment statement Volume Information 404
404
W
writing program macros 85, 87
X
X (exclude), line command using 51, 55 XSTATUS, assignment statement 405
Z
ZDEFAULT edit profile 22 ZEDILMSG dialog variable 108 ZEDISMSG dialog variable 108 ZEDITCMD variable 98 ZEDLMSG 99 ZEDMSGNO dialog variable 108 ZEDSAVE variable 312 ZEDSMSG 99 ZUSERMAC variable 26
430
How satisfied are you that the information in this book is: Very Satisfied Accurate Complete Easy to find Easy to understand Well organized Applicable to your tasks h h h h h h Satisfied h h h h h h Neutral h h h h h h Dissatisfied h h h h h h Very Dissatisfied h h h h h h
h Yes
h No
When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you.
Address
___________________________________________________________________________________________________
Tape do not Fold and _ _ _ _ _ _ _Fold _ _ _and ___ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Please _____ __ _ _ staple _____________________________ ___ _ _ Tape ______ NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES
IBM Corporation Reader Comments DTX/E269 555 Bailey Avenue San Jose, CA U.S.A. 95141-9989
_________________________________________________________________________________________ Please do not staple Fold and Tape Fold and Tape
SC34-4820-05
Printed in USA
SC34-4820-05