7.10 FETCH_CURRENT_RECORD
Use the FETCH_CURRENT_RECORD
function to get the record from the target table with the same key as the current source record without locking the record. This makes the record buffer available to be read into the user exit by completing a call to GET_RECORD
for the target image.
FETCH_CURRENT_RECORD
is supported only for key-sequenced and entry-sequenced Enscribe files. The implementation for entry-sequenced files requires the use of a specified ALTKEY
for proper positioning.
Fetching from the target table is only supported by Replicat, and only if a mapped target buffer is available. Replicat fetches the current record by key.
Syntax
For C:
#include "usrdecs" short result; typedef struct { long error_num; char error_msg [600]; long max_length; long actual_length; short msg_truncated; } error_info_def; error_info_def error_info_ptr; result = FETCH_CURRENT_RECORD (&error_info_ptr);
For TAL:
?source usrdect int result; int .ext error_info_ptr(error_info_def); result := FETCH_CURRENT_RECORD(error_info_ptr);
For COBOL:
?CONSULT =REPLICAT 01 result PIC S9(4) COMP. 01 error-info. 02 error-num PIC S9(4) COMP. 02 error-msg PIC X(600). 02 max-length PIC S9(4) COMP. 02 actual-length PIC S9(4) COMP. 02 msg-truncated PIC S9(4) COMP. ENTER C "FETCH_CURRENT_RECORD" using error-info giving result.
-
actual-length
-
The actual length of the error message that is included.
-
error-msg
-
The message explaining the error. The size is set when the function is used.
PIC X(600)
andchar [600]
are only examples of a possible value. -
error-num
-
A code indicating whether the call was successful or not.
-
max-length
-
The maximum length allowed for an error message.
-
msg-truncated
-
Indicates whether the error message has been truncated.
-
result
-
A code indicating whether the call was successful or not.