File Comparison (Another problem)



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

File Comparison (Another problem)

Postby thermalchu » Fri Sep 07, 2012 2:51 pm

I have a new problem. File comparison has to be done between two files. Both contains 4 million records.

File1 having record length around 7000 bytes.Eg:(Here columns are like ID,animal,flower,fruit etc)
10001 cat rose apple........
10002 dog tulip orange......

File2 having record length around 4000 bytes.Eg:(Here columns are like ID,fruit,animal,flower etc)
10001 apple cat rose......
10002 orange dog tulip....

Now I have to compare first 4000 bytes for both files. But these column positions may be changed. Copybooks will be provided. Which is the best way to compare such files??
thermalchu
 
Posts: 38
Joined: Thu Aug 30, 2012 3:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File Comparison using ICETOOL

Postby NicC » Fri Sep 07, 2012 3:23 pm

New problem = new topic. Topic split
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: File Comparison (Another problem)

Postby thermalchu » Fri Sep 07, 2012 3:31 pm

ok :)
thermalchu
 
Posts: 38
Joined: Thu Aug 30, 2012 3:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File Comparison (Another problem)

Postby thermalchu » Fri Sep 07, 2012 4:12 pm

Can it be done using COBOL program?
thermalchu
 
Posts: 38
Joined: Thu Aug 30, 2012 3:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File Comparison (Another problem)

Postby NicC » Fri Sep 07, 2012 4:43 pm

If you are a COBOL programmer then you should know.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: File Comparison (Another problem)

Postby thermalchu » Fri Sep 07, 2012 5:00 pm

Huge filesize won't be a problem for cobol program?
Because while doing one-to-one matching,fileaid showed 999 is the max record count, icetool: 4k was the limit for record length and superc got abended.Syncsort is not present.
thermalchu
 
Posts: 38
Joined: Thu Aug 30, 2012 3:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File Comparison (Another problem)

Postby Akatsukami » Fri Sep 07, 2012 7:20 pm

thermalchu wrote:Because while doing one-to-one matching,fileaid showed 999 is the max record count

First, that is not the maximum record count, it is the maximum error count; after finding 999 errors, File-AID assumes (probably correctly) that your data are garbage.

Second, the maximum error count can be set to infinite. Of course, if you do so and hand File-AID garbage, you will get a very long listing or a S722 abend (lineout).
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: File Comparison (Another problem)

Postby dick scherrer » Fri Sep 07, 2012 8:25 pm

Hello,

Is there any reason you have not already implemented the code you were shown last week ?

When given a tested, working model, why can you not simply modify this for what you want to do?

This entire topic has been a complete waste :cry:

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: File Comparison (Another problem)

Postby dick scherrer » Fri Sep 07, 2012 8:29 pm

Follow on:

Suggest you stop wasting time and just get this running. The sample code whould not take more than a few minutes (or even an hour) to be running and you will waste much more than that fiddling with tools that are not designed to do what you want.

Also, if you continue working in IT, there will be repeated opportunities to use a 2-file matching program like this. Once you have yours running, it can be easily cloned when new opportunities arise. And you should feel more comfortable because you would be cloning something you had implemented, not some generic sample.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: File Comparison (Another problem)

Postby skolusu » Fri Sep 07, 2012 9:59 pm

thermalchu,

You can use JOINKEYS to compare the 2 files as the compare key is only 4000 bytes. However record layouts for the files are different, so you need to build 4000 LRECL file2 as if it looks like 7000 LRECL file1. To do that we use JNF2CNTL which will arrange the records like how they look like in File1. I just showed you an example of moving around 3 fields.

//STEP0100 EXEC PGM=SORT               
//SYSOUT   DD SYSOUT=*                 
//INA      DD DISP=SHR,DSN=Your Input FB 7000 byte file   
//INB      DD DISP=SHR,DSN=Your Input FB 4000 byte file
//SORTOUT  DD SYSOUT=*                 
//SYSIN    DD *                       
  OPTION COPY                         
  JOINKEYS F1=INA,FIELDS=(1,4000,A)   
  JOINKEYS F2=INB,FIELDS=(1,4000,A)   
  REFORMAT FIELDS=(F1:1,7000)         
//*                                   
//JNF2CNTL DD *                           
  INREC BUILD=(0001,0010,    $ ID         
               0031,0020,    $ ANIMAL     
               0051,0020,    $ FLOWER     
               0011,0020,    $ FRUIT       
              ......
               nnnn,LLLL)               
//*                                       
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post