Appending a sequential file to rejected file (at src file)

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
G SHIVARANJANI
Participant
Posts: 137
Joined: Sun Jan 07, 2007 11:17 pm
Location: VISAKHAPATNAM

Appending a sequential file to rejected file (at src file)

Post by G SHIVARANJANI »

Hi,

I have a source file which reads a csv file followed by a transformer and then oracle_enterprise table.

I have put up a reject file from both source and from transformer;

At source i have kept a reject link(this file collect the records which are short of commas) , and at transformer the records get rejected due to constraint.

Now i want that both the rejected files to be collected in one file.

so i tried putting first reject file in overwrite mode and the second in append mode.

Finally i get a file which has records rejected due to constraint only thats second file but no records from first reject file.

Please suggest.
Shivaranjani
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Appending a sequential file to rejected file (at src fil

Post by chulett »

G SHIVARANJANI wrote:Now i want that both the rejected files to be collected in one file. So i tried putting first reject file in overwrite mode and the second in append mode. Finally i get a file which has records rejected due to constraint only thats second file but no records from first reject file.
Sequential files don't work that way. They support multiple readers but only a single writer process at a time. You'll either need to find a way to 'collect' those two streams before writing or write to two separate files.
-craig

"You can never have too many knives" -- Logan Nine Fingers
prashkvrk
Participant
Posts: 15
Joined: Tue Nov 21, 2006 1:17 am
Location: Bangalore,India

Re: Appending a sequential file to rejected file (at src fil

Post by prashkvrk »

G SHIVARANJANI wrote:Hi,

I have a source file which reads a csv file followed by a transformer and then oracle_enterprise table.

I have put up a reject file from both source and from transformer;

At source i have kept a reject link(this file collect the records which are short of commas) , and at transformer the records get rejected due to constraint.

Now i want that both the rejected files to be collected in one file.

so i tried putting first reject file in overwrite mode and the second in append mode.

Finally i get a file which has records rejected due to constraint only thats second file but no records from first reject file.

Please suggest.
try this option. use funnel stage if the structure of the two files which you have at source end and from the transformer. Collect it using funnel. you will get a merged file containing the rejected records from the source as well as transformer.
G SHIVARANJANI
Participant
Posts: 137
Joined: Sun Jan 07, 2007 11:17 pm
Location: VISAKHAPATNAM

Re: Appending a sequential file to rejected file (at src fil

Post by G SHIVARANJANI »

Hi,

The Format for both the files is not same.

one is a reject link file from a sequential file and the second is from transformer n the third is the rejected reccords from table.
Shivaranjani
Maveric
Participant
Posts: 388
Joined: Tue Mar 13, 2007 1:28 am

Post by Maveric »

You can handle this in different ways. One is to put in a copy stage with RCP on and create the fields in the output tab. then funnel then sequential file. If you need the file just to see the rejects then use 3 different files and append the 2nd and 3rd to the first file after the job at the OS level.
prashkvrk
Participant
Posts: 15
Joined: Tue Nov 21, 2006 1:17 am
Location: Bangalore,India

Re: Appending a sequential file to rejected file (at src fil

Post by prashkvrk »

G SHIVARANJANI wrote:Hi,

The Format for both the files is not same.

one is a reject link file from a sequential file and the second is from transformer n the third is the rejected reccords from table.
But I have a doubt here. The structure(metadata) would be the same for all the files right? Because one is a reject from the source and another one is a reject from the transformer. The format would be the same until and unless you are dropping some columns ! If you are dropping some columns then I don't think you can use funnel stage. If not you can use it.

Prasad
G SHIVARANJANI
Participant
Posts: 137
Joined: Sun Jan 07, 2007 11:17 pm
Location: VISAKHAPATNAM

Re: Appending a sequential file to rejected file (at src fil

Post by G SHIVARANJANI »

I have used the funnel stage to append the reccords,
As its just to see the reccords ,
I have taken the sequntial file ( to read the rejected records ) having one column with size 9999999 and varchar type.
prashkvrk wrote:
G SHIVARANJANI wrote:Hi,

The Format for both the files is not same.

one is a reject link file from a sequential file and the second is from transformer n the third is the rejected reccords from table.
But I have a doubt here. The structure(metadata) would be the same for all the files right? Because one is a reject from the source and another one is a reject from the transformer. The format would be the same until and unless you are dropping some columns ! If you are dropping some columns then I don't think you can use funnel stage. If not you can use it.

Prasad
Shivaranjani
Post Reply