View previous topic :: View next topic
|
Author |
Message |
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Hi,
i have got typical question and i wonder if icetool can solve this??? i tried with splice, but no luck..
Following is just the mock up of the requirement:
Requirement:
Data in File A :
Judy Rob Harry
Judy Mona Bruce
( & rest..how many duplicates is unknown)
Data in File b :
Judy Joe Jerry Kevin Laura
The output should be
Judy Rob Harry Kevin Laura
Judy Mona Bruce Kevin Laura
Can somebody help me out here??
Thanks in advance.
ap_mainframes |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
ap_mainframes
Yes it is possible with DFSORT/ICETOOL, untill and unless u have duplicates only in 1set of file(Make sure as to No duplicates in both the files!).
Check for the topic Create files with matching and non-matching records at http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/.
There are many topics similar to your reuest search in forum too.
Give a try, if didn't work let us know! |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
ap_mainframes
Anyway's, DFSORT/ICETOOL solution for your request is here:
Code: |
//*******************************************************
//STEP001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN2 DD *
JUDY ROB HARRY
JUDY MONA BRUCE
/*
//IN1 DD *
JUDY JOE JERRY KEVIN LAURA
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
/*
//TMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//BOTH DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1) USING(CP01)
COPY FROM(IN2) TO(TMP1) USING(CP02)
SPLICE FROM(TMP1) TO(BOTH) ON(1,4,CH) WITH(31,1) WITH(6,10) -
WITHALL USING(CP03) KEEPNODUPS
/*
//CP01CNTL DD *
OUTREC BUILD=(1,26,30:C'11')
/*
//CP02CNTL DD *
OUTREC BUILD=(1,15,30:C'22')
/*
//CP03CNTL DD *
OUTFIL FNAMES=BOTH,INCLUDE=(30,2,CH,EQ,C'12'),BUILD=(1,26)
/*
|
and the O/P BOTH contains
Code: |
----+----1----+----2----+-
JUDY ROB HARRY KEVIN LAURA
JUDY MONA BRUCEKEVIN LAURA
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What should happen if the inputs are:
Data in File A :
Al Rob Harry
Al Mona Bruce
Judy Rob Harry
Judy Mona Bruce
Michael Rob Harry
Michael Mona Bruce
( & rest..how many duplicates is unknown)
Data in File b :
Al Joe Jerry Kevin Laura
Judy Joe Jerry Kevin Laura
Michael Joe Jerry Kevin Laura
Should the second and third names in file 2 always be skipped? What happens if the second and/or third names are longer?
The posted solution does not appear to match the output defined by the original "requirement". |
|
Back to top |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Hi..
As I mentioned in the requirement.
There can be duplicates in both the files..
Thanks,
ap_mainframes |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Yes, we understood that.
What about the other questions asked (length and skipping 2nd and 3rd entgry)?
What about the output that does not match your posted sample output?
Will the posted suggested do what you need or is there more to your requirement. |
|
Back to top |
|
|
|