Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

DFSORT/ICETOOL :: RE: For each given key value, how to keep up to the first n recs

$
0
0
Author: Arun Raj
Posted: Sat Nov 12, 2016 12:02 am (GMT 5.5)

Rohit Umarjikar wrote:
Quote:
I keep the three records of the most populous cities
Is there any logic to pick popular cities else you can try below approach.
Rohit - He needs the most 'populous', highest to least population.

Regardless, the idea is more or less the same. Sort descending on the population for each country, Assign a SEQuence number in the OUTREC for each GROUP, where KEYBEGINs when country changes. And in OUTFIL INCLUDE SEQuences less than or equals 3.
_________________
Arun
----------------------------------------------------------------------------------------------------
Love is like an hourglass, with the heart filling up as the brain empties. -Jules Renard


Viewing all articles
Browse latest Browse all 8500

Trending Articles