Sort/Merge Utility from MVT

 

The Sort/Merge Utility and installation files are contained in the archive:  mvtsort.tgz [MD5: 27DA2B1B0566D3596B61073DA5AE8B9F].  Click on the archive name to download the archive to your computer.  The archive contains:

  • a HET tape image (mvtsort.het),

  • the output of the mainframe utility TAPEMAP showing the contents of the tape image (mvtsort.map),

  • an installation jobstream (mvtsort.jcl),

  • an installation verification jobstream (sorttest.jcl), and

  • a short document covering the basics of the control statements and parameters (mvtsort.pdf).

Uncompress the archive (use the tar xvzf <archive> command on Linux, or under CYGWIN; or use WinZip or ZipNAll on Windows/??).  The tape image should go into your tape image subdirectory, the jobstreams should go into your JCL subdirectory, the map file may be viewed with a text editor or printed if you are curious about the contents of the tape image, and the documentation PDF should be stored where you can open and view it as needed.

The Sort/Merge Utility consists of a set of load modules and a set of library routine modules, which are loaded as required during the sort execution.  The load modules are contained in the first dataset on the tape image (SORT.LOAD).  The loadable modules are contained in the second dataset on the tape image (SORT.LIB).  These two datasets were created by an IEBCOPY unload and the two libraries were unloaded from 3330 DASD (RECFM=U,BLKSIZE=13030).   

On 21 February 2002 I regenerated the MVT sort using the parameters:

    SORTMERG   SIZE=262144,RECTYPE=(FIXED,VAR,LONG),                   X
               CNTLFLD=(MULTIPLE),SORTOPT=FULLIB,                      X
               SORTDEV=(2311,2314,2301,2400)

The major significance is that all library modules are now included in SYS1.SORTLIB.  The sort size was increased to 256K and I added 2400 to the SORTDEV parameter to allow tape devices.

 

Target Libraries

The load modules for the Sort/Merge Utility must be restored to a load library and the loadable modules must be restored to a Partitioned Dataset that will be available during the execution of the Sort/Merge Utility.  The default targets in the installation jobstream are SYS2.LINKLIB (for the load library), and SYS1.SORTLIB (for the loadable modules).  If these libraries are not correct for your system, you must edit the installation jobstream before submitting it and substitute destination libraries suitable for your configuration.  Search for the comment - <==TARGET - which is contained on each line where a target library is named.  Additionally note that SYS1.SORTLIB is created in step LINK003 and changes to the UNIT and VOL=SER parameters may be required to conform to your configuration.

The installation jobstream reloads the unloaded libraries to temporary datasets and the re-links the contents to the target libraries.  This allows you to place the restored modules on the type of DASD that fits your configuration, rather than restrict the destination to 3350 DASD.  However, you must have 3350 work space available in your configuration to restore the datasets to during the installation.

When you have verified that the installation jobstream - mvtsort.jcl - conforms to your configuration, mount the tape image on a tape device and submit the jobstream to MVS for execution.  The job should take no more than a minute to execute and the return codes expected for the steps are:

IEF142I MVTSORT RELOAD - STEP WAS EXECUTED - COND CODE 0000  
IEF142I MVTSORT LINK001 - STEP WAS EXECUTED - COND CODE 0000  
IEF142I MVTSORT LINK002 - STEP WAS EXECUTED - COND CODE 0000     
IEF142I MVTSORT LINK003 - STEP WAS EXECUTED - COND CODE 0004  
IEF142I MVTSORT LINK004 - STEP WAS EXECUTED - COND CODE 0004   

 

Installation Verification Jobstream

The sorttest.jcl jobstream performs a simple sort of an instream set of card images and prints the sorted images on the printer.  The complete JES2 output for this job may be viewed at sorttest.

After the compiler has been successfully installed and verified, you do not need to retain the installation jobstreams or the tape image on your host computer.

 

Limitations and Execution Considerations

You must have 2311 or 2314 DASD defined on your system to utilize the MVT Sort/Merge program.  It will not utilize anything later than that.  You should be able to perform tape sorts using only tape devices for sort input, sort output, and the work datasets, but that is something I have not tried.

It would be a dream come true if the MVT Sort/Merge program could be updated to utilize later DASD models - 3330, 3350, 3380, 3390, for example - but is probably going to be a major effort.  If you are interested in looking into the possibility, I have created a separate page that shows the steps it takes to get the source onto your system: MVT Sort/Merge Source.


I hope that you have found my instructions useful.  If you have questions that I can answer to help expand upon the information I have included here, please don't hesitate to send them to me:


This page was last updated on April 22, 2008.