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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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