View previous topic :: View next topic
|
Author |
Message |
saravanakumar N
New User
Joined: 24 Mar 2010 Posts: 5 Location: Chennai
|
|
|
|
Hi
I have sequential tape file with record length 3900.
I need to compare yesterday's file with today's file and process only the modifed records.
Every day the file is having more 1.5 million records and more than 80% of these records are unchaged. So I want to remove the unchanged records from both the file (yes'day and today file). By this my COBOL program will run with records that need comparison.
The record can have modification on any of its part. So we need to compare the entire 3900 bytes to find the unmodified records.
What will be the approach to achieve this. Please help me on this |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Fixed or variable-length records?
If only your Cobol program needs this, and the files are in sequence, you could do it as a "two-file match" (sticky at the top of the forum).
Are the records in sequence?
The location of the data (dasd or tape) is irrelevant. Having said that, tape is generally "sequential" isn't it? |
|
Back to top |
|
|
saravanakumar N
New User
Joined: 24 Mar 2010 Posts: 5 Location: Chennai
|
|
|
|
Hi Bill
Its a Fixed length record.
these are sequential files. Records are not in sorted order. we can sort it based on a key of 17 bytes., which is starting from 1st position of the record.
Quote: |
If only your Cobol program needs this, and the files are in sequence, you could do it as a "two-file match" (sticky at the top of the forum). |
only my cobol program will use the files..not able to understand "two-file match"...can you explain?
[/quote] |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
There is a "sticky" in the Cobol forum of a program which performs the two-file match (assorted other names are possible).
Basically, it takes two input files and matches them on a key. What you code for what happens when a match or mismatch occurs is up to you.
However, your files are unsorted, so you need to sort anyway, so may as well do what you can in the sort with anything left being done in the program.
So, you need a JOINKEYS application. You'll need to match with the whole record, so the application will automatically sort on the whole record.
Can you knock up a "sample" of inputs and expected output. Some short (<80 bytes) records but which show fully the situation you want to identify. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
So we need to compare the entire 3900 bytes to find the unmodified records. |
then You will have to sort on the whole record ... 3900 bytes!
look at the manuals for possible limitations on the maximum length of the <concatenated key>
or just try it and see what happens |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
So we need to compare the entire 3900 bytes to find the unmodified records. |
I suspect that these files have a common key. Suggest you sort both files on the "key" and then use the 2-file match/merge code provided and then compare the entire record when there is a match. Do whatever with the mis-matches.
For this to work, the key needs to be unique for each record. The basic code provided will not work for a many-to-many condition. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
saravanakumar N wrote: |
Hi
I have sequential tape file with record length 3900.
I need to compare yesterday's file with today's file and process only the modifed records.
Every day the file is having more 1.5 million records and more than 80% of these records are unchaged. So I want to remove the unchanged records from both the file (yes'day and today file). By this my COBOL program will run with records that need comparison.
The record can have modification on any of its part. So we need to compare the entire 3900 bytes to find the unmodified records.
What will be the approach to achieve this. Please help me on this |
saravanakumar N,
Assuming you do NOT have duplicates within today's and yesterday's file you can use the following DFSORT/ICETOOL JCL which will give you the desired results
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=Your Input yesterdays file,DISP=SHR
// DD DSN=Your Input todays file,DISP=SHR
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,3900,CH) NODUPS
//* |
|
|
Back to top |
|
|
|