In this section: |
In a Master File, you can describe certain types of fields that affect retrieval strategy or optimization.
Reference: |
The Adapter for Adabas can employ a data retrieval strategy through Read Logical by ISN (L1) calls. It can be used to determine the Internal Sequence Number (ISN) of a record that was read or that will be inserted into an Adabas file.
ISN-based access is applicable only if an ISN field is described in the Master File. This field has a field name that is user-defined and an ALIAS of ISN. The Usage format is I and the Actual format must be I4. This field can be defined only in segments that contain non-repeating data (that is, using an access method defined in the Access File as ADBS):
FIELD=ISN_FIELD, ALIAS=ISN, I10, I4, $
Equality tests on the ISN field can be used to retrieve a single record when the:
or
Adabas returns the Response Code 113 if the record with the ISN defined in the test is not present in the Address Converter for the file. The adapter returns the following message: "Record is not found".
The Adapter for Adabas uses Read Logical by ISN (L1) calls to retrieve all records for the entry segment when the:
For example, the Access File ADATEST contains:
SEGNAM=S01, ACCESS=ADBS , ... ,SEQFIELD=ISN_FIELD ,$
Adabas returns each record in ascending order by the value of the ISN.
TABLE FILE ADATEST PRINT AA_FIELD AJ_FIELD WHERE ISN_FIELD EQ 1100 END
Note: Multifetch option will be suppressed for this call.
Read Logical by ISN (L1) calls to retrieve a subset of records for the entry segment when the:
Access File ADATEST contains:
SEGNAM=S01, ACCESS=ADBS, ... ,SEQFIELD=AA_FIELD ,$
Read Logical by ISN (L1) is used:
TABLE FILE ADATEST PRINT AA_FIELD AE_FIELD WHERE ISN_FIELD GT 1100 END
After issuing an Insert request on a file with an ISN field in the Master File, the resulting ISN generated by Adabas is displayed by the message FOC4592:
(FOC4592) RECORD IS INSERTED WITH ISN : nnnnn
MODIFY FILE ADBTEST FREEFORM AA_FIELD AJ_FIELD MATCH AA_FIELD AJ_FIELD ON NOMATCH INCLUDE ON MATCH REJECT DATA 11111111, TAMPA END
ADBTEST ADBSINX ON 09/20/2002 AT 15.22.16 (FOC4592) RECORD IS INSERTED WITH ISN : 11 (FOC4566) RECORDS AFFECTED DURING CURRENT REQUEST : 1/INSERT
TRANSACTIONS: TOTAL = 1 ACCEPTED= 1 REJECTED= 0 SEGMENTS: INPUT = 1 UPDATED = 0 DELETED = 0
You can assign a value for the ISN field if the Insert request contains the ISN field and the assigned value is not 0.
The adapter will issue an Adabas N2 Direct Call to assign this ISN value to the inserted record. Adabas returns Response Code 113 if this value was already assigned to another record in the file or if it is larger than the MAXISN in effect for the file.
Reference: |
The Adapter for Adabas can optimize the performance of queries that use the same Adabas field lists repeatedly. Field lists are generated in Adabas format buffers, and can be retained.
Global Format Buffer ID (GFBID) support is applicable only if a GFBID field is present in the Master File. This field has a user-defined field name, and an ALIAS of GFBID. This field is used to determine the Global Format Buffer ID that will be defined in read requests with identical field lists for the same database. The GFBID field has a USAGE format of A8 and an ACTUAL format of A8. This field can be defined only in segments that contain non-repeating data (that is, the access method defined in the Access File is ADBS).
FIELD=GID_FIELD, ALIAS=GFBID, A8, A8, $
Note:
The GFBID field can be defined in the Master File manually.
The value of GFBID can have up to 8 bytes and must start with a digit or uppercase character.
If GFBID is used in a request against a file that contains simple PE/MU segments, it will be applied to Adabas calls to get the field values from these segments. The GFBID value will be adjusted for each non-ADBS segment, that is, a segment number will be placed in the last (8th) byte of the GFBID field.
Calls to a PE (periodic element) with MU (multi-value) child or an MU with PE parent segment will not use GFBID values.
Note: To make the GFBID value unique within Adabas, do not use 8 byte GFBID values for these types of calls.
ENGINE ADBSINX SET GFBID_OFF {ALL|value} DBID number
When a single value is specified in the SET command, all values issued for child segments are removed as well. If value contains blanks, value must be enclosed in single quotation marks.
ALL clears all GFBID values.
Master File ADATEST contains:
FIELD=GID_FIELD, ALIAS=GFBID, A8, A8, $
Request 1. Global ID = ABC1:
TABLE FILE EMPFILE PRINT AA_FIELD AJ_FIELD ISN_FIELD AQ0201_OCC AR_FIELD AS_FIELD, AT_FIELD WHERE ISN_FIELD GT 1100 AND GID_FIELD EQ 'ABC1'; END
Result:
PAGE 1 AA_FIELD AJ_FIELD ISN_FIELD AQ0201_OCC AR_FIELD AS_FIELD AT_FIELD -------- -------- --------- ---------- -------- -------- -------- 30034517 DERBY 1105 1 UKL 6500 750 30034517 DERBY 1105 2 UKL 6800 1240 30034517 DERBY 1105 3 UKL 7100 1345 30034517 DERBY 1105 4 UKL 7450 1450 30034517 DERBY 1105 5 UKL 7800 1700 50005600 VIENNE 1106 1 FRA 165810 10000 50005300 PARIS 1107 1 FRA 166900 5400 NUMBER OF RECORDS IN TABLE= 7 LINES= 7
Request 2. Global ID = ABC1, but field's list is changed:
TABLE FILE EMPFILE PRINT AA_FIELD ISN_FIELD AQ0201_OCC AR_FIELD AS_FIELD AT_FIELD WHERE ISN_FIELD GT 1100 AND GID_FIELD EQ 'ABC1'; END
Result:
(FOC4567) POSSIBLE MISMATCH BETWEEN FDT AND MFD : file=19879548 (FOC4591) ERROR RETURN ON READ BY ISN : S01 /999:ffffffcd001d00 NUMBER OF RECORDS IN TABLE= 0 LINES= 0
Request 3. Remove value 'ABC1' from Adabas:
ENGINE ADBSINX SET GFBID_OFF ABC1 DBID 3
Request 4. Repeat request 2.
TABLE FILE EMPFILE PRINT AA_FIELD ISN_FIELD AQ0201_OCC AR_FIELD AS_FIELD AT_FIELD WHERE ISN_FIELD GT 1100 AND GID_FIELD EQ 'ABC1'; END
Result:
PAGE 1 AA_FIELD ISN_FIELD AQ0201_OCC AR_FIELD AS_FIELD AT_FIELD -------- --------- ---------- -------- -------- -------- 30034517 1105 1 UKL 6500 750 30034517 1105 2 UKL 6800 1240 30034517 1105 3 UKL 7100 1345 30034517 1105 4 UKL 7450 1450 30034517 1105 5 UKL 7800 1700 50005600 1106 1 FRA 165810 10000 50005300 1107 1 FRA 166900 5400 NUMBER OF RECORDS IN TABLE= 7 LINES= 7
Request 5. Remove all GFBID values for Database 3 from Adabas:
ENGINE ADBSINX SET GFBID_OFF ALL DBID 3
Information Builders |