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 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.
| Command | Description | Usage Example |
|---|---|---|
| I | Insert new line above this line | Place I in line number area, press Enter, type content |
| II, III, I5 | Insert multiple lines (2, 3, or 5 lines) | II inserts 2 lines, I5 inserts 5 lines |
| D | Delete this line | Place D in line number area, press Enter |
| DD, DDD, D5 | Delete multiple lines | DD deletes 2 lines, D5 deletes 5 lines |
| R | Repeat (duplicate) this line below | Place R in line number area, press Enter |
| RR, RRR, R5 | Repeat line multiple times | RR creates 2 copies, R5 creates 5 copies |
| Command | Description | Usage Example |
|---|---|---|
| M | Move this line (mark for moving) | Place M on source line, then A or B on target line |
| MM, MMM | Move multiple lines | Place M on first and last line of range, or use MM for 2 lines |
| C | Copy this line (mark for copying) | Place C on source line, then A or B on target line |
| CC, CCC | Copy multiple lines | Place C on first and last line of range, or use CC for 2 lines |
| A | After - place moved/copied lines after this line | Use after M or C to specify target location |
| B | Before - place moved/copied lines before this line | Use after M or C to specify target location |
| Command | Description | Usage Example |
|---|---|---|
| O | Overlay - replace line content | Place O, press Enter, type new content |
| TS | Text shift - shift text right | Place TS, press Enter to shift one space right |
| TSS | Text shift multiple spaces | TSS shifts 2 spaces, TSSS shifts 3 spaces |
| LEFT | Shift text left | Place LEFT, press Enter to shift one space left |
| U | Uppercase - convert line to uppercase | Place U in line number area, press Enter |
| L | Lowercase - convert line to lowercase | Place L in line number area, press Enter |
| Command | Description | Usage Example |
|---|---|---|
| T | Top - jump to top of file | Place T in line number area, press Enter |
| B | Bottom - jump to bottom of file | Place B in line number area, press Enter |
| n | Jump to line number n | Type line number in line number area, press Enter |
Primary commands are entered on the command line and perform file-wide operations.
| Command | Description | Usage Example |
|---|---|---|
| SAVE | Save all changes to file | Type SAVE on command line, press Enter |
| CANCEL | Discard all changes and exit | Type CANCEL on command line, press Enter |
| END | Save and exit editor | Type END on command line, press Enter (same as PF3) |
| RESET | Reset all changes, return to last saved state | Type RESET on command line, press Enter |
| Command | Description | Usage Example |
|---|---|---|
| FIND text | Find text and position cursor | FIND PROCEDURE finds word PROCEDURE |
| FIND text NEXT | Find next occurrence | FIND PROCEDURE NEXT finds next occurrence |
| FIND text PREV | Find previous occurrence | FIND PROCEDURE PREV finds previous occurrence |
| CHANGE old new | Replace text (one occurrence) | CHANGE OLD NEW replaces first OLD with NEW |
| CHANGE old new ALL | Replace all occurrences | CHANGE OLD NEW ALL replaces all OLD with NEW |
| CHANGE old new PREV | Replace previous occurrence | CHANGE OLD NEW PREV replaces previous occurrence |
| Command | Description | Usage Example |
|---|---|---|
| TOP | Jump to top of file | Type TOP on command line, press Enter |
| BOTTOM | Jump to bottom of file | Type BOTTOM on command line, press Enter |
| n | Jump to line number n | Type line number (e.g., 100) on command line, press Enter |
| UP n | Move up n lines | UP 10 moves up 10 lines |
| DOWN n | Move down n lines | DOWN 10 moves down 10 lines |
| Command | Description | Usage Example |
|---|---|---|
| BOUNDS left right | Set column boundaries | BOUNDS 1 72 sets left=1, right=72 |
| MARGINS left right | Set left and right margins | MARGINS 8 72 sets margins for COBOL Area A/B |
| NUMBER ON/OFF | Show/hide line numbers | NUMBER OFF hides line numbers |
| CAPS ON/OFF | Enable/disable automatic uppercase | CAPS ON converts input to uppercase |
| NULLS ON/OFF | Show/hide null characters | NULLS ON displays null characters |
| Command | Description | Usage Example |
|---|---|---|
| UPPER | Convert selected text to uppercase | Select text with block commands, then UPPER |
| LOWER | Convert selected text to lowercase | Select text with block commands, then LOWER |
| CAPS | Capitalize first letter of words | Select text with block commands, then CAPS |
| SHIFT LEFT n | Shift text left n spaces | Select text, then SHIFT LEFT 5 |
| SHIFT RIGHT n | Shift text right n spaces | Select text, then SHIFT RIGHT 5 |
Function keys provide quick access to common operations:
| Function Key | Description | Action |
|---|---|---|
| PF1 (Help) | Display help information | Context-sensitive help |
| PF2 (Split) | Split screen | View two parts of file simultaneously |
| PF3 (End) | Save and exit | Saves changes and exits editor |
| PF7 (Up) | Scroll up | Scroll up one screen |
| PF8 (Down) | Scroll down | Scroll down one screen |
| PF9 (Swap) | Swap split screens | Switch between split screen views |
| PF10 (Left) | Scroll left | Scroll left in wide files |
| PF11 (Right) | Scroll right | Scroll right in wide files |
Common combinations of commands for frequent tasks:
To copy lines:
To move lines:
To replace text:
To navigate quickly:
Tips for using commands effectively:
Think of ISPF commands like different tools for editing:
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 using commands from this quick reference:
Objective: Practice basic line operations.
Steps:
Objective: Practice moving and copying lines.
Steps:
Objective: Practice primary commands.
Steps:
1. What line command deletes a line?
2. What primary command finds text?
3. What line command inserts a new line?
4. What primary command saves changes?
5. What line command copies lines?