Posted: Tue Oct 29, 2013 9:44 am Post subject: DateTime to Date
Newbie
Joined: 29 Oct 2013 Posts: 3
I'm using version 9(Integration bus) trying to cast DateTime(XMLNSC) to Date(Text).
MQInput--Comput(using CAST function to change to output format)---MQout
DateTime format: yyyy-mm-ddThh:mm:ss.Z(Datetype is STRING in my schema)
To
Date: MMddyyyy(Data type is Date in my schema)
It's throwing me an error(The DFDL serializer cannot convert the xs:string value '2013-10-15T15:08:01.768-07:00' to the declared type 'xs:date').
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
Let's try to understand what you are trying to do.
1) you get a message that is XML formatted and you parse it using the XMLNSC Parser
2) You want to extract the date part of a timestamp and put it into the format you want(Silly american format)
3) You want to output the data as a 'flat file' type to a queue.
If this is true, you can do this without needing the DFDL Parser on the output side. It might be easier to do that if you are not really familiar with the DFDL parser and how to set the model up correctly.
You could cast the CHAR that you have formatted as a BLOB and make that the output message (OutputRoot.BLOB.BLOB). _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Here my requirement is to use DFDL in my output schema because i need to do padding and also i have 19 elements to transform including datetime to date element.
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
Ok so make the DFDL model element for this field an xs:string then the Parser won't try to format it as a date. After all, you have already formatted it properly. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum