uvsort - overview

'uvsort' provides mainframe sorting capability to Linux/Unix/Windows systems. The unix system sort is totally unsatisfactory for mainframe file types (migrated to LUW systems) because:

  1. unix sort cannot sort fixed length record files without LineFeeds
  2. unix sort cannot sort on packed decimal fields
  3. unix sort cannot sort Indexed files (Micro Focus compatible)
  4. unix sort does not have the select/delete/reformat capabilities of uvsort. uvsort has capabilties comparable to mainframe DFSORT or SYNCSORT.

uvsort provides for 600 record selects/deletes for input time & a further 600 record selects/deletes for output time. These select/deletes may be based on multiple and/or conditions comparing record fields to constants. uvsort also provides for 600 instructions for reformatting records at both input time & output time (move,add,subtract,multiply,compare,skip,etc).

uvsort allows 20 input files, 60 output files. Actually the number of files is unlimited using the option to input all files in a directory (or all files matching a pattern using '*' wildcard. There is also an option to output a new file on a control break in the sort key.

uvsort examples

 #1. uvsort "fili1=dat1/sales2,rcs=64,typ=RST,filo1=tmp/s2,rcs=64,key1=30(6),sel1=10(2):21"
     - sort sales2 demo file by product#, selecting only salesman #21
     - output 'typ=RSF' Record Sequential Fixed, recsize=64, no linefeed
     - could specify 'typ=RST' to force Linefeed into the last 64th byte
     - 'key1=30(6)' is product# in bytes 30-35 (zero relative) columns 31-36 (one relative)
     - see http://uvsoftware.ca/uvsort.htm#L3 for sales file layout & results expected
     - this example has only 1 select, but page 'L3' has 6 selects (600 maximum)

 #2. uvsort "fili1=dat1/custmas1,rcs=256,typ=RSF,filo1=tmp/cm1,typ=ISF,key1=0(6),isk1=0(6)"
     - sort & load an Indexed sequential file (C-ISAM & Micro Focus COBOL compatible)
     - 'key1=0(6)' is the sort key (cust# 1st 6 bytes)
     - 'isk1=0(6)' Indexed Sequential Key to load output file (1st 6 bytes)
     - 'rcs=256' input recsize, output will be 257 (Indexed file status byte added)
     - see http://uvsoftware.ca/uvsort.htm#L4 for customer demo file layout

 #3. uvsort "fili1=dat1/custmas1,rcs=256,typ=ISF,filo1=tmp/custphones,rcs=80,typ=LSTt\
     - sort customer master by customer-name & reformat into a telephone list
     - converts Indexed file 'typ=ISF' to a text file 'typ=LSTt'
     - input fixed 256 byte records, output max 80 LineFeed after last non-blank
     - '\' continues script to a 2nd line
     - 'key1=10(25)' sorts on customer-name cols 11-35 (zero relative 10-34)
     - 'clr=35(45)' blanks the address, before telephone# moved here
     - 'mvc=35(12)90' moves the telephone# from cols 91-112 to cols 36-47
     - see http://uvsoftware.ca/uvsort.htm#L6 for demo file results expected

 #4. uvsort "fili1=dat1/sales1,rcs=64,typ=RST,filo1=tmp/salecustomers,key1u1=0(6)"
     - sort sales file with data reduction option 'u1' of 'key1u1=0(6)'
     - unique key option retains only 1st record of duplicate key set (cust#s)
     - see http://uvsoftware.ca/uvsort.htm#C5 for duplicate drop & select options

 #5. uvsort "fili1=dat1/sales1,rcs=64,typ=RST,filo1=tmp/salesman_,key1f1=10(2)"
     - sort sales file with option 'f1' of 'key1f1=10(2)' (salesman cols 11-12)
     - option 'f1' creates a separate output file for each salesman
     - appending the sort key (salesman#) on to output filename
     - see http://uvsoftware.ca/uvsort.htm#C7 for demo file results expected

DFSORT/SYNCSORT to uvsort by JCL converter

The JCL converter automatically converts mainframe SORT steps to uvsort. DFSORT/SYNCSORT syntax is converted to the more compact uvsort equivalents. 'INCLUDE's & 'OMIT's are converted to 'sel's & 'dels'. INREC/OUTREC FIELDS are converted to uvsort equivalents. Here is an example with only 2 'OMIT' conditions, but uvsort can handle up to 600 INCLUDEs/OMITs/INREC/OUTREC FIELDs.

sample mainframe SORT

 //            DCB=(LRECL=64,BLKSIZE=6400,RECFM=FB),
 //            SPACE=(TRK,(50,50),RLSE),UNIT=DISK
 //SYSIN    DD *
 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))

uvsort - automatically converted

 exportfile  SORTIN data1/ar.sales.items
 exportfile  SORTOUT $JTMP/t_tempsls
 cat > $SYSIN <</*
 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
 uvsort "fili1=$SORTIN,typ=RST,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\

See the complete JCL/script conversion at http://www.uvsoftware.ca/jclcnv1demo.htm#2B1.

sample JCL conversions

If you are interested in migrating your applications to unix/linux, UV Softare invites you to send samples of your JCL for conversion to Korn shell scripts. Be sure to send any referenced PROCs & SYSIN parms. UV Software will return the converted equivalent Korn shell scripts within a few days (at no charge).

links to more information

 http://www.uvsoftware.ca                 - UV Software Home Page
 http://www.uvsoftware.ca/uvsort.htm      - uvsort documentation
 http://www.uvsoftware.ca/uvsort.htm#T1   - uvsort TIMINGs vs mfsort & unix sort
 http://www.uvsoftware.ca/jclcnv1demo.htm - JCL Conversion to Unix/Linux scripts
 http://www.uvsoftware.ca/jclcnv2real.htm - instructions for your conversion vs demos
 http://www.uvsoftware.ca/datacnv1.htm#Part_3  - DATA conve
 http://www.uvsoftware.ca/libuvhd.htm     - download uvhd FREE utility
 http://www.uvsoftware.ca/uvprices.htm    - prices & partner agreements
 http://www.uvsoftware.ca/uvintro.htm#G1  - customer list & reference letters
 http://www.uvsoftware.ca/news/           - all newsletters past & present

I invite your feedback. Let me know if these news letters are useful to you, and any suggestions you may have for improvements.

Thank You, Owen Townsend, UV Software Inc.

Goto:   Begin this document End this document UVSI Home-Page