XML dateTime formatter

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

XML dateTime formatter

Post by VCInDSX »

Hi Group,
In my XML output stage i need to emit date-time values for certain fields from a database column.
When i let XML Output stage to produce the datetime values, it generates datetime values like "2007-05-22 14:32:59.140". When i run this against my schema, which has these elements defined to be of type xs:dateTime, i get the following error
Datatype error: Type:InvalidDatatypeValueException, Message:Value '2007-05-22 14:32:59.140' is not in enumeration.
Looking up at http://www.w3.org/TR/xmlschema-2/#dateTime it appears that i should be emitting this as '2007-05-22T14:32:59Z'
Is there any direct routine in datastage to accomplish this or should i write my own? Or am i totally off course?

Your input/suggestions are much appreciated.
Thanks,
-V
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You need to roll your own. I haven't had to worry about TZ yet, so just putting a 'T' where the space was worked for my processes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post by VCInDSX »

Hi Craig,
Thanks a lot for the quick response. That was very helpful. I tried the "T" without the timezone information and it worked great.

Thanks,
-V
Post Reply