Adding year to 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
rafidwh
Participant
Posts: 179
Joined: Mon Oct 10, 2005 11:30 pm

Adding year to date

Post by rafidwh »

Hi All,

How to add 6 years to a incoming date in yyyymmdd format.
The source and target both are sequential files.

Please let me know if there are any functions to convert,add etc..

Regards,
Rafidwh.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Is the column type a string? If so, just use

Code: Select all

In.DateColumn[1,4]+6:In.DateCoLumn[5,4]
Last edited by ArndW on Wed Dec 12, 2007 8:14 am, edited 1 time in total.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

This works unless the incoming date is Feb 29, in which case you also need to subtract 1 from the day number.
ArndW wrote:Is the column type a string? If so, just use

Code: Select all

In.DateColumn[1,4]+6:In.DateCoumn[5,4]
...
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
Post Reply