Making Full Use of :REDO Functionality

If you are like me, many years ago someone showed you how to use :REDO to edit the last command you entered and execute it again. They showed you how to use the directives Replace characters, Insert characters, and Delete characters, and it seemed sufficient. Then the command history stack was added along with the :LISTREDO and :DO commands, and working with the Command Interpreter (CI) became much easier. But there have been great improvements to the functionality of the :REDO command that many users don’t know about. This article will show you these enhancements and help make you more efficient and productive.

“D”elete all characters up to a but not including a specified delimiter. The delimiter is the next character you type after the letter “D” and must be non-alphabetic. D;” will delete all characters from the cursor until it reaches a semi-colon. Because the delimiter itself is not removed it helps to add an extra “D” after the delimiter if you want to remove it as well. Example:

:redo 19
print file.group.account;start=100;end=200
d;d
print file.group.account;end=200

” > ” (greater than symbol) positions the cursor at the end of the line for the editing. Normally you space to underneath the character(s) in the command to be changed, and use R, I, or D to replace, insert, or delete characters. Often times the change you want occurs at the end of the line. By placing a “>” in the first position of the change you direct the CI make the changes at the end of the line, thus saving eliminating pressing the space bar until the cursor reaches the end. This can be used in conjunction with other commands like “D” to delete or can be used to just add characters at the end. Example:


:redo run
run program.group.account;parm=105
>dd
run program.group.account;parm=1
>;xl="XL.PUB.ACCOUNT"
run program.group.account;parm=1;xl="XL.PUB.ACCOUNT"

“^” (carat) and V/v (letter “V”) to upshift and downshift characters respectively. With Posix and HFS file, case sensitivity in file names makes a big difference. Another place where upper and lower case makes a difference is with labeled tapes. The carat and V directives modify the case of characters instead of typing over them in the proper case.


:redo file
file t;label=backup;DEV=DDSII
^^^^^^
file t;label=BACKUP;DEV=DDSII
vvv
file t;label=BACKUP;dev=DDSII

You can also combine the command with a delimiter to change the case of all characters up to a delmiter. This example downshifts all characters leading up to the next “/”.


:REDO PRINT
print /DIRNAME/FILE.NAME;PAGE=0
v/
print /dirname/FILE.NAME;PAGE=0

“C”hange command changes all occurrences of one string to another. This is my favorite feature of all. Change works as a global replace within a command. The syntax is C/old/new as in this example:


:redo
copy ap100.source,ap100.oldsrc
c/100/105
copy ap105.source,ap105.oldsrc

While at first some of these options may seem cumbersome, in time they become second nature, increasing your productivity while at the same time reducing mistakes. I highly encourage you to try them out. For more detailed explanations on these features, enter :HELP REDO on any MPE/iX system.