Date transformations

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
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Date transformations

Post by meena »

Hi All,
I want to know how can we add number of months to today's date in the transformer. something like " DATE() + 12 MONTHS". As I know I can add in sql by using a sql meta tag : %dateadd( date,-no of days). But I want to do it in the transformer by writing a simple stage variable expression.

with regards,
Meena
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Appendix B-1 of the Parallel Job Developer's Guide lists the functions you can use, in your case DateFromDaysSince look like the appropriate one to use.
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

Hi Meena,

There is a function available in the Transformer - DateFromDaysSince(date,number of days),
that lets you add/subtract a certain number of days from a given date.

The second arguement in the function is of int32 type while the first is of date type.

This function is available in the Transformer, at Date & Time under Functions.

Hope this helps.

Regards,

The Bird.
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi,
The function worked for me.

Thank you
Meena
Post Reply