StringToTimestamp err

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

bart12872
Participant
Posts: 82
Joined: Fri Jan 19, 2007 5:38 pm

Post by bart12872 »

Sainath.Srinivasan wrote:The format must not be dependant on the version.
well, as it is write in the Help "Date, Time, and Timestamp functions that take a format string (e.g. timetostring(time, stringformat)) need specific formats."
It seems that the day and the month must be on 2 digits.
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Post by betterthanever »

bart12872,
we can handle single digit month and date as mentioned in the expessions ...

i agree that the expression you mentioned also works..
efxuser
Premium Member
Premium Member
Posts: 50
Joined: Tue Jun 24, 2008 9:00 am

Post by efxuser »

StringToTimestamp(Right('0':Field(DSLink8.Eff_date,'/',1),2):'/':Right('0':Field(DSLink8.Eff_date,'/',2),2):'/':Field(DSLink8.Eff_date,'/',3) :' 00:00:00',"%mm/%dd/%yyyy %hh:%nn:%ss")


this expression works but just waiting for someone to jump in with a elegant solution.Thanks for all the poster's time and help.
EFX
bart12872
Participant
Posts: 82
Joined: Fri Jan 19, 2007 5:38 pm

Post by bart12872 »

efxuser
Premium Member
Premium Member
Posts: 50
Joined: Tue Jun 24, 2008 9:00 am

Post by efxuser »

thanks very much
EFX
newmoonera
Participant
Posts: 2
Joined: Fri Mar 06, 2009 12:22 am
Location: India

Re: StringToTimestamp err

Post by newmoonera »

Wats the datatype of the field you are using...?
newmoonera
(Enjoy the Beauty of Life)
dr.murthy
Participant
Posts: 224
Joined: Sun Dec 07, 2008 8:47 am
Location: delhi

Re: StringToTimestamp err

Post by dr.murthy »

Hi,

use a isvaild function to get the date values which is having proper format means dd-mm-yyyy.you can deal with rest of the dates by prefix 0.
D.N .MURTHY
dr.murthy
Participant
Posts: 224
Joined: Sun Dec 07, 2008 8:47 am
Location: delhi

Re: StringToTimestamp err

Post by dr.murthy »

Hi,

use a isvaild function to get the date values which is having proper format means dd-mm-yyyy.you can deal with rest of the dates by prefix 0.
D.N .MURTHY
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Attention to detail!

There is no function called "isvaild".

Further, your assertion that the "proper" format of dates is dd-mm-yyyy is only correct if this is the default date format string.
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