|
Back To LeighWeb Mainframe Utilities Page
View the module associated with this documentation
This is an edit macro which allows the user to insert a line containing a given
string (e.g. "XXX") after every line in which another (or the same) given
string (e.g. "ZZZ") already exists. An example follows :
COMMAND ===> a %%% @@
File Before : File After :
000100 abcdefg% 000100 abcdefg%
000200 %%% 000200 %%%
000300 rrr%%% 000300 @@
"""""" 000400 rrr%%%
"""""" 000500 @@
In this example, a line with string "@@" was inserted after each line
containing "%%%". If either string contains special characters (space, etc.)
it should be enclosed in quotes.
It is possible to add additional ISPF edit parameters that you might find using
a FIND or CHANGE command. These parameters serve to limit the scope of lines
which the edit macro operates against to find lines which match the "string1"
criteria. These can include any valid combination of : "X/NX", column ranges,
and edit labels (system or user defined, e.g. ".abc", ".zcsr", etc.) These
additional parameters must be specified after "string2" and are "space
delimited".
"String2" may also be specified as a line or block of lines already in the
file; i.e. after every line with an occurance of "string1", you may insert a
line or block of lines in the file. To accomplish this, you must mark the
lines with a line command of "Z" or a block line command pair of "ZZ" and "ZZ"
on the first and last lines of the block of lines. You then specify the
reserved string "ZLINE" instead of a "string2".
The "A" edit macro also can make use of a special "counter" variable in
"string2" or a marked "zline". This variable is called "XCOUNT". If the
string XCOUNT is found anywhere in "string2" or a marked "zline", it will be
replaced with the current incremental count of "string1" lines which have been
found.
Let's look at some examples of these additional features:
COMMAND ===> a %%% @@ nx (processing only non-excluded lines)
File Before : File After :
000100 abcdefg% 000100 abcdefg%
000200 %%% 000200 %%%
- - - - - - 000300 @@
"""""" 000400 rrr%%%
""""""
COMMAND ===> a %%% @xcount@ (using XCOUNT in "string2")
File Before : File After :
000100 abcdefg% 000100 abcdefg%
000200 %%% 000200 %%%
000300 rrr%%% 000300 @1@
"""""" 000400 rrr%%%
"""""" 000500 @2@
COMMAND ===> a %%% zline .a .b (using XCOUNT, blocked zlines,
File Before : File After : edit labels)
zz0100 1xcount 000100 1xcount
000200 22 000200 22
zz0300 333 000300 333
.a0400 wwwds 000400 wwwds
000500 %%% xxx 000500 %%% xxx
000600 abcdefg% 000100 11
000700 %%% 000200 22
.b0800 rrr%%% 000300 333
"""""" 000400 abcdefg%
"""""" 000500 %%%
000100 12
000200 22
000300 333
000500 rrr%%%
000100 13
000200 22
000300 333
|
|