Roberto R. wrote on 04/26/2006 08:06:33 AM:

> Thank you, Frank, your suggestion worked for a while until I stumbled
over a
> different set of record combinations, which I try to illustrate like
this:
>
> Input1:
> A1  A1
> A1  X1
> A1  X2
>
> Input2:
> A1  123
> X1  123
> X1  ABC
>
> Expected output:
> A1  A1  123
> A1  X1  123
> A1  X1  ABC
>
> i.e. the second column in input1 acts as key to the first column in
input2,
> and I need to report on the combined values (3 columns). But I get:
>
>     X1  123
> A1  A1  123
> A1  X1  123
>
> (This includes the final sort in your code.) I've tried what I believe to
be
> any existing variation of the proposal you gave me but I get nowhere, not

> even close. What am I doing wrong?

In the first case, you had duplicates in input2, but not in input1. In this
case, you have duplicates in input1, but not in input2, so it requires a
slightly different solution.  Here's the DFSORT/ICETOOL job you need for
this case:

//S1    EXEC PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//IN2    DD DSN=...  input file2
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=...     input file1
//    DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//OUT DD DSN=...     output file
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
SPLICE FROM(CON) TO(T2) ON(5,2,CH) WITHALL WITH(5,7)
SORT FROM(T2) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(5:1,7,80:X)
/*
//CTL2CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(1,2,CH,A)
/*

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