MO71 recent changes

There have been a number of mini-features added to MO71 over the last few months. We have mentioned a few in passing in our monthly newsletter, but it’s time to take a look at them in a little more detail.

Search Fields added to Alter List Dialog

Some dialog lists, I’m thinking channels and queue managers specifically, have large numbers of fields and it can be hard to find the particular field you are looking for in order to change the columns shown in the list dialog. Both lists in the “Alter List” dialog now have a search field below them to allow you to filter the list and find what you are looking for.

MO71 Alter List Search Filter

A Search Filter box below each list

Multiple fields can be moved in the Alter List Dialog

Staying with the “Alter List” dialog, another change is that you can now select multiple fields to move up and down in the list at once instead of having to move one field at a time. You have the flexibility to make your MO71 List Dialogs look exactly how you need them to look with ease.

MO71 Alter List Multiple Move

Move multiple fields together instead of one at a time

3 Monitor support

MO71 will now remember the dialog positions and sizes for a 1, 2 or 3 monitor set-up.

MO71 Three Monitors

Spread your MO71 dialogs across three monitors if you need to

Command Level 911 and 912 support

MO71 supports the newest command levels provided by IBM MQ. See What’s in Command Levels 91x for details.

HTTP Proxy Support

You can now configure MO71 to make HTTP connections via an HTTP Proxy. This might be necessary for retrieving latest versions of IBM MQ or the latest versions of MO71 from your work location.

MO71 Preferences HTTP tab

Set HTTP Proxy details in Preference

Progress Dialogs

MO71 will now report on its progress as it is moving, copying or deleting large numbers of messages. You will see these only when your action takes longer than 3 seconds (by default), from both the message list dialog and the QLOAD dialog.

MO71 Progress Bar

You’ll see a progress bar for message manipulation actions that take a while

Topic Strings with leading or trailing spaces

MO71 Topic String WarningMost MQ string fields, whether object names or attributes, are not allowed to start with a blank and trailing spaces are insignificant. The queue manager will let you know with an error if you try to have spaces at the beginning. There are one or two fields, such as exit data attributes that allow them, but mainly MO71 would strip leading and trailing spaces before sending to the command server. The topic string attribute is different from many MQ string attributes in that it is legitimate to have leading and/or trailing spaces, and those spaces are significant. A topic string that only differs due to a leading or trailing space from another is a valid and different point in the topic tree.

MO71 allows you to have these leading and/or trailing spaces because if it didn’t you could not look at topic strings that had them, but it also warns you if you try to create one with a leading or trailing space because in all likelihood you did not intend to.

In addition, the problems that MO71 attempts to detect if you run a health check against your queue manager will report any topic strings that contain leading or trailing spaces. If you deliberately have topics that use such a pattern, you can remove these from the list of problems that are detected.

MO71 Topic String Healthcheck

Do you have any topics lurking with extra spaces?


The new version can be downloaded from the MO71 Download Page. Any current licensed users of MO71 can run the new version on their existing licence. If you don’t have a licence and would like to try out MO71 then send an email to support@mqgem.com and a 1-month trial licence will be sent to you.

Advertisements

Check MQ attributes meet standards using MQSCX

Colin Paice and I worked together in IBM Hursley for nearly 20 years. Now we’re both outside IBM, but still both doing things with MQ. I watch his blog posts with interest as he learns new things and writes about them. Recently he has been learning Python and loving it – he is impressed by how few lines of code he needs to achieve his task.

Object Standards

A recent task was to check queue definitions against a set of ‘standards’, for example:

  • Maximum Queue Depth must be at least 100
  • Put and Get must both be enabled
  • Queue Depth events must be enabled

I wondered how a script to do this task using MQSCX would look so I wrote it.

=echo resp(no) cmds(no)

@QlocalStandards = "MAXDEPTH > 100,    +
                    PUT = 'ENABLED',   +
                    GET = 'ENABLED',   +
                    QDPLOEV = 'ENABLED' OR QDPHIEV = 'ENABLED'"

foreach(DISPLAY QLOCAL(*) ALL)
  foritem(@QlocalStandards)
    if (!eval(_item))
      print "Queue", QUEUE, "does not meet standard", _item
    endif
  endfor
endfor

It is nicely compact – I wonder if it has few enough lines of code to impress Colin?

It gives output like this:-

Queue SMALL.Q does not meet standard MAXDEPTH > 100

When adding other standards to check for, you simply use MQSC keywords and values which are nice and familiar. The standards are just one very long string, with each ‘standard’ separated by a comma. I have formatted it over a number of lines using the ‘+’ continuation character to make it easier to see. If you add to it, ensure you have a comma between each individual standard, and end the string with a double quote. When comparing an attribute value to a string like ‘ENABLED’ remember to quote those strings.

I extended it a little to turn it into a function so you could use it for any object type, and ended up with this.

*********************************************************************
* FUNCTION: checkOBJs                                               *
*           This function checks whether all objects                *
*           of a specific type match the values                     *
*           defined as standards to be followed.                    *
*********************************************************************
func checkOBJs(Object, ObjType, Standard)
  foreach(DISPLAY <@Object>(*) <@ObjType> ALL)
    foritem(@Standard)
      if (!eval(_item))
        print @Object, eval(@Object), "does not meet standard", _item
      endif
    endfor
  endfor
endfunc

@QlocalStandards = "MAXDEPTH > 100,    +
                    PUT = 'ENABLED',   +
                    GET = 'ENABLED',   +
                    DESCR NE '',       +
                    QDPLOEV = 'ENABLED' OR QDPHIEV = 'ENABLED'"
@SenderStandards = "HBINT < DISCINT,   +
                    DESCR NE ''"

checkOBJs("Queue",   "TYPE(QLOCAL)", @QlocalStandards)
checkOBJs("Channel", "CHLTYPE(SDR)", @SenderStandards)

You don’t need to turn off the command and response output when in a function as that is the default setting anyway. Three parameters are used to create the DISPLAY command and to formulate the printed output, but otherwise the logic is the same.

In my sender channel example I have added a standard that compares the values of two attributes – haven’t we always told you that Heartbeat Interval (HBINT) should be less than the Disconnect Interval (DISCINT)?

If you find building a long string a bit tricky – can’t get the plus signs and commas in the right places, you can instead build up the list of standards into a global string variable in this way:-

*********************************************************************
* FUNCTION: Add (AddStandard)
*           Build the standard list without worrying about
*           commas and plus signs.
*********************************************************************
func Add(Standard)
  @Standards = @Standards + "," + @Standard
endfunc

=echo input(no)

@Standards = "";
Add("MAXDEPTH > 100")
Add("PUT = 'ENABLED'")
Add("GET = 'ENABLED'")
Add("DESCR NE ''")
Add("QDPLOEV = 'ENABLED' OR QDPHIEV = 'ENABLED'")

checkOBJs("Queue",   "TYPE(QLOCAL)", @Standards)

@Standards = "";
Add("HBINT < DISCINT")
Add("DESCR NE ''")

checkOBJs("Channel", "CHLTYPE(SDR)", @Standards)

If you don’t already have MQSCX and you’d like to try it out, please email support@mqgem.com to request a trial licence.

Announcing Q from MQGem

SupportPac MA01 was written by Paul Clarke back in June 1995. It was one of the first SupportPacs for MQ as you can tell by its number. Paul wrote it because the amqsput, amqsget and amqsbcg samples didn’t give him the flexibility he wanted. It became a very handy tool in the pocket of many an MQ administrator over the years.

When Paul left IBM to form MQGem Software, the MA01 SupportPac was discontinued, and it’s source code put on GitHub for anyone who wanted to build it and run it themselves. However, many MQ users don’t want the complication and expense of looking after home-built tools, and would prefer a fully supported product. As such, a few of our customers have asked whether we would be willing to continue to maintain and enhance the Q program, and so here it is.

Q program pocket knife

A veritable pocket knife of features

The Q program from MQGem has moved on a little from the last version that was the MA01 SupportPac, after all we’ve continued to use it as a very helpful tool here inside MQGem Software. Some of the new features are:-

  • IBM MQ Multi-version Support
    Q will load the MQ libraries from the place identified by setmqenv.
  • New help features
    To make it easier to find the option you are looking for since the Q program does have a lot of flags!.
  • Message formatters added
    Formatters for JSON, EDIFACT, CSV and FIX message formats have been added.
  • Character substitution
    This will display text such as &gt; as the character ‘>’.
  • 64-bit executable
    The Q program is now 64-bit across all platforms.
  • Minor flag enhancements
    1. The special message format string which starts with the ‘#’ character previously had a 40 character limit. This has been lifted.
    2. MQRO_PASS_CORREL_ID has been added to the confirm options on the -n flag as -n[passc].
    3. You can use -dt to print out the offsets of a message
    4. The prompt menu used by -xc to set various client connection channel settings such as TLS and exits has been updated to only request valid exits for a client channel, and to use a more modern CipherSpec by default.
    5. The use of truncation on an MQGET has been made safer by requiring the user explicitly select MQGMO_ACCEPT_TRUNCATED_MESSAGE when using the -=> flag by using the optional ‘t‘ flag, to give -=t<length>.
    6. The Commit interval (-p) flag has been extended to also take an optional commit interval after which an incomplete transaction, that is one that has not reached the requested total number of messages, will be committed anyway.
    7. The subscribe call created with the -S flag can be additionally configured to use MQSO_SET_CORREL_ID by using the -gc:CorrelId flag.
  • Flags renamed
    Some minor flags have been renamed to improve usability and consistency. These are listed in full in the User Guide. The majority of the flags are exactly the same as they were in the Support Pac.

Even if you don’t intend to purchase a licence, you may find value in downloading the user guide. At long last we have a manual for Q! As we said above, the parameters are not absolutely identical to the SupportPac, but the majority are the same, and the vast majority of the manual is still applicable to the SupportPac. You may well discover features you never knew that Q had.


Read more about the new product, and download a copy, from the Q Web Page. If you would like to try out MQGem’s Q program before deciding whether to buy then send an email to support@mqgem.com and a 1-month trial licence will be sent to you.

MQEdit version 9.1.0 is released

MQGem Software is pleased to announce that a new version of MQEdit, our Live Parsing Editor for IBM MQ messages, is now available.

The main reason for the new MQEdit version number, Version 9.1.0, is to remain inline with the current MQ version. However, the following functional changes have also been made:

  • Character Substitution Mode
    As requested by a customer, to make it easier to read certain types of messages, MQEdit now supports a Character Substitution Display Mode. This will display text such as &gt; as the character ‘>’.

    MQEdit Character Substitution Mode

    MQEdit Character Substitution Mode. The top message can be displayed in the manner shown at the bottom with this formatting mode turned on

    The substitutions performed are the following:-

    Sequence Character displayed
    &gt; >
    &lt; <
    &nbsp; (space)
    &amp; &
    &quot; "
    &apos; '
  • QLOAD ‘other’ file processing
    As a result of another customer request, it is now possible to use the QLOAD feature to load a ‘normal’ text file rather than a standard QLOAD file. This text file may contain multiple messages with some sort of delimiter, common with JSON or XML for example. The file can be parsed into these individual messages before being loaded onto the queue.
    MQEdit QLOAD Other File with delimiters

    Loading a file with message delimiters onto a queue

  • Select All
    To make it easier to copy/paste the entire message a new Select All (Ctrl-A) action has been added.

The new version can be downloaded from the MQEdit Download Page. Any current licensed users of MQEdit can run the new version on their existing licence. If you don’t have a licence and would like to try out MQEdit then send an email to support@mqgem.com and a 1-month trial licence will be sent to you.

QLOAD version 9.0.3 – Reading messages from the log

MQGem Software is pleased to announce that a new version of QLOAD, our queue load/unload tool for IBM MQ, is now available.

This release was created for one specific customer requested feature, retrieving messages from your queue manager log.

IBM MQ comes with a utility, dmpmqlog, which can format your queue manager transactional log and dump out the contents of messages in a hex format (example below snipped for brevity).

LOG RECORD - LSN            
**********

HLG Header: lrecsize 720, version 1, rmid 0, eyecatcher HLRH

LogRecdType . . : AQM Put Message (257)
Eyecatcher  . . : ALRH                 Version . . . . : 1
LogRecdLen  . . : 700                  LogRecdOwnr . . : 256    (AQM)
XTranid . . . . : TranType: NULL
QueueName . . . : HELLO.WORLD.Q                               

Data  . . . . . : 
00000:  41 51 52 48 04 00 00 00 FF FF FF FF FF FF FF FF    AQRH....ÿÿÿÿÿÿÿÿ
:
00160:  4D 44 20 20 01 00 00 00 00 00 00 00 08 00 00 00    MD  ............
00176:  00 00 00 00 22 02 00 00 52 03 00 00 4D 51 53 54    ...."...R...MQST
00192:  52 20 20 20 00 00 00 00 01 00 00 00 20 20 20 20    R   ........    
:
00368:  20 20 20 20 20 20 20 20 0B 00 00 00 43 3A 5C 6D            ....C:\m
00384:  71 6D 38 30 30 34 5C 62 69 6E 36 34 5C 61 6D 71    qm8004\bin64\amq
00400:  73 70 75 74 2E 65 78 65 32 30 31 38 30 34 32 33    sput.exe20180423
00416:  30 34 33 34 33 34 35 36 20 20 20 20 00 00 00 00    04343456    ....
00432:  00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00    ............ÿÿ..
00448:  48 65 6C 6C 6F 20 57 6F 72 6C 64 21                Hello World!

Log To QueueThis format is a little tricky to extract the data from to reinstate your message. As you can see above, you get the MQMD and the message data all in one block. It gets even more tricky when your message is broken up into several log records!

This version of QLOAD hopes to make the process of recreating message from your transactional log files much simpler to do. It can only work when the messages you want are in the log file though. There’s no magic!

Running QLOAD against the queue manager log

With the following invocation, QLOAD will run the dmpmqlog utility and parse through the output looking for the queue you requested, in this example HELLO.WORLD.Q, and write any messages it finds to the HELLO.WORLD.RCOV queue on queue manager MQG2.

qload -m MQG1 -j* -i HELLO.WORLD.Q -m MQG2 -o HELLO.WORLD.RCOV

Since you are reading the log files using dmpmqlog, the queue manager, MQG1, cannot be running when this command is issued and so the messages cannot be put onto a queue on that queue manager as part of the command. In this example I’ve chosen to put them onto a side queue on another queue manager but equally I could write them into a QLOAD file and then later put them onto the queue manager once it has started up again, as follows:-

qload -m MQG1 -j* -i HELLO.WORLD.Q -f HELLO_WORLD.qld
strmqm MQG1
qload -m MQG1 -f HELLO_WORLD.qld -o HELLO.WORLD.RCOV

Running QLOAD against output from dmpmqlog

If you have already run dmpmqlog, perhaps to determine whether the messages you wish to retrieve can be found in the log, then you may have already spent a few minutes waiting for the utility to complete. You can use the output files you generated from the utility as input into QLOAD.

dmpmqlog -m MQG1 -b > dmpmqlog.txt
qload -j dmpmqlog.txt -i HELLO.WORLD.Q -m MQG1 -o HELLO.WORLD.RCOV

Running QLOAD against copied off queue manager logs

A third alternative is to run QLOAD against queue manager log files that have been copied off. In this case you provide QLOAD with a directory containing these files.

qload -m MQG1 -j c:\mqmarch\log\MQG1 -i HELLO.WORLD.Q -m MQG1 -o HELLO.WORLD.RCOV

This command drives dmpmqlog with the -f parameter, and so the criteria for this directory must follow what is described in Knowledge Center for running dmpmqlog in that way. In addition, you must use the -m parameter to specific the queue manager name that these log files came from so that queue names can be found, and that queue manager cannot be running at the time.

The specified directory must contain the log header file (amqhlctl.lfh) and a subdirectory called active. The active subdirectory must contain the log files. By default, log files are assumed to be in the directories specified in the IBM MQ configuration information. If you use this option, queue names associated with queue identifiers are shown in the dump only if you use the -m option to name a queue manager name that has the object catalog file in its directory path.

QLOAD filtering

Whichever of the above methods you choose to use, you can add many of the QLOAD filtering options to your command.

For example, you can find all the messages containing a particular search string.

qload -m MQG1 -j* -i HELLO.WORLD.Q -s "World" -m MQG2 -o HELLO.WORLD.RCOV

Or perhaps you need to pluck out one specific message using its message id (or correlation id).

qload -m MQG1 -j* -i HELLO.WORLD.Q -gxm414D51204D51473120202020202020202604E15A21D49501 -m MQG2 -o HELLO.WORLD.RCOV

QLOAD also has time based filtering, so if you’re looking for a message from hours, days or weeks ago, you can go directly to that time period. This example is looking for messages that were put onto the queue between 18 and 19 hours ago.

qload -m MQG1 -j* -i HELLO.WORLD.Q -T0:18:00,0:19:00 -m MQG2 -o HELLO.WORLD.RCOV

Note: Filtering by Selection String (the -H parameter) is not available when your input source is a file (either a QLOAD file or an MQ log file) since it uses the Selector feature of MQOPEN.


The new version can be downloaded from the QLOAD Download Page. Any current licensed users of QLOAD can run the new version on their existing licence. If you don’t have a licence and would like to try out QLOAD then send an email to support@mqgem.com and a 1-month trial licence will be sent to you.

MQEdit version 9.0.3 is released

MQGem Software is pleased to announce that a new version of MQEdit, our Live Parsing Editor for IBM MQ messages, is now available.

This version of MQEdit makes it easier to manage a group of users using the editor from a central position. The following items have been added:

  • The concept of a master configuration file
    Users can reference a master configuration file and any new or change locations can be automatically imported into their own configuration.
  • Import from another MQEdit (or MO71) Configuration file
    You can now import locations direct from another configuration file.
  • Splash screens
    An MQ Administration department can now cause users of MQEdit to see centrally controlled information whenever the user starts MQEdit or attempts to connect to a Queue Manager. This could, for example, display maintenance schedule information, Queue Manager ownership or support contact numbers.
  • Licence Command
    You can now configure a command to be automatically run if the current licence is either invalid or nearing its renewal date.
  • MQEdit Program update notification
    You can ask MQEdit to periodically check whether there is a later version of the program available.

The new version can be downloaded from the MQEdit Download Page. Any current licensed users of MQEdit can run the new version on their existing licence. If you don’t have a licence and would like to try out MQEdit then send an email to support@mqgem.com and a 1-month trial licence will be sent to you.

Use MQGem tools with IBM MQ on IBM Cloud

You may have seen the recent announcement from IBM about the experimental IBM MQ service running on IBM Cloud.
IBM Cloud

You can learn more with these resources:-

When you read the description of this new service in the Bluemix catalog, you’ll see it says the following:-

Manage MQ your way

Manage your cloud-based queue managers with the tools you know and love – including MQ Explorer, the MQ Console, or via MQ Script Commands (MQSC).

This blog post is here to assure you that the tools you know and love from MQGem Software; MO71, MQSCX, MQEdit and QLOAD can all also be used with IBM MQ running on IBM Cloud.

Once you have created your MQ on IBM Cloud Service and Queue Manager, as shown in the above video, and your queue manager is up and running, you’ll have a view something like this.

IBM Cloud QM List

A list showing my Running queue manager

Click on the three vertical dots on the right of your queue manager to “Download Connection info”, or alternatively view the details of your queue manager and then there is a button there too which allows you to download the “Connection Information”. Either way, you’ll be presented with a pop-up which allows you to download a plain text file which contains the queue manager name, hostname, port number and a couple of channel names, one called an Application Channel and one called an Administration Channel.

IBM Cloud Download Connection info

IBM Cloud Download Connection info

In order to remotely connect to your IBM Cloud queue manager you will also need to be able to log in. As the MQ on IBM Cloud documentation describes here, you need the API key as your password to go with the user id ‘admin’. Follow the instructions on that page to obtain your API key.

Now you have all the pieces of information you need to set up any of the MQGem Software tools to administer your queue manager on IBM Cloud. As a reminder, these are the things you will need.

Item From where
Queue Manager Name You invented it when you created the queue manager. If you’ve forgotten it, it’s also in the text file you downloaded with the connection information.
Channel Name The “Administration channel name” can be found in the text file you downloaded with the connection information.
Connection Name This is built by concatenating the “Hostname” and “Listener port” details (with brackets round the port number) that can be found in the text file you downloaded with the connection information.
User ID This is ‘admin’
Password This is the API Key that you created by following the linked instructions.

On the pages that follow, we cover how to use the above information you have gathered in your table to configure each of our tools to connect to your IBM MQ in IBM Cloud Queue Manager. Go directly to the page for the tool you want to use, or page through each one in turn.

  1. MO71
  2. MQEdit
  3. MQSCX
  4. QLOAD

If you don’t have a licence and would like to try out any of our tools then send an email, noting which tool you’d like to try, to support@mqgem.com and a 1-month trial licence will be sent to you.