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

Find the missing record while doing comparison of 4 files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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: 3156
Location: Tucson AZ

PostPosted: Sat Jan 20, 2007 3:29 am
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: 3156
Location: Tucson AZ

PostPosted: Sat Jan 20, 2007 3:33 am
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 Developer


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

PostPosted: Sat Jan 20, 2007 3:58 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top