Page 1 of 2

File Comparison (Another problem)

PostPosted: Fri Sep 07, 2012 2:51 pm
by thermalchu
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??

Re: File Comparison using ICETOOL

PostPosted: Fri Sep 07, 2012 3:23 pm
by NicC
New problem = new topic. Topic split

Re: File Comparison (Another problem)

PostPosted: Fri Sep 07, 2012 3:31 pm
by thermalchu
ok :)

Re: File Comparison (Another problem)

PostPosted: Fri Sep 07, 2012 4:12 pm
by thermalchu
Can it be done using COBOL program?

Re: File Comparison (Another problem)

PostPosted: Fri Sep 07, 2012 4:43 pm
by NicC
If you are a COBOL programmer then you should know.

Re: File Comparison (Another problem)

PostPosted: Fri Sep 07, 2012 5:00 pm
by thermalchu
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.

Re: File Comparison (Another problem)

PostPosted: Fri Sep 07, 2012 7:20 pm
by Akatsukami
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).

Re: File Comparison (Another problem)

PostPosted: Fri Sep 07, 2012 8:25 pm
by dick scherrer
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

Re: File Comparison (Another problem)

PostPosted: Fri Sep 07, 2012 8:29 pm
by dick scherrer
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.

Re: File Comparison (Another problem)

PostPosted: Fri Sep 07, 2012 9:59 pm
by skolusu
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)               
//*