At 12:04 -0700 on 01/06/2016, Paul Gilmartin wrote about Sort for not there?:
Well, the Pigeonhole Principle guarantees that if the data don't exceed 65,535 lines a suitable value must exist. But how to find it? I might take this to IBM-MAIN; someone is apt to jump in with a DFSORT/ICETOOL solution. Hmmm. Count occurences of each initial digraph and select any zero value. But are zeroes counted?
Feed the data file into Sort (possibly) using the sort cards to only select the first 2 characters (ie: Create a 2 character file) and sort it. Now read the sorted 2 character file and and compare against an ascending 2 character string (bumping it when the sort value changes) until you do not get a match (ie: The sort value is higher than the compare value). That is a good value to use. If the sort is an internal sort the program could read the file, pass it to sort. and process the returned sorted file in lieu of needing multiple job steps. An internal sort also avoids the need to create temp files for output since the sorted records come from the sort work area one record at a time as they are passed to the program's E35 exit.
---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN