>>Does SORT have no option to count records with identical keys? That might reduce the scanning burden.
Paul, I was trying to stay away from this topic as you didn't want this thread to be another sort related solution. However since you brought up the capabilities of DFSORT, I had to chime in and Yes DFSORT has the capability of counting identical keys and eliminate the unwanted records. I am also going to show you a way to overcome the delimiter issue of it being present in the instream data. With this solution you have a choice to pick the data even though the DLM character exists in your input instream data. You also now have a choice to pick till "n" delimiter values. You need to SET symbols to pass the delimiter value and the "n" value of delimiter you want to end at. The count of delimiters is set to 8 bytes. You can increase that count if you think you can go beyond that limit. In my case my delimiter value is 'AA' and I want to pick all the data till I hit the 3rd delimiter. (That will give me all the values upto AK // SET DLMVAL='AA' // SET DLMCNT='00000003' //* //STEP0100 EXEC PGM=SORT,PARM='JP1"&DLMVAL",JP2"&DLMCNT"' //SYSOUT DD SYSOUT=* //SORTIN DD * AA <<< SAME DELIMITER AB AC AD AA <<< SAME DELIMITER AE AF AG AH AI AJ AK AA <<< SAME DELIMITER AL AM AN AO <<< NO DELIMITER //SORTOUT DD SYSOUT=* //SYSIN DD * OPTION COPY INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,BI,EQ,JP1),PUSH=(81:ID=8)) OUTFIL INCLUDE=(81,8,CH,LT,JP2),BUILD=(1,80) //* The output of this job when DLMCNT=3 is AA <<< SAME DELIMITER AB AC AD AA <<< SAME DELIMITER AE AF AG AH AI AJ AK The output of this job when DLMCNT=2 is AA <<< SAME DELIMITER AB AC AD The output of this job when DLMCNT=1 or 0 is EMPTY If you want to ignore all the delimiters and get every record, then simply give a higher value for DLMCNT , something like this SET DLMCNT='99999999' Further if you have any questions please let me know Thanks, Sri Hari Kolusu DFSORT Development IBM Corporation Email: [email protected] Phone: 520-799-2237 Tie Line: 321-2237 IBM Mainframe Discussion List <[email protected]> wrote on 01/07/2016 12:11:03 PM: > From: Paul Gilmartin <[email protected]> > To: [email protected] > Date: 01/07/2016 12:11 PM > Subject: Re: Sort for not there? > Sent by: IBM Mainframe Discussion List <[email protected]> > > On Thu, 7 Jan 2016 09:43:43 -0800, Ed Jaffe wrote: > > >On 1/7/2016 7:16 AM, Tom Marchant wrote: > >> I like Robert Rosenberg's solution: sort the file on the first two > >> columns and look for a suitable gap in the sorted data.Probably a lot > >> quicker than your checklist. > > > Does SORT have no option to count records with identical keys? That > might reduce the scanning burden. > > >Indeed. That would have been much quicker. But, what if no suitable > >delimiter can be found? Then you're SOL! :( > > > >It would be nice if JCL supported DLM='an arbitrary-length delimiter > >string similar to what is done for denoting email attachments'. > > > That might not need to be a pervasive change. Aren't instream data > shunted to separate data sets by the Reader so the Interpreter could > be blissfully unaware of a changed DLM= syntax. (A JES specialist > might know better.) > > On Thu, 7 Jan 2016 10:41:38 -0600, Bill Godfrey wrote: > > ... > >This may sound pretty obscure, ... > > > "pretty obscure" or "unlikely" is a poor rationale for an incomplete design. > (Hmmm. I should ask on ISPF-L how I can code a regular expression for > EDIT that contains both apostrophes and quotation marks. Another > defective design. Why would a programmer want to do that? Wrong > question. Why does IBM want to prevent it?) > > -- gil > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
