In the following request, the record is not inserted because the field list contains a group field (LEAVE_DATA):
MODIFY FILE EMPWRITE
-* This is an example of the error caused by using a
-* group field (LEAVE_DATA), rather than only elementary fields,
-* in an INCLUDE process.
-* The insert (Segname=S01) is rejected with the error -
-* (FOC4491) FIND ERROR READING FIRST RECORD : S01 /61
-*
-* Insert for SEGNAM=S01 - ACCESS=ADBS
COMPUTE EMPLOYEE_ID = 'EMPID003';
MATCH EMPLOYEE_ID
ON MATCH COMPUTE
LAST_NAME = 'SMITH' ;
FIRST_NAME = 'ROBERT' ;
MIDDLE_NAME = 'EDWARD' ;
CITY = 'NEW YORK' ;
ZIP_CODE = '10121' ;
COUNTRY = 'USA' ;
LEAVE_DATA = 'VAC0801080700';
ON MATCH INCLUDE
ON NOMATCH REJECT
DATA
END Solution: Use only elementary fields in the field list for INCLUDE and UPDATE.
In the following example EMPLOYEE_ID is defined as a unique key in the Access File. However, Adabas may insert the record even if the employee ID value already exists in the data source:
MODIFY FILE EMPWRITE
-* INSERT FOR SEGNAM=S01 - ACCESS=ADBS
COMPUTE EMPLOYEE_ID = 'EMPID001';
LAST_NAME = 'SMITH';
MATCH EMPLOYEE_ID LAST_NAME
ON NOMATCH COMPUTE
FIRST_NAME = 'ROBERT';
MNAME = 'EDWARD';
CITY = 'NEW YORK';
ON NOMATCH INCLUDE
ON MATCH REJECT
DATA
ENDSolution: Issue the MATCH command for the field EMPLOYEE_ID alone, then enter values into the other fields and issue the INCLUDE command.
| Information Builders |