StingtoDate

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
devanars
Premium Member
Premium Member
Posts: 99
Joined: Thu Nov 30, 2006 6:25 pm

StingtoDate

Post by devanars »

I am getting this error while converting stringtodate. source is .csv file and datatype is varchar have to keep date in oracle target.
using the ds version 8.1

I am using the code: StringToDate(SRC.DATE,'%mm/%dd/%yyyy')
getting resulet like **************

APT_CombinedOperatorController,0: Data string '11/2/2007' does not match format '%mm/%dd/%yyyy': the value for tag %dd has fewer characters than expected.

any advise!
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I had that issue a while back and had to use the length and an IF THEN ELSE clause with two different pictures for the date. I vaguely recall having seen someone post a format that accepts variable length date components but am not sure - I do know that it isn't documented.
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Re: StingtoDate

Post by betterthanever »

using this format would solve the issue

Code: Select all

StringToDate(SRC.DATE,'%m/%d/%yyyy')
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Re: StingtoDate

Post by betterthanever »

repost
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Re: StingtoDate

Post by betterthanever »

using this format would solve the issue

Code: Select all

StringToDate(SRC.DATE,'%m/%d/%yyyy')
devanars
Premium Member
Premium Member
Posts: 99
Joined: Thu Nov 30, 2006 6:25 pm

Re: StingtoDate

Post by devanars »

what is the format i can use if i need to keep the date like 19 sep 2008.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? What do you mean 'keep the date'? A date is a date and is stored in an internal representation, only external (string) formats have display options like that. So use whatever mask matches the incoming date format in the StringToDate function.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply