Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to remove matching records from both the input files.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: how to remove matching records from both the input files.
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Apr 06, 2012 4:46 pm    Post subject: Reply to: how to remove matching records from both the input
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Apr 06, 2012 6:46 pm    Post subject: Reply to: how to remove matching records from both the input
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Fri Apr 06, 2012 7:05 pm    Post subject: Reply to: how to remove matching records from both the input
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

Site Director


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

PostPosted: Fri Apr 06, 2012 8:30 pm    Post subject:
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    Post subject: Re: how to remove matching records from both the input files
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us