Version 7.4.2
 —  Adabas Vista Programming Guidelines  —

Additional Programming-Related Topics

This section provides additional information related to programming applications for use with Adabas Vista:


Command Limit

Each target category for a source profile contains an optional command limit, in addition to the target information. Response code 249, subcode 129 is returned on the first command which exceeds this limit. A command limit of 0 (zero) means that access to this particular file is unlimited.

Top of page

Error Handling

Adabas Vista uses the default Adabas response code 249 to indicate that an Adabas Vista processing error has occurred. This response code can be modified using the job parameter Error Response Code.

To qualify the error, a non-zero binary value is placed in the subcode field (the low-order 2-bytes of the Adabas Control Block Additions 2 field). Possible values for this subcode are provided in section Messages and Codes.

The application programmer can convert the response subcodes to error message text using the ERRM function of the Adabas Vista API (see Application Programming Interface).

When using Natural, the subcode may be retrieved using the USR0610N subprogram in library SYSEXT. This enables the following construct for an ON ERROR block:

0250   READ AVI1 LOGICAL BY NAME
0260       DISPLAY FIRST-NAME LAST-NAME SEX
0270   END-READ
0280   ON ERROR
0290   IF *ERROR-NR = 3249
0300       CALLNAT 'USR061ON' DB_ERR_STR
0310           WRITE 'AVI error, subcode:' DB_SUBCODE
0320   END-IF
0330   END-ERROR
0340   END

It is strongly recommended that error handling is implemented so that error conditions can be identified and handled immediately.

Refer to the job parameter Error Reporting for additional error reporting options.

Top of page

Multiclient File Processing

Adabas Vista is able to process multiclient files. There are a few considerations that should be made when using this type of file with Adabas Vista:

Top of page

Shared Partitions

When processing Adabas Vista files that have some partitions shared, extra processing is required to determine the correct partition for a particular record, and to ensure that records are returned to the application in the most appropriate sequence for the command. This extra processing may have an adverse effect on performance for these command sequences.

For example, an L1 command sequence processes all records in a file that is defined to Adabas Vista with three partitions, the first and third partitions sharing a single file. Adabas Vista will scan through the first file and extract all records that logically belong to the first partition. The second file will be processed as normal, and Adabas Vista will then scan through the first file again to extract the records that logically belong to the third partition.

When issuing an L9 command against a shared partition where the descriptor used is not the partitioning field, although the count returned is correct, the ISN returned in the ISN Lower Limit field may indicate an incorrect partition. It is not possible to differentiate between the partitions in a shared file for an L9 command.

Top of page

Single Partition Focus

The Single Partition Focus feature can be used to define temporarily a partitioned file as having only one partition. Any command restrictions that may apply to partitioned files are lifted. Alternatively, you can set one of the partitions to FULL access and the others to NONE to achieve the same result.

You may enable single partition focus as the default for a partitioned file by using Adabas Vista Online Services. You may enable it for a single session by using the provided Adabas Vista API (example program API004UP).

Warning:
If single partition focus is specified for a partition of a partitioned file, the validation of the partitioning field value against the defined criteria for that partition is no longer performed. This means that records whose partitioning field value does not correspond to the defined partitioning criteria may be updated or stored in that partition. If single partition focus is subsequently lifted and focused access performed against this partitioned file, such records may not be found. For this reason, it is recommended to restrict the use of single partition focus to those partitioned files for which no focused access is performed.

Example

A file is defined with two partitions and the partitioning field high value is set to M and Z, respectively. Single partition focus is specified for the first partition.

As a result, a record with the value T is added to the first partition.

When single partition focus is removed, a subsequent focused access for all records with the value T is directed to the second partition only.

Top of page

Updating the Partitioning Field

A partitioning field can only be updated if there is no requirement to relocate the record from the Adabas file in which it is stored. If this is not the case, a response code is returned. If such an update is required, a DELETE and STORE operation must be performed.

Top of page