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

Its very urgent!!Please reply

Post by poonamgoyal »

Hi , I am quite new to datastage and i have a problem regarding transformation which is quite urgent to be resolved

1) Is there any function for calculating whether the given date is last day of month? like last_day in sql???

2) How to generate a no. of rows depending upon a difference in transformer stage? like what i want to do is depending upon difference of two date values i have to generate that much records except if that day is saturday, or sunday or the last day of month?



plz anyone help
a bunch of thanks in advance plz
poonamgoyal
Participant
Posts: 19
Joined: Thu Jun 15, 2006 6:25 am

Post by poonamgoyal »

pls do help as project timeline is quite a strict
poonamgoyal
Participant
Posts: 19
Joined: Thu Jun 15, 2006 6:25 am

Post by poonamgoyal »

source is a flat file loaded in a dataset and i need to perform the above conversion
bchau
Charter Member
Charter Member
Posts: 46
Joined: Tue Jan 18, 2005 7:39 am
Location: Japan
Contact:

Post by bchau »

You really shouldn't set your topic to "urgent" cuz everyone's issue is urgent in their own eyes. Your topic should be set to a brief discription of your problem. Saying that your problem is "urgent" will not make the users answer your questions any sooner. Please realize that most users do not get paid to support. They are just doing it out of the goodness of their heart. If you need quick responses, you are better off contacting your vendor as they are paid to support the software.

Please also be aware that a lot of the users are in the US and it is their sleepytime right now.

Regarding your issue, you could make a custom stage that would take in the start and end date. In your code for the "buildop" stage you can generate any number of records based on the days in between, weekends, and last day of the month.

Please refer to page 54-1 in the Parallel Job Developer's Guide on how to make custom stages.
poonamgoyal
Participant
Posts: 19
Joined: Thu Jun 15, 2006 6:25 am

Post by poonamgoyal »

bchau wrote:You really shouldn't set your topic to "urgent" cuz everyone's issue is urgent in their own eyes. Your topic should be set to a brief discription of your problem. Saying that your problem is "urgent" will not make the users answer your questions any sooner. Please realize that most users do not get paid to support. They are just doing it out of the goodness of their heart. If you need quick responses, you are better off contacting your vendor as they are paid to support the software.

Please also be aware that a lot of the users are in the US and it is their sleepytime right now.

Regarding your issue, you could make a custom stage that would take in the start and end date. In your code for the "buildop" stage you can generate any number of records based on the days in between, weekends, and last day of the month.

Please refer to page 54-1 in the Parallel Job Developer's Guide on how to make custom stages.




Thanks for your reply and suggestions too.. i ll follow them afterwards....client has said not to use any custom stages so any other option?
bchau
Charter Member
Charter Member
Posts: 46
Joined: Tue Jan 18, 2005 7:39 am
Location: Japan
Contact:

Post by bchau »

This can also be done in a routine where the routine returns a string that includes line feeds based on the number of days. The output of your transformer needs to only have 1 column and writes to a sequential file tho. I believe the custom stage would be better performancewise.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I make it a point to avoid answering any posts that are urgent apart from a short admonition, but in this case I'll at least give a direction to look further

1) If you add a day to a date and compare the month to see if it is unequal to the original date's month then you have found the last day of the month.

2) It was urgent enough for you to post your question but obviously not urgent enough for you to use the SEARCH facility to find out that this question has been asked (and answered) several times before.
bchau
Charter Member
Charter Member
Posts: 46
Joined: Tue Jan 18, 2005 7:39 am
Location: Japan
Contact:

Post by bchau »

heh, i guess i'm too weak, eh? Couldn't resist not replying.
poonamgoyal
Participant
Posts: 19
Joined: Thu Jun 15, 2006 6:25 am

Post by poonamgoyal »

bchau wrote:heh, i guess i'm too weak, eh? Couldn't resist not replying.

Hey ArndW, i can't read ur answer its some premium content ...can u plz quote it...please
bchau
Charter Member
Charter Member
Posts: 46
Joined: Tue Jan 18, 2005 7:39 am
Location: Japan
Contact:

Post by bchau »

ahh, that is sneaky, I highly recommend becoming a charter member. It's great and you get to see everything?
poonamgoyal
Participant
Posts: 19
Joined: Thu Jun 15, 2006 6:25 am

Post by poonamgoyal »

can u please put the solution in quote so that i can view it for now please help me
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I marked the post as non-premium since it is not of premium content.
poonamgoyal
Participant
Posts: 19
Joined: Thu Jun 15, 2006 6:25 am

Post by poonamgoyal »

Hi ArndW, i m again saying sorry for choosing this title but i wasn't aware of these rules , n as its my first module in datastage i was nervous... i did a search on the topic but its for table formats and data in my case is in form of flat files so this is a different question... please help
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If your maximum number of days difference is some manageable amount (i.e. about one month), then you can have a transform or switch stage and use the value you calculate for days to specify output rows, then later on in the job collect those rows back to a single stream. This is the simplest way of doing this kind of thing if your maximum number is known.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Add 31 days to the date (DateFromDaysSince() function). Extract the month and year components of that date (MonthFromDate() and YearFromDate() functions). Assemble the date of the first of that month (by using 1 as the day number with the derived year and month), assembled as a string. Subtract 1 from that date (DateFromDaysSince() function with -1 as the Days argument. Voila!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply