improper records in source files

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

Post Reply
dvpawankumar
Participant
Posts: 46
Joined: Fri Oct 06, 2006 6:36 am
Location: Tucson

improper records in source files

Post by dvpawankumar »

I am having a source file with improper records.
I want to reject those records in source level itself before populating to the next stage.

I tried with the reject file at source level.The improper records are populating into the reject file.But at the same time the rejected records also populating into the next stage.

can any one help him out regarding this how to reject the records at the source level itself.
lucifer_nosferatus
Premium Member
Premium Member
Posts: 10
Joined: Tue Jun 14, 2005 12:55 pm

Re: improper records in source files

Post by lucifer_nosferatus »

If your source is a sequential file and if ur using server edition, try using "Discard and warn" option in the column metadata.
kab123
Participant
Posts: 92
Joined: Tue May 18, 2004 4:05 pm

Post by kab123 »

Try to use a transformer with Reject row box checked in the constraint..
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Guys, this is Enterprise Edition.
What do you mean by "improper records" ? Do they have a new line character in them, or an integer field has alphabets in it?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can add a rejects output link to your Sequential File stage. This will capture any rows from the file that do not match the metadata specified in the record schema for the main output link.

If they are "improper" in the business rules sense, you need to detect these with your job design, most likely with expressions in the Transformer 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.
dvpawankumar
Participant
Posts: 46
Joined: Fri Oct 06, 2006 6:36 am
Location: Tucson

improper record format in source file

Post by dvpawankumar »

Hi ray,

Thanks for your suggestion.I did the same thing like adding rejects output to the source sequential file.The file is capturing the all reject records.But at the same time the reject records also passing to the the next stage.once the reject records are captured those should not be passed to the next stage.But the improper records also passing to the next stage.

So cold you please suggest the another way.

regards
pawan



ray.wurlod wrote:You can add a rejects output link to your Sequential File stage. This will capture any rows from the file that do not match the metadata specified in the record schema for the main output link.

If ...
dvpawankumar
Participant
Posts: 46
Joined: Fri Oct 06, 2006 6:36 am
Location: Tucson

improper record format in source file

Post by dvpawankumar »

Hi ray,

Thanks for your suggestion.I did the same thing like adding rejects output to the source sequential file.The file is capturing the all reject records.But at the same time the reject records also passing to the the next stage.once the reject records are captured those should not be passed to the next stage.But the improper records also passing to the next stage.

So could you please suggest the another way.

regards
pawan



ray.wurlod wrote:You can add a rejects output link to your Sequential File stage. This will capture any rows from the file that do not match the metadata specified in the record schema for the main output link.

If ...
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Your reject mode in the sequential file stage should be set to "output"
dvpawankumar
Participant
Posts: 46
Joined: Fri Oct 06, 2006 6:36 am
Location: Tucson

improper format records in sequential file

Post by dvpawankumar »

i did the same thing.But still the issue is same.

Could you please suggest the another logic in transformer.



ArndW wrote:Your reject mode in the sequential file stage should be set to "output" ...
dvpawankumar
Participant
Posts: 46
Joined: Fri Oct 06, 2006 6:36 am
Location: Tucson

improper format records in sequential file

Post by dvpawankumar »

i did the same thing.But still the issue is same.

Could you please suggest the another logic in transformer.



ArndW wrote:Your reject mode in the sequential file stage should be set to "output" ...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It is simply not possible for a rejected row also to be transmitted to the main output because, if it does not match the metadata, it can not be parsed and therefore can not be imported. Please verify - indeed, prove - your assertion, by posting the record schema and one or two sample 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.
Post Reply