MQSCX on z/OS

The recent release of MQSCX V9.2 included the provision of MQSCX to run natively on the z/OS platform.

All those features of MQSCX that you have been able to use on your distributed platforms, such as report writing, functions, foreach loops (and all the other great MQSCX control language features); namelist processing and more, are now available natively on z/OS

MQSCX can be run interactively in a number of environments on your z/OS system. Type in a command and immediately get responses back. Additionally in these environments you can also run scripts that are stored in MVS files or HFS files.

  • z/OS UNIX (TTY)
    In this environment, you are running with a TTY terminal and MQSCX will look and feel very similar to the experience you have on a Unix or Windows platform. You have tab auto-complete for commands and object names, and scrolling of output.
  • z/OS UNIX (z/OS shell)

    From TSO/E, use the OMVS command to run the z/OS shell. You can use the MQSCX program interactively in this environment.

    GEMUSER:/u/gemuser/mqscx: >mqscx -m MQG1   
    MQSCX Extended MQSC Program - Version 9.2.0 
    Licenced to MQGem Software Limited          
    Licence Location: Any location               
                                                 
    Connected to 'MQG1'                          
    MQG1>DISPLAY QMGR VERSION                 
    CSQM409I %MQG1                               
    QMNAME(MQG1)        VERSION(09010500)        
    MQG1>
     ===> =import file(//MQSCX.SCRIPTS(AGE)) 
                                                                       INPUT
    ESC=¢ 1=Help     2=SubCmd   3=HlpRetrn  4=Top      5=Bottom   6=TSO
          7=BackScr  8=Scroll   9=NextSess 10=Refresh 11=FwdRetr 12=Retrieve
  • TSO/E

    From the TSO READY prompt, or from the ISPF command processor panel (aka Option 6), you can use the MQSCX program interactively. You must remember to tell the CALL command that you don’t want its default behaviour of upper casing the parameter string.

       Menu  List  Mode  Functions  Utilities  Help             
     ─────────────────────────────────────────────────────────────────────
                                   ISPF Command Shell           
     Enter TSO or Workstation commands below:                   
                                                                
     ===> CALL USER.LOAD(MQSCX) '-m MQG1' ASIS                            
                                                                          
                                                                          
                                                                
     Place cursor on choice and press enter to Retrieve command 
                                                                
     => CALL USER.LOAD(MQSCX) '-m MQG1' ASIS                    
     =>                                                         
     MQSCX Extended MQSC Program - Version 9.2.0                
     Licenced to MQGem Software Limited                         
     Licence Location: Any location                             
                                                                
     Connected to 'MQG1'                                        
     MQG1>                                                      
    DISPLAY QMGR VERSION                                        
     CSQM409I %MQG1                                             
     QMNAME(MQG1) VERSION(09010500)                             
     MQG1>                                                      
    =import file(//MQSCX.SCRIPTS(AGE))

As well are providing an interactive MQSC experience, MQSCX can also run scripts in interactive mode, as shown above, and also from batch in JCL jobs.

  • JCL to run a script from a file

    While it is possible to provide the file name directly when running a script, it is much simpler (and shorter) to use a DD name in JCL. This DD name can point to an MVS file or an HFS file as the two example DD names show below.

    //MQSCX    JOB                                                         
    //*********************************************************************
    //* Run an MQSCX script                                                
    //*********************************************************************
    //MQSCX    EXEC PGM=MQSCX,                                             
    //         PARM=('-m MQG1 -i DD:SCRIPT')                               
    //STEPLIB  DD   DSN=GEMUSER.USER.LOAD,DISP=SHR                         
    //         DD   DSN=IBM.MQ.SCSQAUTH,DISP=SHR                           
    //         DD   DSN=IBM.MQ.SCSQANLE,DISP=SHR                           
    //SYSPRINT DD   SYSOUT=*                                               
    //SYSOUT   DD   SYSOUT=*                                               
    //MQGEML   DD   DSN=GEMUSER.MQGEM.LIC,DISP=SHR                         
    //SCRIPT   DD   DSN=GEMUSER.MQSCX.SCRIPTS(AGE),DISP=SHR                
    //SCRIPT2  DD   PATH='/u/gemuser/mqscx/scripts/Age.mqx',
    //         PATHOPTS=(ORDONLY)                            
    //
  • JCL to run a script inline

    While developing your script, you might find it easier to have it inline in the same JCL job you use to submit it. You can either use the SYSIN DD card, or provide a DD name as above, and inline that DD card.

    //MQSCX    JOB                                                         
    //*********************************************************************
    //* Run an MQSCX script                                                
    //*********************************************************************
    //MQSCX    EXEC PGM=MQSCX,                                             
    //         PARM=('-m MQG1')                               
    //STEPLIB  DD   DSN=GEMUSER.USER.LOAD,DISP=SHR                         
    //         DD   DSN=IBM.MQ.SCSQAUTH,DISP=SHR                           
    //         DD   DSN=IBM.MQ.SCSQANLE,DISP=SHR                           
    //SYSPRINT DD   SYSOUT=*                                               
    //SYSOUT   DD   SYSOUT=*                                               
    //MQGEML   DD   DSN=GEMUSER.MQGEM.LIC,DISP=SHR                         
    //SYSIN    DD   *                          
    foreach(DISPLAY QLOCAL(*) CURDEPTH)        
      if (CURDEPTH > 0)                        
        print QUEUE,"has",CURDEPTH,"messages!" 
      endif                                    
    endfor   
    /*                                         
    //

We have endeavoured to make MQSCX work appropriately in each environment on z/OS, but would of course value any feedback users have to improve how MQSCX operates in any and all of these environments.


You can download MQSCX for z/OS from the MQSCX Download Page. If you’d like to try out MQSCX on z/OS, please email support@mqgem.com and a 1-month trial licence will be sent to you.

The team at MQGem would love to hear what you think. Leave your comments here.

This site uses Akismet to reduce spam. Learn how your comment data is processed.