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
 

 

Need to compare to files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need to compare to files
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

Active Member


Joined: 08 May 2006
Posts: 992
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Apr 09, 2009 7:17 pm    Post subject:
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    Post subject: Reply to: Need to compare to files
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    Post subject: Reply to: Need to compare to files
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: 2150
Location: At my coffee table

PostPosted: Mon Apr 13, 2009 7:45 pm    Post subject:
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    Post subject: Reply to: Need to compare to files
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    Post subject: Reply to: Need to compare to files
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    Post subject: Reply to: Need to compare to files
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    Post subject:
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    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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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