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

Need to compare to files


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

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Thu Apr 09, 2009 6:28 pm
Reply with quote

Hi,

I need to compare to files and to create a file1 which will have recrds not found in file2 and vice versa. I ad referenced this topic in foum but was not able to get the desired o/p. Here is my code

Code:
//STEP10   EXEC PGM=ICETOOL 
//TOOLMSG  DD SYSOUT=*       
//DFSMSG   DD SYSOUT=*       
//IN1      DD *             
A                           
B                           
C                           
D                           
I                           
J                           
K                           
L                           
/*                           
/*                                                       
//IN2      DD *                                         
A                                                       
B                                                       
C                                                       
D                                                       
E                                                       
F                                                       
G                                                       
H                                                       
/*                                                       
//T1      DD DSN=&&TEMP,DISP=(,PASS,DELETE),UNIT=SYSDA, 
//        RECFM=FB                                       
//OUT1    DD SYSOUT=*                                   
//OUT2    DD SYSOUT=*                                   
//TOOLIN   DD *                                         
COPY FROM(IN1) TO(T1) USING(CTL1)                       
COPY FROM(IN2) TO(T1) USING(CTL2)                               
SELECT FROM(T1) TO(OUT1) ON(1,1,CH) NODUPS USING(CTL3)           
/*                                                               
//CTL1CNTL DD *                                                 
 INREC OVERLAY=(81:C'1')                                         
/*                                                               
//CTL2CNTL DD *                                                 
 INREC OVERLAY=(81:C'2')                                         
/*                                                               
//CTL3CNTL DD *                                                 
 OUTFIL FNAMES=OUT1,INCLUDE=(81,1,CH,EQ,C'1'),BUILD=(1,80)       
 OUTFIL FNAMES=OUT2,SAVE,BUILD=(1,80)                           
/*                                                               


I need o/p as
Code:
File1:
I
J
K
L
File 2:
E
F
G
H


but I am getting
Code:
file 2:
A
B
C
D
E
F
G
H


please let me know what mistake i have made.

regards,
rupesh gupta
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Apr 09, 2009 7:17 pm
Reply with quote

A slight change will get you what you want:
Code:
//STEP10   EXEC PGM=ICETOOL                     
//TOOLMSG  DD SYSOUT=*                           
//DFSMSG   DD SYSOUT=*                           
//IN1      DD *                                 
A                                               
B                                               
C                                               
D                                               
I                                               
J                                               
K                                               
L                                               
/*                                               
/*                                               
//IN2      DD *                                 
A                                               
B                                               
C                                               
D                                               
E                                               
F                                               
G                                               
H                                               
/*                                                       
//T1      DD DSN=&&TEMP1,DISP=(MOD,DELETE),UNIT=SYSDA,   
//        RECFM=FB                                       
//T2      DD DSN=&&TEMP2,DISP=(MOD,DELETE),UNIT=SYSDA,   
//        RECFM=FB                                       
//OUT1    DD SYSOUT=*                                     
//OUT2    DD SYSOUT=*                                     
//TOOLIN   DD *                                           
COPY FROM(IN1) TO(T1) USING(CTL1)                         
COPY FROM(IN2) TO(T1) USING(CTL2)                         
SELECT FROM(T1) TO(T2) ON(1,1,CH) NODUPS                 
SELECT FROM(T2) TO(OUT1) ON(1,1,CH) NODUPS USING(CTL3)   
SELECT FROM(T2) TO(OUT2) ON(1,1,CH) NODUPS USING(CTL4)   
/*                                                       
//CTL1CNTL DD *                                           
 INREC OVERLAY=(81:C'1')                                 
//CTL2CNTL DD *                                           
 INREC OVERLAY=(81:C'2')                                 
//CTL3CNTL DD *                                           
 INCLUDE COND=(81,1,CH,EQ,C'1')                           
//CTL4CNTL DD *                                           
 INCLUDE COND=(81,1,CH,EQ,C'2')                           
/*                                                       


Garry.
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 09, 2009 8:59 pm
Reply with quote

Rupesh gullu,

If I ran the JCL as you provided I am indeed getting the desired results. You need to show us the DFSMSG sysout to see as to why to get wrong results.


Garry, You really don't need that many passes. OP's original JCL will indeed give the desired results
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Mon Apr 13, 2009 5:56 pm
Reply with quote

Hi Gary,

I have got the desired o/p with your solution,but one thing I am not able to understand is that why use gave MOD as disp parameter.

Skolusu can you let me know how can I post te whole DFSMSG. Do you want the specific DFSMSG or the whole DFSMSG. Whole msg is quite big. I think i won't be able to paste the full one. I am still getting the wrong o/p with my way of soving it.

regards,
rupesh gupta
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Apr 13, 2009 7:45 pm
Reply with quote

Quote:
the specific DFSMSG or the whole DFSMSG
Start with what is on the screen.
Why not post the jes messages.
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Mon Apr 13, 2009 8:05 pm
Reply with quote

Hi Skolusu


I have got the correct solution for the problem. I changed the Disp parameters from Disp=(,pass,delete) to Disp=(mod,pass) and has got the desired o/p without using extra CTL4.

Thanks all for your help

regards,
Rupesh Gupta
Back to top
View user's profile Send private message
chavansu

New User


Joined: 20 Nov 2008
Posts: 14
Location: California USA

PostPosted: Thu Apr 16, 2009 6:38 pm
Reply with quote

I used the job given by rupesh gullu. But I am getting only OUT2 ain the sysout. but not OUT1. Also I want to use ALLDUPS option but it seems its not workin for this.

Please help
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Thu Apr 16, 2009 7:04 pm
Reply with quote

hi chavansu,

For your temp file use disp as (mod,pass) I guess you will get correct ans.
Just try and let me know.

regards,
rupesh gupta
Back to top
View user's profile Send private message
chavansu

New User


Joined: 20 Nov 2008
Posts: 14
Location: California USA

PostPosted: Fri Apr 17, 2009 9:39 am
Reply with quote

Hi Rupesh,

It worked. 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 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