Months Calculations

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
baglasumit21
Participant
Posts: 132
Joined: Wed Mar 01, 2006 11:12 pm
Location: Pune

Months Calculations

Post by baglasumit21 »

I want to get the rows having date created greater than 1st day of (todays date - 6 months ) as below

Todays Date - 24-Aug-2007
Then i want the rows from [1st day of (24-aug-2007 - 6 months = 24-feb-2007)] i.e 01-feb-2007

I have some manipualtions ans look-ups so i cannot implement this logic in database through query. I want this to be done in Constraints of transformer.
Thanks in Advance
SMB
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Months Calculations

Post by sachin1 »

Please search for forum, their is some custom routine developed by Ray.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

I have posted a solution [url = http://dsxchange.com/viewtopic.php?t=11 ... d7ae4b4bf7] HERE [/url] which should serve your purpose.

For number of months to be reduced pass appropriate value (As per above example - INPUT.No_Of_Months - 6) also make sure you are getting the right value for this stage vairiable

Newyr (int) - - > (If (INPUT.curr_date[6,2] <= mnths) Then
INPUT.curr_date[1,4] - 1 Else INPUT.curr_date[1,4]) - yrs
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
Post Reply