HELPLIB.HLB  —  COBOL  PROCEDURE_DIVISION, FIND
  The FIND statement locates a specific record in the database and
  establishes it as the current record of the run unit.

  The FIND ALL statement locates zero or more records in the database and
  inserts them into the named keeplist.

1  –  1format

  The FIND statement locates a specific record in the database and
  establishes it as the current record of the run unit.

  Format 1 -

   FIND database-record [ FOR UPDATE ]

      [          [{| REALM                    |}]         ]
      [RETAINING [{| RECORD                   |}] CURRENCY]
      [          [{| { SET [ set-name ] ... } |}]         ]
      [          [{| { { set-name } ...     } |}]         ]

      [{ [ AT END stment ]  [ NOT AT END stment ]      } ]
      [{ [ ON ERROR stment ]  [ NOT ON ERROR stment ]  } ]

      [ END-FIND ]

1.1  –  database-record

  represents a record selection expression.  References are made to a
  record in the database according to the rules for Record Selection
  Expressions.

1.2  –  set-name

  names a subschema set type.

1.3  –  stment

  is an imperative statement.

2  –  2format ALL

  The FIND ALL statement locates zero or more records in the database and
  inserts them into the named keeplist.

  Format 2 -

   FIND ALL keeplist-name [ record-name ] [ WITHIN { realm-name } ]
                                          [        { set-name   } ]

      [ USING { rec-key } ... ] [ FOR UPDATE ]
      [ WHERE { bool-exp }    ]

      [{ [ AT END stment ]  [ NOT AT END stment ]      } ]
      [{ [ ON ERROR stment ]  [ NOT ON ERROR stment ]  } ]

      [ END-FIND ]

2.1  –  keeplist-name

  names a keeplist in the Sub-Schema Section.

2.2  –  record-name

  is a subschema record name.

2.3  –  realm-name

  is a subschema realm name.

2.4  –  set-name

  is a subschema set name.

2.5  –  rec-key

  is a key data item within the subschema record occurrence.  The same
  rec-key can appear only once in a given USING phrase.

2.6  –  bool-exp

  is a conditional expression that involves data items of the object
  record.  It is used to specify additional requirements of a
  qualifying record.

2.7  –  stment

  is an imperative statement.
Close Help