Post by Stefan on Oct 14, 2022 11:49:52 GMT -5
The ISPF editor offers the K append on the A line command. It makes it much easier to copy/move one or more lines and place them in multiple parts of the data.
The ISPF editor help on the feature states:
The A (after) line command identifies the destination when data is to be moved or copied after a line in the data.
A K can be appended to the A to indicate that the source is to be used with multiple destinations.
The last destination must not contain the K append so that ISPF knows the command set is complete.
No part of the command set is executed until the command set is complete.
The K append is only valid for line copy and move commands.
SPFLite has no native facility to copy/move lines and place them in multiple destinations in the file in one interaction.
The & append can be used with C/CC and M/MM, but requires multiple user interactions to select multiple target locations.
The CK and MK macros provide the above functionality, using familiar syntax, albeit tailored to the SPFLite line-command restrictions.
Last update 15/10/2022: Version 4
Identify Source lines
Line command invocation:
- Use the CK/CKK line command directly to select the line (CK) or block of lines (CKK...CKK) to be copied to multiple locations.
- Use the MK/MKK line command directlly to select the line (MK) or block of lines (MKK...MKK) to be moved to multiple locations.
Primary command invocation:
- Use the CK command to copy a line or block of lines to multiple locations.
- Use the MK command to move a line or block of lines to multiple locations.
To select the source line(s), use the usual C/CC notation to select the source line(s) to be copied (CK) or moved (MK).
If you select the source line(s) with the M/MM notation, the lines will be moved regardless of which command is used.
(In other words, MK will always move data. CK will copy data but can also move data if M/MM is used to select source lines.)
Identify Target lines (Please note, the
symbol below is an unwelcome representation of the '<colon>O' character sequence)

SPFLite does not permit multiple destination line commands (After, Before, Overlay, OR, Here) to be entered for one interaction.
Hence, CK and MK use tags to implement a similar notation, respectively (:A, :B,
, :OR, :H) to identify the target locations (destinations).

You can enter as many target tags as you need for one interaction.
You can also mix the tags as required, eg: Copy the same lines :After line 10 AND :Before line 47 AND :OO...:OOverlaying a block from line 17 to 23.
Tags :A and :B offer no 'block mode'. The macros will simply ignore :AA or :BB as 'user' tags.
Tags
, :OR and :H do offer a block mode. The usual syntax applies, ie. use :OO...:OO, :ORR...:ORR and :HH...:HH to identiify target blocks. However, :OROR is not supported.

Other information
The macros will not process 'special' lines (TABS, COLS, NOTE, BNDS, etc). Only DATA lines will be copied, moved or overlaid.
Block tags must be specified in pairs. A defined block cannot contain any other intervening target tags.
A single line tag (e.g. :H) entered on an excluded line marker is treated as defining a block consisting of all the excluded lines.
Block tags must be specified in pairs. A defined block cannot contain any other intervening target tags.
A single line tag (e.g. :H) entered on an excluded line marker is treated as defining a block consisting of all the excluded lines.
What about the TK macro?
To help the user locate the various destinations where changes were made, CK and MK will leave a :xx> tag (in lieu of a =CHG> marker).
The value of ':xx' is the same as the original target tag.
The TK (T=Tidy) command is intended to be used as a primary command. It removes these tags from the file.
Alternatively, the CK and MK macro each define a variable called "gHighChg" on line 20 which is set to TRUE.
If you edit the macro and set the value to FALSE, changed lines will not be high-lighted with a :xx> tag.