Wednesday, 29 April 2015

Is it a DFSort or a SyncSort or...!?

If you work long enough at a single shop, you'd probably won't bother about this question - because the chances are that you'd never use another SORT product than the one in use at your shop. Ah...wait there can still be exception if you are at a SyncSort shop whose database product is IBM DB2... wait... what!? Well, yes - but we'll talk about it later and first we'll talk about the subject line for this post! :)

If in your Job you code EXEC PGM=SORT or EXEC PGM=ICEMAN -- both of them will invoke the default SORT program at your shop. If you are at a DFSort shop,  EXEC PGM=SORT will invoke the IBM's SORT product - DFSort. On the other hand at a SyncSort shop  EXEC PGM=SORT or EXEC PGM=ICEMAN will invoke the SyncSort's SORT unless the System Programmer mandates to type PGM=SYNCSORT which is very unlikely and stupid actually.

So, SyncSort is a sort product produced by an IBM competitor named Syncsort. There is another SORT product known as CA-Sort and is a sort product produced by an IBM competitor named CA. DFSORT is the IBM sort product.
While some sites might have more than one sort product, they are not cheap and hence most sites only use one sort product so it is fairly rare to have a choice of which to use and that's why I said that if you work long enough at a shop...

And the exception about DB2 is -- For a DB2 shop, even when you are using SyncSort as the primary SORT product, DB2 will invoke DFSort internally if it needs to do some SORTing (ORDER BY or GROUP BY etc.) 

Saturday, 9 August 2014

What is SORT on mainframes?

SORT, as the name implies is 'something' which sort the 'entities' (records) in some particular order. However over the years these sort products have been evolved as a "Software suite" in them selves.

The SORT utility, initially known as the Sort/Merge utility, in a crude sense is a mainframe program to sort records in a file into a specified order or copy selected records. SORT can also be used to merge pre-sorted files into a sorted file. 

Mainframes were originally supplied with limited main memory by today's standards. The amount of data to be sorted was frequently very large. 
Because of this, unlike more recent sort programs, early sort/merge programs placed great emphasis on efficient techniques for sorting data on 
secondary storage, typically tape or disk. In 1968 the OS/360 Sort/Merge program provided five different "sequence distribution techniques" that 
could be used depending on the number and type of devices available.

Sort/Merge is very frequently used; often the most commonly used application program in a mainframe shop.

Modern sort/merge programs also can copy files, select or omit certain records, summarize records, remove duplicates, reformat records, append new 
data and produce reports. Indeed most "Sort/Merge" applications use the wide range of additional processing capabilities, rather than purely 
sorting or merging records: The Sort/Merge product is a very fast way of performing input to and output from these functions.

Sort/merge is important enough that there are multiple companies each selling their own sort/merge package for IBM mainframes and their z/OS, z/VM and z/VSE operating systems.