Barry A Schwarz wrote on 10/18/2006 12:17:51 PM:
> You can use ICETOOL to generate an OCCURS report on the key in a
> temporary dataset and sort the report on the count field in descending
> order with a STOPAFT=1 parameter.

You have the right idea, but you'd actually need to use OUTFIL with
ENDREC=1
rather than STOPAFT=1.  STOPAFT=1 would get the first input record rather
than the first sorted record.  ENDREC=1 would get the first sorted record.
Here's a DFSORT/ICETOOL job using OCCUR that would work:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file
//TOOLIN   DD    *
OCCUR FROM(IN) LIST(T1) ON(1,20,CH) ON(VALCNT,E'99999999') NOHEADER
SORT FROM(T1) TO(OUT) USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(25,8,ZD,D)
  OUTFIL FNAMES=OUT,ENDREC=1
/*

Frank Yaeger - DFSORT Team (IBM)
 Specialties: PARSE, JFY, SQZ, ICETOOL, IFTHEN, OVERLAY, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/




----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to