REPERROR
Valid for
Replicat
Description
Use REPERROR
to determine how Replicat responds to record errors that occur during replication. Using REPERROR
, you can handle most record errors in a default manner and specific errors differently. For example, you can ignore duplicate record errors but abort processing in all other cases.
The parameter "HANDLECOLLISIONS | NOHANDLECOLLISIONS" describes how to handle missing and duplicate record errors as special cases.
See the Handling Replicat Errors for information on error handling for primary key updates, where multi-staged I/O can result in partial replication for non-audited files.
Default
ABEND
Syntax
REPERROR (error
,response
) | RESET
The following are possible response
values and options:
REPERROR (error
, [IGNORE | EXCEPTION | DISCARD | ABEND]) REPERROR (error
, RETRYOP [, MAXRETRIESnumber
] [, DELAYSECSseconds
] [, DELAYCSECScsecs
]) REPERROR (error
, TRANSABORT [, MAXRETRIESnumber
] [, DELAYSECSseconds
] [, DELAYCSECScsecs
]) REPERROR (error
, FILEOP [, MAXRETRIESnumber
] [, DELAYCSECScsecs
] [, DELAYSECSseconds
] [, ABEND | WARN | IGNORE | PURGETARGET] [, CREATE | ALTER | RENAME | PURGE | SETMODE | CONTROL | CHANGELABEL]) REPERROR (error
, RETRYOPEN [, MAXRETRIESnumber
] [, DELAYSECSseconds
] [, DELAYCSECScsecs
]) REPERROR (error [IOTYPE [,INSERT] [,UPDATE] [,DELETE]] {IGNORE | EXCEPTION | DISCARD | ABEND | TRANSABORT})
-
error
-
Valid values are as follows.
-
DEFAULT
-
Sets a global response to all errors except those for which explicit
REPERROR
statements are specified. -
DEFAULT2
-
Signals a backup default exception handling action when
DEFAULT
is set toEXCEPTION
. UseDEFAULT2
when an exception map is not specified for a map that experiences an error. -
error_number
-
A Guardian or SQL error number.
-
-
response
-
Can be one of the following:
-
ABEND
-
Roll back the transaction and terminate processing abnormally.
ABEND
is the default. -
DISCARD
-
Log the error in the discard file but continue processing the transaction and subsequent transactions.
-
EXCEPTION
-
Handle the error as an exception. In anticipation of possible errors, you can create a separate
MAP
statement that executes only after an error. Use thisMAP
statement, for example, to map columns from a failed update statement into a "missing update" table. In the parameter file, specify the map that will handle the exception after the map that failed. -
FILEOP
-
Specifies error handling behavior for each I/O type. The default is to
ABEND
. You cannot specify multiple actions for a given error and operation type, nor can you specify multiple operation types on a single statement.Note:
PURGETARGET
is valid only for theCREATE
option on Enscribe files. It purges the target after a file create and retries theCREATE
. -
IGNORE
-
Ignore the error.
-
IOTYPE
-
Specifies behavior that should be applied for the designated types of operations. If
IOTYPE
is used, at least one of the operation types (insert, update, or delete) must be included. -
RETRYOPEN
-
Retry a file open error. If the error is on file open or during the mapping evaluation,
RETRYOPEN
retries the operation indefinitely every 60 seconds. For example, if a file does not yet exist on the target platform, an operator could create it after seeing the open error, and processing will continue uninterrupted. -
RETRYOP
-
Retry an insert, update, or delete operation. Use the
MAXRETRIES
option to limit the number of retries to the value ofnumber
For example, if Error 45 (file is full) indicates the table is out of extents,RETRYOP
withMAXRETRIES
gives you time to add extents so the transaction does not fail. Replicat abends after the specified number ofMAXRETRIES
.To specify the length of time between attempts, set
RETRYDELAY
as described on "RETRYDELAY". -
TRANSABORT
-
Abort the transaction and reposition to the beginning of the transaction. This will continue either until the record(s) are processed successfully or
MAXRETRIES
expires. IfMAXRETRIES
is not set, then theTRANSABORT
action will loop continuously. To force an infinite loop of retries you can setMAXRETRIES
to -1. Use theDELAY
option to delay the retry.The default delay between retries is 60 seconds, but this can be changed using the
DELAY
option.The
TRANSABORT
option is useful for handling timeouts and deadlocks on databases that support those conditions.
-
-
RESET
-
Use
RESET
to remove all of theREPERROR
settings made at the root level of the parameter file above theRESET
.Note:
The
RESET
option clears only the global error settings. It does not apply to and is not valid withREPERROR
used within aMAP
statement.
Examples
- Example 1
-
This example shows valid actions and operation types for the option
FILEOP.
REPERROR (11, FILEOP, RENAME, WARN) REPERROR (14, FILEOP, RENAME, ABEND) REPERROR (48, FILEOP, RENAME, ABEND) REPERROR (10, FILEOP, CREATE, ABEND) REPERROR (10, FILEOP, CREATE, PURGETARGET) REPERROR (14, FILEOP, CREATE, ABEND) REPERROR (11, FILEOP, PURGE, ABEND) REPERROR (14, FILEOP, PURGE, ABEND) REPERROR (48, FILEOP, PURGE, ABEND) REPERROR (48, FILEOP, SETMODE,IGNORE) REPERROR (48, FILEOP, CONTROL, IGNORE) REPERROR (48, FILEOP, CHANGELABEL, ABEND)
- Example 2
-
This example aborts processing for most file errors, but ignores duplicate record errors for both SQL tables (error -8227) and Enscribe files (Error 10).
REPERROR (DEFAULT, ABEND) REPERROR (-8227, IGNORE) REPERROR (10, IGNORE) REPERROR (11, RETRYOPEN) REPERROR (45, RETRYOP, MAXRETRIES 50)
- Example 3
-
This example invokes an exception map for all errors on the
ACCOUNT
table. Errors on other tables cause Replicat to abend (due to the absence of an exception map for those tables).REPERROR (DEFAULT, EXCEPTION) REPERROR (DEFAULT2, ABEND) -- The following MAP has no exception handler, so errors cause Replicat to -- abend. MAP $DATA1.DAT.PRODUCT, TARGET PRODUCT; -- The following MAP has an exception handler, so errors will -- cause Replicat to insert problem information into the target table. MAP $DATA1.DAT.ACCOUNT, TARGET ACCOUNT; INSERTALLRECORDS MAP $DATA1.DAT.ACCOUNT, TARGET ACCOUNT_EXCEPTION, EXCEPTIONSONLY, COLMAP (ACCOUNT_NO = ACCOUNT_NO, OPTYPE = @GETENV ("LASTERR", "OPTYPE"), DBERR = @GETENV ("LASTERR", "DBERRNUM"), DBERRMSG = @GETENV ("LASTERR", "DBERRMSG"));
- Example 4
-
This example discards inserts if an error 10 is encountered.
REPERROR (10, IOTYPE, INSERT, DISCARD)
This example ignores record not found (error 11) for updates and deletes.
REPERROR (11, IOTYPE, UPDATE, DELETE, IGNORE)