Its very urgent!!Please reply

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

poonamgoyal
Participant
Posts: 19
Joined: Thu Jun 15, 2006 6:25 am

Post by poonamgoyal »

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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

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.
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

try and handle this in unix, the date comparison. Add a parameter to the jobs which wil indicate the result of your calculation (done in unix) and then use that parameter ro generate rows.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

poonamgoyal wrote:Hi ray I again can't see it. premium content problem,can u plz again unmark it!!!
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!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
anujgarg
Participant
Posts: 38
Joined: Sun Jun 26, 2005 11:17 pm

Post by anujgarg »

I think row generation can be done using routine.Either use parallel routine or use the server job for this and write a basic routine for that.
poonamgoyal
Participant
Posts: 19
Joined: Thu Jun 15, 2006 6:25 am

Post by poonamgoyal »

can't write routines...client said no for it
sanjay
Premium Member
Premium Member
Posts: 203
Joined: Fri Apr 23, 2004 2:22 am

Post by sanjay »

still u problem is not solved.

Sanjay
poonamgoyal wrote:can't write routines...client said no for it
anujgarg
Participant
Posts: 38
Joined: Sun Jun 26, 2005 11:17 pm

Post by anujgarg »

Do one thing In transformer stage use stage varables to generate new records and add that to existing record and seperate the records by newline char.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

poonamgoyal wrote:can't write routines...client said no for it
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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I have never seen, at any place, where "they" tell you how to do your work. That means "they" know a better way out and therefore "they" should get it working :evil:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Stick around, we "see" it all the time here...

"Suggest method A"

"Client has forbidden method A"

"How about method B then?

"Sorry, not allowed"

"How about you whack Client upside the head for us?"


:evil: :lol:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

chulett wrote:
"How about you whack Client upside the head for us?"

:evil: :lol:
I vote for that. :twisted:
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.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Agreed! This client is stupid.
Mamu Kim
SettValleyConsulting
Premium Member
Premium Member
Posts: 72
Joined: Thu Sep 04, 2003 5:01 am
Location: UK & Europe

Post by SettValleyConsulting »

Is there any function for calculating whether the given date is last day of month? like last_day in sql???
Maybe I am missing something but I don't think Ray's premium solution works, or completely answers the question ...

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