Paul Gilmartin wrote on 01/15/2008 09:40:44 AM:
> Would it be better on the first pass do sort on name ascending major;
date
> descending minor?  Then the DEDUPE second pass would be almost trivial.

You can do it in one pass with a DFSORT/ICETOOL job like this:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD *
FRANK  20080107
FRANK  20080115
PAUL   20071230
FRANK  20071231
PAUL   20080112
GEORGE 20080103
PAUL   20080105
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,7,CH) FIRST USING(CTL1)
//CTL1CNTL DD *
  SORT FIELDS=(1,7,CH,A,8,8,CH,D)

OUT would have:

FRANK  20080115
GEORGE 20080103
PAUL   20080112

Note that SELECT sets EQUALS automatically.

If the records are already in sorted order by the name and date,
you can do it more easily like this:

//S2    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD *
FRANK  20071231
FRANK  20080107
FRANK  20080115
PAUL   20071230
PAUL   20080105
PAUL   20080112
GEORGE 20080103
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,7,CH) LAST

> Will MERGE operate on a single input file, or would it require
> SORTIN02 DD DUMMY?

You can use one SORTINdd file for MERGE.

Frank Yaeger - DFSORT Development Team (IBM) - [EMAIL PROTECTED]
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