"UNMERGE"

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
bernix
Member
Posts: 21
Joined: Tue Oct 28, 2008 8:32 pm
Location: Vienna, Austria

"UNMERGE"

Post by bernix » Tue Mar 29, 2011 7:09 pm

HI,

I've got 2 Files and my desired result is kind of "intersection" of those 2 files. I want all records that occur in File01 but DO NOT occur in File02

Example:
File01

AAA
BBB
DDD


File02
AAA
BBB
CCC
EEE

My desired Output
DDD

Because DDD occurs in File01 but does not occur in File02.

Thanks for your help

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Mar 29, 2011 8:29 pm

Try this:

Code: Select all

//SORT001  EXEC PGM=SORT             
//SORTJNF1 DD *                      
AAA                                  
BBB                                  
DDD                                  
//SORTJNF2 DD *                      
AAA                                  
BBB                                  
CCC                                  
EEE                                  
//SORTOUT  DD SYSOUT=*               
//SYSOUT   DD SYSOUT=*               
//SYSIN    DD *                      
   JOINKEYS FILES=F1,FIELDS=(1,3,A)  
   JOINKEYS FILES=F2,FIELDS=(1,3,A)  
   JOIN UNPAIRED,F1,ONLY             
   SORT FIELDS=COPY                  
/*
Regards,
Anuj

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Mar 29, 2011 8:34 pm

If you are using DFSort at your shop, interface will be little changed though the idea is still the same:

Code: Select all

//SORT001  EXEC PGM=SORT              
//IN1 DD *                      
AAA                                  
BBB                                  
DDD                                  
//IN2 DD *                      
AAA                                  
BBB                                  
CCC                                  
EEE                                  
//SORTOUT  DD SYSOUT=*                
//SYSOUT   DD SYSOUT=*                
//SYSIN    DD *                      
   JOINKEYS F1=IN1,FIELDS=(1,3,A)  
   JOINKEYS F2=IN2,FIELDS=(1,3,A)  
   JOIN UNPAIRED,F1,ONLY              
   SORT FIELDS=COPY                  
/*
Regards,
Anuj

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue Mar 29, 2011 10:28 pm

If you are using DFSort at your shop, interface will be little changed
Not true. The posted JOINKEYS job will work fine with DFSORT. DFSORT supports Syncsort's JOINKEYS syntax. DFSORT also supports additional JOINKEYS syntax that is not supported by Syncsort.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Mar 29, 2011 11:01 pm

I realized what mistake I've done - though this
DFSORT supports Syncsort's JOINKEYS syntax
is correct, however vice-versa is not true - I've seen this in my experiments...

Sorry about that, Frank...:oops:

Have a good one,

Regards,

bernix
Member
Posts: 21
Joined: Tue Oct 28, 2008 8:32 pm
Location: Vienna, Austria

Post by bernix » Wed Mar 30, 2011 2:50 pm

job works fine. thanks for your help Frank

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Mar 31, 2011 1:14 pm

Glad to hear that!
Regards,
Anuj

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Jan 25, 2016 10:01 pm

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others