Handling rejected rows

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

Handling rejected rows

Post by parag.s.27 »

Hi,

I am having a lookup for accounts having any kind of transaction for a particular month. i.e. the key field is account number.
Now the lookup hash file is having some extra records other then the matching account numbers of lookup.

I want to extract those extra records in another file.
I tried the reject row concept of transformer stage but it failed because it always take those records from the lookup file for which there is any matching record.

can anyone please help on this
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It sounds like you need to change your lookup hashed file into the main input stream and your current data stream into the reference stream to get the intersection and thus the complement of your two sets. Your current design will, as you've already noted, only get you the reference rows that match the key and not any extra records.
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

Then you would need to change your design of job from

Code: Select all

   Hashed File
          |
          |
          |
          V
Src----->TX----->TGT
To

Code: Select all

               Src
                |
                |
                |
                V
Hashed File----->TX----->TGT
                |
                |
                |
                V
        Reject Link
Hope this helps.
Success consists of getting up just one more time than you fall.
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

Post by parag.s.27 »

ArndW wrote:It sounds like you need to change your lookup hashed file into the main input stream and your current data stream into the reference stream to get the intersection and thus the complement of your two sets. Your current design will, as you've already noted, only get you the reference rows that match the key and not any extra records.
Hi ArndW,

Avtually i am having a condition where i have to use one source file format having all the transaction details regarding the particular account numbers, in the month of jan 06. And i am having another source file with some account numbers from jan06 month and some new in Feb month.

Now i have to apply some transformations on those accounts those are present in both months. But those account numbers present only in Feb06 month and not in jan06 month must be recorded in another source file.

Can this be achieved.
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

How about using link collector for this.

Code: Select all

   Hashed File
          |
          |
          |
          V
Src----->TX----->To Link Collector1

               Src
                |
                |
                |
                V
Hashed File----->TX----->To Link Collector1
                |
                |
                |
                V
        Reject Link
and after that

Code: Select all

Link Collector1----->TX----->Tgt
Hope this helps.
Success consists of getting up just one more time than you fall.
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

Post by parag.s.27 »

loveojha2 wrote:Then you would need to change your design of job from

Code: Select all

   Hashed File
          |
          |
          |
          V
Src----->TX----->TGT
To

Code: Select all

               Src
                |
                |
                |
                V
Hashed File----->TX----->TGT
                |
                |
                |
                V
        Reject Link
Hope this helps.
Hi,

I changed my design to this, but don't know why, the records going in lookup file are 151 but comming out of it are 550. Why transformer is doing this.
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post by ameyvaidya »

Try This:

Code: Select all

                    JanOnlyHashedFile
                          |
                          |
                          |
                          |[RefLink]
                          |       
Jan&FebSrcFile--------> Transformer------------------------------------>Output1
                          |
                          |[Only Feb Constraint: IsNull(<RefLink>.<AnyColumn>)]
                          |-------------------------------------------->Output2
Output 1 Will have All Account Numbers.

Output 2 will have all the Feb Only Account Numbers.

IHTH
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

Post by parag.s.27 »

ameyvaidya wrote:Try This:

Code: Select all

                    JanOnlyHashedFile
                          |
                          |
                          |
                          |[RefLink]
                          |       
Jan&FebSrcFile--------> Transformer------------------------------------>Output1
                          |
                          |[Only Feb Constraint: IsNull(<RefLink>.<AnyColumn>)]
                          |-------------------------------------------->Output2
Output 1 Will have All Account Numbers.

Output 2 will have all the Feb Only Account Numbers.

IHTH
Hi,

I tried all possible transformations but still its failing.
i'll show u the exact job design



Src file----->Sorter
|
|
v
Transformer for inducing key----->File with induced key
|
|
v
Transformer
for splitting
src file with
all months data
to multiple individual
months data
| |
| |
v v
December Jan File
file (1470 recs) (157 recs)
| |
| |(157)
|(1470) v
| Hash file
v /
/
Transformer<_____/(151)
for
finding JAN data
and DEC data
having Dec amount
substracted from
Jan amount.
| |
| |
v v
Jan file Dec File
151 1470

Thus the problem is i want to catch missing 6 records.
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

Post by parag.s.27 »

ameyvaidya wrote:Try This:

Code: Select all

                    JanOnlyHashedFile
                          |
                          |
                          |
                          |[RefLink]
                          |       
Jan&FebSrcFile--------> Transformer------------------------------------>Output1
                          |
                          |[Only Feb Constraint: IsNull(<RefLink>.<AnyColumn>)]
                          |-------------------------------------------->Output2
Output 1 Will have All Account Numbers.

Output 2 will have all the Feb Only Account Numbers.

IHTH
Hi,

I tried all possible transformations but still its failing.
i'll show u the exact job design

Code: Select all

Src file----->Sorter
                |
                |
                v
             Transformer for inducing key----->File with induced key
                                                                           |
                                                                           |
                                                                           v
                                                                     Transformer 
                                                                      for splitting
                                                                        src file with 
                                                                           all months data
                                                                        to multiple individual
                                                                           months data
                                                                             |                 |
                                                                             |                 |
                                                                             v                v
                                                                 December               Jan File
                                                                 file (1470 recs)    (157 recs)
                                                                           |                  |
                                                                           |                  |(157)
                                                                           |(1470)        v
                                                                           |              Hash file
                                                                           v                    /
                                                                                               /
                                                                 Transformer<_____/(151)
                                                                           for
                                                                      finding JAN data
                                                                         and DEC data
                                                                        having Dec amount
                                                                           substracted from
                                                                           Jan amount.
                                                                           |                 |
                                                                           |                 |
                                                                           v                v
                                                                    Jan file             Dec File
                                                                      151                    1470
Thus the problem is i want to catch missing 6 records.
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

parag.s.27 wrote:
ameyvaidya wrote:Try This:

Code: Select all

                    JanOnlyHashedFile
                          |
                          |
                          |
                          |[RefLink]
                          |       
Jan&FebSrcFile--------> Transformer------------------------------------>Output1
                          |
                          |[Only Feb Constraint: IsNull(<RefLink>.<AnyColumn>)]
                          |-------------------------------------------->Output2
Output 1 Will have All Account Numbers.

Output 2 will have all the Feb Only Account Numbers.

IHTH
Hi,

I tried all possible transformations but still its failing.
i'll show u the exact job design

Code: Select all

Src file----->Sorter
                |
                |
                v
             Transformer for inducing key----->File with induced key
                                                                           |
                                                                           |
                                                                           v
                                                                     Transformer 
                                                                      for splitting
                                                                        src file with 
                                                                           all months data
                                                                        to multiple individual
                                                                           months data
                                                                             |                 |
                                                                             |                 |
                                                                             v                v
                                                                 December               Jan File
                                                                 file (1470 recs)    (157 recs)
                                                                           |                  |
                                                                           |                  |(157)
                                                                           |(1470)        v
                                                                           |              Hash file
                                                                           v                    /
                                                                                               /
                                                                 Transformer<_____/(151)
                                                                           for
                                                                      finding JAN data
                                                                         and DEC data
                                                                        having Dec amount
                                                                           substracted from
                                                                           Jan amount.
                                                                           |                 |
                                                                           |                 |
                                                                           v                v
                                                                    Jan file             Dec File
                                                                      151                    1470
Thus the problem is i want to catch missing 6 records.
Yes it is often difficult to get these in right position. If you have made any test jobs, try to take a screen shots and past here using Img options available. But make is small. :wink:
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

Post by parag.s.27 »

this is the job[/url]
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

parag.s.27 wrote:this is the job[/url]
I guess you may need to edit this post.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post by ameyvaidya »

kumar_s wrote: Yes it is often difficult to get these in right position.
Good Ol' Notepad (Font:Courier) is my preferred Canvas. The rest is just copy and Paste. :wink:
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
Post Reply