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

comparing more than 2 files using ICETOOL


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

New User


Joined: 03 May 2007
Posts: 20
Location: bangalore

PostPosted: Tue Sep 09, 2008 2:33 pm
Reply with quote

Hi all,

I have three different input files, where i need to compare them based on the key field at appropriate position and get 2 output files (matching and non-matching records). The key field is present in the same position in all the three files.

Code:
//CC11 EXEC UCC11,TYPRUN=F
//*
//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//QTR1FILE DD DSN=UNLOAD,DISP=OLD
//RT7CLSCD DD DSN=RT7CLSCD,DISP=OLD
//LITCLSCD DD DSN=LITCLSCD,DISP=OLD
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//LIT1     DD DSN=LITGTN1,
//            SPACE=(CYL,(10,10),RLSE),
//            DISP=(,CATLG,CATLG)
//*
//PRG1     DD DSN=PURGE1,
//            SPACE=(CYL,(10,10),RLSE),
//            DISP=(,CATLG,CATLG)
//*
//TOOLIN DD *
COPY FROM(RT7CLSCD) TO(T1) USING(CTL1)
COPY FROM(LITCLSCD) TO(T1) USING(CTL2)
COPY FROM(QTR1FILE) TO(T1) USING(CTL3)
SPLICE FROM(T1) TO(LIT1) ON(147,2,BI) KEEPBASE KEEPNODUPS -
  WITHALL WITH(1,161) ---- USING(CTL4)
/*
//CTL1CNTL DD *
  INREC BUILD=(147:1,2,161:C'AAA')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(147:1,2,161:C'BBB')
/*
//CTL3CNTL DD *
  INREC OVERLAY=(161:C'CCC')
/*
//CTL4CNTL DD *
  OUTFIL FNAMES=LIT1,INCLUDE=(---------),
    BUILD=(1,160)
  OUTFIL FNAMES=PRG1,INCLUDE=(-----------),
    BUILD=(1,160)
/*


plz correct me if i'm wrong anywhere and suggest me what needs to be put in the control card.

I need to get 2 o/p files:
OUTPUT FILE1: Should contain the matching records from files QTR1FILE and RT7CLSCD and non-matching records from file LITCLSCD.

OUTPUT FILE2: Should contain the matching records from files QTR1FILE, RT7CLSCD and LITCLSCD.
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Tue Sep 09, 2008 3:33 pm
Reply with quote

I assume by matching records you mean records that are present in all the three files. I also assume in the ouput you need only one record per key.

If so your splice shouls look like this

Code:


SPLICE FROM(SORTIN) TO(SORTOUT)-                           
ON(1,1,CH) WITH(161,1) WITH(162,1) WITH(163,1) KEEPNODUPS WITHEACH



and your outfil should include "BCA" to get the matching. To get non-matching you can include non "BCA"
Back to top
View user's profile Send private message
obulisankar

New User


Joined: 03 May 2007
Posts: 20
Location: bangalore

PostPosted: Thu Sep 11, 2008 12:31 pm
Reply with quote

Kolusu,
Here is the information you asked for:

LRECL --> 160
RECFM --> FB
Volume of records --> will be in millions
No. of duplicates --> keep varying
No. of keys used
for comparision --> 1
Lenghth of
key field --> 10
Position of Key --> 147


The DCB properties are same for all the input and output files.

I have 3 files: File1 , File2 , File3 . All of these files contain the records of the same type.

I need to compare these 3 files and get 2 output files.

Output File1 : Should contain the matching records from File1 and File2 and non-matching records from File3.

Output File2 : Should contain all the matching records from 3 files.

Example:
--------

File1: File2: File3:
----- ------ ------
AAA BBB 100 DDD AAA BBB 100 DDD AAA BBB 100 DDD
EEE FFF 200 ccc CCC FFF 600 EEE CCC FFF 200 GGG
DDD NNN 300 AAA XXX jjj 400 VVV EEE JJJ 500 KKK
zzz NNN 300 AAA zzz NNN 300 AAA


Output File1: Output File2:
-------------- -------------
DDD NNN 300 AAA AAA BBB 100 DDD
zzz NNN 300 AAA

Thanks in advance
Back to top
View user's profile Send private message
obulisankar

New User


Joined: 03 May 2007
Posts: 20
Location: bangalore

PostPosted: Thu Sep 11, 2008 12:37 pm
Reply with quote

Hey,
Sorry for the improper format of example.Please find it below:

File1:
-----
AAA BBB 100 DDD
EEE FFF 200 ccc
DDD NNN 300 AAA
zzz NNN 300 AAA


File2:
------
AAA BBB 100 DDD
CCC FFF 600 EEE
XXX jjj 400 VVV
zzz NNN 300 AAA



File3:
------
AAA BBB 100 DDD
CCC FFF 200 GGG
EEE JJJ 500 KKK



Output File1:
--------------
DDD NNN 300 AAA
zzz NNN 300 AAA

Output File2:
-------------
AAA BBB 100 DDD

Thanks
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 ICETOOL returns no records JCL & VSAM 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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
Search our Forums:

Back to Top