Comparing Dates in PX jobs

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
dlvsrinivas
Participant
Posts: 18
Joined: Mon Jul 07, 2003 12:56 am
Location: India

Comparing Dates in PX jobs

Post by dlvsrinivas »

Dear All,

I need to calculate the difference between the current system date and the date passed as an input in months and days using PX job. I have a routine to do the same, but I can't use the same in PX jobs.

Could anybody suggest the functions to be used for the same purpose which takes care of the above purpose? Can we have something similar to routine in PX jobs which can be reused across different PX jobs?

Thanks in advance.
With best regards,
Srinivas.
Peytot
Participant
Posts: 145
Joined: Wed Jun 04, 2003 7:56 am
Location: France

Post by Peytot »

You can create a Variable into your transform which does the same think that your routine.

Pey
bigpoppa
Participant
Posts: 190
Joined: Fri Feb 28, 2003 11:39 am

Post by bigpoppa »

The subtraction operator is overriden for the APT_DATE type. You can subtract two APT_DATEs, and the result will be given to you in number of days. You can use other date functions to convert this into MON/DAY/YEARS.

- BP
Post Reply