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

File comparison using ICETOOL


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

New User


Joined: 19 Jul 2005
Posts: 7

PostPosted: Wed Oct 17, 2007 3:15 am
Reply with quote

I have 2 files as in put

File1
1Record1X
2Record2X
3Record3X
4Record4X
5Record5X
6Record6X

File2
7Record7X
5Record5X
4Recor44X
3Record3X
2Recor22X
1Record1X

when I used the following JCL

//S010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=MIS.INPUT.FILE.FIRST,DISP=SHR
// DD DSN=MIS.INPUT.FILE.SECOND,DISP=SHR
//OUT DD DSN=MIS.OUTPUT.FILE.NO.DUP2,
// DISP=(,KEEP,DELETE),
// RECFM=FB,LRECL=80,
// SPACE=(80,(10,10),RLSE)
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,9,CH) NODUPS
/*
//

I am getting the below output

2RECORD2X
2RECOR22X
4RECORD4X
4RECOR44X
6RECORD6X
7RECORD7X

But my output should come as

7Record7X
6Record6X
2Recor22X
4Recor44X

Basically I need two compare the first file with second file and if any changes in second file then I need to write the second file changes and not first file changes.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 17, 2007 3:17 am
Reply with quote

Hello,

Does your system run DFSORT or is some other sort product used? You can tell from the sysout information created when you run your job.
Back to top
View user's profile Send private message
nnaveenreddy

New User


Joined: 19 Jul 2005
Posts: 7

PostPosted: Wed Oct 17, 2007 3:19 am
Reply with quote

Yeap..my system run on DFSORT and as well as sort utilities
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: Wed Oct 17, 2007 5:01 am
Reply with quote

nnaveenreddy,

DFSORT/ICETOOL did what you told it to. It found all of the unique records from your input concatenation of file1 and file2.

Quote:
But my output should come as

7Record7X
6Record6X
2Recor22X
4Recor44X

Basically I need two compare the first file with second file and if any changes in second file then I need to write the second file changes and not first file changes.


How does 6Record6X fit with those rules? It comes from file1 but you say you only want records from file2. So I would expect your output to be:

Code:

7Record7X   
4Recor44X   
2Recor22X   


If that's not the output you want, then you need to explain the rules for getting from input to output.

If that is the output you want, then here's a DFSORT/ICETOOL job that will give you that output:

Code:

//S010     EXEC PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//IN1    DD DSN=MIS.INPUT.FILE.FIRST,DISP=SHR
//IN2    DD DSN=MIS.INPUT.FILE.SECOND,DISP=SHR
//***> USE MOD DATA SET FOR T1
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT    DD DSN=MIS.OUTPUT.FILE.NO.DUP2,
//          DISP=(,KEEP,DELETE),
//          SPACE=(80,(10,10),RLSE)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,9,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'1')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'2')
/*
//CTL3CNTL DD *
  SORT FIELDS=(1,9,CH,D)
  OUTFIL FNAMES=OUT,INCLUDE=(81,1,CH,EQ,C'2'),
    BUILD=(1,80)
/*
//
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top