conversion of date(4) to timestamp(26)

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
karrisuresh
Participant
Posts: 57
Joined: Sat Jun 09, 2007 1:14 am
Location: chicago

conversion of date(4) to timestamp(26)

Post by karrisuresh »

HI I have a column of Date(4) and needed to convert in the transformer to timestamp(26)
Could any one give the syntax for this

Thanks in advance
thanks for your time

Suresh
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not without some idea what your "DATE(4)" data looks like and what you want to do for the missing date/time portions.
-craig

"You can never have too many knives" -- Logan Nine Fingers
karrisuresh
Participant
Posts: 57
Joined: Sat Jun 09, 2007 1:14 am
Location: chicago

Post by karrisuresh »

I am sorry the date(10) and the corresponding timestamp(26)
If at all anything missing then should be replaced with 00:00
thanks
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Use DateToString() to convert your Date into a String, then StringToTimeStamp() to convert that string into a timestamp.
karrisuresh
Participant
Posts: 57
Joined: Sat Jun 09, 2007 1:14 am
Location: chicago

Post by karrisuresh »

I used this one:
StringToTimestamp(DateToString(lnk_xfrm_column.UPDATE_DT),'yyyy-mm-dd hh:nn:ss')
but still not working

Thanks
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Try doing things just one step at a time. What is the string output of

Code: Select all

DateToString(lnk_xfrm_column.UPDATE_DT)
for your data?
karrisuresh
Participant
Posts: 57
Joined: Sat Jun 09, 2007 1:14 am
Location: chicago

Post by karrisuresh »

StringToTimestamp(DateToString(lnk_Lkp_CustKy_out.UPDATE_DT),'yyyy-mm-dd hh:nn:ss')


I have date so If I convert it into string
I might get for eg 1999-11-05 is the date
and the corresponding string is "1999-11-05"

could you pls help me

thanks
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

karrisuresh wrote:...could you pls help me...

I'm trying to. Just do it bit by bit. What is the string output from my last post's suggestion? Is what you posted your result or just what you think the result ought to look like?
changming
Participant
Posts: 68
Joined: Wed Oct 13, 2004 3:35 am

date to string them string to timestamp

Post by changming »

It should work. I used few days ago. Check your format %yyyy-%mm-%dd
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

changming - of course it cannot work. Which is why I am trying to get get the original poster to confirm his output.

hint: 1999-11-05 does not match the timestamp pattern 'yyyy-mm-dd hh:nn:ss'
Post Reply