ASPLMQ User Guide v 1.00
© 2026 Bassem W. Jamaleddine


I

   Adding MQ Scripting to ASPL


Extract the code distribution ASPLMQ-v1.tgz in /tmp.

#  cd /tmp; tar xzvf ASPLMQ-v1.tgz

This will create the directory /tmp/ASPLMQ-v1/ where you can find the code that we used in this text.
Under the directory ASPLMQ-v1/ you can locate the following files:
  • README.TXT describes the content of the directory ASPLMQ-v1.
  • filtermq-queues is the parsing script for IBM MQ queues, it includes the formatting function to tabulate the queues.
  • filtermq-channels is the parsing script for IBM MQ channels, it includes the formatting function to tabulate the channels.
  • ACMECO.mqsc is a stringified IBM MQ listing of objects for some hypothetical company ACME Co. that we use for testing the parser, it can also be used by runmqsc to create ACMECO qmgr.
  • ShallowMatches.pm contains the preprocessors for shallow matching operations in ASPL.
  • HOWTO-CREATE-THE-GROUPING-CLASSES.TXT contains the metagrouping commands to create the grouping classes in ASPL's egC-Container used in this text.


  • Under the directory ASPLMQ-v1/ you can locate the following subdirectories.
    ASPLMQ-v1/
    |-- ggfunc        <--- contains *.pm to be copied to GG-Container
    |-- junkwr        <--- contains *.pl to test writers in standalone
    |-- MQutils       <--- contains the MQparser.pm
    |-- MQ_Writers    <--- contains the Perl writers modules
    `-- shared        <--- contains the shared scripts
    


     COPYING THE FILTERS TO ASPL SHARED DIRECTORY

    #  cp filtermq-queues `asplcmd ~shared`

    #  cp filtermq-channels `asplcmd ~shared`

    #  chmod 755 `asplcmd ~shared`/filtermq-queues

    #  chmod 755 `asplcmd ~shared`/filtermq-channels



     TESTING THE FILTERS ON DIRECT OUTPUT OF ACMECO.mqsc

    #  cat ACMECO.mqsc | filtermq-queues

    #  cat ACMECO.mqsc | filtermq-channels



     TESTING THE FILTERS ON OBJECTS RETRIEVED FROM LIVE QMGR
    The ACMECO.mqsc can be used to create the the qmgr ACMECO of some hypothetical company ACME Co.
    If you have MQ installed on some host vavamq, create the qmgr ACMECO using ACMECO.mqsc.

    (vavamq's qmgr:ACMECO) 18:23 mqm@vavamq: ~ #  crtmqm -ll -lf 2048 -lp 10 -ls 12 -u SYSTEM.DEAD.LETTER.QUEUE ACMECO

    (vavamq's qmgr:ACMECO) 18:23 mqm@vavamq: ~ #  strmqm ACMECO

    (vavamq's qmgr:ACMECO) 18:23 mqm@vavamq: ~ #  runmqsc ACMECO < ACMECO.mqsc

    (vavamq's qmgr:ACMECO) 18:23 mqm@vavamq: ~ #  endmqm ACMECO

    (vavamq's qmgr:ACMECO) 18:23 mqm@vavamq: ~ #  strmqm ACMECO

    Test the filter by getting ACMECO objects using saveqmgr.

    #  ssh -q mqm@vavamq /home/mqm/mqtools/saveqmgr -m ACMECO -s -c 2>&1 | filtermq-queues

    #  ssh -q mqm@vavamq /home/mqm/mqtools/saveqmgr -m ACMECO -s -c 2>&1 | filtermq-channels

    The installation of saveqmgr may be different on your system. You need to replace the /home/mqm/mqtools/saveqmgr with the path where you have installed saveqmgr.



     INSTALLING THE MQ WRITERS IN ASPL ~writersdir 
    The writers modules are in /tmp/ASPLMQ-v1/MQ_Writers. Copy them to ASPL ~writersdir.

    #  cp /tmp/ASPLMQ-v1/MQ_Writers/*.pm `asplcmd ~writersdir`

    Check that they have been copied to ~writersdir using the following command. Note that your ASPL installation may reflect a different directory.

    #  file `asplcmd ~writersdir`/*.pm

    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_ChannelsCmpQmgr.pm:   Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_ChannelsColor.pm:     Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_ChannelsColorTest.pm: Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_Channels.pm:          Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_QmgrsColor.pm:        Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_QmgrsColorTest.pm:    Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_Qmgrs.pm:             Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_QmgrsPrintbw.pm:      Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_QmgrsPrinter.pm:      Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_QmgrsPrint.pm:        Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_QueuesCmpQmgr.pm:     Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_QueuesColor.pm:       Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_QueuesColorTest.pm:   Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_QueuesLogos.pm:       Perl5 module source, ASCII text
    /opt/ASPLv1.00/.aspl/etc/Writers/MQ_Writer_Queues.pm:            Perl5 module source, ASCII text
    
    Test that writers are loadable by ASPL.

    # asplcmd showwriteformat

    
      THE WRITER FORMAT IDENTIFIER TO SELECT THE FORMATTING ROUTINE:
    
                          IDENTIFIER              GROUPINGCLASS   DESCRIPTION                      
                          ----------  -------------------------   ------------------------------------  
     >                       nothing                          *   format nothing at all     
                  MQ_Writer_Channels       IBMMQ_CHANNELS_GROUP   IBM MQ channels formatted table      
           MQ_Writer_ChannelsCmpQmgr       IBMMQ_CHANNELS_GROUP   IBM MQ channels comparative qmgrs formatted table
             MQ_Writer_ChannelsColor       IBMMQ_CHANNELS_GROUP   IBM MQ channels comparative qmgrs table with colors 
         MQ_Writer_ChannelsColorTest       IBMMQ_CHANNELS_GROUP   IBM MQ channels comparative qmgrs table with colors 
                     MQ_Writer_Qmgrs           IBMMQ_QMGR_GROUP   IBM MQ comparative qmgrs formatted table          
                MQ_Writer_QmgrsColor           IBMMQ_QMGR_GROUP   IBM MQ comparative qmgrs formatted table with colors 
            MQ_Writer_QmgrsColorTest           IBMMQ_QMGR_GROUP   IBM MQ comparative qmgrs formatted table with colors 
                MQ_Writer_QmgrsPrint           IBMMQ_QMGR_GROUP   IBM MQ comparative qmgrs formatted table with colors 
              MQ_Writer_QmgrsPrinter           IBMMQ_QMGR_GROUP   IBM MQ comparative qmgrs formatted table with colors 
                    MQ_Writer_Queues         IBMMQ_QUEUES_GROUP   IBM MQ queues formatted table               
             MQ_Writer_QueuesCmpQmgr         IBMMQ_QUEUES_GROUP   IBM MQ queues comparative Qmgrs formatted table 
               MQ_Writer_QueuesColor         IBMMQ_QUEUES_GROUP   IBM MQ queues formatted table testing with ANSI colors 
           MQ_Writer_QueuesColorTest         IBMMQ_QUEUES_GROUP   IBM MQ queues formatted table testing with ANSI colors 
               MQ_Writer_QueuesLogos         IBMMQ_QUEUES_GROUP   IBM MQ queues formatted table with logos nytesta/vatesta 
    
       CURRENTLY WRITER IS POINTING TO  nothing
       TO SET THE WRITER TO A SPECIFIC HANDLER USE setwriteformat FOLLOWED BY ONE OF THE IDENTIFIERS
    
    


     CREATING THE ELEMENT GROUPING CLASSES IN ASPL egC-Container 
    Use the ASPL command metagrouping to create the element grouping classes.
    There are three element grouping classes that you need to create in ASPL. These are: IBMMQ_QMGR_GROUP, IBMMQ_QUEUES_GROUP, and IBMMQ_CHANNELS_GROUP

    #  metagrouping -creategrouping IBMMQ_QMGR_GROUP -displayphrase "GROUP OF ATTRIBUTES FOR IBM MQ QMGR" -attributes "PSRTYCNT,i" "LOCALEV,s" "LOGGEREV,s" "SCHINIT,s" "PSSYNCPT,s" "PSMODE,s" "MAXUMSGS,i" "TREELIFE,i" "SSLCRLNL,s" "ACCTCONO,s" "ACTIVREC,s" "MONCHL,s" "ACCTQ,s" "REPOSNL,s" "MAXPRTY,i" "MONACLS,s" "CHADEXIT,s" "CONFIGEV,s" "CHADEV,s" "ALTTIME,s" "ACCTMQI,s" "STATACLS,s" "SSLRKEYC,i" "SSLFIPS,s" "MAXPROPL,s" "MARKINT,i" "CLWLLEN,i" "STATINT,i" "CRTIME,s" "STATCHL,s" "CLWLEXIT,s" "INHIBTEV,s" "CHAD,s" "CRDATE,s" "PLATFORM,s" "CHLEV,s" "DISTL,s" "CMDEV,s" "STATQ,s" "MAXMSGL,i" "STATMQI,s" "ACCTINT,i" "CLWLDATA,s" "DEADQ,s" "CCSID,i" "STRSTPEV,s" "CMDLEVEL,i" "PSNPRES,s" "SSLCRYP,s" "SSLEV,s" "QMNAME,s" "CLWLUSEQ,s" "TRIGINT,i" "ALTDATE,s" "REPOS,s" "QMID,s" "DESCR,s" "REMOTEEV,s" "MONQ,s" "COMMANDQ,s" "PARENT,s" "MAXHANDS,i" "SCMDSERV,s" "IPADDRV,s" "PERFMEV,s" "ROUTEREC,s" "SSLKEYR,s" "CLWLMRUC,i" "AUTHOREV,s" "DEFXMITQ,s" "PSNPMSG,s"

    #  metagrouping -creategrouping IBMMQ_QUEUES_GROUP -displayphrase "GROUPING CLASS FOR QUEUES ATTRIBUTES OF IBM MQ QUEUES" -attributes "DESCR,s" "PUT,s" "DEFPRTY,i" "DEFPSIST,s" "DEFPRESP,s" "DEFREADA,s" "PROPCTL,s" "LIKE,s" "CLWLUSEQ,s" "SCOPE,s" "GET,s" "MAXDEPTH,i" "MAXMSGL,i" "DEFSOPT,s" "MSGDLVSQ,s" "USAGE,s" "TRIGTYPE,s" "TRIGDPTH,i" "TRIGMPRI,i" "TRIGDATA,s" "PROCESS,s" "INITQ,s" "RETINTVL,i" "BOTHRESH,i" "BOQNAME,s" "QDEPTHHI,i" "QDEPTHLO,i" "QDPMAXEV,s" "QDPHIEV,s" "QDPLOEV,s" "QSVCINT,i" "QSVCIEV,s" "DISTL,s" "NPMCLASS,s" "STATQ,s" "MONQ,s" "ACCTQ,s" "CLUSTER,s" "CLUSNL,s" "DEFBIND,s" "CLWLRANK,i" "CLWLPRTY,i" "TARGET,s" "ALTDATE,s" "ALTTIME,s" -heterogeneousrecords

    #  metagrouping -creategrouping IBMMQ_CHANNELS_GROUP -displayphrase "GROUPING CLASS FOR CHANNEL ATTRIBUTES OF IBM MQ CHANNELS" -attributes "CHANNEL,s" "CHLTYPE,s" "CLUSTER,s" "CONNAME,s" "CONVERT,s" "DESCR,s" "MCATYPE,s" "MCAUSER,s" "MAXMSGL,i" "XMITQ,s" "LONGTMR,i" "SHORTTMR,i" "MRRTY,i" "SHORTRTY,i" "SSLCAUTH,s" "HBINT,i" "COMPMSG,s" "COMPHDR,s" "ALTDATE,s" "ALTTIME,s" -heterogeneousrecords





     ADD THE GG-functions TO ASPL GG-Container 
    The directory /tmp/ASPLMQ-v1/ggfunc/ contains the three Perl modules: ggibmqmgrs.pm, ggqmgrqueues.pm, and ggqmgrchann.pm, that provide the GG-functions ggibmqmgrs(), ggqmgrqueues() and ggqmgrchann() respectively. You need these Perl modules to your ASPL GG-Container.

    #  cp ggibmqmgrs.pm `asplcmd ~gg`

    #  cp ggqmgrqueues.pm `asplcmd ~gg`

    #  cp ggqmgrchann.pm `asplcmd ~gg`

    Check that ASPL GG-Container can load them using the command.

    #  asplcmd 'ggls *qmgr*'

    The following are the GG functions:
      ggibmqmgrs                  to view it issue the command:   ggls ggibmqmgrs()
      ggqmgrchann                 to view it issue the command:   ggls ggqmgrchann()
      ggqmgrqueues                to view it issue the command:   ggls ggqmgrqueues()
    


     CHECK IF YOUR ASPL DISTRIBUTION HAS MQparser.pm IN ASPL lib DIRECTORY
    Check if MQparser.pm already exist in your ASPL lib directory.

    #  file `asplcmd ~home`/lib/MQutils/MQparser.pm

    If not, then create MQutils directory and copy the /tmp/ASPLMQ-v1/MQutils/MQparser.pm into it. If MQparser.pm is not in your ASPL lib directory, then you can create MQutils directory and copy the MQparser.pm into it by using the following commands.

    #  mkdir `asplcmd ~home`/lib/MQutils

    #  cp /tmp/ASPLMQ-v1/MQutils/MQparser.pm `asplcmd ~home`/lib/MQutils

    #  ls -l `asplcmd ~home`/lib/MQutils

    #  file `asplcmd ~home`/lib/MQutils/MQparser.pm



     ADD THE PREPROCESSORS mqcha2elem AND mqcha3elem TO ShallowMatches.pm 
    The ShallowMatches.pm is in your ASPL's etc directory, You can edit it by entering:

    #  asplcmd ~shallowed

    The ASPL shallow matching operators that do matching of equality (based on regular expression filters) use the preprocessors that are coded in the shallowed module ShallowMatches.pm. In the book, see the section "Shallow Group Operations on IBM MQ Channel Attributes" on how to add the shallow preprocessors mqcha2elem and mqcha3elem to your ShallowMatches.pm.


     TEST THE WRITER WITH SOME STANDALONE SCRIPTS 
    The Perl script in /tmp/ASPLMQ-v1/junkwr/*.pl can be run from within the directory. These have been used in Chapter "ASPL MQ Writers".

    #  ls -l *.pl

    -rw-r--r-- 1 root root  711 Aug 25 02:48 testqueueslogo.pl
    -rw-r--r-- 1 root root  670 Aug 25 02:44 testqueues.pl
    -rw-r--r-- 1 root root  658 Aug 25 02:43 testqueueswritercolor.pl
    -rw-r--r-- 1 root root  686 Aug 25 01:59 testqueueswriter.pl
    -rw-r--r-- 1 root root 1132 Aug 27 18:56 testwriterdir.pl
    


     COPY THE UTILITY SCRIPTS TO ASPL SHARED DIRECTORY 
    Copy the scripts in /tmp/ASPLMQ-v1/shared/ to your ASPL ~shared directory.

    #  cp /tmp/ASPLMQ-v1/shared/* `asplcmd ~shared`

    The following is the list of the scripts that we used in this text.
    channelscompare.pl
    channelsdisp.pl
    qmgrscompare.pl
    qmgrsdisp.pl
    queuescompare.pl
    queuesdisp.pl
    
    acme_channels.aspl
    acme_delta_channels.aspl
    acme_delta_qmgrs.aspl
    acme_delta_qmgrs_notify.aspl
    acme_delta_queues.aspl
    acme_qmgrs.aspl
    acme_queues.aspl
    clustered_delta_channels.aspl
    clustered_delta_qmgrs.aspl
    clustered_delta_queues.aspl
    monitor_clustered_delta_channels.aspl
    monitor_clustered_delta_qmgrs.aspl
    monitor_clustered_delta_queues.aspl