TAGX macro to insert tag before/after selected word

Macro name. TAGX Edit macro TAGX
users. HTML, DCF, SCRIPT/VS authors Author: David McRitchie
type. Edit Macro resides in SYS1.TSOCLIST for use with TSO
Edit Macro resides in d:\spfmacro  for use with SPF/PC
TAGX Place tags before and after identified X or NX line groupings.
Related GMLNXNXPINXUNGML

TAGX is an edit macro that can be used to quickly add a beginning and ending GML, HTML or other tags of your choice before and after selected lines. Groups of lines are created beforehand by being either DISPLAYED (NX) or EXCLUDED (X) lines.

TAGX can be a very useful tool when doing documentation or when preparing data within a PDS member.


ISREDIT  TAGX  [lptr-range | ENTIRE]  [NX | X]  <tag1>   <tag2>

lptr-range A pair of line pointers can be used to restrict the lines under consideration  The line pointers must be a labels.  Specifying one line pointer is invalid.  The default, if not specified, is .ZFIRST and .ZLAST, indicating that all lines are to be processed.
ENTIREwill be substituted by .ZFIRST .ZLAST
NX Lines that are NOT EXCLUDED from the display will as a group be preceded by the chosen beginning tag (%B% is the default), and followed by a chosen ending tag (%A% is the default) after the last line in each group of NX lines.
X Lines that are EXCLUDED from the display will as a group be preceded by the chosen beginning tag (%B% is the default), and followed by a chosen ending tag (%A% is the default) after the last line in each group of (excluded) X lines.

Examples:

       TAGX
       TAGX     :gt15. :egt15.
       TAGX     .A .B
       TAGX     .A .B  :italic. :eitalic.

       TAGX      
       TAGX     .A .B   
 EDIT---- xxxx.xxx.TEXT(EXAMPLE1) - 01.00 -COLUMNS 001 080
 COMMAND ===> TAGX X                                            SCROLL ===> CSR
****** *************************** TOP OF DATA *****************************
000001 The line which have been excluded from the display might be
000002 JCL, for which we want these lines to appear within :gt15.
000003 and :egt15. tags.
- - -  - - - - - - - - - - - - - - - - - - - - - - 08 LINES(S) NOT DISPLAYED
000011 Later on in the document there may be some more material
000012 that must also appear between :gt15. and :egt15. tags.
****** ************************ BOTTOM OF DATA *****************************

 EDIT---- xxxx.xxxxx.TEXT(EXAMPLE1) - 01.00 -                   COLUMNS 001 080
 COMMAND ===>                                                   SCROLL ===> CSR
****** *************************** TOP OF DATA *****************************
=NOTE= 19:07:26 TAGX x :gt15. :egt15.
=NOTE= :GT15. WILL BE INSERTED BEFORE X LINE GROUPS WITHIN RANGE
=NOTE= :EGT15. WILL BE INSERTED AFTER X LINE GROUPS WITHIN RANGE
000001 The line which have been excluded from the display might be
000002 JCL, for which we want these lines to appear within :gt15.
000003 and :egt15. tags.
000004 :gt15.
- - -  - - - - - - - - - - - - - - - - - - - - - - 08 LINES(S) NOT DISPLAYED
000012 :egt15.
000013 Later on in the document there may be some more material
000014 that must also appear between :gt15. and :egt15. tags.
000015 :gt15.
- - -  - - - - - - - - - - - - - - - - - - - - - - 10 LINES(S) NOT DISPLAYED
000025 :egt15.
****** ************************ BOTTOM OF DATA *****************************

Example of use

The following example shows the major portion of the conversion of  the  content
of SYS1.HELP(SYSHELP) into a SCRIPT text member.

    COPY                                      shiftnx left 3 validnx
    /* copy SYS1.HELP(SYSHELP)                c all (( 1 :h4
    /*    into an empty member                c all ( 1 :h3
    /* for ungml please ...                   x 1 p'ª' all
    /*  label  .zfirst  as  .a                tagx :gt15. :egt15.
    /*  label  .zlast   as  .b                fixquote
    ungml                                     period
Internal Aspects:    [TSO code]  [SPF/PC code should be same as TSO]
Internal aspects describes how the edit macro functions.  This information is particularly useful to someone who may need to design a similarly functiona edit macro.  It may also provide additional insight to the user.
  1. Checks that no labels or exactly two labels appear in operand list.
  2. Verification is made that both X and NX lines occur within range.
  3. A loop will add a line before the first NX line and after the the last NX line in each group.
  4. If X is in use the previous item will apply to X line groupings instead of NX line groupings.
  5. When the loop fails to identify any more items, done processing will check the display status of the last line within the range and may accordingly add an ending tag after it if it is of the same status as the request.  The ending line pointer will be adjusted downward if a new line was added.  No adjustment will be made if .ZLAST is the last line identifier for the range.

Comments and Related Information

You are visitor  ctr since count started Jan 15, 1998.

Please send your comments concerning my pages or materials to:  David using send email comments

Disclaimer and site usage:  Material at The REXX Macros Toolbox is available without warranty of any kind.  Redistribution of source, coding and documentation other than from this site is prohibited.

Copyright © 1995 - 2006, F. David McRitchie, All Rights Reserved