Its very urgent!!Please reply
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 19
- Joined: Thu Jun 15, 2006 6:25 am
Hi ray I again can't see it. premium content problem,can u plz again unmark it!!! and ArndW which statement to apply in transformer stage to generate a row... I am actually not getting it
I will give u the full statement my source flat file contains too many columns around 230 and there is one field current and if current=0 then there are two fields valid_from and valid_to and we are supposed to calculate the difference of two dates and then see if the days falling within these two dates are saturday or sunday or last day of month and for each date which is niether saturday, sunday nor the last day of month we r supposed to insert records for each such date .... i have applied all the rest of logic except the record insertion and thats what i want to know...so please help
I will give u the full statement my source flat file contains too many columns around 230 and there is one field current and if current=0 then there are two fields valid_from and valid_to and we are supposed to calculate the difference of two dates and then see if the days falling within these two dates are saturday or sunday or last day of month and for each date which is niether saturday, sunday nor the last day of month we r supposed to insert records for each such date .... i have applied all the rest of logic except the record insertion and thats what i want to know...so please help
Let us assume you can have 1, 2 or 3 days difference. In you transform stage have one output link with the constraint DaysDiff<2, one with DaysDiff<3 and another with DaysDiff<4. Each of these three links go to a link collector.
When you have 2 days difference, the first two constraints will produce an output row and the last won't, so you get 2 output records after the collector.
When you have 2 days difference, the first two constraints will produce an output row and the last won't, so you get 2 output records after the collector.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
No, precisely because it IS premium content. It provides a succinct solution using intrinsic DataStage functions. Premium membership can be yours for less than $1 per week. Shudder at the thought of how much you would need to pay me to produce that solution commercially!poonamgoyal wrote:Hi ray I again can't see it. premium content problem,can u plz again unmark it!!!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 19
- Joined: Thu Jun 15, 2006 6:25 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What would you do if you were a mechanic and your client wanted you to repair an engine but forbade you to use a spanner? Sometimes you just have to challenge apparently arbitrary restrictions, particularly if there are no other solutions available.poonamgoyal wrote:can't write routines...client said no for it
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I vote for that.chulett wrote:
"How about you whack Client upside the head for us?"
No Craig, i have seen in here and only here. No where else. There have been times when whacky clients have tried to take me over, but i stuck to my word and after a wild goose chase when no other option was of avail, "they" had to resort to my way.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Premium Member
- Posts: 72
- Joined: Thu Sep 04, 2003 5:01 am
- Location: UK & Europe
Maybe I am missing something but I don't think Ray's premium solution works, or completely answers the question ...Is there any function for calculating whether the given date is last day of month? like last_day in sql???
I think Ray's solution returns the last day of month that a given date lies in (correct?), poonamgoyal asked for a function that indicates if a given day IS the last day of the month, not quite the same thing.
I won't quote the premium content verbatim but I think the solution does not always work as adding 31 days will sometimes jump forward two months ...eg
Start with 30 Jan 2006
Add 31 days = 02 Mar 2006
Get 1st day = 01 Mar 2006
Subtract 1 = 28 Feb 2006 <- wrong answer.
Arnd's idea of adding one day to the date and seeing if this triggers a change in the month is the most elegant solution, but if you really cannot use routines then to use a British expression you're basically stuffed.
"Shudder at the thought of how much you would need to pay me to produce that solution commercially"
Me too!