Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to know missing records between 2 files (Set and Sub-set

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

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Tue Feb 15, 2011 10:39 am    Post subject: How to know missing records between 2 files (Set and Sub-set
Reply with quote

Hi,

Could you please help me out?
Below is the my requirement

File-1 is set and file-2 sub set(all records of file-2 will present in file-1, but vise-versa is NOT true)

Now I want to know which all records are missing in file-2, when compare to file-1.

File-1
Code:
01
02
03
04
05
06

File-2
Code:
01
03
05

Expected out of file-3
File-3
Code:
02
04
06

NOTE: content of all files is in BINARY format

Rgds,
Srini
Back to top
View user's profile Send private message

hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Tue Feb 15, 2011 12:25 pm    Post subject:
Reply with quote

Hi vicharapusrinu,
You can use the DFSORT job below.

Code:

//S1 EXEC PGM=SORT                     
//SYSOUT DD SYSOUT=*                   
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2                             
//SORTOUT DD DSN=...  output file                 
//SYSIN    DD  *                 
  JOINKEYS F1=IN1,FIELDS=(1,2,A)
  JOINKEYS F2=IN2,FIELDS=(1,2,A)
  JOIN UNPAIRED,F1,ONLY         
  REFORMAT FIELDS=(F1:1,2)       
  OPTION COPY                   
//*                             


Thanks,
Ashwin.
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: Wed Feb 16, 2011 12:24 am    Post subject:
Reply with quote

If the records in input file1 are already sorted (as shown in the example), it would be more efficient to add SORTED to the JOINKEYS statement for F1. If the records in input file2 are already sorted (as shown in the example), it would be more efficient to add SORTED to the JOINKEYS statement for F2.

Alternatively, assuming the two input files have the same RECFM and LRECL, you can use a DFSORT/ICETOOL job like the following:

Code:

//S1 EXEC PGM=ICETOOL                                 
//TOOLMSG DD SYSOUT=*                                 
//DFSMSG DD SYSOUT=*                                 
//CON DD DSN=...  input file1
//    DD DSN=...  input file2                                           
//OUT DD DSN=...  output file                                     
//TOOLIN   DD  *                                     
SELECT FROM(CON) TO(OUT) ON(1,2,BI) NODUPS           
/*
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Thu Feb 17, 2011 12:27 pm    Post subject:
Reply with quote

Dear Frank Yaeger/Lashwin.

I am glad to inform that it is working perfectly!!!!!!!!!!!!

Our forum help me so many times in order to know more about mainframe, I can't imagine my official life with out IBMMAINFRAMES.COM

Thanks, Thanks a lot Frank Yaeger and Lashwin.


Regards,
Srini.
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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us