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 IndexGeneral IBM MQ Supportamqsact bug with time selection

Post new topicReply to topic
amqsact bug with time selection View previous topic :: View next topic
Author Message
tczielke
PostPosted: Thu Jul 02, 2015 12:21 pm Post subject: amqsact bug with time selection Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 941
Location: Illinois, USA

FYI – If you use the amqsact sample program for Activity Tracing, there is a bug in how the -s (startTime) and -e (endTime) switches work to only find records for a given time range. There is a bug in both the start and end time check.

The amqsact logic has the following to build one of the tm structures that is used for the check.

Code:

          sscanf(MsgStartTime, "%2u.%2u.%2u",
                 &(startTm.tm_hour),
                 &(startTm.tm_min),
                 &(startTm.tm_sec));



However, MsgStartTime has a format like “13:11:01”. This causes some of these fields in the tm structure to not get parsed correctly, and therefore the time selection does not work correctly.

The amqsact code needs to be changed to the following to work correctly for the time selection:

Code:

          sscanf(MsgStartTime, "%2u:%2u:%2u",
                 &(startTm.tm_hour),
                 &(startTm.tm_min),
                 &(startTm.tm_sec));

.
.
          sscanf(MsgEndTime, "%2u:%2u:%2u",
                 &(endTm.tm_hour),
                 &(endTm.tm_min),
                 &(endTm.tm_sec));


The format of how amqsact reads in the -s and -e is a little odd (i.e. 2017-07-07 11.15.00), but not a bug:

Code:

          sscanf(pval, "%4u-%2u-%2u %2u.%2u.%2u",
                 &(startTime.tm_year),
                 &(startTime.tm_mon),
                 &(startTime.tm_mday),
                 &(startTime.tm_hour),
                 &(startTime.tm_min),
                 &(startTime.tm_sec));


For my own custom version of amqsact that I use, I changed it to the following (i.e. 2017-07-02T11:15:00)


Code:

          sscanf(pval, "%4u-%2u-%2uT%2u:%2u:%2u",
                 &(startTime.tm_year),
                 &(startTime.tm_mon),
                 &(startTime.tm_mday),
                 &(startTime.tm_hour),
                 &(startTime.tm_min),
                 &(startTime.tm_sec));


I am not sure how this time selection part of the amqsact sample was tested successfully, as it mostly just does not work with the current bug.
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexGeneral IBM MQ Supportamqsact bug with time selection
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.