Im sorry I was joking about AWK and especially SED
thought there are people who would do it :-)

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Paul Gilmartin
Sent: Thursday, September 17, 2020 12:06 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: [EXTERNAL] Re: COBOL ? Re: SORT selection question

On Thu, 17 Sep 2020 14:58:44 +0000, Farley, Peter x23353 
<peter.far...@broadridge.com> wrote:

>Of course that is an option, particularly the COBOL one.  I am personally very 
>familiar with awk and z/OS awk does support "classic" datasets via DD, ...
> 
Citation needed.  According to what IBM document?

On Thu, 17 Sep 2020 08:01:46 -0700, Sri h Kolusu wrote:

>> Can you set an a priori upper bound on the number of 'ABC' records?
>> Suppose you're confident that there are at most 1000.
>
>Unfortunately that wouldn't work.  If your input  have less than 1000
>records for the key 'ABC' and you code STOPAFT=1001, then it would read the
>entire file as we did not reach the STOPAFT limit.  The parm STOPAFT is
>executed after the INCLUDE/OMIT. Check this link for processing order.
> 
Note that I changed your EQ to GE.  So it would stop after reading no
more than 1001 irrelevant records, much improving the performance
for the OP's  "very large" SORTIN.  Note also that the OP said SORTIN
had previously been sorted, so no records having key LT,'ABC' would
precede the desired.

>https://www.ibm.com/support/knowledgecenter/SSLTBW_2.4.0/com.ibm.zos.v2r4.icea100/ice2ca_DFSORT_processing_.htm#idg7073__stmtseq
>
>> 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.
>
>You don't need a second step as you can use STARTREC/ENDREC/ACCEPT parms on
>OUTFIL to select "n" number of records.
> 
Needed because I change 'EQ' to 'GE.

All depending on the ability to *guess* the upper bound for STOPAFT.

-- gil

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

----------------------------------------------------------------------
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