Sorting in MVS38J / Hercules  - Part II
=======================================


Date: 2/29/2020  Release V1R0M00            

Author: Larry Belmontes Jr.
        https://ShareABitofIT.net/Sorting-in-MVS38J-part-ii
        Copyright (C) 2020  Larry Belmontes, Jr.

 
 
   Sorting data in MVS38J is facilitated through the OS 360 Sort/Merge
product.  As a utility, Sort/Merge is invoked through MVS JCL to
order files of data before applying a programmed process - comparing 
or reporting or any other subsequent process. 
 
   However, the product can also be invoked via languagues such
as, but no limited to, Assembler, COBOL and PL/I.
 
   Assembler can use the LINK macro to call the SORT with a parmlist 
to provide control information.
 
   COBOL uses the SORT verb to perform a simple file sort or more
complex sorting operations using sort input and sort output procedures. 
 
   Lastly, PL/I uses several ENTRY points to perform various file sorting
operations.  Two of several SORT entry points are IHESRTA and IHESRTD. 
As a companion entry point, IHESARC, is used to set return codes to  
designate certain actions to be executed by the SORT program upon returning 
from a call.
 
   The distribution tape contains several working samples to demonstrate
the use of the OS 360 Sort/Merge product being used in MVS JCL, Assembler
COBOL and PL/I using sort input and sort output user procedures.
 
 
 
---------------------------------------------------------------------- 
| I n s t a l l a t i o n   R e f e r e n c e                        | 
---------------------------------------------------------------------- 

   The approach for this installation procedure is to transfer the
distribution tape content from the your personal computing device to
MVS with minimal JCL (less than 24 lines for easy copy-paste) and to
continue the installation procedure using supplied JCL from the MVS
CNTL data set under TSO.                         

   Below are description of ZIP file content, pre-installation
requirements and installation steps.
 
Good luck and enjoy!
-Larry Belmontes



======================================================================
* I. C o n t e n t   o f   Z I P   F i l e                           |
======================================================================

o  $INST01.JCL          Load CNTL data set from distrubtion tape
 
o  SORT01_V1R0M00.HET   Hercules Emulated Tape (HET) with VOLSER VS1000 
                        containing the sort program examples      
                        software distribution.                  
 
o  DSCLAMR.TXT          Disclaimer
 
o  README.TXT           This File                                              
 



======================================================================
* II. P r e - i n s t a l l a t i o n   R e q u i r e m e n t s      |
======================================================================

o  Tape files use device 480.
 
o  HERC01.SORTS01.CNTL (PDS) will be created.
    
o  DASD file(s) are loaded to VOLSER=PUB000, type 3350 device.
   Confirm that 100 tracks are available.
    
o  Download ZIP file to your PC local drive.    
 
o  Unzip the downloaded file into a temp directory on your PC device.
  
o  If dataset name, HERC01.SORTS01.CNTL is changed, some JCL changes
   may be necessary in the supplied complile-link-and-go JCL.
 
 
                                                
======================================================================
* III. I n s t a l l a t i o n   S t e p s                           |
======================================================================
                                                
+--------------------------------------------------------------------+
| Step 1. Load CNTL data set from distribution tape                  |
|         JCL Member: $INST01                                        |
+--------------------------------------------------------------------+
 
 
//$INST01  JOB (SYS),'Load HET SORTS1',          <-- Review and Modify
//             CLASS=A,MSGCLASS=A,               <-- Review and Modify
//             MSGLEVEL=(1,1)                    <-- Review and Modify
//* -------------------------------------------------------*
//* *  Sorting in MVS38J / Hercules  Part II               *
//* *                                                      *
//* *  JOB: $INST01                                        *
//* *       Load CNTL data set from distribution tape      *
//* -------------------------------------------------------*
//STEP001  EXEC PGM=IEBCOPY                                           
//SYSPRINT DD  SYSOUT=*                                              
//SYSUT1   DD  DSN=SORTS01.V1R0M00.TAPE,DISP=OLD,
//             VOL=SER=VS1000,LABEL=(1,SL),                  
//             UNIT=480                          <-- Review and Modify   
//SYSUT2   DD  DSN=HERC01.SORTS01.CNTL,
//             DISP=(,CATLG),DCB=(RECFM=FB,LRECL=80,BLKSIZE=19040),
//             SPACE=(TRK,(100,10,10)), 
//             UNIT=3350,VOL=SER=PUB000          <-- Review and Modify   
//SYSIN    DD  DUMMY                                                    
/*                                                                  
//
Figure 1: $INST01 JCL
 
 
    a) Before submitting the above job, the distribution tape   
       must be made available to MVS by issuing the following
       command from the Hercules console:
 
       DEVINIT 480 X:\DIRNAME\SORTS01_V1R0M00.HET READONLY=1
 
       where X:\DIRNAME is the complete path to the location
       of the Hercules Emulated Tape file. 
 
    b) Issue the following command from the MVS console to vary
       device 480 online:
 
       V 480,ONLINE
 
    c) Copy and paste the above JCL to a PDS member, update JOB 
       statement to conform to your installation standard.
 
    d) Submit the job.                                              
 
    e) Review job output for successful load of the CNTL data set.
 
                                                                            
                                                                            
+--------------------------------------------------------------------+
| Step 2. Done                                                       |
+--------------------------------------------------------------------+
 
 
    a) Congratulations!  Installation complete.





Have Fun and Learn!
                                                                            

