Date Conversion

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
jpraveen
Participant
Posts: 71
Joined: Sat Jun 06, 2009 7:10 am
Location: HYD

Date Conversion

Post by jpraveen »

Hi All,

I am getting data in CSV File and the date format is mm/dd/yyyy,
in Sequential file i can't view the data
so i made the datatype as Varchar and now i can view the data ,and my output format must be like this YYYY-MM-DD

but when i run the job the job is getting Aborted.

The error message is
DB2Driver Embedded SQL message: SQL0180N The syntax of the string representation of a datetime value is
incorrect. SQLSTATE=22007
In Transformer i made as

Code: Select all

StringToDate(DateToString(LkInto_TRNS_SeqGen.Date,"%mm/%dd/%yyyy"),"%yyyy-%mm-%dd")
please help on this
Jaypee
Vidyut
Participant
Posts: 24
Joined: Wed Oct 13, 2010 12:45 am

Post by Vidyut »

Try This:
StringToDate(LkInto_TRNS_SeqGen.Date,"%mm/%dd/%yyyy")
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What is your target, another string or a date field? Assuming date from what you posted but you haven't explicitly said. And is your source a string still or did you set it back to a date?

It would probably help if you posted some actual samples of the values you are seeing in the file.
-craig

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