Loop

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
parsi_cnu
Charter Member
Charter Member
Posts: 43
Joined: Thu Dec 04, 2003 4:26 pm

Loop

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
parsi_cnu
Charter Member
Charter Member
Posts: 43
Joined: Thu Dec 04, 2003 4:26 pm

Loop

Post 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
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post 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"?
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Edwink
Participant
Posts: 47
Joined: Sat Aug 19, 2006 4:57 am
Location: Chennai

Post 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.
Post Reply