Window
A window is used to limit the extent of string matching. Normally, specifying a string in a rangelist implies processing all lines where the string occurs anywhere within the line, regardless of starting column and surrounding context.
With a window, string matching can be restricted to a specified column window (example: 10/30 means column 10 through column 30). Shorthand: (1) = (1/1), ([/30) = (first column/30), and (30/]) = (30/last column). Use a (1/132) window with "TEXT" files to reduce the record width to 132 columns. The column numbers begin with 7 in COBOL and 1 in the other languages.
The complete syntax for a window is: ( [column/column] [ keyword]...)
The window keywords are
Window keyword | Default |
(SMART | NOSMART) | NOSMART |
(UPSHIFT | NOUPSHIFT ) | NOUPSHIFT |
(PATTERN | NOPATTERN) | NOPATTERN |
(MATCH | NOMATCH ) | MATCH |
(REGEXP | NOREGEXP ) | NOREGEXP |
A single window may specify multiple options separated by spaces or commas and following the column range, but if Pattern is included the Smart-NoSmart option is ignored. That is, (Upshift Pattern) makes sense, but (NoSmart Pattern) does not. The options are independent and setting or resetting one does not change the others.
With the Smart keyword, Qedit matches a string only if the string is preceded by a "special" character, or the start of the window, and is followed by a "special" character, or the end of the window. In SPL, the apostrophe is not "special". In COBOL, the hyphen is not "special". In Pascal, the underline is not "special". In FORTRAN, embedded spaces are allowed.
When you specify Nomatch, Qedit selects the lines that do not contain the string. The default of course is MATCH to select lines that do contain the string.
With the Upshift window keyword, Qedit ignores the case of letters in deciding whether to find a match.
Pattern means that the string in the window is to be treated as a pattern to be matched (i.e., "@UPD@MASTER@"). It may be combined with Upshift.
Regexp means that the string in the window is to be treated as a regular expression to be matched (i.e., "UPD.*MASTER"). It may be combined with Upshift.
Here are some example uses of windows:
/list ".begin" (1/10 upshift)
{.begin in 1st 10 cols}
/list "@begin@end@" (pattern upshift)
{...begin...end...}
/list "^begin.*end$" (regexp noup)
{begin...end}
A window can be specified permanently with the Set Window command, or temporarily after any string in a rangelist. For example:
/set window (smart)
{use Smart for all string searches}
/list "sum"
{defaults to Smart searching}
/l "Sam" (upshift)
{upshift in this command only}
![Home](rnd2hm_s.gif)
![Previous](rnd2pr_s.gif)
![Next](rnd2nx_s.gif)