System Date -15 Years

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
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

System Date -15 Years

Post by ds2000 »

I want to a compare of date (yyyy-mm-dd) with system date -15 years in Transformer in px. What functions should i use.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Depends how accurately you need it. You could use DateFromDaysSince() if you're happy to say that 15 years is 5479 days. Otherwise you need to break the date into its components, using YearFromDate(), MonthFromDate() and DayFromDate(), subtract 15 from the year component, re-assemble the date, subtracting 1 from the day if the date is Feb 29, using DateFromString(). The integers will cast implicitly to strings.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

It works fine..Thanks Ray.
Post Reply