Sample CULPRIT code to read path and non-path related records
search cancel

Sample CULPRIT code to read path and non-path related records

book

Article ID: 20992

calendar_today

Updated On:

Products

IDMS IDMS - Database

Issue/Introduction

It is possible to retrieve record occurrences that do not participate in defined paths, as well as path-related records, by calling or branching to the DB-EXIT facility in type 7 logic.

Environment

Release: All supported releases.
Component: Culprit.

Resolution

Call or branch to the DB-EXIT facility in type 7 logic.

A call to the DB-EXIT facility which has the following selection criteria arguments:

  • Argument 1 ('CALC') generates an OBTAIN CALC EMPLOYEE retrieval command.

  • Argument 2 ('EMPLOYEE ') specifies the EMPLOYEE record. (trailing blank is required unless the record name is 16 characters).

  • Argument 3 (EMP-ID-0415) specifies the name of the CALC-key field for the EMPLOYEE record.

  • Argument 4 ('IDS.INDEX') specifies an occurrence of the work field IDS.5 that has the value of the EMP-ID-0415 field being selected.

  • Argument 5 specifies the length of the EMP-ID-0415 field.

  • IDMS-STATUS NE '0000' 400 checks the IDMS Status for values that indicate error conditions or records not retrieved. If the condition is true, Culprit generates a buffer dump and stops the run.

  • STOP-RUN terminates the run.

To use the DB-EXIT facility:

  1. A dummy PATH parameter (PATH--) with one or more database records

  2. A STOP-RUN command on a type 7 parameter if the only paths coded for the run are dummy paths.

  3. A CALL or BRANCH to the DB-EXIT facility on a type 7 parameter

  4. An IDMS-STATUS value checking in procedure logic statements after each DB-EXIT call.

For example:

col. 2

//SYSIN   DD *
DATABASE DICTNAME=APPLDICT
IN DB SS=EMPSS01
PATH--EMPLOYEE
01OUT 80 D
010 IDS.5 '0302' '0048' '0054' '0301' '0001'  $Employee ID values
010 INDEX 1
010 DUMP
010 MESSAGE 'EMPLOYEE NOT FOUND'
0151*005 IDMS-STATUS                   HH 'IDMS-STATUS' 'FIELD'
0151*010 EMP-ID-0415         FM '9999' HH 'EMPLOYEE' 'ID'
0151*020 EMP-NAME-0415                 HH 'EMPLOYEE' 'NAME'
0152*005 IDMS-STATUS
0152*010 IDS.INDEX
0152*020 MESSAGE
017100   CALL DB-EXIT ('CALC' 'EMPLOYEE ' EMP-ID-0415 IDS.INDEX 4)
017      IF IDMS-STATUS EQ '0326'  200            $Employee not found
017      IDMS-STATUS NE '0000'  400
017      RELS 1
017      B 300
017200   MOVE 'EMPLOYEE NOT FOUND' TO MESSAGE
017      RELS 2
017300   INDEX + 1 INDEX
017      IF INDEX LE 5 100
017      STOP-RUN
017400   DUMP / DUMP DUMP                         $Forces a buffer dump
017      STOP-RUN

Result