O (Overlay)
The O (overlay) line command copies data from specified columns of one or more source records to the corresponding columns of one or more (existing) destination records.
The source range of records to be overlaid onto a destination record is specified with one of the following line commands:
- C (copy)
- M (move).
You can use the COPY primary command to copy records from another data set/member.
The O (overlay) line command used without parameters overlays data from one source record to a destination record. If a single record or MASK information line is being overlaid, the data from the first record in the source range is overlaid on the designated line.
OVERLAY Line Command Syntax
O[n]
OO
n
Specifies the number of destination lines to be overlaid. If there are fewer destination lines than source records, not all source records are used in the overlay process. If you specify the source range with the C (copy) line command, the message: NOT ALL DATA COPIED is displayed. If the M (move) line command specifies the source range, the message: LINES NOT DELETED is displayed.
If the number of destination lines is greater than or equal to the number of source records and you used the M (move) line command to specify the source range, the source lines are deleted.
OO
Specifies the block of destination lines to be overlaid.
If a block of lines to be overlaid contains information lines (other than a MASK information line), these lines are assigned a source record, but are not actually overlaid. Thus, you can include information lines in the destination range where you want to skip a source record during an overlay operation. A MASK information line is treated as a data record during the execution of the O (Overlay) line command.
If a block of lines is being overlaid, the destination lines are overlaid with successive source records in sequence. If the number of destination lines exceeds the number of source records, the source records are reused until all destination lines have been overlaid.
Guidelines
The overlay mask defines which columns of the destination record(s) are to be overlaid with data from the source record(s). Columns of the overlay mask that contain an asterisk (*) are overlaid, and the columns that contain a blank character are not overlaid.
The contents of the overlay mask are displayed on the OVLY information line, which is displayed with the OVLY line command. You can alter the contents of the overlay mask using the OVERLAY primary command, or by typing over the OVLY information line.
At least one column of the OVLY information line must contain an asterisk (*) before the overlay operation is requested. Otherwise, an error is detected and the message: NO EXISTING OVERLAY LINE is displayed.
Unlike the overlay operation in ISPF/PDF, the overlay operation in File-AID is not confined to columns within the edit bounds.
The source range may consist of a single line or a block of lines. Any information lines in the source range are ignored (in the case of overlay operations only). If the source range consists entirely of information lines, the overlay operation has no effect on the destination record(s).
The destination may be a block of lines, a single data record or a MASK information line. A single O marks a single destination record or MASK information line. To specify a block of lines, enter O in the sequence field of the first line of the block, followed by the number of lines (n). You can specify a block of destination lines also by by marking the first and last lines of the block with OO. An information line (other than a MASK information line) may be marked with OO, but may not be marked with O or On. If you mark an information line with O or On, the message: INVALID ON THIS LINE is displayed.
When editing a keyed data set, the record key of protected records cannot be overlaid. If you attempt to overlay the record key of a protected record, the message: RECORD(S) NOT OVERLAID is displayed, the protected record is flagged with the ERR flag, and the original contents of the record key field remains intact. Any specified columns outside the record key field are overlaid. An unsuccessful attempt to overlay a protected key does not inhibit the deletion of a source range specified with the M (move) command.
Example 1
This example demonstrates the overlay operation:
=COLS> ----+----1----+----2----+--
CC 001 AAAAAAAAAAAAAAAAAAAAAAAAAAA
CC 002 BBBBBBBBBBBBBBBBBBBBBBBBBBB
OO 003 111111111111111111111111111
000004 222222222222222222222222222
OO 005 333333333333333333333333333
The first line of this example shows the OVLY information line, which indicates that columns 6 through 10 and 16 through 20 may be overlaid. The source range in this example consists of lines 1 and 2. The overlay destination range consists of lines 3, 4, and 5. Since there are more destination lines than source records, the first source record is used twice.
The result of the overlay operation is shown below:
=COLS> ----+----1----+----2----+--
000001 AAAAAAAAAAAAAAAAAAAAAAAAAAA
000002 BBBBBBBBBBBBBBBBBBBBBBBBBBB
000003 11111AAAAA11111AAAAA1111111
000004 22222BBBBB22222BBBBB2222222
000005 33333AAAAA33333AAAAA3333333
Example 2
This example demonstrates the result when the source and destination ranges contain information lines.
MM 001 AAAAAAAAAAAAAAAAAAAAAAAAAAA
000002 BBBBBBBBBBBBBBBBBBBBBBBBBBB
=BNDS> < >
MM 003 CCCCCCCCCCCCCCCCCCCCCCCCCCC
OO 004 111111111111111111111111111
000005 222222222222222222222222222
000006 333333333333333333333333333
=MASK>
=COLS> ----+----1----+----2----+--
OO 007 444444444444444444444444444
The BNDS information line is ignored, so the source range effectively consists of records 1, 2, and 3. Therefore, record 4 is overlaid with record 1, record 5 with record 2, and record 6 with record 3. The MASK information line is overlaid as if it were a data record. Since all source range records have been used, it is overlaid with record 1. The COLS information line is assigned record 2, but is not overlaid. Record 7 is overlaid with record 3. Finally, since all source range records were used, the source range (specified with the M (move) command) is deleted, and the sequence numbers are updated. The result is as follows:
=BNDS> < >
000001 11111AAAAA11111AAAAA1111111
000002 22222BBBBB22222BBBBB2222222
000003 33333CCCCC33333CCCCC3333333
=MASK> AAAAA AAAAA
=COLS> ----+----1----+----2----+--
000004 44444CCCCC44444CCCCC4444444