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 » Problem setting date and time

Post new topic  Reply to topic
 Problem setting date and time « View previous topic :: View next topic » 
Author Message
marco
PostPosted: Fri Dec 15, 2006 2:19 am    Post subject: Problem setting date and time Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

Hi,


I've created a messageflow to receive input through the HTTP-input node and put the data on an MQSeries Queue.

The problem is that the date and the time of every message (in the MQMD) is that of the last deploy from the messageflow.

I tried setting time and date in different ways (even hardcoding, just to check) but nothing helps. The confusing part is that the setting of for example the application name works perfectly ...

...
SET OutputRoot.MQMD.PutApplName = 'plain_http_adapter';
SET OutputRoot.MQMD.PutApplType = 11;
SET OutputRoot.MQMD.PutDate = CURRENT_DATE;--'20061210'
SET OutputRoot.MQMD.PutTime = CURRENT_TIME;
...

Any help would be appreciated ...

T

PS I'm currently working on a v5 broker
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Dec 15, 2006 3:39 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Have you tried using character variables for date and time and using the GMT version (MQ dates are always in GMT) then assigning the date to the variable (make sure the format will match) and finally assigning the variable to the MQMD field?

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
marco
PostPosted: Fri Dec 15, 2006 4:08 am    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

I've tried setting it hard-coded ... that should always work ... no ?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Dec 15, 2006 4:57 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Maybe you should tell us what version and fix pack level you're using.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
marco
PostPosted: Fri Dec 15, 2006 6:00 am    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

Sorry :

Version 5 broker, Release 0.1 Update 4
Back to top
View user's profile Send private message
EddieA
PostPosted: Mon Dec 18, 2006 10:34 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

The MQMD fields for date and time are MQCHAR8. The character representation of CURRENT_DATE and CURRENT_TIME contain "additional" characters.

You need to either SUBSTRING out the relevent information, or use FORMAT. (Was FORMAT available in V5 ??)

Cheers.
_________________
Eddie Atherton
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
JosephGramig
PostPosted: Mon Dec 18, 2006 12:59 pm    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

And the format syntax is something like:
Code:
SET szTest = CAST(CURRENT_DATE AS CHARACTER FORMAT 'dd/MM/yy');


And it is not available in WBIMB 5.0.
_________________
Joseph
Administrator - IBM WebSphere MQ (WMQ) V6.0, IBM WebSphere Message Broker (WMB) V6.1 & V6.0
Solution Designer - WMQ V6.0
Solution Developer - WMB V6.1 & V6.0, WMQ V5.3
Back to top
View user's profile Send private message AIM Address
marco
PostPosted: Wed Dec 20, 2006 1:06 am    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

Thanx for the replies ...

I've tried both :
SET OutputRoot.MQMD.PutDate = '19/12/06'
SET OutputRoot.MQMD.PutDate = '20061219'

None of them works ...

I'm really lost here, this will be something stupid, but I can't find it

T
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Dec 20, 2006 11:34 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

What do you have for the Message Context, in the MQOutput node. Try using one of the SET options.

Cheers.
_________________
Eddie Atherton
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
marco
PostPosted: Wed Dec 20, 2006 11:40 pm    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

Let me give some more information :

This is the ESQL I'm running :

DECLARE d CHAR CAST(CURRENT_DATE AS CHAR); -- YYYY-MM-DD "DATE '2006-12-14'"
DECLARE t CHAR CAST(CURRENT_TIME AS CHAR); -- HH:MM:SS.mmm "TIME '15:41:00.515'"

SET OutputRoot.MQMD.StrucId = MQMD_STRUC_ID;
SET OutputRoot.MQMD.ApplIdentityData = '';
SET OutputRoot.MQMD.ApplOriginData = '';
SET OutputRoot.MQMD.Expiry = -1;
SET OutputRoot.MQMD.Encoding = InputRoot.Properties.CodedCharSetId;
SET OutputRoot.MQMD.PutApplName = 'plain_http_adapter';
SET OutputRoot.MQMD.PutApplType = 11;
SET OutputRoot.MQMD.PutDate = '20050311';--SUBSTRING(d FROM 7 for 4)||SUBSTRING(d FROM 12 for 2)||SUBSTRING(d FROM 15 for 2);
SET OutputRoot.MQMD.PutTime = SUBSTRING(t FROM 7 for 2)||SUBSTRING(t FROM 10 for 2)||SUBSTRING(t FROM 13 for 2)||SUBSTRING(t FROM 16 for 2);
SET OutputRoot.MQMD.UserIdentifier = 'testuser';



Just before the "return TRUE" is called in the compute node, the MQMD looks like this :

StrucId : MD
ApplIdentityData : ' '
ApplOriginData : ' '
Expiry : -1
Encoding : 1208
PutApplName : plain_http_adapter
PutApplType : 11
PutDate : 20050311
PutTime : 08264970
UserIdentifier : testuser

looks the way I would like it ...

when stepping out of the compute node the MQMD becomes :


StrucId : MD
ApplOriginData : ' '
Expiry : -1
Encoding : 546
PutApplName : plain_http_adapter
PutApplType : 11
PutDate : 2006-12-21
PutTime : 07:25:43.624
UserIdentifier : testuser
Format : ' '
CodedcharsetId : 1208
Transactoinal : false
persistence : 0
Priority : 0
CorrelID : 000000000000000000000000000000000000000000000000

So here some field are overridden ...

My compute node has mode "All", the outputnode has "set all" configured, but the data is already wrong there ...

T

PS I'v tried setting the date with '2005-03-11', but same results occur
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Dec 21, 2006 10:16 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Insert this
Code:
CREATE NEXTSIBLING OF OutputRoot.Properties domain 'MQMD';

before
Code:
SET OutputRoot.MQMD.StrucId = MQMD_STRUC_ID;

Cheers,
_________________
Eddie Atherton
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
fjb_saper
PostPosted: Thu Dec 21, 2006 2:39 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

And I don't believe that MQMD takes any decimals on the time field....
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
marco
PostPosted: Tue Jan 02, 2007 2:05 am    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

Thanx for the suggestions, I've just tried them, but it failed.
This is the complete module code :

CREATE COMPUTE MODULE Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
DECLARE type CHAR;
SET type = FIELDNAME(InputRoot.XML.[<]);



SET OutputLocalEnvironment.Destination.MQ.DestinationData.queueName =
TRIM(THE(Select ITEM A.QNAME from Database.DB2ADMIN.ROUTING AS A
where A.IDOC_TYPE = type));

SET OutputRoot.Properties = InputRoot.Properties;
CALL CreateMQMD();
SET OutputRoot.XML = InputRoot.XML;

RETURN TRUE;
END;

CREATE PROCEDURE CreateMQMD() BEGIN

DECLARE d CHAR CAST(CURRENT_DATE AS CHAR); -- YYYY-MM-DD "DATE '2006-12-14'"
DECLARE t CHAR CAST(CURRENT_TIME AS CHAR); -- HH:MM:SS.mmm "TIME '15:41:00.515'"

CREATE NEXTSIBLING OF OutputRoot.Properties domain 'MQMD';
SET OutputRoot.MQMD.StrucId = MQMD_STRUC_ID;
SET OutputRoot.MQMD.ApplIdentityData = '';
SET OutputRoot.MQMD.ApplOriginData = '';
SET OutputRoot.MQMD.Expiry = -1;
SET OutputRoot.MQMD.Encoding = InputRoot.Properties.CodedCharSetId;
SET OutputRoot.MQMD.PutApplName = 'plain_http_adapter';
SET OutputRoot.MQMD.PutApplType = 11;
SET OutputRoot.MQMD.PutDate = '2005-03-11';--SUBSTRING(d FROM 7 for 4)||SUBSTRING(d FROM 12 for 2)||SUBSTRING(d FROM 15 for 2);--
SET OutputRoot.MQMD.PutTime = SUBSTRING(t FROM 7 for 2)||SUBSTRING(t FROM 10 for 2)||SUBSTRING(t FROM 13 for 2)||SUBSTRING(t FROM 16 for 2);
SET OutputRoot.MQMD.UserIdentifier = 'testuser';
/*SET OutputRoot.MQMD.Report = 0;
SET OutputRoot.MQMD.Persistence = 2;
SET OutputRoot.MQMD.Priority = -1;
SET OutputRoot.MQMD.Offset = 0;
SET OutputRoot.MQMD.ReplyToQ = ' ';
SET OutputRoot.MQMD.ReplyToQMgr = ' ';
SET OutputRoot.MQMD.MsgType = 8;
SET OutputRoot.MQMD.MsgSeqNumber = 1;
SET OutputRoot.MQMD.MsgFlags = 0;
SET OutputRoot.MQMD.CodedCharSetId = 0;
SET OutputRoot.MQMD.BackoutCount = 0;
SET OutputRoot.MQMD.Version = 1;
SET OutputRoot.MQMD.Transactional = true;
SET OutputRoot.MQMD.SourceQueue = 'WebService';*/
END;


CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
Back to top
View user's profile Send private message
special_agent_Queue
PostPosted: Tue Jan 02, 2007 6:04 am    Post subject: Reply with quote

Centurion

Joined: 27 Jul 2006
Posts: 102

The PutTime needs to be in a TIMESTAMP format. If you need the time in a different format, add it to the message somewhere, the rfh2 usr folder, or just have the receiving application handle it.
Back to top
View user's profile Send private message
marco
PostPosted: Tue Jan 02, 2007 6:14 am    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

I've tried with the CURRENT_TIME function, without luck.

I'm afraid I will have to put the time and date in the data somewhere ... but I'm still finding it very strange it wont work
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 » Problem setting date and time
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.