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 » [solved] CASTing TIMESTAMP AS CHARACTER FORMAT 'e'

Post new topic  Reply to topic
 [solved] CASTing TIMESTAMP AS CHARACTER FORMAT 'e' « View previous topic :: View next topic » 
Author Message
j.f.sorge
PostPosted: Thu Dec 30, 2010 4:32 am    Post subject: [solved] CASTing TIMESTAMP AS CHARACTER FORMAT 'e' Reply with quote

Master

Joined: 27 Feb 2008
Posts: 218

I am using WMB 6.1.0.7 and wanted to check which day of week I currently have, so I've check the documentation and it stated to use the 'e' pattern in order to get the current day-number. I thought that it would be 4 when using the following code and values but it was 5.
Code:
DECLARE intDayInWeek   INTEGER CAST(CAST(tsNextStartTs AS CHARACTER FORMAT 'e') AS INTEGER);

Code:
intDayInWeek   5
tsNextStartTs   2010-12-30 13:26:53.869

So I've checked my environment and it prints the following
Code:
C:\Programme\Message_Broker_Runtime>mqsiservice -t
BIPv610  de DE
  ucnv Console CCSID 850    dft ucnv CCSID 5348
    ICUW ibm-5348_P100-1997    ICUA ibm-5348_P100-1997

ICU Version: 3.2
Current Local time: 2010-12-30 13:20:30.873
Current UTC time:   2010-12-30 12:20:30.875
ICU TimeZone ID:    Europe/Berlin
  Standard offset from GMT: 60
  Supports DST?             true
  Locating DST boundaries
    GMT                   Local                 DST Mins
    2010-01-01 13:00:00   2010-01-01 14:00:00   0

    2010-03-27 13:00:00   2010-03-27 14:00:00   0
    2010-03-28 13:00:00   2010-03-28 15:00:00   60

    2010-10-30 13:00:00   2010-10-30 15:00:00   60
    2010-10-31 13:00:00   2010-10-31 14:00:00   0
Day Names: Sonntag, Montag, Dienstag, Mittwoch, Donnerstag, Freitag, Samstag,
Month Names: Januar, Februar, März, April, Mai, Juni, Juli, August, September, Oktober, November, Dezember,
First day of week: 2
Days in first week of year: 4
AM: vorm. PM: nachm.
BIP8071I: Befehl wurde erfolgreich ausgeführt.

where I'm not sure whether "First day of week: 2" it the cause of my problem. Does the broker always use number 1 for sunday, 2 for monday and so on (and compute correctly depending on the value "First day of week" set by operating system)?!
_________________
IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0


Last edited by j.f.sorge on Thu Dec 30, 2010 5:56 am; edited 1 time in total
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Dec 30, 2010 5:40 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Looking at the infocentre page on the Extract command
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ak05420_.htm
Ok that if for V6.0 but the rules won't have changed for 6.1

shows that the first day of the week is Sunday. So Thursday is indeed day 5.

The EXTRACT(DAYOFWEEK....) would have given you the same result as the format 'e' by the way.
_________________
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.
Back to top
View user's profile Send private message
j.f.sorge
PostPosted: Thu Dec 30, 2010 5:55 am    Post subject: Reply with quote

Master

Joined: 27 Feb 2008
Posts: 218

smdavies99 wrote:
...
The EXTRACT(DAYOFWEEK....) would have given you the same result as the format 'e' by the way.

Thanks a lot for your help! By the way the documentation of EXTRACT function is more precise when speaking about the weekday numbers, so I have changed my code accordingly.
_________________
IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
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 » [solved] CASTing TIMESTAMP AS CHARACTER FORMAT 'e'
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.