Please help StringToTimestamp

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
tini
Participant
Posts: 24
Joined: Thu Jun 19, 2003 6:37 am

Please help StringToTimestamp

Post by tini »

I support to convert a string with varchar (17) and the data looks like 20070111124536777.
I need convert it to timestamp yyyy-mm-dd hh:nn:ss.
could someone help me please. Please give me the syntax too.
Thank you for your help
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Code: Select all

StringToTimeStamp(In.Col,'%yyyy%mm%dd%hh%nn%ss')
and Bob's your uncle as some Yorkshire friends of mine are prone to saying.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Version 4 parallel job? Really? :shock:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
tini
Participant
Posts: 24
Joined: Thu Jun 19, 2003 6:37 am

Post by tini »

ray.wurlod wrote:Version 4 parallel job? Really? :shock:
oop! version 7.1 not 4x.
sorry
tini
Participant
Posts: 24
Joined: Thu Jun 19, 2003 6:37 am

Post by tini »

If I try the code on 7.1 then it works without warning. but Try on version 7.5 then we get the error
Warning:--Input_file,0: Conversion error calling conversion routine timestamp_from_string data may have been lost
do you know why? thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You have more digits than are required (that is, your string includes fractional seconds, but your date format string does not).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply