Elardus Engelbrecht,

HIGHER(0) will give you ALL the records for the key at 23 for a length of 
8 bytes as if the key exists then the counter will be 1 which is greater 
than 0. So I am not sure as to what you are trying to accomplish with 
Higher(0). If your intention is to get only 1 record per key or get the 
first record from the duplicates, you can use FIRST or LOWER(2).

Just so you know you don't need a SORT and a SELECT operator as you can 
get everything in a single pass of data. Also I noticed that your SORTCNTL 
has VLSHRT parm , so I am assuming your Input is a VB file ? if your input 
is indeed VB then your INCLUDE conditions are checking the RDW instead of 
the data fields.  If your input has RECFM=F, then you really don't need 
VLSHRT ( it of course will be ignored by DFSORT)

If you can show me a sample of input and desired output along with the DCB 
properties, then I will show you a simple and efficient way to get the 
desired results.

Thanks,
Kolusu
DFSORT Development

IBM Mainframe Discussion List <[email protected]> wrote on 
04/22/2015 05:00:21 AM:

> From: Elardus Engelbrecht <[email protected]>
> To: [email protected]
> Date: 04/22/2015 05:01 AM
> Subject: DFSORT / ICETOOL query about handling duplicats with SELECT 
HIGHER
> Sent by: IBM Mainframe Discussion List <[email protected]>
> 
> To all who can SORT me out,
> 
> I am curious why is this SELECT .... HIGHER(0) is not working 
> properly according to documentation.
> 
> As documented (re-formatted for posting) :
> 
> "HIGHER(x) - Limits the records selected to those with ON values 
> that occur more than x times (value count > x). You can use this 
> operand to keep just those records with field values that occur more
> than x times.
> 
>     x must be specified as n or +n where n can be 0 to 99."
> 
> So, I tried HIGHER(0) operand in SELECT operator - it is not 
> working. Any other values, yes, they're working 100% .
> 
> 
> Below results in that selected records which are appearing only ONCE
> in INVOER are dropped. Selected records appearing more than once are
> coming out in PRINT.
> 
> //TOOLIN   DD * 
>  SORT    FROM(INVOER) TO(TEMP0001) USING(SORT) 
>  SELECT  FROM(TEMP0001) TO(TEMP0002) ON(23,8,CH) HIGHER(0) 
>  DISPLAY FROM(TEMP0002) LIST(PRINT) - 
>          PAGE - 
>          TITLE('USERS ') - 
>          DATE(4MD/) - 
>          TIME(24:) - 
>          BLANK - 
>          ON(01,10,CH) HEADER('DATE') - 
>          ON(11,8,CH) HEADER('TIME') - 
>          ON(23,8,CH) HEADER('USER ID') - 
>          ... etc ...
> 
> //SORTCNTL   DD * 
>  OPTION VLSHRT 
>  SORT FIELDS=(23,8,CH,A) 
>  INCLUDE COND=(01,10,CH,EQ,C'2015/04/21',AND, 
>                23,03,CH,EQ,C'???',AND, 
>          ... etc ...
> 
> I had to fallback to this nice oldie: SUM FIELDS=NONE in SORTCNTL to
> get all selected records which appeared one or more times in my input.
> 
> In 'Smart DFSORT Tricks' I see this:
> 
> With SUM FIELDS=NONE and EQUALS in effect, DFSORT eliminates 
> "duplicate records" by writing the first record with each key to the
> SORTOUT data set and deleting subsequent records with each key.
> 
> Very useful for me, but why not SELECT HIGHER(0) ?
> 
> Why? Please sort me out, will ya?
> 
> Groete / Greetings
> Elardus Engelbrecht
> 
> ----------------------------------------------------------------------
> 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

Reply via email to