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

i am facing problem in Comparing 2 files using ICETOOL


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

New User


Joined: 20 Nov 2006
Posts: 19
Location: india

PostPosted: Mon Dec 11, 2006 8:55 pm
Reply with quote

I have to compare 2 files say FILE A(conatins duplicates) and FILE B, then
write all the records from FILE A to output file FILE C, which does not have matched records in FILE B.

key: offset 14, length:14 for both input files.

FILE A: record length : 210 and FB
D00000000000000001090000002451902192434249820061128
D00000000000000008880000002451902192434249820061128
D00000000000000001170000002451902192434249820061128
D00000000000000001580000002451902192434249820061128
D00000000000000001110000002451902192434249820061128
D0000000000000000222000002451902192434249820061128
D00000000000000003330000002451902192434249820061128


FILE B: record length : 200 and FB
50000620000002
50010030000002
50049160000002
00000420000002
00001090000002
00001170000002
00000590000002
00001580000002
00002080000002
50600090000002
50600090000002
50600090000002
50639530000002
50644640000002
50644640000002
50661700000002

FILE C: record length : 210 and FB output:

D00000000000000008880000002451902192434249820061128
D00000000000000001110000002451902192434249820061128
D0000000000000000222000002451902192434249820061128
D00000000000000003330000002451902192434249820061128


I'm using the following job but it's not working properly:

Code:

//SORT1 EXEC PGM=ICETOOL                             
//TOOLMSG DD SYSOUT=*                               
//DFSMSG DD SYSOUT=*                                 
//IN2 DD DSN=file a
//IN1 DD DSN=file b
//*T1  DD DSN=BB0908.DZT.OSCAR.TEST4,DISP=MOD       
//*     UNIT=SYSDA,SPACE=(212,(5,5),RLSE),           
//*     DCB=(RECFM=FB,LRECL=212)                     
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(212,(5,5),RLSE), 
//       DCB=(RECFM=FB,LRECL=212),DISP=(MOD,PASS)   
//F1 DD DSN=&&F1,UNIT=SYSDA,SPACE=(212,(5,5),RLSE), 
//      DCB=(RECFM=FB,LRECL=212),DISP=(MOD,PASS)     
//OUT1 DD DSN=file c
//TOOLIN DD *                                       
* GET FIRST RECORD WITH EACH NAME FROM FILE1.                     
  SELECT FROM(IN1) TO(F1) ON(14,14,CH) FIRST                     
* GET FIRST RECORD WITH EACH NAME FROM FILE2.                     
  SELECT FROM(IN2) TO(F1) ON(14,14,CH) FIRST                     
* GET ONE RECORD WITH EACH NAME IN FILE1 AND FILE2               
* AND ADD 'AA' IDENTIFIER.                                       
  SELECT FROM(F1) TO(T1) ON(14,14,CH) FIRSTDUP USING(CTL1)       
* GET ONE RECORD WITH EACH NAME ONLY IN FILE1 OR ONLY IN FILE2   
* AND ADD 'BB' IDENTIFIER.                                       
  SELECT FROM(F1) TO(T1) ON(14,14,CH) NODUPS USING(CTL2)         
*----------------------------------------------------------------*
* ADD '11' IDENTIFIER FOR FILE1 RECORDS.                         
  COPY FROM(IN1) TO(T1) USING(CTL3)                               
* ADD '22' IDENTIFIER FOR FILE2 RECORDS.                         
  COPY FROM(IN2) TO(T1) USING(CTL4)                               
* SPLICE TO MATCH UP RECORDS AND WRITE THEM TO THEIR             
* APPROPRIATE OUTPUT FILES.                                       
  SPLICE FROM(T1) TO(OUT12) ON(14,14,CH) -                       
  WITHALL WITH(1,211) USING(CTL5)                                 
/*                                                     
//CTL1CNTL DD                                           
* MARK RECORDS WITH FILE1/FILE2 MATCH WITH 'AA'.       
  OUTFIL FNAMES=T1,OVERLAY=(211:C'AA')                 
/*                                                     
//CTL2CNTL DD                                           
* MARK RECORDS WITHOUT FILE1/FILE2 MATCH WITH 'BB'.     
  OUTFIL FNAMES=T1,OVERLAY=(211:C'BB')                 
/*                                                     
//CTL3CNTL DD *                                         
* MARK FILE1 RECORDS WITH '11'                         
* INREC OVERLAY=(211:C'11')                             
  OUTFIL FNAMES=T1,OVERLAY=(211:C'11')                 
/*                                                     
//CTL4CNTL DD *                                         
* MARK FILE2 RECORDS WITH '22'                         
* INREC OVERLAY=(211:C'22')                             
  OUTFIL FNAMES=T1,OVERLAY=(211:C'22')                 
/*                                                     
//CTL5CNTL DD *                                                 
* WRITE FILE1 ONLY RECORDS TO OUT1 FILE. REMOVE ID.             
  OUTFIL FNAMES=OUT1,INCLUDE=(211,1,CH,EQ,C'1B'),BUILD=(1,210)   
/*                                                               
//                             
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Dec 11, 2006 9:56 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/210)
//IN2 DD DSN=...  input file2 (FB/200)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,S\ACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/210)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(T2) ON(14,14,CH) KEEPNODUPS -
  WITH(1,211) WITH(213,8) USING(CTL3)
SORT FROM(T2) TO(OUT) USING(CTL4)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(211:C'BB',213:8X)
/*
//CTL2CNTL DD *
  INREC OVERLAY=(211:C'VV',213:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=T2,INCLUDE=(211,2,CH,EQ,C'VV')
/*
//CTL4CNTL DD *
  SORT FIELDS=(213,8,ZD,A)
  OUTREC BUILD=(1,210)
/*
Back to top
View user's profile Send private message
sri_code

New User


Joined: 20 Nov 2006
Posts: 19
Location: india

PostPosted: Mon Dec 11, 2006 11:40 pm
Reply with quote

thaks Frank for quick response...

my problem still not resolved, actually i want the non matching records from FILEA not from File B and i want duplicates to present in FILE C if they are in FILE A..

waiting for your response.......

Thankyou
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 12, 2006 1:58 am
Reply with quote

Sri,

My job produces exactly the output you show from the input you show. Specifically, OUT has:

Code:

D00000000000000008880000002451902192434249820061128     
D00000000000000001110000002451902192434249820061128     
D0000000000000000222000002451902192434249820061128     
D00000000000000003330000002451902192434249820061128     


If you want something different than you indicated you wanted, then you need to show me the input and output records for that and explain what you want.

If you want what you showed and you're not getting it with my job, then you're doing something different and you need to show me the job you're using, the TOOLMSG and DFSMSG messages you get, and the records in OUT you get.
Back to top
View user's profile Send private message
sri_code

New User


Joined: 20 Nov 2006
Posts: 19
Location: india

PostPosted: Tue Dec 12, 2006 2:44 pm
Reply with quote

actually i want the non matching records from FILEA not from File B and i want duplicates to present in FILE C if they are in FILE A..

i.e,

if input file contents are

D00000000000000001090000002451902192434249820061128
D00000000000000008880000002451902192434249820061128
D00000000000000008880000002451902192434249820061128
D00000000000000001170000002451902192434249820061128
D00000000000000001170000002451902192434249820061128
D00000000000000001580000002451902192434249820061128
D00000000000000001110000002451902192434249820061128
D0000000000000000222000002451902192434249820061128
D00000000000000003330000002451902192434249820061128
D00000000000000003330000002451902192434249820061128

file B contents are :

50000620000002
50010030000002
50049160000002
00000420000002
00001090000002
00001170000002
00000590000002
00001580000002
00002080000002
50600090000002
50600090000002
50600090000002
50639530000002
50644640000002
50644640000002
50661700000002

then output (FILE C) contents should be :

D00000000000000008880000002451902192434249820061128
D00000000000000008880000002451902192434249820061128
D00000000000000001110000002451902192434249820061128
D0000000000000000222000002451902192434249820061128
D00000000000000003330000002451902192434249820061128
D00000000000000003330000002451902192434249820061128

with with this job im getting output as

D00000000000000008880000002451902192434249820061128
D00000000000000001110000002451902192434249820061128
D0000000000000000222000002451902192434249820061128
D00000000000000003330000002451902192434249820061128

i.e duplicates deleted. i want the duplicates to be retained.
Back to top
View user's profile Send private message
sri_code

New User


Joined: 20 Nov 2006
Posts: 19
Location: india

PostPosted: Tue Dec 12, 2006 8:52 pm
Reply with quote

Hi Frank,

i got the above results with small changes
SPLICE FROM(T1) TO(T2) ON(14,14,CH) KEEPBASE KEEPNODUPS WITHALL -
WITH(1,211) WITH(213,8) USING(CTL3)
SORT FROM(T2) TO(OUT) USING(CTL4)

thank you very much for ur support
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 12, 2006 10:03 pm
Reply with quote

I can only go by what you tell me. Your original input didn't have duplicates in fileA so I coded the job with that in mind. Your new input does have duplicates in fileA so it requires a different job. Anyway, you seem to have figured out the new job you need.
Back to top
View user's profile Send private message
sri_code

New User


Joined: 20 Nov 2006
Posts: 19
Location: india

PostPosted: Tue Dec 12, 2006 10:41 pm
Reply with quote

ya it was my mistake actually

i mensioned that i have dublicates in FILE A but didn't provide data for that....
Thankyou for ur support........ have nice day
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 Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top