Output Link Variable - OTHERWISE for Reject

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
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Output Link Variable - OTHERWISE for Reject

Post by DS_MJ »

Hello:

How to implement the following in PX job.

"IsNull(COL_ID) Or toTarget_Table.REJECTED" (Server job)

Code: Select all

DB2 Table -----Transformer -----Target Table
                     |
                     |
                  Error Table
In the PX I see link variable -->output -->Otherwise in the transformer. But I dont understand "What otherwise is suppose to achieve". The manual is sometimes difficult to follow.

What the job needs is the following:

1 - Do insert only without clearing in the target if COL_ID is not null.
2 - In the Error Table capture rows that are null for COL_ID or any row rejected on the Target table.

How do I capture the rejects besides the Null for COL_ID in PX and send it to the Error table? Any guidence would be much appreciated.
Thanks in advance,
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

In px, database stages support reject links. You need a link coming out of your target database stage going into the error table. This way two links will be feeding to the error table. One from the transformer where the null checking is done and the other from your target database stage if the insert fails.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post by DS_MJ »

Thank you DSguru2B.

However my Target table is a Dynamic RDBMS and so is the Error table and when I try to link these two tables it says
The Destination stage cannot support any more stream input Links
[/code]

Thanks Much.
Thanks in advance,
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post by DS_MJ »

An Dynamic RDBMS - DBMS Type is MSSQL server.
Thanks in advance,
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

No problem. Use another DRS stage to load the same error table. Or collect your rejects in a single file and then load it to the error table in another job or so.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post by DS_MJ »

DSguru2B wrote:No problem. Use another DRS stage to load the same error table. Or collect your rejects in a single file and then load it to the error table in another job or so.
I thought that I could create a reject link going to a seq file and in another job used this DataSet file to load into the Error table however,When I try to create a link from the source stage (Target table ) it give a message
The source stage does not support non-reject output links whilst it has input links
Thanks in advance,
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Yes. Make sure it is a reject link.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post by DS_MJ »

Hello DSguru2B:

What if I checked the little box in the transformer that says otherwise / log - where I put the constraint for if not null then load into the target. then get a reject link out of transformer to a dataset. Would it then capture rows rejected other then the not null into this link?

Thanks much.
Thanks in advance,
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Any record that is rejected by the database due to any reason will go down the reject link
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 »

Database rejects will NOT go down the reject link of a Transformer stage.

The rejects link (which is NOT the same thing as the Otherwise/Log link) handles input rows that cause an exception in the stage, for example an attempt to divide by zero or to take the square root of a negative number.

Database rejects are captured in the reject link of an Enterprise stage. Try using the SQL Server Enterprise stage instead of the Dynamic RDBMS 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.
Post Reply