Developer Mapping Guide > Mapping Administration > Reject Files
  

Reject Files

During a mapping run, the Data Integration Service creates a reject file for each target instance in the mapping. If the Data Integration Service cannot write a row to the target, then the Data Integration Service writes the rejected row to the reject file. The reject file and mapping log contain information that helps you determine the cause of the rejection.
If the reject file does not contain any rejected rows, the Data Integration Service deletes the reject file at the end of the mapping run.
Each time you run a mapping, the Data Integration Service appends rejected data to the reject file. Depending on the source of the problem, you can correct the mapping and target database to prevent rejects in subsequent mappings.

Location of Reject Files

The Data Integration Service creates reject files for each target instance in the mapping. It creates reject files in the target reject file directory.
Configure the target reject file directory in the run-time properties for a flat file or relational target in a mapping. By default, the Data Integration Service creates reject files in the directory defined by the RejectDir system parameter. The Data Integration Service names reject files after the target instance name. The default name for reject files is <file_name>.bad.
When the Data Integration Service creates multiple partitions for a target, the Data Integration Service creates a separate reject file for each partition named <file_name><partition_number>.bad. For example, three partitions might write to reject files named MyOutput1.bad, MyOutput2.bad, and MyOutput3.bad.

Content of Reject Files

After you find a reject file, you can read it using a text editor that supports the reject file code page.
Reject files contain rows of data rejected by the writer or the target database. The Data Integration Service writes the entire row in the reject file. However, the problem usually centers on one column within the row. To help you determine which column caused the row to be rejected, the reject file contains indicators that give you more information about each column.
Reject files contain the following indicators:
Row indicator
The first column in each row of the reject file is the row indicator. The row indicator defines whether the row was marked for insert, update, delete, or reject.
Column indicator
Column indicators appear after every column of data. The column indicator defines whether the column contains valid, overflow, null, or truncated data.

Row Indicators

The first column in the reject file is the row indicator. The row indicator is a flag that defines the update strategy for the data row.
The following table describes the row indicators in a reject file:
Row Indicator
Meaning
Rejected By
0
Insert
Writer or target
1
Update
Writer or target
2
Delete
Writer or target
3
Reject. Marked for reject by an update strategy expression.
Writer
4
Rolled-back insert
Writer
5
Rolled-back update
Writer
6
Rolled-back delete
Writer
7
Committed insert
Writer
8
Committed update
Writer
9
Committed delete
Writer
The following sample reject file shows the row indicator of "0" for each row that indicates an insert update strategy for the row:
0,D,1921,D,Nelson,D,William,D,415-541-5145,D
0,D,1922,D,Page,D,Ian,D,415-541-5145,D
0,D,1923,D,Osborne,D,Lyle,D,415-541-5145,D
0,D,1928,D,De Souza,D,Leo,D,415-541-5145,D
0,D,2001123456789,O,S. MacDonald,D,Ira,D,415-541-514566,T

Column Indicators

A column indicator appears after every column of data. A column indicator defines whether the data is valid, overflow, null, or truncated.
The following table describes the column indicators in a reject file:
Column Indicator
Type of data
Writer Treats As
D
Valid data.
Good data. Writer passes it to the target database. The target accepts it unless a database error occurs, such as finding a duplicate key.
N
Null. The column contains a null value.
Good data. Writer passes it to the target, which rejects it if the target database does not accept null values.
T
Truncated. String data exceeded a specified precision for the column, so the value was truncated.
Bad data, if you configured the mapping target to reject overflow or truncated data.
Null columns appear in the reject file with commas marking their column. The following example shows a null column surrounded by good data:
0,D,5,D,,N,5,D
The column indicator "D" also appears after each row indicator. The following example shows the column indicator "D" after the row indicator "0":

0,D,2001123456789,O,S. MacDonald,D,Ira,D,415-541-514566,T
Either the writer or target database can reject a row. Consult the log to determine the cause for rejection.