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:
Note: A STOP-RUN command must be coded on a type 7 parameter to terminate a CA Culprit run that specifies only a dummy path.
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:

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:
Note: For more information about error status codes, see the CA IDMS Messages and Codes Guide.
|
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.
Level-n is the level number of the database record or logical record to be obtained; the default is 1. If level-n is specified, it must be separated from the record name by a comma, with no intervening spaces, and must be terminated by a space. If ARG2 is a logical record, any WHERE clause associated with that record and level number is applied when an occurrence of that record is retrieved.
ARG3 Values
ARG3 values vary depending on the value of ARG1.
Note: See the explanation of suffix notation conventions above.
The CALC key can be a concatenated field that contains one or more noncontiguous database record fields; for example, FIELDA, FIELDB, FIELDC. CA Culprit can retrieve records with concatenated CALC keys by using the CALC DB-EXIT command and a CA Culprit module that performs variable-length moves (CULLUS43). CULLUS43 must be executed for each partial CALC key except the last; the module moves a value to each partial key field. The value for ARG3 in a CALC DB-EXIT call is the name of the last partial CALC-key field.
Note: For more information about procedure module CULLUS43, see the CA Culprit for CA IDMS User Modules Guide.
The following considerations apply depending on whether the field is alphanumeric or numeric:
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:
CA Culprit converts numeric fields to the length and data type specified for field-length-vn and field-data-type-qv, respectively. To perform the conversion, the numeric field must have the following characteristics:
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.
|
Copyright © 2014 CA.
All rights reserved.
|
|