DATE

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
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

DATE

Post by karry450 »

Hi Friends,

I am getting a column(DATE)Timestamp in transformer stage say ex 29-05-2010 06:00:00 I want to add +4 days in the transformer stage.

when I say DATE+4 in transformer stage it doesnt work can anyone help me with function or the way to add 4 days for the input DATE


Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You will need to separate the date and time components. Get these date arithmetic routines and add 4 days to the date, then re-assemble the time portion onto the end.

Or:

Code: Select all

Oconv(Iconv(Field(InLink.MyTimestamp," ",1,1), "DYMD") + 4, "D-YMD[4,2,2]") : " " : Field(InLink.MyTimestamp," ",2,1)
Last edited by ray.wurlod on Wed Jun 09, 2010 4:21 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Post by karry450 »

ray.wurlod wrote:You will need to separate the date and time components. Get these date arithmetic routines and add 4 days to the da ...
Hi Ray,

I dont have the premium membership can you please help me with the code

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Hi karry450

I don't have a desire to have DSXchange die through lack of funding can you please obtain a premium membership?

Thanks
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

He did help. The rest is up to you... or any of the thousands of other people here could chime in as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Even if you don't have premium membership, you have the lead from that small portion.

Only thing is you need to have understanding of Iconv and oconv function.

you need to split date part and time part and add 4 days to date and then concatanate with time part.

IConv of date returns a number which is number of days from 1970. So adding 4 to that you will get date+4 and then convert it to date format using OConv.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Sorry for not posting the exact code, but in case you dont want to write it on your own, please hire someone who can or get the premium membership to look at Ray's post.

Try it, its quite simple to write that code.

EDIT:- by the way click on the link to get routines written by Ray to make the task easy.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply