On Sun, Apr 3, 2016 at 1:50 AM, Andrew Rowley <and...@blackhillsoftware.com> wrote:
> On 02/04/2016 10:09 PM, David Crayford wrote: > >> IBM switched the magic bit to offload the JZOS JNI C/C++ workload to a >> zIIP so they could do the same for DFSORT. A well engineered library >> could handle the callbacks so the client just reads records like a normal >> API. That would certainly push Java batch up a notch. >> > One question that puzzles me (maybe it's my lack of an application > programming background): Why is sort used so much on z/OS? > > I know you can then e.g. do grouping based on key changes, but is that > really necessary in current programs? Is that the reason it is commonly > used? > In my shop, it is used mainly so that the output, such as reports sent to a web site for perusal or email, are in some order such as account number. Also, DB2 uses it a lot when you do a CREATE INDEX, I think. IDCAMS uses it when you build an alternate INDEX. This done when a VSAM file (yes, there are a lot of them still around) is "reorganized" for performance or space reasons. > > I generally use e.g. Java HashMap, C# Hashtable for grouping so the data > doesn't need to be sorted. Do other common languages on z/OS provide > similar functions? (C++ I know.) Are there opportunities to use programming > language features to avoid sorts altogether? > Sure, but how often do you have a Java HashMap which contains, say, a million entries? Oh, and the entries are not something like an "int", but more like a C struct where the size of each struct is around 1500 bytes. That would require about 1.5 Terabytes of memory. Not many systems have that much to give you for a single "object". And yes, we _do_ sort such monsters. Not often, granted, but we're doing a conversion right now and the programmer is doing work on claims which go back 10 years! That's a _lot_ of data! And <sob>, we don't have _any_ data bases, just VSAM and sequential data sets. I've actually used VSAM to do "sorting", by inserting records randomly, then reading them back in keyed order. The performance was horrible. DB2, or other database system, could be used in such as manner to avoid sorting. But I'd bet it would also be horrible. Of course, if you're reading an already existing VSAM keyed file, or a database, then you're golden. I'd bet most of the data in the non-z/OS world is kept in such a manner, as opposed to a regular "file". On z/OS, REXX has "stem" variables which are "content addressable", much like a HashMap (keep type HaspMap, <grin>). The COBOL language doesn't have anything like this built in. Neither does PL/I. Of course, IBM's Java for z/OS does. As do other languages in the UNIX environment such as Perl. But there just aren't as many of them in z/OS due to the effort to make them work in an EBCDIC environment instead of an ASCII (or Unicode) environment. For Perl, Larry Wall just said "forget it, we're not doing it any more". I know that there is a port of LUA ( http://lua4z.com/ ), but I don't know how popular it is. Unfortunately, z/OS people (programmers, sysprogs, and management) don't really seem to be very interested in doing UNIX type work on z/OS. Possibly because "it's too expensive!" or "it's not how we have done things in the past and it's too difficult to bother learning." Or, maybe, just plain NIH syndrome (Not Invented Here). I mean, have you read the screams here about the latest COBOL requiring PDSEs for their executable output? You'd think that they'd been told to convert their COBOL to FORTRAN. > > Andrew Rowley > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > -- How many surrealists does it take to screw in a lightbulb? One to hold the giraffe and one to fill the bathtub with brightly colored power tools. Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN