Data Manipulation Commands


ISPF provides powerful line commands that allow users to edit and manipulate data in datasets. These commands are executed by entering them in columns 1 to 6 (Command Area) and pressing Enter. Below is a simplified overview of the most commonly used commands, categorized for ease of understanding.

Basic Commands -

INSERT (I):

  • Insert blank lines into the dataset.
  • Single Line: Enter I in columns 1 to 6.
    Single Line Insert Single Line Insert
  • Multiple Lines: Specify the number of lines after I (e.g., I11 for 11 lines).
    Multiple Line Insert Multiple Line Insert

DELETE (D):

  • Remove lines from the dataset.
  • Single Line: Enter D.
    Single Line Delete Single Line Delete
  • Multiple Lines: Add a number after D (e.g., D6 to delete 6 lines).
    Multi Line Delete Multi Line Delete
  • Block of Lines: Use DD at the start and end of the block.
    Block Delete Block Delete

REPEAT (R):

  • Duplicate lines.
  • Single Line: Enter R to duplicate once.
  • Multiple Copies: Add a number after R (e.g., R6 to repeat a line 6 times).
  • Block of Lines: Use RR at the start and end of the block to repeat it once.
Note! REPEAT and DELETE works in a similar way.

Copy/Move Commands -

Note! COPY or MOVE should always code in a combination with PASTE or OVERLAY.

COPY (C):

  • Copy lines without removing the original.
  • Single Line: Enter C.
  • Block of Lines: Use CC at the start and end of the block.

MOVE (M):

  • Move lines, removing the original content.
  • Single Line: Enter M.
  • Block of Lines: Use MM at the start and end of the block.

PASTE (A/B):

  • Paste copied or moved content.
  • A: Paste after the specified line.
    Block Copy Block Copy
  • B: Paste before the specified line.

OVERLAY (O/OO):

  • Overlay copied or moved content onto existing lines.
  • O: Overlay a single line.
  • OO: Overlay multiple lines.
  • If the overlay is incomplete, the line will be copied instead, and an error message will be displayed.

Exclude/Show Commands -

Exclude Lines (X):

  • Temporarily hide lines without deleting them.
  • Single Line: Enter X.
    Single Line Exclude Single Line Exclude
  • Block of Lines: Use XX at the start and end of the block.

Show Lines:

  • Display excluded lines.
  • F: Show the first line of an excluded block.
    Show Lines Show Lines
  • L: Show the last line of an excluded block.
  • L3: Show the last 3 lines of an excluded block.

Text Handling Commands -

  • TS: Split a text line at the cursor to insert content.
  • TF: Flow text to the end of a paragraph.
  • TE: Format the screen for typing paragraphs.
  • LC: Change text from uppercase to lowercase.
  • UC: Change text from lowercase to uppercase.

Miscellaneous Commands -

  • BNDS: Adjust the current bounds for editing.
  • COLS: Display formatted column numbers.
  • MASK: Edit the current mask for line editing.
  • TABS: Adjust tab settings.

Data Commands -

MD (Make Dateline):

  • Convert temporary lines (e.g., from NOTE or MASK) into permanent data lines that will be saved.

Assigning Commands to PF Keys -

  • You can assign line commands to PF keys for quick access.
  • Example: Assign I5 (Insert 5 lines) to PF7:
    • Type KEYS on the command line to open the key list.
    • Assign :I5 to PF7.
    • Save the key list.