IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to remove matching records from both the input files.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
saravanakumar N

New User


Joined: 24 Mar 2010
Posts: 5
Location: Chennai

PostPosted: Fri Apr 06, 2012 4:38 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 06, 2012 4:46 pm
Reply with quote

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
View user's profile Send private message
saravanakumar N

New User


Joined: 24 Mar 2010
Posts: 5
Location: Chennai

PostPosted: Fri Apr 06, 2012 6:12 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 06, 2012 6:46 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Apr 06, 2012 7:05 pm
Reply with quote

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 icon_cool.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Apr 06, 2012 8:30 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Apr 06, 2012 10:08 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top