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
 

 

File comparison using ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: File comparison using ICETOOL
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

Site Director


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

PostPosted: Wed Oct 17, 2007 3:17 am    Post subject:
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Oct 17, 2007 5:01 am    Post subject:
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    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 Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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