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
 
Find the missing record while doing comparison of 4 files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Sat Jan 20, 2007 2:33 am    Post subject: Find the missing record while doing comparison of 4 files
Reply with quote

i need to find the missing record while doing comparison of 4 files.

I have 4 files with dates in each one. i need to compare them and report which file is missing what date

Code:

File1          File2        File3        File4
20070101       20070101     20070101     20070102
20070102       20070102     20070102     20070103
20070103       20070103     20070103


File 4 is missing 20070101, hence when comparing i need to report that 20070101 is missing from file4. How to accomplish this?

There are no duplicates in any of the files.
Back to top
View user's profile Send private message

kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Sat Jan 20, 2007 2:36 am    Post subject: Re: find the missing record
Reply with quote

sorry the file values got mixed up.. here are the values

Code:

File1 
20070101
20070102
20070103

File2
20070101
20070102
20070103

File3
20070101
20070102
20070103

File4
20070102
20070103
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Sat Jan 20, 2007 3:01 am    Post subject: Re: find the missing record
Reply with quote

Here is a suggestion.

Take all four files and concatenate them into a single SORT sorting on the date field and using FIRST. The OUTPUT file would then be a dataset consisting of all possible dates. So SORT together FILEA, FILEB, FILEC, and FILED using FIRST and create FILEE.

Then take the OUTPUT of the 1st sort (with all possible dates - FILEE) and sort it with the 1st of the 4 files (FILEA) using NODUPS. The output of this sort would be records from the FILEE that did not match a record on FILEA, therefore they were missing.

Then take the OUTPUT of the 1st sort (with all possible dates - FILEE) and sort it with the 2nd of the 4 files (FILEB) using NODUPS. The output of this sort would be records from the FILEE that did not match a record on FILEB, therefore they were missing.

Then take the OUTPUT of the 1st sort (with all possible dates - FILEE) and sort it with the 3rd of the 4 files (FILEC) using NODUPS. The output of this sort would be records from the FILEE that did not match a record on FILEC, therefore they were missing.

Then take the OUTPUT of the 1st sort (with all possible dates - FILEE) and sort it with the 4th of the 4 files (FILED) using NODUPS. The output of this sort would be records from the FILEE that did not match a record on FILED, therefore they were missing.

If you need the DFSORT setup, I'm sure Frank Yaeger could code this up in no time.
Back to top
View user's profile Send private message
Hritam

New User


Joined: 27 Jun 2005
Posts: 36
Location: India

PostPosted: Sat Jan 20, 2007 3:06 am    Post subject:
Reply with quote

Hi,
Mention which file you are using as a reference file, having all the dates in it. Then we can run a comparison of each file( e.g File2, File3, etc) with that reference one(e.g File1) to get the missing dates/Records in that(File2/File3....etc).
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sat Jan 20, 2007 3:29 am    Post subject:
Reply with quote

I looked at the Smart DFSORT Tricks manual section "Create files with matching and non-matching records" it looks like it could be applied to four files.
I think if you stretched the 11 and 22 to 1111, 2222, 3333 and 4444 and added 2 more splice statements, those records that, at the end had a 1234 appeared in all four files and for instance, a record that had 1123 was missing from the second file.
Give it a look and maybe it can solve your problem.

Bill
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sat Jan 20, 2007 3:33 am    Post subject:
Reply with quote

Quote:
a record that had 1123 was missing from the second file
Dang! make that 1134
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Jan 20, 2007 3:58 am    Post subject:
Reply with quote

kalukakkad,

cpuhawg has the right idea assuming you want to take the set of all dates in all of the files and then find the missing dates in each file. Here's a DFSORT/ICETOOL job to it.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON0 DD DSN=...  input file1 (FB/8)
//     DD DSN=...  input file2 (FB/8)
//     DD DSN=...  input file3 (FB/8)
//     DD DSN=...  input file4 (FB/8)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON1 DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//     DD DSN=...  input file1 (FB/8)
//CON2 DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//     DD DSN=...  input file2 (FB/8)
//CON3 DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//     DD DSN=...  input file3 (FB/8)
//CON4 DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//     DD DSN=...  input file4 (FB/8)
//MISS1 DD SYSOUT=*
//MISS2 DD SYSOUT=*
//MISS3 DD SYSOUT=*
//MISS4 DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(CON0) TO(T1) ON(1,8,CH) FIRST
SELECT FROM(CON1) TO(MISS1) ON(1,8,CH) NODUPS
SELECT FROM(CON2) TO(MISS2) ON(1,8,CH) NODUPS
SELECT FROM(CON3) TO(MISS3) ON(1,8,CH) NODUPS
SELECT FROM(CON4) TO(MISS4) ON(1,8,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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
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
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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