Need to Find months between date and load to history table

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
vjkrsn
Participant
Posts: 2
Joined: Mon Sep 08, 2008 5:02 pm

Need to Find months between date and load to history table

Post by vjkrsn »

Hi DS experts,

I have a situation where in my input (for a set of keys) there is an Effective Date and Term Date

For each record(identified by keys) i need to find the months between effective date and termination date and insert it to a history table.

to explain better I have given an example below.

Input
=====
KEY Effective Terminate
M1 03/25/2008 06/10/2008
M2 12/10/2008 04/15/2009


Output
=======
Key Effective Terminate
M1 03/25/2008 03/31/2008
M1 04/01/2008 04/30/2008
M1 05/01/2008 05/31/2008
M1 06/01/2008 06/10/2008

M2 12/10/2008 12/31/2008
M2 01/01/2009 01/31/2009
M2 02/01/2009 02/28/2009
M2 03/01/2009 03/31/2009
M2 04/01/2009 04/15/2009

Please let me know the best possible approach in Datastage.

Please note that Shell Scripts/Routines/Stored Procedures are generally not allowed in my production environment and I have to get approval from lot of people stating a very strong reason

Thanks
Vj.
Last edited by vjkrsn on Wed Oct 21, 2009 5:55 am, edited 2 times in total.
Vij
tehavele
Premium Member
Premium Member
Posts: 79
Joined: Wed Nov 12, 2008 5:41 am
Location: Melbourne

Post by tehavele »

I have come across this sort of calculation.For this I had created a buildop which would create duplicate rows equal to difference of the months and then in the following transformer after build op calculate dates.This is just a general idea.
Tejas
Post Reply