Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Compare two files with different structures

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 200
Location: Keane India Ltd., Hyderabad

PostPosted: Thu Jan 12, 2006 12:03 pm    Post subject: Compare two files with different structures
Reply with quote

Hi,

I have two files with the following structure. I want to compare the fields from both the files and list the differences if any. The records are sorted in ascending order of a key in both the files.

FILE1: Structure
MBNISS S9(9) (Key sorted by ascending order)
NAME X(20)
AGE 9(2)
ADDRESS1 X(40)
ADDRESS2 X(40)
CITY X(30)
STATE X(20)

FILE2: Structure
MBNISS S9(9) (Key sorted by ascending order)
CREATEDT X(10)
NAME X(20)
AGE 9(2)
ADDRESS1 X(40)
ADDRESS2 X(40) OCCURS 6 TIMES
CITY X(30)
ZIPCODE 9(5)
STATE X(20)



Please give me the code using any utility(DFSORT or ICETOOL) to compare both the files and list the differences.


Thanks,
Reddy.
Back to top
View user's profile Send private message
References
prabs2006
Warnings : 1

Active User


Joined: 12 Jan 2006
Posts: 104

PostPosted: Thu Jan 12, 2006 3:36 pm    Post subject:
Reply with quote

Hi Reddy,

Juz try this...but am not sure...

Give both files as input...and
using ICETOOL, Select from(IN) to(OUT) OCCURS(1,9,zd) list(NODUPS)
above one will display all the recs that are mismatches..check with syntax also...
Back to top
View user's profile Send private message
Alain Benveniste

Active User


Joined: 14 Feb 2005
Posts: 90

PostPosted: Thu Jan 12, 2006 3:43 pm    Post subject:
Reply with quote

The structure of your files are different: we can't compare the entire records. So what fields need to be compared ?

Alain
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 486

PostPosted: Thu Jan 12, 2006 4:32 pm    Post subject: Re: Compare two files with different structures
Reply with quote

Hi,
I also agree with Alain , As teh structure of files are different, we can not compare the whole recorde.

Regards'
Rupesh
Back to top
View user's profile Send private message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 200
Location: Keane India Ltd., Hyderabad

PostPosted: Thu Jan 12, 2006 5:51 pm    Post subject:
Reply with quote

Hi Rupesh/Alain,

Give me a complete JCL to compare the following fields in both the files.
MBNISS S9(9) (Key sorted by ascending order)
NAME X(20)
ADDRESS1 X(40)
ADDRESS2 X(40)
CITY X(30)
STATE X(20)

Thanks,
Reddy.
Back to top
View user's profile Send private message
fixdoubts

Active User


Joined: 21 Oct 2005
Posts: 52

PostPosted: Thu Jan 12, 2006 6:00 pm    Post subject:
Reply with quote

Hi,

This might help you

//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//*ILEIN1 DD DSN=XT2.SMS.TEST.SORT2,DISP=SHR
//FILEIN1 DD *
245 20 A 230 D 230 E 240
246 20 A 230 D 240 E 240
247 40 B 230 D 230 E 240
//*ILEIN2 DD DSN=XT2.SMS.TEST.SORT3,DISP=SHR
//FILEIN2 DD *
246 30 230 D 230 E 240
247 40 230 D 230 E 240
248 50 230 D 230 E 240
//OUT DD SYSOUT=*
//T1 DD DSN=&&TT,DISP=MOD
//TOOLIN DD *
COPY FROM(FILEIN1) TO(T1) USING(CPY1)
COPY FROM(FILEIN2) TO(T1) USING(CPY2)
SPLICE FROM(T1) TO(OUT) ON(1,14,CH)-
WITHEACH KEEPNODUPS WITH(15,02) USING(CPY3)
/*
//CPY1CNTL DD *
OUTREC FIELDS=(1:1,4,5:10,3,8:16,3,11:22,3,18:5,2,80:X)
/*
//CPY2CNTL DD *
OUTREC FIELDS=(1:1,4,5:8,3,8:14,3,11:20,3,18:5,2,80:X)
/*
//CPY3CNTL DD *
OUTFIL FNAMES=OUT,OUTREC=(1,80)
/*
//

the output is
245 230230240 A
246 230230240 30
246 230240240 A
247 230230240
248 230230240 50

where in 247 is only common and
246 230230240 30
248 230230240 50 are unique in second file and 246 230230240 30 is having different key.
245 230230240 A
246 230240240 A --- different key( 246 230230240in first file ) which is the difference in the key fields

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