Previous Topic: About DB-EXITNext Topic: Examples


Usage Notes

Where to Code It

Records that are to be retrieved by using the DB-EXIT facility appear on dummy PATH parameters. Dummy PATH parameters specify a primary path id of two hyphens (--). The following considerations apply to dummy PATH parameters:

Automatic Record Retrieval

The DB-EXIT facility can also be used to retrieve records that appear on automatic retrieval paths. When this occurs, currency for the automatic retrieval path can be affected as follows:

Each DB-EXIT call requires from one to six argument values. This table lists the arguments required for each particular DB-EXIT call.

Values of Arguments Associated with DB-EXIT:

Values of Arguments

Notes:

* Code a literal value in quotes or refer to an alphanumeric field equal to the literal.

# Literal values must end in a space.

The following suffix conventions are used for variable items in the above table. A suffix comprises all entries appearing after the last hyphen in a variable item; multiple entries indicate acceptable alternatives.

Notation

Meaning

-a

User-supplied value

-n

Numeric literal

-q

Value enclosed in quotation marks

-v

Variable data field containing an appropriate value or targeted to receive data

-x

Hexadecimal literal denoted as X'variable'

When CA Culprit processes a DB-EXIT call, it sets values in the reserved input buffer fields, IDMS-STATUS and LR-STATUS, as follows:

Code

Description

0000

No run-time errors occurred.

0326

Record was not found by using a CALC key, sort key, or index key.

0307

Record was not returned due to an end-of-set (or an end-of-area) condition, which results from an attempt to find the next or prior record in the set (or area).

Note: It is the user's responsibility to check IDMS-STATUS and LR-STATUS after each DB-EXIT call and to specify appropriate action in the procedure logic, as shown in the following example:

017010 IDMS-STATUS EQ '0307' DROP

Each DB-EXIT argument is described below:

ARG1

ARG1 is an alphanumeric literal or work field that determines the type of CA IDMS/DB retrieval command issued. The following table lists the possible values for ARG1 and associated commands, except for SET-VALUE.

When CA Culprit encounters SET-VALUE, it does not access the database. SET-VALUE sets a value in an input buffer field. This value is generally referenced in a WHERE clause for a logical record obtained in a subsequent LR-FIRST or LR-NEXT DB-EXIT call.

If SET-VALUE is used to set a value in a logical record, the SET-VALUE call must be performed before each LR-FIRST or LR-NEXT call. Otherwise, the DBA-specified retrieval path may cause the value to be overlayed.

ARG1

Retrieval Command Generated

DBKEY

OBTAIN database-record-name DBKEY IS dbkey-field-name

FORMAT-6

OBTAIN database-record-name WITHIN ix-set-name USING key-value-va

CALC

OBTAIN CALC database-record-name

DUP

OBTAIN DUP database-record-name (This command must be preceded by a CALC DB-EXIT call.)

OWNER

OBTAIN OWNER WITHIN set-name (Database-record-name in ARG2 is the owner record.)

NEXT

OBTAIN NEXT database-record-name WITHIN set-name

PRIOR

OBTAIN PRIOR database-record-name WITHIN set-name

FIRST

OBTAIN FIRST database-record-name WITHIN set-name

LAST

OBTAIN LAST database-record-name WITHIN set-name

NTH

OBTAIN occurrence-vn database-record-name WITHIN set-name

NEXT-AREA

OBTAIN NEXT database-record-name WITHIN area-name

PRIOR-AREA

OBTAIN PRIOR database-record-name WITHIN area-name

FIRST-AREA

OBTAIN FIRST database-record-name WITHIN area-name

LAST-AREA

OBTAIN LAST database-record-name WITHIN area-name

NTH-AREA

OBTAIN occurrence-vn database-record-name WITHIN area-name

IF-MEMBER

FIND CURRENT database-record-name IF set-name MEMBER

LR-FIRST

OBTAIN FIRST logical-record-name WHERE lr-boolean-expression

LR-NEXT

OBTAIN NEXT logical-record-name WHERE lr-boolean-expression

ARG2 Values

ARG2 values vary depending on the value of ARG1.

Note: See the explanation of suffix notation conventions above.

ARG3 Values

ARG3 values vary depending on the value of ARG1.

Note: See the explanation of suffix notation conventions above.

ARG4 Values

ARG4 values vary depending on the value of ARG1:

Specified Data Type

 

 

Maximum Field

Data Type

After Conversion

' '

Alphanumeric

256

'1'

Binary

4

'2'

Zoned

31

'3'

Packed signed

16

Note: Data types associated with a field specified in a SET-VALUE call must be enclosed in single quotation marks.

ARG5 Values

ARG5 values vary depending on the value of ARG1:

ARG6

ARG6 is the last argument when ARG1 specifies FORMAT-6. ARG6 is assigned key-length-vn, which is a numeric literal or work field that contains the length of the indexed field, as defined in IDD, for the set that contains the record to be accessed.