Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to Compare records in Two files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
itdsen

New User


Joined: 20 Sep 2006
Posts: 23
Location: Chennai

PostPosted: Tue Jun 17, 2008 5:05 pm    Post subject: How to Compare records in Two files
Reply with quote

I want to compare two files records and matched records should be written into file1 and un matched records into file2.
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Jun 17, 2008 5:17 pm    Post subject: Reply to: How to Compare records in Two files
Reply with quote

itdsen,

This has been discussed many times. Search the forum with the Keyowrd "SELECT".

If you want a working JCL do post few more details on your requirement. l You want the entire record to be compared or specific bytes alone?
Back to top
View user's profile Send private message
itdsen

New User


Joined: 20 Sep 2006
Posts: 23
Location: Chennai

PostPosted: Tue Jun 17, 2008 6:12 pm    Post subject: Reply to: How to Compare records in Two files
Reply with quote

input file 2 contain duplicate. so i want count no of records matched and count no of times matched .


eg
input file 1

121
100
123
124
156


input file 2.

121
123
121
121
121
156
156


output file
no of times matched
121 4
123 1
156 2


count no of rec matched : 3
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Jun 17, 2008 10:32 pm    Post subject:
Reply with quote

itdsen,

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

Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN1      DD *                                             
121                                                         
100                                                         
123                                                         
124                                                         
156                                                         
//IN2      DD *                                             
121                                                         
123                                                         
121                                                         
121                                                         
121                                                         
156                                                         
156                                                         
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//T2       DD DSN=&&T2,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(T2) ON(1,3,CH) KEEPNODUPS -             
  WITHALL WITH(01,80) WITH(85,1) USING(CTL3)                 
  COPY FROM(T2) USING(CTL4)                                 
//CTL1CNTL DD *                                             
  OUTFIL FNAMES=T1,BUILD=(1,3,81:1,3,C'11')                 
//CTL2CNTL DD *                                             
  OUTFIL FNAMES=T1,OVERLAY=(81:3X,C'22')                     
//CTL3CNTL DD *                                             
  OUTFIL FNAMES=T2,INCLUDE=(84,2,CH,EQ,C'12'),               
  REMOVECC,NODETAIL,BUILD=(1,80),                           
  SECTIONS=(81,3,                                           
  TRAILER3=(1,3,COUNT))                                     
//CTL4CNTL DD *                                             
  OUTFIL FNAMES=OUT,REMOVECC,                               
  TRAILER1=('COUNT NO OF REC MATCHED : ',COUNT)             
/*


Hope this helps...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us