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 » IBM MQ API Support » Perl MQ API - Need to get timestamp from message header

Post new topic  Reply to topic
 Perl MQ API - Need to get timestamp from message header « View previous topic :: View next topic » 
Author Message
any2xml
PostPosted: Tue Sep 21, 2004 8:56 am    Post subject: Perl MQ API - Need to get timestamp from message header Reply with quote

Apprentice

Joined: 18 May 2004
Posts: 42

Does MQ timestamp each message? Is it possible to read the timestamp from the message header? The messages I have been getting from a federal agency is supposed to include the date and time inside the message but it is so screwy I can not rely on it.

I am using MQSeries Perl API.

Help appreciated.
_________________
A Perl Hacker
http://www.goreliance.com
http://www.any2xml.com
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Sep 21, 2004 9:08 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You mean the PutMessageTime in the MQMD?

That should be available through the Perl API.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
any2xml
PostPosted: Tue Sep 21, 2004 4:02 pm    Post subject: Not sure which module and method Reply with quote

Apprentice

Joined: 18 May 2004
Posts: 42

I presume you are right. I am unable to find reference to PutMessageTime in the Application Programming Reference.

Could you point to me the module / method that I should be using? I did not find a reference to PutMessageTime via Perldoc.

There are many MQSeries modules. I am not sure which one I need to use.

If you have an example that would be splendid. Thanks
_________________
A Perl Hacker
http://www.goreliance.com
http://www.any2xml.com
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Sep 21, 2004 5:49 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Sorry. My memory isn't very good for niggling details. That's why I keep the manuals available electronically.

Applicationg Programming Reference, Chapter 10 - MQMD Message Descriptor wrote:
PutTime (MQCHAR8)
Time when message was put.

This is part of the origin context of the message. For more information about message context, see Overview; also see the WebSphere MQ Application Programming Guide.

The format used for the time when this field is generated by the queue manager is:

HHMMSSTH

where the characters represent (in order):

HH
hours (00 through 23)
MM
minutes (00 through 59)
SS
seconds (00 through 59; see note below)
T
tenths of a second (0 through 9)
H
hundredths of a second (0 through 9)
Note:
If the system clock is synchronized to a very accurate time standard, it is possible on rare occasions for 60 or 61 to be returned for the seconds in PutTime. This happens when leap seconds are inserted into the global time standard.
Greenwich Mean Time (GMT) is used for the PutDate and PutTime fields, subject to the system clock being set accurately to GMT.

On OS/2, the queue manager uses the TZ environment variable to calculate GMT.

If the message was put as part of a unit of work, the time is that when the message was put, and not the time when the unit of work was committed.

For the MQPUT and MQPUT1 calls, this is an input/output field if MQPMO_SET_ALL_CONTEXT is specified in the PutMsgOpts parameter. The contents of the field are not checked by the queue manager, except that any information following a null character within the field is discarded. The null character and any following characters are converted to blanks by the queue manager. If MQPMO_SET_ALL_CONTEXT is not specified, this field is ignored on input and is an output-only field.

After the successful completion of an MQPUT or MQPUT1 call, this field contains the PutTime that was transmitted with the message. If the message has no context, the field is entirely blank.

On VSE/ESA, this is a reserved field.

This is an output field for the MQGET call. The length of this field is given by MQ_PUT_TIME_LENGTH. The initial value of this field is the null string in C, and 8 blank characters in other programming languages.


I don't have an example from the Perl API, but it should be a matter of asking for something like "$message{'PutTime'}".
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
clindsey
PostPosted: Wed Sep 22, 2004 5:56 am    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

Code:

my $request = MQSeries::Message->new();

$::requestq->Get
  (
   Message    => $request,
  ) || die "Error occured while waiting for requests\n";
 
my $putTime = $request->MsgDesc('PutTime');
Back to top
View user's profile Send private message
any2xml
PostPosted: Thu Sep 23, 2004 5:10 pm    Post subject: Thanks I figured that out Reply with quote

Apprentice

Joined: 18 May 2004
Posts: 42

Thanks for all the help. Appreciated.
_________________
A Perl Hacker
http://www.goreliance.com
http://www.any2xml.com
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 » IBM MQ API Support » Perl MQ API - Need to get timestamp from message header
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.