in my transformer i don't have any thing defined for the constraint, so DS thinks that all the records are success all the time, but in reality there are some rejected records from Db2. How can i get these records and wriite to a file.
Mark the second output link from the Transformer stage as "Rejects". This is a check box in the constraints editor. Leave the constraint expression for this link blank. The mere fact that it's marked as "Rejects" will cause it to capture database rejects from the first output link.
You also have access to stage variables from the first output link, such as DBMSCODE and LASTERR, that can aid diagnosing the cause of any rejected rows.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
It does make no difference...job is executing okay, but the no rejected records were in rejected file.The log shows that the records were rejected due to duplicate keys.
I am using DB2 API Stage and 'insert rows without clearing' action.
Just wanted to make sure i am briefing the procedure what i have done.
Ihave sequencial file,transformer, Db2 API and Reject file from tranformer stage.Read records from File(separated by pipe) and in the transformer i don't have any constraints defined for DB2 stage and [Rejected] for Rejected file stage.
Ah... it does need to be 1 to capture them reliably, however it seems like it should still have 'worked' after a fashion when it is set higher. From what I recall, Oracle would report the right number but put the wrong record in the reject file. It also depended on if your total row count exceeded the array size or not, IIRC.
There should be a post in here from me on the subject from five years or so ago.
-craig
"You can never have too many knives" -- Logan Nine Fingers