Author |
Message
|
mqbrk_newbie |
Posted: Fri Oct 15, 2004 7:51 am Post subject: mqmd |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
hi,
I have some situation where I need to record the time when the message is coming into the message flow and the time when message goes out of the message flow without using current_date and currect_time function . Is there anyway that I can retrieve the date and time through MQMD. Can any one please let me know the ESQL statement for that..
thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 15, 2004 8:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The MQMD will not change between the start of your message flow and the end of your message flow.
The MQMD does contain the Put time of the message. But that merely tells you when the message was put on the queue. It does not tell you when the message was gotten from the queue, or what time it is when you put it back.
You could get the put time of your outgoing message by putting a Compute Node after your MQOutput Node, and then accessing the PutMessageTime field of the MQMD. That would tell you when you put the message.
But that's populated by MQSeries using the current time
Your requirements basically don't make any sense the way you have explained them. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mqbrk_newbie |
Posted: Fri Oct 15, 2004 8:23 am Post subject: |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
jeff,
If you put a message on a queue there is a field called creation time which is stored on the properties field of the message. how can i retrive that information and store in some environment variable. Can u help me with this please..
thanks |
|
Back to top |
|
 |
JT |
Posted: Fri Oct 15, 2004 8:26 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Quote: |
Is there anyway that I can retrieve the date and time through MQMD |
Yes, of course.
Code: |
DECLARE putDate DATE InputRoot.MQMD.PutDate;
DECLARE putTime GMTTIME InputRoot.MQMD.PutTime;
|
But I have to agree with Jeff's statement that your requirements basically don't make sense. I'm curious as to why the current date & time functions cannot be used. |
|
Back to top |
|
 |
JT |
Posted: Fri Oct 15, 2004 8:31 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Code: |
DECLARE creationTime GMTTIMESTAMP InputRoot.Properties.CreationTime; |
|
|
Back to top |
|
 |
mqbrk_newbie |
Posted: Fri Oct 15, 2004 10:16 am Post subject: |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
hi ,
As told by your guys I used two compute nodes one after after MQ input node and another one after MQ outputnode to see the time when message was sent and received.
As suggested by you i used your esql statement
DECLARE creationTime GMTTIMESTAMP InputRoot.Properties.CreationTime;
and stored it on environment variable as message sent time and received time , but the problem is that I am getting the same time in both the variables. Am I doing anything wrong
thanks for your help in advance |
|
Back to top |
|
 |
kirani |
Posted: Fri Oct 15, 2004 11:12 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Well, the time in the Properties folder does not change at every stage of the message flow nor does the time in the MQMD.PutTime field. If you use the default option on your MQOutput node, it will put current timestamp in MQMD.PutDate and MQMD.Puttime field, but you need to read that message to see what values it'd put in.
May I ask why don't you want to use CURRENT_TIMESTAMP? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
mqbrk_newbie |
Posted: Fri Oct 15, 2004 11:34 am Post subject: |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
HI,
Sorry for being a novice and bothering you.
I did not get exactly what you said . what is the default option in MQOutput node means(is that mean setting the message context to default on the advanced properties of MQoutput node).As per your suggestion can you tell me exaclty how to get using current_timestamp. I tried it . It still showing the same value . I am not sure whether I am correct or not can u explain it please.
thanks |
|
Back to top |
|
 |
mqbrk_newbie |
Posted: Fri Oct 15, 2004 12:10 pm Post subject: |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
hi,
Actually I used this peace of code in the compute node after the MQ output node. I am getting invalid ESQL expression . Am I doing anything wrong..
DECLARE timest TIMESTAMP;
SET timest = CURRENT_TIMESTAMP;
SET Environment.Variables.MessageSentTime = timeset;
Am I doing anything wrong..
Can u please help me out |
|
Back to top |
|
 |
mqbrk_newbie |
Posted: Fri Oct 15, 2004 12:26 pm Post subject: |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
hi all,
Actually as told by kirani, I used the current_timestamp function. Its working fine . I think thats the only way I can do it. Thanks all for the help. |
|
Back to top |
|
 |
|