Unmatching records using icetool



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Unmatching records using icetool

Postby thermalchu » Tue Oct 09, 2012 2:07 pm

I have two files. One file contain 10 records and second file contain 20 records. Both have a 6 digit key at the same position(1-6 in both files). I wanted to compare whole records whose keys are matching and print unmatching records from both in the output file.

Input 1:
100001 mainframe
100002 cics
100004 rexx

Input 2:
100001 main
100002 cics
100003 jcl
100004 rexx pgm
100005 db2

output:
100001 mainframe
100001 main
100004 rexx
100004 rexx pgm
thermalchu
 
Posts: 38
Joined: Thu Aug 30, 2012 3:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unmatching records using icetool

 

Re: Unmatching records using icetool

Postby thermalchu » Tue Oct 09, 2012 2:32 pm

By using NODUPS in icetool i'm getting all the mismatching records,but i need to compare only those which have same key value...
thermalchu
 
Posts: 38
Joined: Thu Aug 30, 2012 3:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unmatching records using icetool

Postby dick scherrer » Tue Oct 09, 2012 8:01 pm

Hello,

You need to post your JCL, Sort Control statements, and the informational output generated by the run (including the message ids).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Unmatching records using icetool

Postby skolusu » Tue Oct 09, 2012 9:26 pm

thermalchu,

You need to use JOINKEYS instead of select with NODUPS. Use the following DFSORT JCL which will give you the desired results

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//INA      DD *                                             
----+----1----+----2----+----3----+----4----+----5----+----6
100001 MAINFRAME                                           
100002 CICS                                                 
100004 REXX                                                 
//INB      DD *                                             
100001 MAIN                                                 
100002 CICS                                                 
100003 JCL                                                 
100004 REXX PGM                                             
100005 DB2                                                 
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  OPTION COPY                                               
  JOINKEYS F1=INA,FIELDS=(1,6,A)                           
  JOINKEYS F2=INB,FIELDS=(1,6,A)                           
  REFORMAT FIELDS=(F1:1,80,F2:1,80,?)                       
                                                           
  OUTFIL IFOUTLEN=80,OMIT=(1,80,CH,EQ,81,80,CH),           
  IFTHEN=(WHEN=(161,1,CH,EQ,C'B',AND,(7,74,CH,NE,87,74,CH)),
  BUILD=(1,80,/,81,80)),                                   
  IFTHEN=(WHEN=(161,1,CH,EQ,C'2'),BUILD=(81,80))           
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Unmatching records using icetool

Postby thermalchu » Wed Oct 10, 2012 9:09 am

Thnak you so much skolusu..Will u please tell me what 7,74,161,2 stands for?
thermalchu
 
Posts: 38
Joined: Thu Aug 30, 2012 3:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unmatching records using icetool

Postby BillyBoyo » Wed Oct 10, 2012 4:51 pm

The example shown assumes 80-byte fixed-length records.

Position 161 of the REFORMAT record contains DFSORT's "match marker" from JOINKEYS. Values are: B - Both files (a match); 1, file 1 only (no match); 2, file 2 only (no match).

In the first IFTHEN, the matched-key records have the remainder of their data compared and two records are output in the case of a further match. In the second IFTHEN, if on file 2 only, the original file 2 record is output.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Unmatching records using icetool

Postby skolusu » Wed Oct 10, 2012 9:07 pm

thermalchu wrote:Thnak you so much skolusu..Will u please tell me what 7,74,161,2 stands for?


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post