Overlaying data in existing rows

You can overlay data in a row with data from another row by specifying the O or OO prefix commands.

When data is to be copied or moved by the C (copy) or M (move) prefix commands and overlaid on one or more existing rows, the O or OO (overlay) prefix commands specify the destination for the data. You can only overlay data onto character columns (CHAR and VARCHAR).

The data that is copied or moved overlays blanks in the destination rows.

If the destination column is VARCHAR:
  • It must have a non-zero length.
  • If the length of the data being moved or copied is longer than the destination column, only the data that can fit into the destination column is moved or copied.
When data is to be moved or copied and then overlaid on a destination:
  • Where the destination is a single row:
    • The O (overlay) prefix command specifies the destination for the data.

      You can type a number after the O prefix command to specify the number of times that the M or C prefix command is to be performed. For example, typing the command O3 against a row causes the data to be moved or copied and then overlaid on that row and also the next two rows.

  • Where the destination is a block of rows:
    • The OO (overlay, multiple-line target) prefix command specifies the first and last row of the destination for the data.

To overlay one or more single rows:

  1. Type either M or C in the prefix area of the row that is to be moved or copied.
  2. Type O in the prefix area of the row that the moved or copied record is to overlay.
  3. Press Enter. The data being moved or copied overlays the specified row or rows.

To overlay one or more blocks of rows:

  1. Type either MM or CC in the prefix area of the first and last rows of a block of rows 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 prefix area of the first and last rows that the block of rows 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 rows that contain the two CC or MM commands and all of the rows between them overlay the rows that contain the two OO commands and all of the rows between them.

The number of source and receiving rows need not be the same. If there are more receiving rows, the source rows are repeated until the receiving rows are gone. If there are more source rows than receiving rows, the extra source rows are ignored.

Related topics

Related references