Go to LeighWeb Home Page            

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") before every line in which another (or the same) given
 string (e.g. "ZZZ") already exists.  An example follows :

 COMMAND ===> b %%% @@
 File Before :    File After :
 000100 abcdefg%  000100 abcdefg%
 000200 %%%       000200 @@
 000300 rrr%%%    000300 %%%
 """"""           000400 @@
 """"""           000500 rrr%%%

 In this example, a line with string "@@" was inserted before 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. before 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 "B" 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 ===> b %%% @@ nx                   (processing only non-excluded lines)
 File Before :    File After :
 000100 abcdefg%  000100 abcdefg%
 000200 %%%       000200 @@
 - - -  -  -  -   000300 %%%
 """"""           - - -  -  -  -
 """"""

 COMMAND ===> b %%% @xcount@                (using XCOUNT in "string2")
 File Before :    File After :
 000100 abcdefg%  000100 abcdefg%
 000200 %%%       000200 @1@
 000300 rrr%%%    000300 %%%
 """"""           000400 @2@
 """"""           000500 rrr%%%

 COMMAND ===> b %%% 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 11
 000600 abcdefg%  000100 22
 000700 %%%       000200 333
 .b0800 rrr%%%    000300 %%% xxx
 """"""           000400 abcdefg%
 """"""           000500 12
                  000100 22
                  000200 333
                  000300 %%%
                  000500 13
                  000100 22
                  000200 333
                  000300 rrr%%%