Last calender date

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

Post Reply
sateeshbabu
Participant
Posts: 48
Joined: Sat Oct 22, 2005 9:56 am

Last calender date

Post by sateeshbabu »

Hi

I have to populate "last calendar date" in end_date column

Source : Varchar
Targget : Date

I am doing in the below way

END_DATE[1,4]:'-':MonthFromDate(END_DATE)+1:'-':01 SvarDt1


JulianDayFromDate(SvarDt1)-1 SvarDt2

DateFromJulianDay(SvarDt2 Svardt3


End_date=Svar3

I am getting the follwoing errors

APT_CombinedOperatorController,0: Invalid character conversion found converting to ISO-8859-1, substituting.

Un-handled conversion error on field "START_DATE " from source type "date" to destination type "raw[7]":


When i took the stagevariable values to peek stage i am getting like "SvarDt1:2008/2/1 SvarDt2:-1 Svardt3:093-02-27 "

Could you please help me out in solving this

Regards,
Sateesh.M
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:idea: Rather than make people puzzle out and guess what you mean by "last calendar date" why not provide specific examples so it hopefully becomes clearer? For example, show an "END_DATE" value and what it should be transformed into as a "last calendar date".
-craig

"You can never have too many knives" -- Logan Nine Fingers
sateeshbabu
Participant
Posts: 48
Joined: Sat Oct 22, 2005 9:56 am

Post by sateeshbabu »

Chulett,

Thanks for the reply.

I have to populate last calendar date of the month that i am getting from input.

For Exapmple Input record is 2008-12-27 then need to popultae '2008-12-31' in end_date column.

Regards,
Sateesh.M
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Do an Exact search on "month end date" in the PX forum.
-craig

"You can never have too many knives" -- Logan Nine Fingers
fareeda_b
Participant
Posts: 48
Joined: Sat Feb 23, 2008 4:25 pm

Post by fareeda_b »

Hi Sateesh,

Could you please explan how your doing this Last calender date function logic ?

thanks
fareeda
Thanks
fareeda_b
Participant
Posts: 48
Joined: Sat Feb 23, 2008 4:25 pm

Post by fareeda_b »

Hi Sateesh,

Could you please explan how your doing this Last calender date function logic ?

thanks
fareeda
Thanks
hemanthakumar
Participant
Posts: 34
Joined: Mon May 05, 2008 1:31 am

Last Calender Date

Post by hemanthakumar »

Hi Sateesh,
For last month last date use this follwing logic:
DateFromJulianDay(JulianDayFromDate(CurrentDate()) - CurrentDate() [9,2])
fareeda_b
Participant
Posts: 48
Joined: Sat Feb 23, 2008 4:25 pm

Post by fareeda_b »

Hi hemantha kumar,

need clarification on last calender date if i want 2008-12-31 date .

could you please explan me how it will resolve this.


thanks
fareeda
Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How about a simple expression to generate the last day of the month (perhaps in a stage variable), and build the new date from that? Don't forget to handle leap year (perhaps a separate stage variable).
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