ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Date format

Post new topic  Reply to topic
 Date format « View previous topic :: View next topic » 
Author Message
brgmo
PostPosted: Mon Oct 29, 2007 4:22 am    Post subject: Date format Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

Hi All,

Can someone please help me in getting the followinf format of date:

2007/10/30

How to get the date in the above format. I have explored the date function and it doesn't work the way i want.

Also, what should i do get only </fieldname> in the output i mean i don't want to have <fieldname></fieldname> but instead only the closing tag i.e. </fieldname>.

Regards
brgmo.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 29, 2007 4:30 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

A) date formatting depends on what domain you are using.
b) how XML is rendered depends on what XML domain you are using, but generally to get the result you want, the element must exist in the tree, but have no value.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
brgmo
PostPosted: Mon Oct 29, 2007 4:36 am    Post subject: Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

Thanks Jeff. I am using XML domain presently but will be MRM later on.
For getting the desired date pattern i have written the following code:

declare pattern char 'yyyy/dd/mm'

set outputroot.xml.dat = cast(current_date as date format pattern)

for getting xml with the closing tag only, i have written the following code:

set outputroot.xml.notag value null;

both of the above are notworking.

Regards
brgmo.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 29, 2007 4:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Why would you possibly use XML, when you should be using XMLNS or XMLNSC?

Casting a date field into a date field won't cause any formatting to occur. The FORMAT clause is for controlling how a string value is turned into a date field, or a date field is turned into a string field.

Remember that XML data is all strings, anyway.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 29, 2007 4:39 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Also, setting the value of a non-existent field won't create the field, afaik.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
brgmo
PostPosted: Mon Oct 29, 2007 5:16 am    Post subject: Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

Please,anyone can helpme on this.

Regards
brgmo.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 29, 2007 5:24 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Don't use XML. Use XMLNS or XMLNSC. Really!

Cast your date value to a CHARACTER, rather than another date.

create or set the noData field in output first, and then set the value to NULL.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
vsr
PostPosted: Mon Oct 29, 2007 5:32 am    Post subject: Reply with quote

Centurion

Joined: 04 Apr 2006
Posts: 104

1)CAST(CURRENT_DATE AS CHARACTER FORMAT 'yyyy/DD/mm')
2)CREATE FIELD OutputRoot.XMLNS.<Root_Tag>.notag VALUE(NULL);
Back to top
View user's profile Send private message
brgmo
PostPosted: Mon Oct 29, 2007 6:18 am    Post subject: Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

CAST(CURRENT_DATE AS CHARACTER FORMAT 'yyyy/DD/mm')
the above code doesn't work and displays just //00. any idea.
Back to top
View user's profile Send private message
vsr
PostPosted: Mon Oct 29, 2007 9:15 am    Post subject: Reply with quote

Centurion

Joined: 04 Apr 2006
Posts: 104

Try this:

CAST(CURRENT_DATE AS CHARACTER FORMAT 'yyyy/dd/MM')
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Date format
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.