Error Handling and Recovery Mechanisms Is SAP Data Services 4.2 - SAP Blogs
Error Handling and Recovery Mechanisms Is SAP Data Services 4.2 - SAP Blogs
Former Member
September 4, 2014 | 7 minute read
Error Handling is an important aspect of any ETL tool. BO Data Services have
in-built error-handling and automatic recovery mechanisms in place. Also by
using different dataflow designs, we can manually recover a job from a failed
execution and ensure proper data in the target.
The following screenshot describes exception groups that we can catch in a try/catch
block:
try
begin
steps
end
catch(integer_constants)
begin
steps
end
You can only invoke these error functions inside a catch script, a user function, or in an
audit script for a data flow.
A) One or more groups of exceptions that the catch object handles. If we want to assign
different actions to different exception groups, we need to add a catch for each set of
actions.
C) Optional error functions inside the catch block to identify details of the error.
D) For batch jobs only, we should not refer output variables from a try/catch block in any
subsequent steps if we are using the automatic recovery feature. Referencing such
variables could alter the results during automatic recovery.
E) Also, try/catch blocks can be used within any real-time job component. However,
try/catch blocks cannot straddle a real-time processing loop and the initialization or
cleanup component of a real-time job.
The work flow or job may or may not be terminated based on whether a try-catch block
surrounds the call.
· Data Conversion Errors — Datatype mismatch between file format and data.
Suppose a field might be defined in the File Format Editor as having a data type of
integer but the data encountered is actually varchar.
· Row Format Errors — In the case of a fixed-width file, the software identifies a row
that does not match the expected width value.
In the File Format Editor, the Error Handling set of properties performs the following
actions on selection:
o Check for either of the two types of source flatfile error (Data Conversion & Row
Format ).
o Write the invalid rows to a specified Error file in the Job Server.
o Stop processing the source file after reaching a specified number of invalid row
count.
If an SAP Data Services job does not complete properly, we must fix the problems that
prevented the successful execution of the job and run the job again. However, during
the failed job execution, some data flows in the job may have completed and some
tables may have been loaded, partially loaded, or altered. Therefore, we need to design
the data movement so that we can recover—that is, rerun the job and retrieve all the
data without duplicating or missing the data.
1) Enable recovery
To enable recovery of a batch job, execute it initially with Enable recovery (execution
property) selected. This selection will prompt the software to record the results of each
successful step.
In case the job fails, rerun the job with this option. ‘Recover from last failed execution’
reruns uncompleted or failed steps under the same conditions as the original job.
3.2 Manually recovering jobs using status
tables
We need to design the jobs and work flows so that it can manually recover from an
unsuccessful run.
o We can implement special steps to recover data when a step did not
complete successfully during a previous run.
The above functionality can be achieved by using an execution status table to produce
jobs that can be run multiple times without duplicating target rows.Alert Moderator
The table records
the job’s execution status. A “failure” value signals SAP BODS to take a recovery
execution path.
Assigned Tags