Currentdate-1 ?

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
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Currentdate-1 ?

Post by swades »

Hi,

Can anyone help me how to calculate currentdate()-1 ?

Thanks
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Where do you want to do that, in DataStage? or in a database stage?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

I want to do this in Datastage.


Thanks
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

here you go to use in transformer

OCONV(ICONV(@Date,"D4-YMD[4,2,2]")-1,"D4-YMD[4,2,2]")

Change the format to meet your requirement
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

paddu wrote:here you go to use in transformer

OCONV(ICONV(@Date,"D4-YMD[4,2,2]")-1,"D4-YMD[4,2,2]")

Change the format to meet your requirement
Paddu,
Iconv and Oconv aren't available in PX.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

Thanks

I want that in PX.


Thanks
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You can do it inside the transformer. Something like

Code: Select all

DateFromJulianDay(JulianDayFromDate(DSJobStartDate) -1)
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

Thanks you very much

I used

Code: Select all

DateFromJulianDay((JulianDayFromDate(CurrentDate())-1)) 
It works fine

Thanks again.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

swades wrote:Thanks you very much

I used

Code: Select all

DateFromJulianDay((JulianDayFromDate(CurrentDate())-1)) 
It works fine

Thanks again.
I think you can remove the extra pair of parenthesis. :wink:

Code: Select all

DateFromJulianDay(JulianDayFromDate(CurrentDate())-1) 
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

sorry overlooked
Post Reply