Extended Line Command Modifiers

Extended Line Command Modifiers

Contents of Article


Introduction

Standard command forms with modifiers

Retain line-command modifier

Forward and backward modifiers

Post-exclude and post-unexclude modifiers

Coexistence of & and +/- modifiers

Examples


Introduction


Many line commands support the use of Extended Line Command Modifiers.  These are optional characters appended to the right end of a line command, requesting additional special processing to be performed.


Standard command forms with modifiers


       The standard form of a line command with a modifier is is to place the modifier after the command name, rather than the end of the command as a whole.


For example, if a command to copy 5 lines (C5) was to be retained with a & modifier, the standard form is C&5 rather than C5&.   The standard way to lower-case 3 lines and then exclude them following the operation would be with a command LC-3 rather than LC3-


However, SPFLite also accepts commands with modifiers in non-standard forms.  When the display is refreshed, commands are redisplayed in their standard form.  If you enter the command C5&, it will be redisplayed as C&5.


Retain line-command modifier


The addition of the modifier & to a line command requests that the command be retained on the line following completion of the command rather than having the command disappear when completed.   This is similar to the use of & prefix on the primary command line to retain the primary command.  


This could be used, for example, when copying a range of line commands with a pair of CC commands and you will be copying these lines to multiple scattered locations.   If the CC commands are entered as CC& commands and the destination as A then following completion of the copy, the CC& commands will remain on the selected lines awaiting placement of the next A line command for the next copy operation.  When all copies are done, the CC& can be manually blanked, or cleared with a RESET COMMAND command, usually abbreviated as RES CMD.  


Note:  Once a command is "retained" on a line using &, a simple RESET command without CMD will not clear it.


If you enter a pair of block commands, one with & and one without &, the command without & will be "promoted" to one with the & on it.  For example, if you enter CC on one line and CC& on another, the CC will be changed into CC&.


The & line command option can be used with the A, B, C, CC, H, HH, O, OO, OR, and ORR


Note: Users of recent versions of IBM ISPF should be aware that SPFLite's implementation of the & modifier is different from the ISPF K support.  The SPFLite retain modifier applies to more commands, and the semantics are slightly different.   SPFLite uses the & because SPFLite's support was not really compatible with ISPF, and for us to use K was somewhat misleading.


Forward and backward modifiers


For line commands that accept a 'number of lines' operand, the Forward modifier / and the Backward modifier \ may be used instead of a number to represent the range of lines starting from the one on which the command is placed to the beginning or end of the dataset.  Appending a / character requests all lines from the marked line Forward to the last line inclusive.  Appending a \ character requests all lines from the marked line Backward to the top of the file inclusive.


For example, entering a D\ on line 3 would request deletion of lines 1 through 3.  Entering a C/ on line 1 would select the entire file as the range to be used for whatever Primary command was entered.


Note:  Be careful using the D line command with forward or backward modifiers.  If you were to place D/ on line 1 of a file and press Enter, every line of the file will be deleted.  There are no safeguards, and no "are you sure" messages to prevent you from doing this by accident.  If you did issue a  D/ on line 1 and didn't mean to, you can either (a) immediately issue an UNDO command, or (b) issue a CANCEL command to get out of the edit session without saving the (now zero-length) file.  Bear in mind that if you issue a CANCEL command, you will lose all changes you have made to your file that were done after the last time the file was saved.  Because the UNDO action may be more helpful than the CANCEL action, be sure you have issued an appropriate SETUNDO command to enable the UNDO command to work as you need it to.  The SETUNDO status is defined in the Profile and is specific to each file type.


For marking lines using the Forward / modifier, from a specific line to the bottom, this is equivalent to using a dummy 99999 operand to mean the rest of the file.  IBM ISPF has no notation equivalent to the Backward \ modifier.


The and line command options can be used with the C, D, G, H, J, LC, M, O, OR, R, S, SC, TC, TG, TJ, TR, UC, and X


For R and TR line commands with / or \ modifiers, SPFLite converts these to an "equivalent block form" of RR and TRR, and has nothing to do with repetition factors or line lengths.  See the R / RR - Repeat Lines and TR / TRR - Trim Trailing Blanks commands for more information.


The Pad to Length line command PL will accept a special modifier of / or \.  When used in this way, a command of PL/ will pad all following lines to a minimum length of 1; PL\ will do the same to preceding lines. Placing PL/ on line 1 of a file can be used to ensure that all lines in the file have a minimum line length of 1; that is, it is a quick way to ensure there are no zero-length lines in the file.  If you need to pad to a longer length (such as 4 for example), you can use the block mode version with PLL4 on line 1 and PLL on the last line.


See PL / PLL - Pad Lines for more information.


Note: Re: foreign keyboards.  Since the / and \ characters are shifted characters on many keyboards, SPFLite will accept a period (.) in place or a / and two periods (..) in place of a \ to simplify typing.


Post-exclude and post-unexclude modifiers


The addition of one of + or - to a line command requests the lines specified by the command be excluded (-) or unexcluded (+) following the operation.  For example, using CC- instead of CC for a copy operation requests the original lines being copied be excluded following the operation, just as if the range had been marked by XX line commands.  If you used a regular CC block, and copied lines to an A- line, the original lines would not be excluded, but the new copies of those lines would be excluded.


(See also comments below about commands such as A&-).


The + and - line command options can be used with the A, AA, B, BB, C, CC, H, HH, LC, LCLC, LCC, O, OO, OR/ORR, R, RR, SC, SCSC, SCC, TC, TCTC, TCC, TG, TJ, UC, UCUC, UCC, (, ((, ), ))

Coexistence of & and +/- modifiers

The & (Retain) line command modifier, and the -/+ (post-exclude and post-unexclude) line command modifier, can coexist for the line commands A, B, C/CC, O/OO and OR/ORR.   In CC, OO and ORR the lines that begin and end the block will not themselves be excluded or unexcluded by the -/+ modifier, but only the lines within those blocks.

Why would you wish to have both a & and a + or modifier at the same time?  Consider an example where you might to gather a copy of several different blocks of lines, scattered throughout your edit file, and you want them copied to some fixed point, and you also want those lines to be initially excluded so they don't distract you.  You could set up an A&- or B&- line command as the “sink” for those CC or MM line commands.  

Note that if you wanted all of the moved or copied lines to get copied to the kept copy point, and if you used an A&- for this, each group of lines would be copied just after the A&- line, which means they would end up being just before the last group of lines copied in.  So, if you used A&- for that purpose, each successive group of lines would get copied in reverse order, much like a ‘stack'.  For most users, that will be a surprising and undesired effect.  To get the lines copied in the same order as you issue the CC or MM line commands, the copy-point should be defined as B&- instead.  A little trial and experimentation will make this point clear.  Once your copying or moving of lines is complete, just go back and remove the persistent A&- or B&- command from the line it was on.

Examples


Copy 3 lines after another and exclude the copied lines following the operation.


C3     AAA.....

000002 BBB.....

A-     CCC.....

000004 DDD.....


would result in


000001 AAA.....

000002 BBB.....

000003 CCC.....

------ ----------------------- < 000003 > -------

000007 DDD.....



Copy a line and after keep the copy command for re-use.


C&     AAA.....

000002 BBB.....

A      CCC.....

000004 DDD.....


would result in


C&     AAA.....

000002 BBB.....

000003 CCC.....

000004 AAA...

000005 DDD.....


Created with the Personal Edition of HelpNDoc: Free help authoring tool