KEEP

Keeps (retains) some components in a result set while discarding others.

Syntax

KEEP «component»

Parameters

component

The name of a component found among the objects declared in a set specification. Any number of components can be specified, provided they appear among the declared objects.

Comments

In certain instances, you want to select records from several objects based on their relationships, but to keep data from only some of those objects. The KEEP subcommand enables you to specify the components whose data is to be kept in the result set.

The specified components of the set specification are kept. Components not kept are discarded, and duplicate records are removed from the set being specified.

Example

find all Employees WorkIn Department \
  where LastName = "Jones" keep Departments

The department information is kept; all other components are discarded. If the KEEP subcommand were omitted, department information would be repeated for any department where more than one employee named Jones works.

 

Related Topics