How to append values to next link

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
surendra_ds
Participant
Posts: 12
Joined: Wed Apr 19, 2006 7:41 am

How to append values to next link

Post by surendra_ds »

Hi All

Thanks all in Advance

Can you please help in resolving below situation...

I have date like this in main link
seqno,date
1,2007-05-01
2,2007-05-02

data in reference link
seqno,date
1,2007-05-01
2,2007-05-02
3,2007-05-03
4,2007-05-04


we need to append the last two rows of data from the reference link to the target along with the two rows from main link

Thank you & Regards
Surendra
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Can you please post how you want your target data to look? From what I understand a full outer join should do.
Kris

Where's the "Any" key?-Homer Simpson
surendra_ds
Participant
Posts: 12
Joined: Wed Apr 19, 2006 7:41 am

Post by surendra_ds »

Hi Kris

here I am giving data once again..

Source data.

itemno,start_date,volume
1,2007-02-05,120
2,2007-02-06,130

reference link data
seqno,start_date
1,2007-02-05
2,2007-02-06
3,2007-02-07
4,2007-02-08

Target data should be ...
1,2007-02-05,120
2,2007-02-06,130
3,2007-02-07,NULL
4,2007-02-08,NULL

we need do this job in server edition

Thank you
Regards
Surendra
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your 'reference link' is a lookup? If so, when you get a hit on the lookup, include the reference data values in the output column. When you get a 'miss', set the derivation of the column to null.

Or just always include the results of the lookup without checking and the above will follow. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In a server job there is no support for right outer join other than via a Merge stage, which needs to read two text files.

You need to reverse the sense of stream and reference inputs, and perform a regular lookup. The nulls will happen 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.
Post Reply