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
-
vinsashi
- Participant
- Posts: 150
- Joined: Mon Aug 20, 2007 4:52 am
- Location: singapore
Post
by vinsashi »
i want to extract previous timestamp from current timestamp filed in datastage PX.
Thanks
v......
-
deeplind07
- Participant
- Posts: 31
- Joined: Mon Jun 28, 2010 5:15 am
- Location: pune
Post
by deeplind07 »
can you please explain in detail?
-
vinsashi
- Participant
- Posts: 150
- Joined: Mon Aug 20, 2007 4:52 am
- Location: singapore
Post
by vinsashi »
in my source file i am getting date columns and for target i should pass previous date for those columns.
ex:
frezdate
10/01/2010
01/03/2010
output:
09/01/2010
27/02/2010
like this i want output just previous date i should load for each record.
-
prasson_ibm
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
Post
by prasson_ibm »
Hi,
In transformer you can do the derivation in this way:-
DatefromJulianDay(Juliandayfrom date(Input.date)-1))
I think it should work.
Thnaks
Prasoon
-
deeplind07
- Participant
- Posts: 31
- Joined: Mon Jun 28, 2010 5:15 am
- Location: pune
Post
by deeplind07 »
I am not sure as i dont have datastage access now, but you can try using 'column_name - 1' directly in trnsformer
-
chulett
- Charter Member
- Posts: 43085
- Joined: Tue Nov 12, 2002 4:34 pm
- Location: Denver, CO
Post
by chulett »
That won't work, I'm afraid.
Another solution - research the use of the DateFromDaysSince function.
-craig
"You can never have too many knives" -- Logan Nine Fingers
-
ray.wurlod
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
-
Contact:
Post
by ray.wurlod »
TimestampFromSecondsSince() function with an offset of -86400 should also work.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.