IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can DFSort (Icetool ) do this???


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Wed Jul 11, 2007 9:11 am
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jul 11, 2007 10:10 am
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jul 11, 2007 11:59 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jul 11, 2007 11:29 pm
Reply with quote

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
icon_question.gif

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
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Thu Jul 12, 2007 8:36 am
Reply with quote

Hi..
As I mentioned in the requirement.
There can be duplicates in both the files..

Thanks,
ap_mainframes
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 12, 2007 8:43 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
Search our Forums:

Back to Top