TAG - Alter Tag Status of a Range of Lines

Syntax


TAG

[ :tagname ]

{ search-string  [NF] }

[ start-column [ end-column ] ]

[ ON | OFF | TOGGLE | ASSERT | SET ]

[ FIRST | LAST | NEXT | PREV | ALL ]

[ PREFIX | SUFFIX | WORD | CHAR ]

[ line-control-range ]

[ color-selection-criteria ]

[ X | NX ]

[ U | NU ]

[ MX | DX ] 

[ TOP ]


Operands


:tagname

The tagname to be manipulated by this command.


Note:        Although operands can be entered in any order, :tagname may appear twice in the command, as the tagname to be manipulated, and as one of the standard sub-operands of a line-control-range.  In this command the first or leftmost one detected will be assumed to be the :tagname being manipulated, the second or rightmost, when two are entered, will be considered part of the line-control-range.


search-string

The search string that identifies the lines to be processed.  Note:  A search-string on a TAG command is just like a search-string on a FIND command, which means the same kinds of SPFLite string types are permitted, such as C, T, X, P and R strings.


start-column

Left column of a range (when end-column present) within which the search-string value must be found.  If no end-column operand is present, then the search-string operand must be found starting in start-col.


end-column

Right column of a range (when start-column present) within which the search-string value must be found.


NF

Requests Not-Found search mode.  It changes the search from looking for lines which contain the string to one which searches for lines which do not contain the string.


ON | OFF |

TOGGLE | ASSERT |

SET

Specifies the action

       

ON        Will set the specified tag on the line.


OFF        Will clear the specified tag on the line.


       If :tagname is specified, it will clear the tagname only if the existing tag on the line matches the one specified.


       If :tagname is NOT specified, it will clear any existing tagname on the line.


TOGGLE        If :tagname is NOT specified, it will clear any existing tagname on the line.


       If :tagname is specified, it will clear the tagname only if the existing tag on the line matches the one specified.


       If :tagname is specified, and no existing tagname is present, it will assign :tagname to the line.


ASSERT        If :tagname is specified, it will clear the tagname only if the existing tag on the line matches the one specified AND the search-string is not found in the line.


       If :tagname is NOT specified, AND the search-string is not found in the line it will clear any existing tagname on the line.


SET        SET requires a tagname and search-string.  If search string is found on the line (or, not found, if the NF option is used), then the line is assigned the tagname.


       If search string is not found on the line (or, is found, if the NF option is used), then the line is cleared of any existing tags.


       SET may thus be used to assign a tag to a line range without have to pre-clear any existing tags in a separate step.


FIRST

Starts at the top of the specified range and searches ahead to find the first occurrence of search-string.


LAST

Starts at the bottom of the specified range and searches backward to find the last occurrence of search-string.


NEXT

Starts at the first position after the current cursor location and searches ahead to find the next occurrence of search-string.  NEXT is the default.


PREV

Starts at the current cursor location and searches backward to find the previous occurrence of search-string.


ALL

Starts at the top of the data and searches ahead to find all occurrences of search-string.


PREFIX

Locates search-string at the beginning of a word.


SUFFIX

Locates search-string at the end of a word.


WORD

Locates search-string when it is delimited on both sides by blanks or other non-alphanumeric characters


CHAR

.Locates search-string as-is, regardless of what precedes or follows it.


line-control-range

The range of lines which are to be processed by the command.  Line control ranges provide a powerful tool to customize the range of lines to be processed.   The full syntax and allowable operands which make up a line control range are discussed in "Line Control Range Specification".  Refer to that section of the documentation for details.


color-selection-criteria

A request for selection based on the highlight color of the search-string. Color requests provide another powerful tool to control search selection.   The full syntax and allowable operands which make up a color-selection-criteria  are discussed in "Color Selection Criteria Specification".   Refer to that section of the documentation for details.


X | NX

Specifies a subset of the line range to be processed.   X requests only excluded lines are to be examined, NX requests only non-excluded lines are to be examined.   If neither X or NX are specified, all lines in the range will be examined.


U | NU

Specifies a subset of the line range to be processed.   U requests only User lines are to be processed, NU requests only non-User lines are to be processed.   If neither U or NU are specified, all lines in the range will be processed.


MX

MX requests that all lines which do contain search-string be excluded from the display following command processing.  MX = Make excluded.


DX

DX requests that lines which do contain search-string, which, if excluded, would normally be made visible, be left in their excluded status.  DX = Don't change excluded status


TOP

Normally, at the completion of the command, the first, or only, line processed is highlighted (if it is on the current screen) or the screen is scrolled to the 2nd screen line (as ISPF does) if the line is not on the current screen.  If TOP is coded, then the line is always positioned as the top line of the screen, regardless of its current location.


Abbreviations and Aliases

PREFIX can also be spelled as PRE or PFX

SUFFIX can also be spelled as SUF or SFX

WORDS can also be spelled as WORD

CHARS can also be spelled as CHAR

TOGGLE can also be spelled as TOG

Description


The TAG command is used to affect tags based on a search string.  TAG is basically modeled on the FIND command with some modifications.


The search arguments are used to locate specific lines, and the :tagname and ON/OFF/TOGGLE operands to specify how a tag is to be added or removed from the line.


Examples


TAG :BL ON "      " 1 6 ALL


This will locate all lines containing blanks in columns 1 to 6 and set the tagname of :BL on those lines.



TAG OFF ALL .FROM .TO


This will clear all tags from the lines defined by the range of lines from .FROM to .TO inclusive.


TAG :A ON "A" 10 ALL

TAG :BOTH ON "B" 20 ALL :A


These two commands will first tag all lines with an "A" in column 10 with the tag :A. The second command will then examine all lines tagged with :A  and those with a "B" in column 20 will be tagged with tag :BOTH.


See Working with Line Tags for more information.


Created with the Personal Edition of HelpNDoc: Full-featured Kindle eBooks generator