|
|
| Author |
Message |
Megalai
New User
Joined: 13 Jan 2006 Posts: 16
|
|
|
|
Hi Friends,
Please tell me the Solution for the below.
Input file1:
Cust id Address
1 A1
2 A1
3 A1
2 A2
Input file 2:
Custid Contact
1 C1
1 C2
1 C3
2 C1
2 C2
Output file should be like this:
Cust id Address Contact
1 A1 C1
1 A1 C2
1 A1 C3
2 A1 C1
2 A2 C1
2 A1 C2
2 A2 C2
3 A1
i.e) for the matching custid's the address & contact info should be written to the output file along with the cust id.
Thanks and Regards,
Megalai. |
|
| Back to top |
|
 |
References
|
|
 |
Megalai
New User
Joined: 13 Jan 2006 Posts: 16
|
|
|
|
Hi Friends,
Please assume that the Record length is 80.
Thanks,
Megalai . |
|
| Back to top |
|
 |
fixdoubts
Active User
Joined: 21 Oct 2005 Posts: 52
|
|
|
|
Hi,
This might help you
| Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//FILEIN1 DD *
1 A1
2 A1
3 A1
2 A2
//FILEIN2 DD *
1 C1
1 C2
1 C3
2 C1
2 C2
//OUT DD SYSOUT=*
//T1 DD DSN=XT2.SMS.TEST.SORT3,DISP=MOD
//TOOLIN DD *
COPY FROM(FILEIN1) TO(T1) USING(CPY1)
COPY FROM(FILEIN2) TO(T1) USING(CPY2)
SPLICE FROM(T1) TO(OUT) ON(1,1,CH)-
WITHALL KEEPNODUPS WITH(06,02) USING(CPY3)
/*
//CPY1CNTL DD *
OUTREC FIELDS=(1:1,4,80:X)
/*
//CPY2CNTL DD *
OUTREC FIELDS=(1:1,1,6:3,2,80:X)
/*
//CPY3CNTL DD *
OUTREC FIELDS=(1:1,1,6:3,2,80:X)
/*
//CPY3CNTL DD *
OUTFIL FNAMES=OUT,OUTREC=(1,80)
/*
//
|
The out put will be like this
| Code: |
1 A1 C1
1 A1 C2
1 A1 C3
2 A1
2 A1 C1
2 A1 C2
3 A1
|
Regards, |
|
| Back to top |
|
 |
Megalai
New User
Joined: 13 Jan 2006 Posts: 16
|
|
|
|
Hi Fixdoubts,
Thanks for ur Reply. But my Requirement is i have to get the matching records for each Cust id the address and Contact.
Thanks,
Megalai |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4684 Location: San Jose, CA
|
|
|
|
| I think what you're trying to do is the equivalent of a cartesian join - the first 2 in file1 has to be joined with the first and second 2 in file2, and then the second 2 in file1 has to be joined with the first and second 2 in file2. DFSORT/ICETOOL cannot do that. |
|
| Back to top |
|
 |
Megalai
New User
Joined: 13 Jan 2006 Posts: 16
|
|
|
|
Hi Frank,
Thanks for ur Reply.
thanks and Regards,
Megalai. |
|
| Back to top |
|
 |
|
|