Date column

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
reshma11
Premium Member
Premium Member
Posts: 25
Joined: Mon Oct 13, 2008 7:52 am

Date column

Post by reshma11 »

How to add 2 years to system current date.

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

Post by chulett »

Depends on how picky you are about "two years". If you go with the definition that says a year is 365 days, then use DateFromDaysSince() to add 730 days to the system date.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

What does 2 year constitue ? What is 2 years from 29/02/2008 ?

365 days per year or 12 months per year or only 2 years increment.

For first, you can do a DaysFromDateSince().

For other 2 options, search for DateToString() and StringToDate().
reshma11
Premium Member
Premium Member
Posts: 25
Joined: Mon Oct 13, 2008 7:52 am

Re: Date column

Post by reshma11 »

[quote="reshma11"]How to add 2 years to system current date.

Thanks.

only 2 years increment and the format should be YYMM
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

I will suggest you try from the given information rather than asking the full solution.

We expect some effort from you also - apart from typing your requirement.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hmmm... then that sounds like just a little substring work and adding 2 to the YY portion before you glue them together.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

With a little care where YY is "98" or "99".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah, true... you'd need to constrain it to the rightmost two digits but that's simple enough.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply