Page 1 of 1

String to timestamp

Posted: Thu Jun 19, 2008 10:10 am
by dsdeveloper66
Hi,
Iam using the function
StringToTimestamp(DSLink2.XXXX,"yyyy-mm-dd hh:nn:ss")

DSLink2.XXXX='2005-01-01 12:01:01'(varchar(50))

When i tried to execute above, getting the following error.

Transformer_3,0: Caught exception from runLocally(): APT_ParseError: Parsing parameters "yyyy-mm-dd hh:nn:ss" for conversion "timestamp=timestamp_from_string[%yyyy-%mm-%dd %hh:%nn:%ss](string)": APT_Conversion_String_TimeStamp: Invalid Format [yyyy-mm-dd hh:nn:ss] used for string_from_time type conversion.

I looked into forums but could not get exact error posts.

we are having datastage v 7.5.1

Thanks

Posted: Thu Jun 19, 2008 11:31 am
by chulett
You missed all of the '%' markers:

Code: Select all

StringToTimestamp(DSLink2.XXXX,"%yyyy-%mm-%dd %hh:%nn:%ss") 

Posted: Fri Aug 01, 2008 5:22 am
by LavanyaRamesh007
I have a question.. I just want to know how this function works internally..
say I have a string
20030707

StringtoTimestamp converts the given string into time. %yyyy%dd%mm says let the first four characters be year. Next two be date and next two be month isnt??

If i dont specify the format what happens..???

Posted: Fri Aug 01, 2008 7:20 am
by keshav0307
If i dont specify the format what happens..???
then what will be your command??


it will fail to convert.

DS manual

Posted: Mon Aug 18, 2008 6:20 am
by vercama
keshav0307 wrote:
If i dont specify the format what happens..???
then what will be your command??


it will fail to convert.


Hi,
does anybody know where I can find a DS manual with the list of available transformation functions, please?

Thanks!

Posted: Mon Aug 18, 2008 6:35 am
by ArndW
On your pc, the PDF document is titled QualityStageParallel Job Developer Guide.

Posted: Mon Aug 18, 2008 6:36 am
by keshav0307
F1 in the transformer stage, The help.

Posted: Mon Aug 18, 2008 7:11 am
by ray.wurlod
In the Administrator client you can set default date, time and timestamp formats for the project (and the default decimal placeholder character). It is these that are used if no format string is provided, for better or worse.

The Transformer stage is documented in the Parallel Job Developer's Guide with its functions documented in an Appendix of that manual.