MQGem tools on Linux on Little Endian Power

MQGem is pleased to announce the availability of three of its products on the Linux on Little Endian Power platform.

We have had these products available on Linux on Power for a number of years, and now have added the Little Endian platform to the list.

Thanks to those customers who requested it.

You cannot run a Big Endian application on a Little Endian platform and vice versa. Ensure you download the appropriate version of the tool for the platform you are using. For example, if you try to run the Big Endian version on a Little Endian platform, you will see an error something like this:-

-bash: ./mqscx: cannot execute binary file

If you are not sure which platform you are using, try one of the following commands:-

lscpu

which will show you output similar to:

Architecture:          ppc64le
Byte Order:            Little Endian
CPU(s):                ...

Or if you have an older version of Linux, which doesn’t provide that command, try:-

uname -a

which might give you hint.

Linux gemlnx4.mqgem.com 3.10.0-327.36.3.el7.ppc64le #1 SMP Thu Oct 20 04:58:48 EDT 2016 ppc64le ppc64le ppc64le GNU/Linux

Extra Reading Material


The new versions can be downloaded from the website from the links given above. Any current licensed users of these products can run them on the new platform using their existing licence. If you don’t have a licence and would like to try out any of our products then send an email to support@mqgem.com and a 1-month trial licence will be sent to you.

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.

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.

MQSCX version 9.0.1 is released

MQGem Software is pleased to announce that a new version of MQSCX, our command line extended MQSC tool for IBM MQ, is now available.

This is a mini-release, specifically to release the first of the below features. But then we added a couple more things at the same time!

Issue RESET QSTATS as an MQSC command

Sparked by a conversation on MQSeries.net we were intrigued when one user asked us whether it would be possible to provide RESET QSTATS as an MQSC command on the distributed platforms using MQSCX. Turns out it is possible!

Support certlabl on connect

The =conn command provides for a number of client channel configuration attributes, and now certlabl is among them.

The Any Key

Press Any Key?

Provide a simple way of getting user key input

This version introduces the getkey() function which will return the next key pressed by the user. This can be useful to, for example, navigate your way through a script menu, or to exit from a while loop in a script at the user’s command.


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

Creating a CCDT for any version

You may have read an earlier post where we described being able to determine what version of CCDT you had in your hand.

CCDT Version

How often have you had a CCDT file in your hand and wondered what version it was and whether you can give it to some of your known back-level client machines to use.

MQSCX can help you determine this. Open up your CCDT using the mqscx -n mode and then you can quite simply display the version number of all your client channels therein.

What you may not have realised from that post however, was that not only can MQSCX help to investigate what version number your CCDT is made for, it can also make a CCDT for the correct version as well. If you have back-level clients, it can be a real pain having to keep a queue manager of the same level around just to be able to create a CCDT that it will understand. Well, you can ditch that queue manager and use MQSCX instead. It’s really easy to do as well.

To use MQSCX to work with a CCDT, you need to use the -n parameter. This will then look for the CCDT file in the location specified by the MQCHLLIB and MQCHLTAB environment variables unless you provide the -t parameter to give it a specific file name. If one doesn’t exist, it will make a new one for you, and if one does exist it will read it and allow you to update it. In order to control the version of CCDT you are creating, you should additionally use the -V parameter which allows you to specify the version the CCDT file should be written as.

Here’s an example, run the MQSCX program like this:

mqscx -n -t C:\MQGem\CCDT\MQGEM.TAB -V7.0

And then you can use it to make DISPLAY, ALTER and DELETE commands.

MQSCX Extended MQSC Program – Version 8.0.0

CCDT commands directed to file ‘C:\MQGem\CCDT\MQGEM.TAB’

Licenced to Paul Clarke

Licence Location: Head Office

[12:02:10] DISPLAY CHANNEL(*) CONNAME VERSION

_________________________________________________

CHANNEL(MQG1.SVRCONN) CHLTYPE(CLNTCONN)

CONNAME(win12.mqgem.com(1602)) VERSION(8.0)

_________________________________________________

CHANNEL(MQG2.SVRCONN) CHLTYPE(CLNTCONN)

CONNAME(aix5.mqgem.com(4231)) VERSION(8.0)

_________________________________________________

CHANNEL(MQG3.SVRCONN) CHLTYPE(CLNTCONN)

CONNAME(mvs1.mqgem.com(1255)) VERSION(8.0)

_________________________________________________

Total display responses – Received:3

>

As you can see, at the moment all the channels in this CCDT are at V8.0 which means my V7.0 client won’t be able to read them. I need to make a change to each record to ensure MQSCX will write it out at version V7.0 as I have indicated on my start command. Helpfully, I can do that in one single command:-

ALTER CHANNEL(*)

This makes no actual change to the attributes of the channel definition, but does ‘touch’ each record to ensure that it gets the new version. Displaying the records again as above will show that the version number for each channel mentioned by the ALTER command (in this example all of them), now indicates it is at version V7.0, just what my back-level client application needs.

Exiting MQSCX and re-running it will show you that this earlier version of the CCDT has indeed been hardened.

Note that if you had been using some attributes introduced in later versions than V7.0, this information would be lost when altering the channel definition to be an earlier version.


If you’d like to try out MQSCX, please email support@mqgem.com to request a trial licence.

MQSCX Bootstrap file

MQSCX BootstrapMQGem recently delivered a new version of MQSCX that supports the new IBM MQ V9 release. As well as support for the new command level, there were a number of other features in this new version of MQSCX. One of those new features was a bootstrap file. This is a well known named MQSCX script file that is always imported when you start up MQSCX. It can be a handy place to put any frequently used functions.

The bootstrap file can either have your frequently used functions included in it directly, or the bootstrap file can have =import file statements in it (or both). For example:-

*********************************************************************
* Load these useful functions at start up                           *
*********************************************************************
=import file(C:\MQGem\MQScripts\Utility.mqx)

Then when you start the program you’ll see:-

MQSCX Extended MQSC Program – Version 9.0.0

Licenced to Paul Clarke

Connected to ‘MQG1’

[10:50:13] =import file(C:\MQGem\MQScripts\Utility.mqx)

MQG1>

and all your utility functions will be available.

The bootstrap file could also be used to print a banner out to remind users of something each time they start up the MQSCX program. For example:-

print '*************************************************'
print '*                                               *'
print '*  MQGem Software systems must only be used by  *'
print '*               MQGem employees                 *'
print '*                                               *'
print '*************************************************'

Then when you start the program you’ll see:-

MQSCX Extended MQSC Program – Version 9.0.0

Licenced to Paul Clarke

Connected to ‘MQG1’

*************************************************

* *

* MQGem Software systems must only be used by *

* MQGem employees *

* *

*************************************************

MQG1>

Of course the bootstrap file could also be used to run a command, or a number of commands every time the program is started up. Anything you can do in a normal MQSCX script file (or interactively) you can put into the bootstrap file. Here’s one example, but of course I’m sure you can think of plenty of others.

*********************************************************************
* Always check queue manager up-time                                *
*********************************************************************
DISPLAY QMSTATUS STARTDA STARTTI

Then when you start the program you’ll see:-

MQSCX Extended MQSC Program – Version 9.0.0

Licenced to Paul Clarke

Connected to ‘MQG1’

[11:09:54] DISPLAY QMSTATUS STARTDA STARTTI

QMNAME(MQG1) STATUS(RUNNING) STARTDA(2016-08-05) STARTTI(20.58.00)

MQG1>

I’m sure there are lots of other things you could do with the bootstrap file. Let us know in the comments if you have any other ideas.


If you are a current MQSCX licence holder, you can simply download the new version of MQSCX and start using it. If you’re not a current licence holder, and you’d like to try out MQSCX, please email support@mqgem.com to request a trial licence.

Be sure of your CCDT Version

CCDT VersionWe all know that you can’t use a CCDT file with a client that is older than the CCDT version. For example, a version 6 client can’t understand what the channel definitions in a V8 produced CCDT mean.

How often have you had a CCDT file in your hand and wondered what version it was and whether you can give it to some of your known back-level client machines to use.

MQSCX can help you determine this. Open up your CCDT using the mqscx -n mode and then you can quite simply display the version number of all your client channels therein.

DISPLAY CHANNEL(*) VERSION

CHANNEL(MQGEM.SVRCONN)            CHLTYPE(CLNTCONN)   VERSION(8.0)
CHANNEL(MQGEM.SVRCONN.SSL)        CHLTYPE(CLNTCONN)   VERSION(9.0)
CHANNEL(MQGEM.SVRCONN.ADMIN)      CHLTYPE(CLNTCONN)   VERSION(7.0)

Alternatively, you might like to write a little script that could iterate through all the channels in the table and tell you the minimum and maximum versions in use within that CCDT.

if (_ccdtmode)
  @minVer = 999999999
  @maxVer = 0
  foreach (DISPLAY CHANNEL(*) VERSION)
    if (VERSION < @minVer)
      @minVer = VERSION
    endif
    if (VERSION > @maxVer)
      @maxVer = VERSION
    endif
  endfor
  if (_numEach)
    print "Channel version in",_ccdt
    print "Minimum:",@minVer,"Maximum:",@maxVer
  else
    print "No channels found in",_ccdt
  endif
else
  print "Run this script with MQSCX in CCDT mode"
endif

Running this against a multi-version CCDT might produce output such as:-

Channel version in C:\MQGem\CCDT\MQGEM101.TAB
Minimum: 7.00 Maximum: 9.00

foreachThis type of CCDT analysis is possible due to the recent addition of the foreach construct to the CCDT processing in MQSCX.

If you are a current MQSCX licence holder, you can simply download the new version of MQSCX and start using it. If you’re not a current licence holder, and you’d like to try out MQSCX, please email support@mqgem.com to request a trial licence.