Searches for a specified string on a line-by-line basis.
Figure 278 WHEN Structure Format
Mandatory for all ON statements except ON DATA.
Note: These parameters are available for all ON statements except ON DATA.
Table 270 WHEN Structure Parameters
Parameter |
Description |
---|---|
LINE |
Line range to be searched. |
FROM LINE |
A 3-digit number from 001 through 999. Mandatory. |
UNTIL LINE |
A 3-digit number from 001 through 999, greater than or equal to FROM LINE. Mandatory. |
COL |
Column range to be searched. |
FROM COL |
A 3-digit number from 001 through 999. Mandatory. |
UNTIL COL |
A 3-digit number from 001 to 999, greater than or equal to FROM COL plus the length of the specified string minus 1. Mandatory. |
Note: The line and column positions can also be specified using relative values (for example, the first line of the current page, plus an offset value). For more information, see Search Areas (LINE and COL Parameters). When search strings are joined by a Boolean operator (for example, .AND. or .OR.), the values specified in the COL parameter are ignored and data is extracted from the first column in the specified line range. |
|
STOP |
Determines if STOP criteria are to be specified:
|
AND/OR |
When A (And) or O (Or) is specified, an additional WHEN line is opened on the screen.
|
STRING |
The string to search for. The string can be up to 50 characters in length. If you need to use a longer identification string, specify another WHEN statement using the AND parameter. The string may contain blanks. The length of the string to be located is measured from the start of the field to the last non-blank character. To search for a string with trailing blanks, embed the string in quotes (for example, ‘TRAILING BLANKS’). STRING can contain logical comparison operators. The format of the string when it contains these operators is: STRING =.op.string STRING =.op.string .AND.op.string STRING =.op.string .OR.op.string where |
STRING (continued) |
For additional information, see "STRING Operators" below. One or more Boolean operators (.AND. and .OR.) can be used with comparison operators .GT., .LT., .GE., .LE., and .NE. When both .AND.s and .OR.s. are used in the same STRING parameter, the .AND. operators are evaluated (resolved) before the .OR. operators. Examples
Examples 8 and 9 below illustrate how the .AND. and .OR. Boolean operators are used to facilitate data extraction. |
STRING (continued) |
The comparison is performed character by character, left to right. |
Note: For comparison operators, the length of the string must not exceed the length between the FROM COLUMN and UNTIL COLUMN parameters, inclusive. |
|
STOP criteria |
LINE and COL ranges to be searched and the STOP string to search for. Formats are identical to the parameters above. Optional. |
Parent Topic |