Page 1 of 1

Loop

Posted: Wed Feb 28, 2007 7:40 pm
by parsi_cnu
Hi ,

I had peculiar problem i had a date source

Source
COl1 COl2
Jan 22 2006 Jan 23 2007

Lookup
Start Dt End_dt
Jan 20 2005 1 Feb 2006
2 Feb 2006 1 March 2006


Source start_dt should increment 1 day till it falls outside of stat_dt and End_dt of lookup

Start dt End_dt
1 March 2006 to Jan 23 2007

Clear example

SOurce
Start_dt End_dt
01 Jan 2005 02 AUg 2006


Lookup
12 Feb 2004 12 Feb 2005
13 Feb 2005 13 Feb 2006



SInce source start_dt is falling between lookup start_dt and lookup end_dt it should increment itself till it falls outside of all the start_dt and end_dt of lookup.

It should give results
14 Feb 2006 02 Aug 2006

Posted: Wed Feb 28, 2007 8:12 pm
by ray.wurlod
Since you have not asked a question I will assume that you have a solution to the situation you describe. Can I therefore ask you to post that solution?

If you don't have a solution, can you post a question?

Loop

Posted: Wed Feb 28, 2007 9:33 pm
by parsi_cnu
[quote="ray.wurlod"]Since you have not asked a question I will assume that you have a solution to the situation you describe. Can I therefore ask you to post that solution?

If you don't have a solution, can you post a question?[/quote]


I dont have the solution can anybody help me to implement forloop logic in my datastage job

Posted: Wed Feb 28, 2007 9:43 pm
by narasimha
parsi_cnu,

Can you please provide more details as to what logic you need to use to get to your results from your given example?
Do you have something in mind you want to implement using a "for loop"?

Posted: Thu Mar 01, 2007 12:19 am
by ray.wurlod
What are the data sources containing these values? Whatever the case, you are going to need to write some code, since you are on version 6.

But please begin with an English language specification of the expected output from this processing.

Posted: Thu Mar 01, 2007 3:48 am
by Edwink
lookup based on key,


after lookup, in transformer output link have a constraint
not(inputlink.notfound)

In keyexpression for st date just code If ((looup.enddate > source.stdate) and (looup.stdate <= source.stdate)) then"(looup.enddate +1)" Else source.stdate

for date comparisson just go for iconv and oconv function.