On Wed, 16 Sep 2020 20:17:10 +0000, Farley, Peter x23353 wrote: >Thanks Sri, I am aware of the STOPAFT parameter, but it uses a hard-coded >count. When the goal is to find ALL records with the selected values and one >does not know in advance how many there are, it is not as helpful as it could >be. > Can you set an a priori upper bound on the number of 'ABC' records? Suppose you're confident that there are at most 1000. Then modify Kolusu's scheme to:
//SYSIN DD * OPTION COPY,STOPAFT=1001 INCLUDE COND=(1,3,CH,GE,C'ABC') /* This will select (some value of) N 'ABC' records plus 1001-N other records. A second step can select the 'ABC' records from that smaller data set. -- gil >I was thinking of a command similar to OMIT / INCLUDE, something like: > >STOPWHEN COND=(key value greater than this stop reading) > >E.G., STOPWHEN(1,3,'AC ') > >Peter > >-----Original Message----- >From: IBM Mainframe Discussion List <[email protected]> On Behalf Of >Sri h Kolusu >Sent: Wednesday, September 16, 2020 3:54 PM >To: [email protected] >Subject: Re: SORT selection question > >EXTERNAL EMAIL > >>>> When using SORT (either DFSORT or SYNCSORT) to select a relatively >> small sample of records by (a) particular key value(s) from a *very >> large* sequential file, > >Peter, > >You can use STOPAFT parm to stop reading the input once you get to a threshold >value. For example if you have file with 300 million records and if you are >only interested in only 100 records for the key 'ABC', then you can use the >following > >//SYSIN DD * > OPTION COPY,STOPAFT=100 > INCLUDE COND=(1,3,CH,EQ,C'ABC') >/* >-- > >This message and any attachments are intended only for the use of the >addressee and may contain information that is privileged and confidential. If >the reader of the message is not the intended recipient or an authorized >representative of the intended recipient, you are hereby notified that any >dissemination of this communication is strictly prohibited. If you have >received this communication in error, please notify us immediately by e-mail >and delete the message and any attachments from your system. > >---------------------------------------------------------------------- >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
