Previous Topic: Operand DefinitionsNext Topic: FIRST Command


Components Used with the FIND Command

The FIND command applies to the components listed below. Default column boundaries for each component are also listed.

 

Column Edited

Column Boundaries

Member

Data area

1‑72

Report

 

 

Detail

Field name

1‑25

Heading

Field name

1‑56

Column

Field name

1‑56

Program

 

 

Procedure

Data area

1‑72

Parameter

Field name

1‑19

Working data

Field name

1‑19

Dataview

 

 

Field

Field name

1‑19

Key (VSAM)

Field name

1‑32

Plan

 

 

DBRM

DBRM

1‑8

Resource

Program name

1‑8

Specifying lines or columns are optional. You can specify line and column clauses in either order. For example,

FIND /DISPANEL/ LINES 16500 17500 COLUMNS 10 40

or,

FIND /DISPANEL/ COLUMNS 10 40 LINES 16500 17500

If you use the n operand to search for all occurrences or any number of occurrences greater than 1, FIND displays only those lines containing the string. You can use the following commands with this display:

FIND, FIRST, NEXT, LAST, or PREVIOUS (where n > 1)
IGNORE
SCROLL

The use of any command other than those listed above replaces this display with a display showing the lines of the data in sequence.

Example

The FIND command in this example is looking for the string DISPANEL.NUMBER in a specific range.

=> FIND /DISPANEL.NUMBER/ LINES 16800 17500 ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.... IDEAL: PROCEDURE DEFINITION PGM CURRENT (001) TEST SYS: DEM FILL-IN ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..Command ==================================== T O P ============================ ======= <<PROCESS_PANEL>> PROC 016500 TRANSMIT DISPANEL 016600 SELECT 016700 WHEN $ENTER-KEY 016800 FOR EMPLOYEE 016900 WHERE EMPLOYEE.NUMBER = DISPANEL.NUMBER 017000 MOVE DISPANEL TO EMPLOYEE BY NAME 017100 WHEN NONE 017200 SET DISPANEL.MSG = 'EMPLOYEE DELETED' 017300 SET ATTR HIGHLIGHT TEMP ON DISPANEL.NUMBER 017400 ENDFOR 017500

The line with the string is found and positioned at the top of the region, as shown below, with subsequent lines filling the region. The find operation is then continued by specifying the command FIND with no string or by pressing F9/21 (FIND while in editing mode). The same LINE and COLUMN range is also assumed.

=>FIND ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.... IDEAL: PROCEDURE DEFINITION PGM CURRENT (001) TEST SYS: DEM FILL-IN ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..Command ====================================== T O P ========================== ======= WHERE EMPLOYEE.NUMBER = DISPANEL.NUMBER 017000 MOVE DISPANEL TO EMPLOYEE BY NAME 017100 WHEN NONE 017200 SET DISPANEL.MSG = 'EMPLOYEE DELETED' 017300 SET ATTR HIGHLIGHT TEMP ON DISPANEL.NUMBER 017400 ENDFOR 017500

The find operation continues and the line containing the next occurrence of the string originally specified in the FIND command is positioned to the top of the region.

....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.... IDEAL: PROCEDURE DEFINITION PGM CURRENT (001) TEST SYS: DEM FILL-IN ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..Command ====================================== T O P ========================== ======= SET ATTR HIGHLIGHT TEMP ON DISPANEL.NUMBER 017400 ENDFOR 017500

The FIND command in the following example uses the operands ALL and EXCLUDE to search for all lines that do not contain the string EMPLOYEE.

=> FIND ALL EXCLUDE /EMPLOYEE/ ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.... IDEAL: PROCEDURE DEFINITION PGM CRTEST (001) TEST SYS: DEM FILL-IN ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..Command ================================ T O P ================================= ====== SELECT 000100 WHEN $ENTER-KEY 000200 FOR EMPLOYEE 000300 WHERE EMPLOYEE.NUMBER = DISPLANEL.NUMBER 000400 MOVE DISPANEL TO EMPLOYEE BY NAME 000500 WHEN NONE 000600 SET DISPANEL.MSG = 'EMPLOYEE DELETED' 000700 SET ATTR HIGHLIGHT TEMP ON DISPANEL.NUMBER 000800 ENDFOR 000900 SET NEXT_PANEL = 'DISPANEL' 001000 WHEN $PF11 001100 SET NEXT_PANEL = 'EMPMENU' 001200 WHEN $PF12 001300 DO TERMINATE_SES 001400 WHEN $ENTER-KEY 001500 FOR EMPLOYEE 001600 WHERE EMPLOYEE.NUMBER = DISPLANEL.NUMBER 001700

FIND displays all lines that do not contain the string. The status line shows the compare rule EXCL and the search string /EMPLOYEE/.

=>

....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.... IDEAL: PROCEDURE DEFINITION PGM CRTEST (001) TEST SYS: $ID FILL-IN EXCL /EMPLOYEE/ ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..Command SELECT 000100 WHEN $ENTER-KEY 000200 WHEN NONE 000600 SET ATTR HIGHLIGHT TEMP ON DISPANEL.NUMBER 000800 ENDFOR 000900 SET NEXT_PANEL = 'DISPANEL' 001000 WHEN $PF11 001100 SET NEXT_PANEL = 'EMPMENU' 001200 WHEN $PF12 001300 DO TERMINATE_SES 001400 WHEN $ENTER-KEY 001500