Previous Topic: FIND / GET PHYSICAL SEQUENTIALNext Topic: FIND / GET Using Storage Key


FIND / GET OWNER WITHIN SET

FIND/GET OWNER WITHIN SET retrieves the owner record of a database set occurrence. For all set membership options other than mandatory automatic (that is, mandatory manual, optional manual, and optional automatic), an occurrence of a member record type need not be a member of a set occurrence unless the parameter BELONGING TO is specified.

Access mode:The syntax below is invalid when the access switch is set to IDMS.

FIND locates database records but does not retrieve them into the report file. GET locates database records and does retrieve them into the report file.

Syntax:

►►─┬─ FINd ─┬─┬─────────┬─────────────────────────────────────────────────────►
   └─ GET ──┘ └─ OWNer ─┘

 ►─┬───────────────────────────────────────────────────────┬─ record ─────────►
   └─┬────────────┬─ owner-record-name ─┬────────────────┬─┘
     └─ view-id. ─┘                     └─ (field-list) ─┘

 ►─┬────────────────────────────────────────────────────────────────┬─────────►
   └─ BELonging to this ─┬────────────┬─ member-record-name record ─┘
                         └─ view-id. ─┘

 ►─┬───────────────────────┬──────────────────────────────────────────────────►
   └─ withIN set-name set ─┘

 ►─┬──────────────────┬───────────────────────────────────────────────────────►◄
   └─ WHEre criteria ─┘
►►─── REPeat with ─┬─────────┬────────────────────────────────────────────────►
                   └─ OWNer ─┘

 ►─┬───────────────────────────────────────────────────────┬─ record ─────────►
   └─┬────────────┬─ owner-record-name ─┬────────────────┬─┘
     └─ view-id. ─┘                     └─ (field-list) ─┘

 ►─┬──────────────────┬───────────────────────────────────────────────────────►◄
   └─ WHEre criteria ─┘

Parameters:

OWNER

Specifies the retrieval of the owner record. This parameter is required if owner-record-name is not specified.

view-id

The qualifying ID for the record or logical record name. Use view-id when you are signed on to multiple subschemas. View-id refers to the subschema where the record (or logical record) can be found.

owner-record-name

Specifies the owner record type in the set. Owner-record-name must be used if the OWNER keyword is not specified. If member-record-name and set-name are not specified, the owner record type must be the owner of only one set type in the subschema view.

BELONGING TO THIS member-record-name

Retrieves the owner record of the current member record type. If owner-record-name is not used, the member record type must participate as member in only one set in the subschema view. If both member and owner record types are named, the specified records must participate as member and owner within only one set in the subschema view.

WITHIN set-name

Specifies the owner-record-name set and retrieves the owner occurrence of that set type. You must use set-name if the owner record participates as owner in more than one set in the subschema view. Using set-name may be required to resolve ambiguity.

WHERE

Specifies criteria for selecting a record occurrence. If you specify a WHERE clause, you must also specify the owner-record-name.

REPEAT

Duplicates an immediately preceding FIND/GET OWNER WITHIN SET (or REPEAT for FIND/GET OWNER WITHIN SET) command.

OWNER= owner-record-name

Specifies retrieval of the owner record type.

WHERE

Specifies criteria used in selecting record occurrences.

Examples:

The following examples illustrate the use of FIND/GET OWNER WITHIN SET and associated REPEAT commands based on the set occurrence diagram shown below:

Illustrate the use of FIND/GET OWNER WITHIN SET and associated REPEAT commands based on the set occurrence diagram

Get First Physical

GET enters the database and establishes currency:

get first phys office (office-code-0450
 office-phone-0450(1)) where calckey = 002

 OFFICE
    OFFICE-DBKEY     :    0/5007132:1
   OFFICE-CODE-0450 : '002'
   OFFICE-PHONE-0450(1)    9562377
 END OF RECORD

Repeat Get

A REPEAT command retrieves the next OFFICE record in the in the database:

repeat with next

 OFFICE
    OFFICE-DBKEY     :    0/5007142:1
   OFFICE-CODE-0450 : '003'
   OFFICE-PHONE-0450(1)    3297700
 END OF RECORD

For more information:

Global Syntax