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.
>
>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 ')
> 
I'm imagining something like:
    ...STOPAFT=1
        ...COND=(1,3,CH,GT,C'ABC')

Certainly stops at (almost) the right place. but Kolusu indicates, there's
no way to select COND=(1,3,CH,EQ,C'ABC') for output.


>-----Original Message-----
>From: Sri h Kolusu
>Sent: Wednesday, September 16, 2020 3:54 PM
>
>>>> 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,
>
>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')
>/*

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to