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

Compare two files with Duplicates.


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

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Wed Apr 02, 2008 5:28 pm
Reply with quote

Hi

I have two FB datasets. Primary key is 12 byte feild. In IN1 it start from 1st postion. In IN2 it start s from 15th postion.
IN1 is having unique records and is of LRECL = 15. IN2 is having unique as well as duplicate records and is of LRECL = 30.

I want to compare IN1 to IN2 and report in OUT1 only those records, whose key is present in IN1.

IN1

003160250993616
003160255992616
003200015992616

IN2

...003160250993616...
...003160250993616...
...003160250993616...
...003160255992616...
...003200015992616...
...003160255993616...
...003160255993616...

OUT1

...003160250993616...
...003160250993616...
...003160250993616...
...003160255992616...
...003200015992616...
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Apr 02, 2008 10:53 pm
Reply with quote

The following DFSORT/ICETOOL JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD DSN=your unique 15 lrecl file,
//            DISP=SHR                                               
//IN2      DD DSN=your duplicate 30 lrecl file,
//            DISP=SHR
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)         
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
  COPY FROM(IN1) USING(CTL1)                                         
  COPY FROM(IN2) USING(CTL2)                                         
  SPLICE FROM(T1) TO(OUT) ON(15,12,CH) WITHALL WITH(01,30) USING(CTL3)
//CTL1CNTL DD *                                                       
  OUTFIL FNAMES=T1,OVERLAY=(15:1,12,31:1,12)                         
//CTL2CNTL DD *                                                       
  OUTFIL FNAMES=T1,OVERLAY=(31:12X)                                   
//CTL3CNTL DD *                                                       
  OUTFIL FNAMES=OUT,BUILD=(01,30),                                   
  INCLUDE=(15,12,CH,EQ,31,12,CH)
/*
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Thu Apr 03, 2008 10:07 am
Reply with quote

The output dataset is coming empty. No of records in IN1 and No of records in IN2 are different.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Apr 03, 2008 8:58 pm
Reply with quote

suzeet wrote:
The output dataset is coming empty. No of records in IN1 and No of records in IN2 are different.


suzeet,

I am guessing that you did not copy my JCL as is. Note that the temp dataset T1 has MOD in disp parm. If you dont have that you will not get the desired results.

If the above is NOT true then you need to show me the DFSMSG sysout to be able to help you.
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top