NEXCLUDE - Exclude Where String is Not Found

Syntax


NEXCLUDE

search-string

[ start-column [ end-column ] ]

[ FIRST | LAST | NEXT | PREV | ALL ]

[ PREFIX | SUFFIX | WORD | CHAR ]

[ line-control-range ]

[ U | NU ]

[ color-selection-criteria ]

[ TOP ]

               

Operands


search-string

The search string that identifies the lines whose exclusion status will remain unchanged. Lines where this string is not found will be excluded


start-column


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


end-column

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


FIRST

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


LAST

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


NEXT

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


PREV

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


ALL

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


PREFIX

Looks for search-string at the beginning of a word.


WORD

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


CHAR

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


SUFFIX

Looks for search-string at the end of a word.


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.


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.


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.


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

NEXCLUDE can also be spelled as NX

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

Description


You can use the NEXCLUDE command to look for a search string, and exclude (conceal) the lines that do not contain the string from the display. Note that the normal selection options of X and NX are not allowed, since NEXCLUDE operates only on non-excluded lines.  See Working with Excluded Lines for more information.


To exclude the next non-excluded line that does not contain the letters ELSE without specifying any other qualifications:


On the Command line, type:  


NEXCLUDE ELSE


Press Enter. Since no other qualifications were specified, the letters ELSE can be:  



To exclude the next line that does not contains the letters ELSE, but only if the letters are uppercase:

 

On the Command line, type:


NEXCLUDE C"ELSE"


and press Enter.


This type of exclusion is called a character string exclusion (note the C that precedes the search string) because it searches for the letters ELSE only if the letters are found in uppercase. However, since no other qualifications were specified, the exclusion occurs no matter where the letters are found on a non-excluded line, as outlined in the previous list.


Excluding all-blank lines with NEXCLUDE


It is not possible to use EXCLUDE to exclude all blank lines.  The reason is that a "blank" might have a variable number of space characters, or in a zero-length line there are no space characters at all.  So, there is no specific string you could "search" for that would always be there.  SPFLite's string search engine cannot find strings of zero length, because there is literally nothing to find.


The easiest way to exclude blank lines is to use NEXCLUDE instead of EXCLUDE.  Instead of trying to exclude "blank" lines, you exclude all lines which are not non-blank lines.  


People sometimes have issues with this, since it's like a "double negative", and not intuitive.  Once you observe it in action, you'll see that it makes sense.


You can find non-blank lines by finding lines that contain  P'^' or  P'¬', which match non-blank characters.  So, to exclude all blank lines, you exclude all lines which don't contain any non-blanks, like this:


NEXCLUDE P'^' ALL


Be sure to specify  NEXCLUDE  (or NX) and not  EXCLUDE.  If you say  EXCLUDE P'^' ALL, you will exclude every line in the file that is not blank.


If you don't care for the "double negative" appearance of this command, you can define a SET variable that's easier to remember.  Let's say we call this variable XBLANK.  You define it like this (the outer quotes are required):


       SET XBLANK = "NX P'^'"


Then when you want to exclude all blank lines, you would do it like this:


       =XBLANK ALL

You can create a command alias so that the leading = sign is not needed.  To do this, define the XBLANK command like this:


       SET ALIAS.XBLANK = "NX P'^'"


Then when you want to exclude all blank lines, you would do it like this:


       XBLANK ALL


Created with the Personal Edition of HelpNDoc: Create iPhone web-based documentation