Capturing Reject records

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Capturing Reject records

Post by mydsworld »

I have a job design like this :

Seq File -> Transformer -> DB2 API

While loading DB2 table, some records are getting dropped in DB2 API stage. I need to capture those Reject records in a file (not from Director) Now, DB2 API stage doesn't allow to have a Reject link.

When I use ODBC Ent stage instead of DB1 API and set Write Method = Upsert, I can have a Reject link, but getting the following error :

Sequential_File_20: Error when checking operator: Could not find input field "sqlcode". [api/interface_rep.C:2168]

As ODBC Ent stage adds a field 'sqlcode' in the rejected data set which is not coming from input.

Please advise.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Look carefully. The Sequential File stage is the one that has generated the error message. This stage type does not generate sqlcode - after all, it doesn't use SQL.

My guess is that you have tried to propagate sqlcode column through your job design. Get rid of it. If you create a proper reject link ("Convert to Reject") as output from your database stage, then sqlcode will appear there automatically.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

I introduced a Transformer in the Reject link between ODBC Ent and Seq file (to drop 'sqlcode'). Now it is giving the same error on that Transformer. So, there is some setting in the ODBC Ent stage that adds that 'sqlcode' field in the Reject link.

Please advice.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No. Simply create the reject link FROM THE ODBC ENTERPRISE STAGE.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

I created the Reject link from ODBC Ent to Seq File (directly without any Transformer etc).It is giving the error :

Sequential_File_20: Error when checking operator: Could not find input field "sqlcode". [api/interface_rep.C:2168]

When I place Peek stage instead of Seq File, the job works. But I would like to use Seq File to capture the reject records.

Please advise.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

GET RID of the sqlcode column from the sequential file and transformer stages.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

Thats the problem, the 'sqlcode' appears in grey (read-only), so can not be removed from Seq file or Transformer.Even if I remove it from Transormer right side it gives that same error.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The reject link should not have any connection to the Transformer stage. It is an output from the ODBC Enterprise stage. Its link type must be Reject (painted in long dashes in the design area).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

Ray,

Believe me, I am directly taking the Reject link from target ODBC Ent to Seq File (with no Transformer in between). It does give that error. This was my original design.

Now, if I replace Seq File (at the other end of Reject link) with Peek, it works. So, any idea why I am not able to use Seq file to capture the rejected records.
devanars
Premium Member
Premium Member
Posts: 99
Joined: Thu Nov 30, 2006 6:25 pm

Post by devanars »

I dont think so seqential file will work for rejected link. It will work fine if you use only Peak or Hash file.
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

The requirement is to capture the Reject records (failing to get inserted in database table) in a file that can be shared with other application or can be mailed.Thats why I need to use File and not Peek.
devanars
Premium Member
Premium Member
Posts: 99
Joined: Thu Nov 30, 2006 6:25 pm

Post by devanars »

If you need a file for rejected records then use load option instead of using upsert then you can see a rejected file with date under scratch folder each time.
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

I am using ODBC Ent stage that has write option 'Upsert' and 'Write'. I dont find any option called 'Load'.
paulistrate
Participant
Posts: 1
Joined: Wed Nov 14, 2007 3:08 pm

Post by paulistrate »

mydsworld wrote:Now, if I replace Seq File (at the other end of Reject link) with Peek, it works. So, any idea why I am not able to use Seq file to capture the rejected records.
Put another link from Peek to SeqFile. This will activate the columns again. Then remove "sqlcode".
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

devanars wrote:I dont think so seqential file will work for rejected link. It will work fine if you use only Peak or Hash file.
We're in the parallel job world here!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply