ISPF Editor Quick Reference: Line & Primary Commands

This quick reference provides essential ISPF editor commands at a glance. Use this as a cheat sheet for the most commonly used line commands and primary commands. For detailed explanations and advanced usage, refer to the comprehensive line commands and primary commands tutorials.

Line commands are placed in the line number area (to the left of line numbers) and operate on specific lines. Primary commands are entered on the command line (labeled "Command >>>") and perform file-wide operations. This reference consolidates the most important commands for quick lookup.

Line Commands Quick Reference

Line commands are single or double characters placed in the line number area. They operate on the line where they're placed or on ranges of lines.

Basic Line Operations

Basic line operation commands
CommandDescriptionUsage Example
IInsert new line above this linePlace I in line number area, press Enter, type content
II, III, I5Insert multiple lines (2, 3, or 5 lines)II inserts 2 lines, I5 inserts 5 lines
DDelete this linePlace D in line number area, press Enter
DD, DDD, D5Delete multiple linesDD deletes 2 lines, D5 deletes 5 lines
RRepeat (duplicate) this line belowPlace R in line number area, press Enter
RR, RRR, R5Repeat line multiple timesRR creates 2 copies, R5 creates 5 copies

Move and Copy Operations

Move and copy operation commands
CommandDescriptionUsage Example
MMove this line (mark for moving)Place M on source line, then A or B on target line
MM, MMMMove multiple linesPlace M on first and last line of range, or use MM for 2 lines
CCopy this line (mark for copying)Place C on source line, then A or B on target line
CC, CCCCopy multiple linesPlace C on first and last line of range, or use CC for 2 lines
AAfter - place moved/copied lines after this lineUse after M or C to specify target location
BBefore - place moved/copied lines before this lineUse after M or C to specify target location

Text Manipulation Line Commands

Text manipulation line commands
CommandDescriptionUsage Example
OOverlay - replace line contentPlace O, press Enter, type new content
TSText shift - shift text rightPlace TS, press Enter to shift one space right
TSSText shift multiple spacesTSS shifts 2 spaces, TSSS shifts 3 spaces
LEFTShift text leftPlace LEFT, press Enter to shift one space left
UUppercase - convert line to uppercasePlace U in line number area, press Enter
LLowercase - convert line to lowercasePlace L in line number area, press Enter

Navigation Line Commands

Navigation line commands
CommandDescriptionUsage Example
TTop - jump to top of filePlace T in line number area, press Enter
BBottom - jump to bottom of filePlace B in line number area, press Enter
nJump to line number nType line number in line number area, press Enter

Primary Commands Quick Reference

Primary commands are entered on the command line and perform file-wide operations.

File Operations

File operation primary commands
CommandDescriptionUsage Example
SAVESave all changes to fileType SAVE on command line, press Enter
CANCELDiscard all changes and exitType CANCEL on command line, press Enter
ENDSave and exit editorType END on command line, press Enter (same as PF3)
RESETReset all changes, return to last saved stateType RESET on command line, press Enter

Search and Replace

Search and replace primary commands
CommandDescriptionUsage Example
FIND textFind text and position cursorFIND PROCEDURE finds word PROCEDURE
FIND text NEXTFind next occurrenceFIND PROCEDURE NEXT finds next occurrence
FIND text PREVFind previous occurrenceFIND PROCEDURE PREV finds previous occurrence
CHANGE old newReplace text (one occurrence)CHANGE OLD NEW replaces first OLD with NEW
CHANGE old new ALLReplace all occurrencesCHANGE OLD NEW ALL replaces all OLD with NEW
CHANGE old new PREVReplace previous occurrenceCHANGE OLD NEW PREV replaces previous occurrence

Navigation Commands

Navigation primary commands
CommandDescriptionUsage Example
TOPJump to top of fileType TOP on command line, press Enter
BOTTOMJump to bottom of fileType BOTTOM on command line, press Enter
nJump to line number nType line number (e.g., 100) on command line, press Enter
UP nMove up n linesUP 10 moves up 10 lines
DOWN nMove down n linesDOWN 10 moves down 10 lines

Editor Configuration

Editor configuration primary commands
CommandDescriptionUsage Example
BOUNDS left rightSet column boundariesBOUNDS 1 72 sets left=1, right=72
MARGINS left rightSet left and right marginsMARGINS 8 72 sets margins for COBOL Area A/B
NUMBER ON/OFFShow/hide line numbersNUMBER OFF hides line numbers
CAPS ON/OFFEnable/disable automatic uppercaseCAPS ON converts input to uppercase
NULLS ON/OFFShow/hide null charactersNULLS ON displays null characters

Text Transformation

Text transformation primary commands
CommandDescriptionUsage Example
UPPERConvert selected text to uppercaseSelect text with block commands, then UPPER
LOWERConvert selected text to lowercaseSelect text with block commands, then LOWER
CAPSCapitalize first letter of wordsSelect text with block commands, then CAPS
SHIFT LEFT nShift text left n spacesSelect text, then SHIFT LEFT 5
SHIFT RIGHT nShift text right n spacesSelect text, then SHIFT RIGHT 5

Function Keys Quick Reference

Function keys provide quick access to common operations:

Function keys quick reference
Function KeyDescriptionAction
PF1 (Help)Display help informationContext-sensitive help
PF2 (Split)Split screenView two parts of file simultaneously
PF3 (End)Save and exitSaves changes and exits editor
PF7 (Up)Scroll upScroll up one screen
PF8 (Down)Scroll downScroll down one screen
PF9 (Swap)Swap split screensSwitch between split screen views
PF10 (Left)Scroll leftScroll left in wide files
PF11 (Right)Scroll rightScroll right in wide files

Common Command Combinations

Common combinations of commands for frequent tasks:

Copying Lines

To copy lines:

  • Place C (or CC for multiple) on source lines
  • Place A (After) or B (Before) on target line
  • Press Enter

Moving Lines

To move lines:

  • Place M (or MM for multiple) on source lines
  • Place A (After) or B (Before) on target line
  • Press Enter

Search and Replace

To replace text:

  • Use FIND text first to verify occurrences
  • Use CHANGE old new to replace one occurrence
  • Use CHANGE old new ALL to replace all occurrences

Quick Navigation

To navigate quickly:

  • Type line number on command line to jump to that line
  • Use FIND text to locate specific content
  • Use TOP or BOTTOM to jump to file boundaries

Command Usage Tips

Tips for using commands effectively:

  • Line Commands: Place in line number area (left of line numbers), press Enter to execute
  • Primary Commands: Type on command line (labeled "Command >>>"), press Enter to execute
  • Multiple Lines: Use repeated letters (DD, CC) or place command on first and last line of range
  • Undo: Use RESET to undo all changes, or CANCEL to exit without saving
  • Help: Press PF1 for context-sensitive help on any command
  • Case Sensitivity: Most commands are case-insensitive, but text in FIND/CHANGE is case-sensitive by default
  • Command History: Use command history (if available) to recall previous commands

Explain Like I'm 5: ISPF Commands

Think of ISPF commands like different tools for editing:

  • Line Commands are like sticky notes you put on specific lines. You write a letter (like D for delete, I for insert) on the sticky note, and when you press Enter, the editor does that action on that line. It's like putting a note that says "delete this" or "add a new line here"!
  • Primary Commands are like instructions you give to the whole editor. You type them on the command line (like "find this word" or "save everything"), and the editor does that action for the whole file. It's like telling the editor "do this for everything"!
  • Function Keys are like shortcut buttons. Instead of typing commands, you just press a button (like PF3 to save and exit). It's like having a remote control with buttons for common actions!
  • Combining Commands is like using multiple tools together. You might mark lines to copy (C), then mark where to put them (A for after), and press Enter to do both actions together. It's like saying "copy these lines and put them after that line"!

So ISPF commands are like having different tools - sticky notes for specific lines, instructions for the whole file, and shortcut buttons for quick actions!

Practice Exercises

Practice using commands from this quick reference:

Exercise 1: Basic Line Commands

Objective: Practice basic line operations.

Steps:

  • Open a file in ISPF editor
  • Use I to insert a new line
  • Use D to delete a line
  • Use R to repeat a line
  • Practice with multiple lines (II, DD, RR)

Exercise 2: Move and Copy

Objective: Practice moving and copying lines.

Steps:

  • Use C to mark lines to copy
  • Use A to specify where to copy them
  • Press Enter to execute
  • Use M to move lines instead
  • Compare the difference

Exercise 3: Primary Commands

Objective: Practice primary commands.

Steps:

  • Use FIND to locate text
  • Use CHANGE to replace text
  • Use TOP and BOTTOM to navigate
  • Use SAVE to save changes
  • Practice with different command options

Test Your Knowledge

1. What line command deletes a line?

  • I
  • D
  • R
  • M

2. What primary command finds text?

  • SEARCH
  • FIND
  • LOCATE
  • SEEK

3. What line command inserts a new line?

  • D
  • I
  • A
  • N

4. What primary command saves changes?

  • WRITE
  • SAVE
  • STORE
  • KEEP

5. What line command copies lines?

  • M
  • C
  • D
  • R

Related Concepts